[PATCH 27 of 33] IB/ipath - cleaner shutdown at driver unload,disable IB link earlier

From: Bryan O'Sullivan
Date: Thu Mar 15 2007 - 18:22:28 EST


# HG changeset patch
# User Bryan O'Sullivan <bos@xxxxxxxxxxxxx>
# Date 1173994465 25200
# Node ID fddf5d03720ca586054b66d250d84233bdb3bf86
# Parent 284c34f2adddd16f7cb4fe48a2f6fbe9ad4beea5
IB/ipath - cleaner shutdown at driver unload, disable IB link earlier

Moved the code that shuts down the IB link earlier in the unload process, to
be sure no new packets can arrive while we are unloading.

Signed-off-by: Dave Olson <dave.olson@xxxxxxxxxx>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@xxxxxxxxxx>

diff -r 284c34f2addd -r fddf5d03720c drivers/infiniband/hw/ipath/ipath_driver.c
--- a/drivers/infiniband/hw/ipath/ipath_driver.c Thu Mar 15 14:34:25 2007 -0700
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c Thu Mar 15 14:34:25 2007 -0700
@@ -536,8 +536,6 @@ static void __devexit cleanup_device(str
{
int port;

- ipath_shutdown_device(dd);
-
if (*dd->ipath_statusp & IPATH_STATUS_CHIP_PRESENT) {
/* can't do anything more with chip; needs re-init */
*dd->ipath_statusp &= ~IPATH_STATUS_CHIP_PRESENT;
@@ -633,6 +631,12 @@ static void __devexit ipath_remove_one(s
struct ipath_devdata *dd = pci_get_drvdata(pdev);

ipath_cdbg(VERBOSE, "removing, pdev=%p, dd=%p\n", pdev, dd);
+
+ /*
+ * disable the IB link early, to be sure no new packets arrive, which
+ * complicates the shutdown process
+ */
+ ipath_shutdown_device(dd);

if (dd->verbs_dev)
ipath_unregister_ib_device(dd->verbs_dev);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/