From: Jeff Garzik <jgarzik@pobox.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: ktech@wanadoo.es,
Kernel Mailing List <linux-kernel@vger.kernel.org>,
Manfred Spraul <manfred@colorfullife.com>
Subject: Re: 2.6.7-rc1 breaks forcedeth
Date: Sun, 06 Jun 2004 14:21:56 -0400 [thread overview]
Message-ID: <40C360C4.7010703@pobox.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0406051958150.7010@ppc970.osdl.org>
Linus Torvalds wrote:
> The thing is, the driver seems to not actually even register the irq
> handler until the device is opened, which seems a bit bogus. It will
That's normal. The net driver model is:
Probe phase (struct pci_driver::probe):
* make sure device isn't actively sending irqs or DMA'ing
* read MAC address from EEPROM
* put device in low power state (D3 is acceptable)
Interface-up (dev->open):
* power-up device
* allocate consistent DMA memory
* request_irq
* activate DMA engine
* activate link state machine (hardware or software)
Interface-down (dev->stop):
* reverse the interface-up steps
So by definition it is a driver bug if the hardware is sending irqs
outside of when the driver indicates interest in the irq via
request_irq...free_irq.
This is very nice because the sysadmin knows the device is inactive when
the interface is down, providing a clear and clean correlation between
interface state and hardware state.
In a _very few_ situations, it is impossible to do this because the
hardware (or virtual hardware, such as ppc64 hypervisor or s/390) sends
interesting (or necessary) events while the interface is down.
> certainly result in problems if the device ever sends an interrupt. And
> that seems to be exactly the behaviour you see.
>
> I suspect that the driver should at the very least make sure to disable
> any potentially pending interrupts in the "nv_probe()" function. I have no
> idea how to do that, but it looks like something like
>
> writel(0, base + NvRegIrqMask);
> writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
Agreed; this naturally falls out of the above "Probe phase" description,
in a properly written driver.
Also, PCI 2.3 devices have an "interrupt disable" bit in PCI_COMMAND
they can use, iff (a) it's implemented and (b) the driver isn't using MSI.
Jeff
next prev parent reply other threads:[~2004-06-06 18:22 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-06 1:59 2.6.7-rc1 breaks forcedeth ktech
2004-06-06 3:14 ` Linus Torvalds
2004-06-06 8:36 ` Manfred Spraul
2004-06-06 17:04 ` Linus Torvalds
2004-06-06 18:13 ` Jeff Garzik
2004-06-06 18:21 ` Jeff Garzik [this message]
2004-06-06 18:32 ` Linus Torvalds
-- strict thread matches above, loose matches on Subject: below --
2004-06-16 18:40 David Mansfield
2004-06-06 13:49 jjluza
[not found] <E1BWxTh-0002dx-KR@mb06.in.mad.eresmas.com>
2004-06-06 13:31 ` Daniel Schmitt
2004-06-06 12:10 ktech
2004-06-06 12:53 ` Vincent van de Camp
2004-06-06 13:40 ` Manfred Spraul
2004-06-06 14:17 ` Manfred Spraul
2004-06-05 23:41 Luis Miguel García Mancebo
2004-06-05 23:50 ` Linus Torvalds
2004-05-31 0:29 jjluza
2004-05-30 17:54 Luis Miguel García Mancebo
2004-05-30 20:47 ` Jeff Garzik
2004-05-30 15:57 Lee Howard
2004-05-30 17:20 ` Jeff Garzik
2004-05-30 22:59 ` Lee Howard
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=40C360C4.7010703@pobox.com \
--to=jgarzik@pobox.com \
--cc=ktech@wanadoo.es \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=torvalds@osdl.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