IB/ipath: Fix check for no interrupts to reliably fallback to INTx

Newer HCAs support MSI interrupts and also INTx interrupts.  Fix the
code so that INTx can be reliably enabled if MSI interrupts are not
working.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
Dave Olson
2008-04-16 21:09:30 -07:00
committed by Roland Dreier
parent 1d7c2e529f
commit 9b436eb4f8
3 changed files with 42 additions and 22 deletions

View File

@@ -138,19 +138,6 @@ static struct pci_driver ipath_driver = {
},
};
static void ipath_check_status(struct work_struct *work)
{
struct ipath_devdata *dd = container_of(work, struct ipath_devdata,
status_work.work);
/*
* If we don't have any interrupts, let the user know and
* don't bother checking again.
*/
if (dd->ipath_int_counter == 0)
dev_err(&dd->pcidev->dev, "No interrupts detected.\n");
}
static inline void read_bars(struct ipath_devdata *dd, struct pci_dev *dev,
u32 *bar0, u32 *bar1)
{
@@ -218,8 +205,6 @@ static struct ipath_devdata *ipath_alloc_devdata(struct pci_dev *pdev)
dd->pcidev = pdev;
pci_set_drvdata(pdev, dd);
INIT_DELAYED_WORK(&dd->status_work, ipath_check_status);
list_add(&dd->ipath_list, &ipath_dev_list);
bail_unlock:
@@ -620,9 +605,6 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
ipath_diag_add(dd);
ipath_register_ib_device(dd);
/* Check that card status in STATUS_TIMEOUT seconds. */
schedule_delayed_work(&dd->status_work, HZ * STATUS_TIMEOUT);
goto bail;
bail_irqsetup:
@@ -753,7 +735,6 @@ static void __devexit ipath_remove_one(struct pci_dev *pdev)
*/
ipath_shutdown_device(dd);
cancel_delayed_work(&dd->status_work);
flush_scheduled_work();
if (dd->verbs_dev)
@@ -2195,6 +2176,10 @@ void ipath_shutdown_device(struct ipath_devdata *dd)
del_timer_sync(&dd->ipath_stats_timer);
dd->ipath_stats_timer_active = 0;
}
if (dd->ipath_intrchk_timer.data) {
del_timer_sync(&dd->ipath_intrchk_timer);
dd->ipath_intrchk_timer.data = 0;
}
/*
* clear all interrupts and errors, so that the next time the driver