From: Stephen Hemminger Date: Tue, 4 Dec 2007 01:02:17 +0000 (-0800) Subject: sky2: recovery deadlock fix X-Git-Tag: v2.6.24-rc5~106^2~4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8cfcbe998aa0459e20bbad61376f81c1715b25d6;p=linux-2.6 sky2: recovery deadlock fix Prevent deadlock in sky2 recovery logic. sky2_down calls napi_synchronize which gets stuck if napi was already disabled. Fix by rearranging slightly and not calling napi_disable until after both ports are stopped. The napi_disable probably is being overly paranoid, but it is safe now. Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 3d1dfc9484..6197afb3ed 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -2906,16 +2906,14 @@ static void sky2_restart(struct work_struct *work) int i, err; rtnl_lock(); - sky2_write32(hw, B0_IMSK, 0); - sky2_read32(hw, B0_IMSK); - napi_disable(&hw->napi); - for (i = 0; i < hw->ports; i++) { dev = hw->dev[i]; if (netif_running(dev)) sky2_down(dev); } + napi_disable(&hw->napi); + sky2_write32(hw, B0_IMSK, 0); sky2_reset(hw); sky2_write32(hw, B0_IMSK, Y2_IS_BASE); napi_enable(&hw->napi);