[openib-general] [PATCH] fix ipoib proc entries WAS: [OOPS] unloading ib_mthca with ib0 up

Tom Duffy Tom.Duffy at Sun.COM
Thu Sep 16 11:02:12 PDT 2004


On Wed, 2004-09-15 at 20:36 -0700, Roland Dreier wrote:
> Does this fix the oops?

Although, I do get this when I remove ib_services.

Badness in remove_proc_entry at /build1/tduffy/openib-work/linux-2.6.9-rc2-openib/fs/proc/generic.c:688
                        
Call Trace:<ffffffff801b58bf>{remove_proc_entry+207} <ffffffff80151f8b>{sys_delete_module+331}
       <ffffffff8016e3ca>{sys_munmap+90} <ffffffff8011191a>{system_call+126}

This stems from ipoib making bad entries:

# ls /proc/infiniband/
ipoib_arp_ib%d  ipoib_mcast_ib%d  ipoib_vlan  poll_counts
ipoib_arp_ib%d  ipoib_mcast_ib%d  mad         tracelevel

This is because the proc entries are created *before* register_netdev()
is called which sets the correct name.

So, this patch moves the proc entry creation after register_netdev().

-tduffy

Index: drivers/infiniband/ulp/ipoib/ipoib_main.c
===================================================================
--- drivers/infiniband/ulp/ipoib/ipoib_main.c	(revision 853)
+++ drivers/infiniband/ulp/ipoib/ipoib_main.c	(working copy)
@@ -459,14 +459,8 @@
 	if (ipoib_ib_dev_init(dev, ca, port))
 		goto out_tx_ring_cleanup;
 
-	if (ipoib_proc_dev_init(dev))
-		goto out_ib_cleanup;
-
 	return 0;
 
-out_ib_cleanup:
-	ipoib_ib_dev_cleanup(dev);
-
 out_tx_ring_cleanup:
 	kfree(priv->tx_ring);
 
@@ -620,12 +614,18 @@
 		goto register_failed;
 	}
 
+	if (ipoib_proc_dev_init(priv->dev))
+		goto proc_failed;
+
 	down(&ipoib_device_mutex);
 	list_add_tail(&priv->list, &ipoib_device_list);
 	up(&ipoib_device_mutex);
 
 	return 0;
 
+proc_failed:
+	unregister_netdev(priv->dev);
+
 register_failed:
 	ipoib_port_monitor_dev_stop(priv->dev);
 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20040916/67ee8794/attachment.sig>


More information about the general mailing list