Date: Fri, 4 Mar 2016 16:10:04 +0300 From: Michael Zhilin <mizhka@gmail.com> To: Stanislav Galabov <sgalabov@gmail.com> Cc: Adrian Chadd <adrian.chadd@gmail.com>, "freebsd-mips@freebsd.org" <freebsd-mips@freebsd.org> Subject: Re: [BCM4718] Broken interrupts Message-ID: <CAF19XBK7aXq1F9Q835AEnxLoOifTQqq5NEXoyg=pS0B=Ov4UeA@mail.gmail.com> In-Reply-To: <CANiSyhTG5WE0G41HfaujqCXc-O=kQEsSq=zUhF6uTwTqqe%2BRBA@mail.gmail.com> References: <CAF19XBKR2qz-oWKzNmOx-RjiOJxoz%2B=heUm8bg9ijzY6Oz-SLw@mail.gmail.com> <CAJ-Vmo=ObijfE5pf0gojvi01qCpRH4N8Y1F2VCjECmp6JNDLkg@mail.gmail.com> <CAF19XBLS467HY9nzDT54Kxa=ZxvEvLY%2BTpDYL-RQzVEM1JxfcQ@mail.gmail.com> <CANiSyhSyzGVaHjoiptpTcgrditLa3Cyeo_HhBAzx6w_iRP=rYg@mail.gmail.com> <CANiSyhTG5WE0G41HfaujqCXc-O=kQEsSq=zUhF6uTwTqqe%2BRBA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Stanislav, I've added to BCM471x: makeoptions MIPS_INTRNG options MIPS_INTRNG to options.mips: MIPS_INTRNG opt_global.h Then removed all kernel object files and run buildkernel (thank you, Adrian, for freebsd-wifi-build scripts!). But it's still same behavior. Here is output of printfs before and after clock_intr: cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=f2fe11a cmp=deadc0bb cause=8000 after clock_intr cnt=f45c9e6 cmp=ffffffff cause=8000 cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=f6225e7 cmp=ffffffff cause=8000 after clock_intr cnt=f780e46 cmp=ffffffff cause=8000 cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=f946b1e cmp=ffffffff cause=8000 after clock_intr cnt=faa548a cmp=ffffffff cause=8000 cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=fc6b178 cmp=ffffffff cause=8000 after clock_intr cnt=fdc9ae6 cmp=ffffffff cause=8000 cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=ff8f7b8 cmp=ffffffff cause=8000 after clock_intr cnt=100ee112 cmp=ffffffff cause=8000 cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=102b8fa8 cmp=ffffffff cause=8000 after clock_intr cnt=1041cc94 cmp=ffffffff cause=8000 cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=105e7b26 cmp=ffffffff cause=8000 after clock_intr cnt=1074b6c8 cmp=ffffffff cause=8000 cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=10916586 cmp=ffffffff cause=8000 after clock_intr cnt=10a7a24c cmp=ffffffff cause=8000 cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=10c4510a cmp=ffffffff cause=8000 after clock_intr cnt=10da8c62 cmp=ffffffff cause=8000 cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=10f73c6e cmp=ffffffff cause=8000 after clock_intr cnt=110d7838 cmp=ffffffff cause=8000 As I mentioned before, there are 2 symptoms: * cnt != cmp for IRQ5 triggering * cause is always 8000 (i.e. IP7 = 1) even after mips_wr_compare. Thanks! On Fri, Mar 4, 2016 at 3:33 PM, Stanislav Galabov <sgalabov@gmail.com> wrote: > Also, before doing that, you'll have to add: > MIPS_INTRNG opt_global.h > to the end of sys/conf/options.mips > > Adrian, we somehow missed that in the commit of > https://reviews.freebsd.org/D5182 although it is in the last diff I had > attached... I'll put up a review for this on monday. > > Best wishes, > Stanislav > > On Fri, Mar 4, 2016 at 2:17 PM, Stanislav Galabov <sgalabov@gmail.com> > wrote: > >> Hi Michael, >> >> If I understand correctly the goal is to use INTRNG for MIPS? >> If so, I didn't notice 'options MIPS_INTRNG' anywhere in your kernel >> config files... >> Please try to add this to your sys/mips/bcm471x/std.bcm471x for example >> and let us know how this goes. >> >> Best wishes, >> Stanislav >> >> On Fri, Mar 4, 2016 at 1:19 PM, Michael Zhilin <mizhka@gmail.com> wrote: >> >>> Hi Adrian! >>> >>> Yes, KDB works. And yes, (today's finding) something is silly that force >>> make IRQ5 endless. After processing of previous request, next request is >>> starting. According to mips docs found in google, IRQ5 must be triggered >>> only if count == compare. In my case, count increments on 0x20000 >>> roughly, >>> compare is constant. There is another finding: cause register is always >>> 0x8000, even after call mips_wr_compare(). I suppose that this is >>> possible >>> reason of infinite IRQ5 requests, but still don't know how to fix it... >>> >>> Thx, >>> Michael >>> >>> On Fri, Mar 4, 2016 at 11:56 AM, Adrian Chadd <adrian.chadd@gmail.com> >>> wrote: >>> >>> > hm, does kdb work (ie ,break to debugger at that point), or is the >>> system >>> > hosed? >>> > >>> > is it something silly like it getting stuck servicing interrupts >>> > because they're not being correctly ACKed? >>> > >>> > >>> > >>> > -a >>> > >>> > >>> > On 3 March 2016 at 12:22, Michael Zhilin <mizhka@gmail.com> wrote: >>> > > Hi, >>> > > >>> > > I'm trying to load FreeBSD kernel on Broadcom MIPS router (ASUS >>> RT-N16). >>> > > Here is actual dmesg: http://pastebin.com/AtEz6kc9 . But my actual >>> > problem >>> > > is broken interrupts. After enabling of interrupts in >>> > > autoconf.c:configure_final the MipsException code is called, it works >>> > fine >>> > > (including INTRNG), but cpu doesn't return to main thread (suprise!). >>> > > >>> > > I can see printf from clockintr, i.e. there are regular timer >>> requests. >>> > But >>> > > there is no printf from main thread (autoconf.c) after enabling of >>> > > interrupts. >>> > > >>> > > Also I've tried to simplify MipsException to avoid any issue with >>> > > saving/restoring registers: >>> > > mfc0 k0, MIPS_COP_0_EXC_PC >>> > > rfe >>> > > jr k0 >>> > > >>> > > but still there is no return to main thread. >>> > > >>> > > I'm not familiar with JTAG and have no JTAG adapter for debugging. >>> :( To >>> > be >>> > > honest, I've lost hope. >>> > > >>> > > What could possibly be wrong? Here is github branch for reference: >>> > > https://github.com/Cka3o4Huk/freebsd/tree/user/mizhka/bcm471x >>> > > >>> > > Thank you in advance, >>> > > Michael >>> > > _______________________________________________ >>> > > freebsd-mips@freebsd.org mailing list >>> > > https://lists.freebsd.org/mailman/listinfo/freebsd-mips >>> > > To unsubscribe, send any mail to " >>> freebsd-mips-unsubscribe@freebsd.org" >>> > >>> _______________________________________________ >>> freebsd-mips@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/freebsd-mips >>> To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" >>> >> >> >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF19XBK7aXq1F9Q835AEnxLoOifTQqq5NEXoyg=pS0B=Ov4UeA>