From patchwork Mon Jan 31 18:50:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jussi Kivilinna X-Patchwork-Id: 520721 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0VInpUp002237 for ; Mon, 31 Jan 2011 18:50:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755929Ab1AaSuI (ORCPT ); Mon, 31 Jan 2011 13:50:08 -0500 Received: from tulikuusama.dnainternet.net ([83.102.40.132]:44601 "EHLO tulikuusama.dnainternet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754943Ab1AaSuI (ORCPT ); Mon, 31 Jan 2011 13:50:08 -0500 Received: from localhost (localhost [127.0.0.1]) by tulikuusama.dnainternet.net (Postfix) with ESMTP id 0B4272CB0E; Mon, 31 Jan 2011 20:50:07 +0200 (EET) X-Virus-Scanned: DNA Postiturva at dnainternet.net X-Spam-Flag: NO X-Spam-Score: -1.44 X-Spam-Level: X-Spam-Status: No, score=-1.44 tagged_above=-9999 required=6 tests=[ALL_TRUSTED=-1.44] Received: from tulikuusama.dnainternet.net ([83.102.40.132]) by localhost (tulikuusama.dnainternet.net [127.0.0.1]) (amavisd-new, port 10041) with ESMTP id cF+PBx0-FR-u; Mon, 31 Jan 2011 20:50:06 +0200 (EET) Received: from oliivipuu.dnainternet.net (oliivipuu.dnainternet.net [83.102.40.215]) by tulikuusama.dnainternet.net (Postfix) with ESMTP id D3F182CB01; Mon, 31 Jan 2011 20:50:06 +0200 (EET) Received: from fate.lan (dyn2-85-23-163-224.psoas.suomi.net [85.23.163.224]) by oliivipuu.dnainternet.net (Postfix) with ESMTP id 861492BB1A; Mon, 31 Jan 2011 20:50:02 +0200 (EET) Subject: [PATCH 19/22] zd1211rw: reset device when CR_BCN_FIFO_SEMAPHORE freezes in beacon setup To: linux-wireless@vger.kernel.org From: Jussi Kivilinna Cc: Daniel Drake , "John W. Linville" , Ulrich Kunitz Date: Mon, 31 Jan 2011 20:50:02 +0200 Message-ID: <20110131185002.10044.3635.stgit@fate.lan> In-Reply-To: <20110131184657.10044.98610.stgit@fate.lan> References: <20110131184657.10044.98610.stgit@fate.lan> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 31 Jan 2011 18:50:17 +0000 (UTC) diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index a590a94..beaa969 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c @@ -703,7 +703,7 @@ static int zd_mac_config_beacon(struct ieee80211_hw *hw, struct sk_buff *beacon) dev_err(zd_mac_dev(mac), "Giving up beacon config.\n"); r = -ETIMEDOUT; - goto release_sema; + goto reset_device; } } msleep(20); @@ -770,6 +770,17 @@ out: mutex_unlock(&mac->chip.mutex); kfree(ioreqs); return r; + +reset_device: + mutex_unlock(&mac->chip.mutex); + kfree(ioreqs); + + /* semaphore stuck, reset device to avoid fw freeze later */ + dev_warn(zd_mac_dev(mac), "CR_BCN_FIFO_SEMAPHORE stuck, " + "reseting device..."); + usb_queue_reset_device(mac->chip.usb.intf); + + return r; } static int fill_ctrlset(struct zd_mac *mac,