Subject: Re: [RFC][BNX2X]: New driver for Broadcom 10Gb Ethernet.

From: Roland Dreier <[email-masked]>
Date: Tue, 07 Aug 2007 16:04:19 -0700

> > +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.