Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jan 2010 01:30:59 -0800 (PST)
From:      Neelkanth Natu <neelnatu@yahoo.com>
To:        Oleksandr Tymoshenko <gonzo@bluezbox.com>, smeagle@bsdler.de
Cc:        freebsd-mips@freebsd.org
Subject:   Re: AR71XX RTC
Message-ID:  <434364.57659.qm@web34405.mail.mud.yahoo.com>
In-Reply-To: <1264351951.2647.93.camel@brain.lan.terror.local>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Flo,=0A=0ACan you try the following patch and see if it helps with the =
=0Ahang-followed-by-trap problem?=0A=0AI am seeing a similar problem on the=
 Sibyte and this patch gets me=0Apast it.=0A=0Abest=0ANeel=0A=0AIndex: swtc=
h.S=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A--- swtch.S=09(=
revision 202961)=0A+++ swtch.S=09(working copy)=0A@@ -323,7 +323,7 @@=0A =
=09 * to be saved with the other registers do so here.=0A =09 */=0A =0A-=09=
sw=09a3, TD_LOCK(a0)=09=09=09# Switchout td_lock =0A+=09sw=09a2, TD_LOCK(a3=
)=09=09=09# Switchout td_lock =0A =0A mips_sw1:=0A #if defined(SMP) && defi=
ned(SCHED_ULE)=0A=0A=0A--- On Sun, 1/24/10, Florian Kruegl <smeagle@bsdler.=
de> wrote:=0A=0A> From: Florian Kruegl <smeagle@bsdler.de>=0A> Subject: Re:=
 AR71XX RTC=0A> To: "Oleksandr Tymoshenko" <gonzo@bluezbox.com>=0A> Cc: fre=
ebsd-mips@freebsd.org=0A> Date: Sunday, January 24, 2010, 8:52 AM=0A> Hi,=
=0A> =0A> On Sun, 2010-01-24 at 02:41 +0100, Florian Kruegl wrote:=0A> > On=
 Sat, 2010-01-23 at 16:53 -0800, Oleksandr=0A> Tymoshenko wrote:=0A> > > On=
 2010-01-23, at 4:44 PM, Florian Kruegl wrote:=0A> > > =0A> > > > Hi,=0A> >=
 > > =0A> > > > On Sat, 2010-01-23 at 16:21 -0800, Oleksandr=0A> Tymoshenko=
 wrote:=0A> > > >> On 2010-01-23, at 4:00 PM, Florian=0A> Kruegl wrote:=0A>=
 > > >> =0A> > > >>> Hi,=0A> > > >>> =0A> > > >>> anyone working on pfc2123=
 driver for=0A> RouterStation Pro? =0A> > > >>> Seems quite well documented=
, one=0A> issue might be CS hack, but the rest=0A> > > >>> should be straig=
ht.=0A> > > >>=A0 =A0 Driver was commited=0A> yesterday:=0A> > > >> http://=
svn.freebsd.org/viewvc/base?view=3Drevision&revision=3D202839=0A> > > >> =
=0A> > > >> And yes, CS hack is the problem. I'm=0A> trying to figure out h=
ow to fit it into FreeBSD=0A> > > >> SPI framework. =0A> > > > =0A> > > > s=
ounds good, will do an update as soon as i=0A> removed me work from code.=
=0A> > > > My CS "solution" was more than crude, but=0A> the frames simply =
didn't=0A> > > > fit... so I am looking forward for a=0A> different one :) =
=0A> > > =0A> > >=A0 =A0=A0=A0Yeah, my CS solution was=0A> dirty hack too. =
If for "didn't fit" you mean missing last =0A> > > byte of frame then this =
problem was solved to.=0A> Bug was in AR71XX SPI code: falling =0A> > > edg=
e was not provided for last byte in transfer=0A> in time and RTC chip acts =
of falling edge. =0A> > > Fix was committed before driver.=0A> > > =0A> > >=
 =0A> > > =0A> > =0A> > code looks similar, can't tell much about result as=
=0A> kernel hangs for a=0A> > while before getting this:=0A> >=0A> <<<<<<<<=
<<<<<<<<<<<<<<<<<<<=0A> schnipp=0A> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>=0A> > T=
rap cause =3D 2 (TLB miss (load or instr. fetch) -=0A> kernel mode)=0A> > [=
thread pid 4 tid 100009 ]=0A> > Stopped at=A0 =A0 =A0=0A> _thread_lock_flag=
s+0x150:=A0 =A0=0A> =A0=A0=A0lw=A0 =A0 =A0 v0,60(a3)=0A> > db> bt=0A> > Tra=
cing pid 4 tid 100009 td 0xc0c47270=0A> > db_trace_thread+30 (?,?,?,?) ra 8=
00a6c10 sz 24=0A> > 800a6af4+11c (0,?,ffffffff,?) ra 800a6604 sz 32=0A> > 8=
00a6270+394 (?,?,?,?) ra 800a6794 sz 168=0A> > db_command_loop+78 (?,?,?,?)=
 ra 800a8e68 sz 24=0A> > 800a8d60+108 (?,?,?,?) ra 80215ff8 sz 424=0A> > kd=
b_trap+f8 (?,?,?,?) ra 80474350 sz 32=0A> > trap+134c (?,?,?,?) ra 8046b7fc=
 sz 176=0A> > MipsKernGenException+100 (b,173,804d5de8,deadc0d8) ra=0A> 801=
c593c sz 200=0A> > _thread_lock_flags+130 (?,?,?,?) ra 80221f18 sz 56=0A> >=
 sleepq_broadcast+ac (?,?,?,?) ra 801e5f20 sz 40=0A> > wakeup+2c (?,?,?,?) =
ra 8016de18 sz 32=0A> > g_io_deliver+198 (?,?,?,?) ra 8016bbd4 sz 80=0A> > =
8016b590+644 (?,?,?,?) ra 8016e184 sz 104=0A> > g_io_schedule_down+2ec (?,?=
,?,?) ra 8016eb94 sz 64=0A> > 8016eb18+7c (?,?,?,?) ra 801a331c sz 24=0A> >=
 fork_exit+a0 (?,?,?,?) ra 80478f10 sz 48=0A> > fork_trampoline+10 (?,?,?,?=
) ra 0 sz 0=0A> > pid 4=0A> >=0A> <<<<<<<<<<<<<<<<<<<<<<<<<<<=0A> schnapp=
=0A> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>=0A> > =0A> > will use AR71XX as config=
 file tomorrow, mine has many=0A> additional devs=0A> > configured for boot=
ing from usb devices.=0A> > =0A> [...]=0A> =0A> seems to make no difference=
. removed all mini pci=0A> devs=A0 and most code=0A> changes. kernel hangs =
during bootup for a while. then gets=0A> a trap. =0A> =0A> Source Info:=0A>=
 =0A> -------------------------- schnipp=0A> --------------------------=0A>=
 brain:head> svn info=0A> Path: .=0A> URL: svn://svn.freebsd.org/base/head=
=0A> Repository Root: svn://svn.freebsd.org/base=0A> Repository UUID: ccf9f=
872-aa2e-dd11-9fc8-001c23d0bc1f=0A> Revision: 202904=0A> Node Kind: directo=
ry=0A> Schedule: normal=0A> Last Changed Author: marcel=0A> Last Changed Re=
v: 202904=0A> Last Changed Date: 2010-01-24 00:16:50 +0100 (Sun, 24 Jan=0A>=
 2010)=0A> -------------------------- schnapp=0A> -------------------------=
-=0A> =0A> -------------------------- schnipp=0A> -------------------------=
-=0A> brain:head> svn stat=0A> ?=A0 =A0 =A0=A0=A0GRTAGS=0A> ?=A0 =A0 =A0=A0=
=A0GSYMS=0A> ?=A0 =A0 =A0=A0=A0GTAGS=0A> ?=A0 =A0 =A0=A0=A0GPATH=0A> M=A0 =
=A0 =A0=A0=A0sys/kern/vfs_mount.c=0A> M=A0 =A0 =A0=A0=A0sys/mips/conf/AR71X=
X=0A> ?=A0 =A0 =A0=A0=A0sys/dev/pfc2123=0A> -------------------------- schn=
app=0A> --------------------------=0A> =0A> - vfs_mount should be far away.=
 =0A> - sys/dev/pfc2123 is no longer used.=0A> - sys/mips/conf/AR71XX alter=
ed to include pfc2123_rtc=0A> =0A> =0A> -------------------------- schnipp=
=0A> --------------------------=0A> FreeBSD 9.0-CURRENT #1: Sun Jan 24 15:5=
8:37 UTC 2010=0A> =0A> root@pinky.lan.terror.local:/home/smeagle/obj/mips/m=
ips/home/smeagle/src/freebsd/head/sys/AR71XX=0A> mips=0A> real memory=A0 =
=3D 134217728 (131072K bytes)=0A> avail memory =3D 125689856 (119MB)=0A> ne=
xus0: <MIPS32 root nexus>=0A> clock0: <Generic MIPS32 ticker> on nexus0=0A>=
 clock0: [FILTER]=0A> apb0 at irq 4 on nexus0=0A> apb0: [FILTER]=0A> uart0:=
 <16550 or compatible> on apb0=0A> uart0: [FILTER]=0A> uart0: console (1152=
00,n,8,1)=0A> pcib0 at irq 0 on nexus0=0A> pcib0: [FILTER]=0A> pci0: <PCI b=
us> on pcib0=0A> pci0: <old, non-VGA display device> at device 0.0 (no=0A> =
driver attached)=0A> pci0: <processor> at device 17.0 (no driver=0A> attach=
ed)=0A> arge0: <Atheros AR71xx built-in ethernet interface>=0A> at mem=0A> =
0x19000000-0x19000fff irq 2 on nexus0=0A> miibus0: <MII bus> on arge0=0A> u=
kphy0: <Generic IEEE 802.3u media interface> PHY 4=0A> on miibus0=0A> ukphy=
0:=A0 10baseT, 10baseT-FDX, 100baseTX,=0A> 100baseTX-FDX, 1000baseT-FDX,=0A=
> auto=0A> arge0: Ethernet address: 00:00:00:00:46:61=0A> arge0: [FILTER+IT=
HREAD]=0A> arge1: <Atheros AR71xx built-in ethernet interface>=0A> at mem=
=0A> 0x1a000000-0x1a000fff irq 3 on nexus0=0A> arge1: Ethernet address: 00:=
00:00:00:46:62=0A> arge1: [FILTER+ITHREAD]=0A> spi0: <AR71XX SPI> at mem 0x=
1f000000-0x1f00000f on=0A> nexus0=0A> spibus0: <spibus bus> on spi0=0A> mx2=
5l0: <M25Pxx Flash Family> at cs 0 on spibus0=0A> mx25l0: mx25ll128, sector=
 65536 bytes, 256 sectors=0A> ar71xx_wdog0: <Atheros AR71XX watchdog timer>=
 on=0A> nexus0=0A> Timecounter "MIPS32" frequency 360000000 Hz quality 800=
=0A> Timecounters tick every 1.000 msec=0A> bootpc_init: wired to interface=
 'arge0'=0A> Sending DHCP Discover packet from interface arge0=0A> (00:00:0=
0:00:46:61)=0A> arge0: link state changed to DOWN=0A> Trap cause =3D 2 (TLB=
 miss (load or instr. fetch) - kernel=0A> mode)=0A> [thread pid 4 tid 10000=
8 ]=0A> Stopped at=A0 =A0 =A0=0A> _thread_lock_flags+0x150:=A0 =A0=0A> =A0=
=A0=A0lw=A0 =A0 =A0 v0,60(a3)=0A> db> bt=0A> Tracing pid 4 tid 100008 td 0x=
c0c414e0=0A> db_trace_thread+30 (?,?,?,?) ra 80055900 sz 24=0A> 800557e4+11=
c (0,?,ffffffff,?) ra 800552f4 sz 32=0A> 80054f60+394 (?,?,?,?) ra 80055484=
 sz 168=0A> db_command_loop+78 (?,?,?,?) ra 80057b58 sz 24=0A> 80057a50+108=
 (?,?,?,?) ra 8017b7d8 sz 424=0A> kdb_trap+f8 (?,?,?,?) ra 8035ab40 sz 32=
=0A> trap+134c (?,?,?,?) ra 80351fec sz 176=0A> MipsKernGenException+100 (b=
,173,8039ce74,deadc0d8) ra=0A> 8012c92c sz 200=0A> _thread_lock_flags+130 (=
?,?,?,?) ra 801876f8 sz 56=0A> sleepq_broadcast+ac (?,?,?,?) ra 8014b700 sz=
 40=0A> wakeup+2c (?,?,?,?) ra 800d6ba8 sz 32=0A> g_io_deliver+198 (?,?,?,?=
) ra 800d4964 sz 80=0A> 800d4320+644 (?,?,?,?) ra 800d6f14 sz 104=0A> g_io_=
schedule_down+2ec (?,?,?,?) ra 800d7924 sz 64=0A> 800d78a8+7c (?,?,?,?) ra =
8010c0ac sz 24=0A> fork_exit+a0 (?,?,?,?) ra 8035f700 sz 48=0A> fork_trampo=
line+10 (?,?,?,?) ra 0 sz 0=0A> pid 4=0A> -------------------------- schnap=
p=0A> --------------------------=0A> =0A> =0A> =0A> =0A> Flo=0A> =0A> _____=
__________________________________________=0A> freebsd-mips@freebsd.org=0A>=
 mailing list=0A> http://lists.freebsd.org/mailman/listinfo/freebsd-mips=0A=
> To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org"=
=0A> =0A=0A=0A      



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?434364.57659.qm>