From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Guillaume Dargaud <dargaud@lpsc.in2p3.fr>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: Analysing a kernel panic
Date: Sun, 10 Jul 2011 09:16:35 +1000 [thread overview]
Message-ID: <1310253395.8267.7.camel@pasglop> (raw)
In-Reply-To: <201107080926.47588.dargaud@lpsc.in2p3.fr>
On Fri, 2011-07-08 at 09:26 +0200, Guillaume Dargaud wrote:
> > What is "Xad." ? (btw, coding style FAIL !)
>
> That's the struct I use to access the control registers of the hardware.
> About the coding style, don't worry it's never going to make it into mainstream as there's only one piece of that
> hardware ever built ! (which is also why I didn't respect things like allowing multiple devices, please don't nail me to
> the cross for that). And it's only my 2nd real Linux driver...
>
> > Are you trying to write to HW registers using a structure like that
> > without using the appropriate MMIO register accessors ?
> > In that case, your accesses may happen our of order since you don't have
> > memory barriers (among other potential problems).
>
> Yes. I discovered the out() functions afterwards. But I insert asm(eieio) to avoid 'out of order' problems.
Yeah well, you may have the compiler playing tricks too. Use
{read,write}{b,w,l} instead, or the _be variants to avoid byteswap.
> > The crash looks like you aren't properly clearing the interrupt
> > condition on the HW, it remains asserted, tho it shouldn't overflow like
> > that, something seems wrong with your PIC.
>
> Is there some constraints I should tell the electronics guys ? Should the interrupt be raised for less than some max
> duration ? It's on a raising signal, so I don't see why that should be an issue.
What do you mean by "raising signal" ? It's meant to be positive edge
sensitive ? Maybe that's your problem, ie, maybe you haven't configued
the interrupt controller for edge trigger but for level trigger
instead ?
> > What HW is this ? What PIC ? It looks like the interrupt source isn't
> > masked on the PIC itself while it's being handled or something...
>
> The hardware is a heavily modified Xilinx ML405 derivative.
> The PIC is a XPS_INTC (in VHDL)
Ok, I'm not familiar with that PIC. You need to check what's going on
between the PIC, your interrupt source and the kernel.
Normally, if it's an edge interrupt, it's a single event that gets
latched by the PIC. The kernel will then call ack() on that PIC driver
(irq_chip) which should clear that latch -before- getting into your
device driver for processing.
Also, the interrupt shall either be masked while processing or if it
re-enters, the PIC code shall try to mask it (lazy masking) until the
original handler completes at which point it gets unmasked. That shall
be handled by the standard flow handlers, so it really depends on how
you hookup your PIC in SW.
It looks like one of these things isn't happening, but it's hard to tell
without seeing more of the code & vhdl
Cheers,
Ben.
next prev parent reply other threads:[~2011-07-09 23:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-05 14:19 Analysing a kernel panic Guillaume Dargaud
2011-07-07 15:32 ` Guillaume Dargaud
2011-07-07 22:58 ` Benjamin Herrenschmidt
2011-07-08 7:26 ` Guillaume Dargaud
2011-07-09 23:16 ` Benjamin Herrenschmidt [this message]
2011-07-11 14:38 ` Guillaume Dargaud
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1310253395.8267.7.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=dargaud@lpsc.in2p3.fr \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).