]> git.baikalelectronics.ru Git - kernel.git/commit
sunhme: Fix Quattro HME irq registration on proble failures
authorMeelis Roos <mroos@linux.ee>
Wed, 11 Feb 2009 01:29:42 +0000 (17:29 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Feb 2009 01:29:42 +0000 (17:29 -0800)
commitd4e19cd623b2ec8e7d2cb67fcf4d868a9c206088
tree8d14ebfbfcf4285388736e1b45a5d6dd7e17220b
parent3c166d37cd909b188062a963fe590d8ed30e71db
sunhme: Fix Quattro HME irq registration on proble failures

Currently, the sunhme driver installs SBus Quattro interrupt handler
when at least one HME card was initialized correctly and at least one
Quattro card is present. This breaks when a Quattro card fails
initialization for whatever reason - IRQ is registered and OOPS happens
when it fires.

The solution, as suggested by David Miller, was to keep track which
cards of the Quattro bundles have been initialized, and request/free the
Quattro IRQ only when all four devices have been successfully
initialized.

The patch only touches SBus initialization - PCI init already resets the
card pointer to NULL on init failure.

The patch has been tested on Sun E3500 with SBus and PCI single HME
cards and one PCI Quattro HME card in a situation where any PCI card
failed init when the SBus routines tried to init them by mistake.

Additionally it replaces Quattro request_irq panic with error return -
if this card fails to work, at least let the others work.

Tested on E450 with PCI HME and PCI Quad HME.

[ Minor coding style fixups -DaveM ]

Signed-off-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/sunhme.c