]> git.karo-electronics.de Git - mv-sheeva.git/commit
cnic: Decouple uio close from cnic shutdown
authorMichael Chan <mchan@broadcom.com>
Wed, 13 Oct 2010 14:06:50 +0000 (14:06 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 14 Oct 2010 17:45:55 +0000 (10:45 -0700)
commita3ceeeb8f11d74f26e3dfca40ded911a82402db5
treeec30fde13baa7880a48a6353ef5ff0af6bd67185
parentcd801536c236e287f1d3eeee428abf9ffd523ede
cnic: Decouple uio close from cnic shutdown

During cnic shutdown, the original driver code requires userspace to
close the uio device within a few seconds.  This doesn't always happen
as the userapp may be hung or otherwise take a long time to close.  The
system may crash when this happens.

We fix the problem by decoupling the uio structures from the cnic
structures during cnic shutdown.  We do not unregister the uio device
until the cnic driver is unloaded.  This eliminates the unreliable wait
loop for uio to close.

All uio structures are kept in a linked list.  If the device is shutdown
and later brought back up again, the uio strcture will be found in the
linked list and coupled back to the cnic structures.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/cnic.c