From: Roland Dreier <rdreier@cisco.com>
To: Michael Buesch <mb@bu3sch.de>
Cc: "Michael Chan" <mchan@broadcom.com>,
davem@davemloft.net, jeff@garzik.org, netdev@vger.kernel.org,
eliezert@broadcom.com, lusinsky@broadcom.com,
eilong@broadcom.com
Subject: Re: [RFC][BNX2X]: New driver for Broadcom 10Gb Ethernet.
Date: Tue, 07 Aug 2007 16:04:19 -0700 [thread overview]
Message-ID: <adaodhjq74c.fsf@cisco.com> (raw)
In-Reply-To: <200708020006.13457.mb@bu3sch.de> (Michael Buesch's message of "Thu, 2 Aug 2007 00:06:12 +0200")
> > +static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance)
> > +{
> > + struct net_device *dev = dev_instance;
>
> You need to check if dev==NULL and bail out.
> Another driver sharing the IRQ with this might choose to pass the dev
> pointer as NULL.
I don't really understand this. If another driver is sharing the IRQ
with a different device pointer (or even NULL), then that driver's
handler is the one that would be called. It's certainly the case that
an interrupt handler can be called for a shared interrupt generated by
another device, but a driver will never get a cookie back into its
interrupt handler different than the one it passed to request_irq().
A NULL check couldn't really help anything -- because if one driver's
dev_id can get passed into another driver's interrupt handler, the
non-NULL case would be even worse, because you would have one driver
poking into another driver's data structure. But fortunately the
kernel is smart enough not to create this mess.
(And also, MSI-X interrupts are never shared so this is doubly
irrelevant in this particular case)
- R.
prev parent reply other threads:[~2007-08-07 23:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-01 8:31 [RFC][BNX2X]: New driver for Broadcom 10Gb Ethernet Michael Chan
2007-08-01 22:06 ` Michael Buesch
2007-08-01 22:28 ` Roland Dreier
2007-08-01 22:50 ` Jeff Garzik
2007-08-02 18:13 ` Eliezer Tamir
2007-08-02 18:09 ` Eliezer Tamir
2007-08-02 21:48 ` Michael Chan
2007-08-07 22:15 ` Jeff Garzik
2007-08-07 22:20 ` Michael Buesch
2007-08-07 23:04 ` Christoph Hellwig
2007-08-07 23:08 ` David Miller
2007-08-08 8:40 ` Michael Buesch
2007-08-07 23:04 ` Roland Dreier [this message]
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=adaodhjq74c.fsf@cisco.com \
--to=rdreier@cisco.com \
--cc=davem@davemloft.net \
--cc=eilong@broadcom.com \
--cc=eliezert@broadcom.com \
--cc=jeff@garzik.org \
--cc=lusinsky@broadcom.com \
--cc=mb@bu3sch.de \
--cc=mchan@broadcom.com \
--cc=netdev@vger.kernel.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).