From patchwork Tue Feb 3 21:21:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Ryazanov X-Patchwork-Id: 5771941 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AADAE9F302 for ; Tue, 3 Feb 2015 21:21:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C787A20259 for ; Tue, 3 Feb 2015 21:21:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9BD4220256 for ; Tue, 3 Feb 2015 21:21:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966542AbbBCVVZ (ORCPT ); Tue, 3 Feb 2015 16:21:25 -0500 Received: from mail-la0-f46.google.com ([209.85.215.46]:64100 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756172AbbBCVVY (ORCPT ); Tue, 3 Feb 2015 16:21:24 -0500 Received: by mail-la0-f46.google.com with SMTP id s18so54870919lam.5 for ; Tue, 03 Feb 2015 13:21:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=ximbT76tt0qu59E9NlAZ9TYfiMeA+wDTN43P2xbrSbg=; b=JNR8C7pINjHTiR2x8prL+viB2huHpiVZN7oL55Ojgqpu9FmFoM2shhfiCsT4s6VkdI AkPEzstP+Ckx9ONSu5myajh5/w8ZhsHkEHpyD3KkB6GB2nyc7mauMz+ScMpJnjOkLM4t eFORTqPmfThrXxo05Q1ui58qTkddV3A+DdpkpcLho5m001FkhBmtPYhP9bssOdgw7+H7 298cC+jNJSVjZkojmB7sv+lPdBYWmmRmqAsD49PN54C/TwYKsDbE8WAcnDSLSLiHrnG8 Vc9Vb2ItzYXaxqMHRi7VWtRsTQ9QIalOhOp1ZXI16r/PgBVvReimrM/xd+GqybvlC34Z Y2xQ== X-Received: by 10.152.183.196 with SMTP id eo4mr27399607lac.0.1422998483271; Tue, 03 Feb 2015 13:21:23 -0800 (PST) Received: from rsa-laptop.internal.lan ([217.25.229.52]) by mx.google.com with ESMTPSA id oa1sm5266741lbc.24.2015.02.03.13.21.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Feb 2015 13:21:22 -0800 (PST) From: Sergey Ryazanov To: linux-wireless@vger.kernel.org Cc: Jiri Slaby , Nick Kossifidis , "Luis R. Rodriguez" Subject: [PATCH] ath5k: fix spontaneus AR5312 freezes Date: Wed, 4 Feb 2015 00:21:13 +0300 Message-Id: <1422998473-3709-1-git-send-email-ryazanov.s.a@gmail.com> X-Mailer: git-send-email 2.0.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sometimes while CPU have some load and ath5k doing the wireless interface reset the whole WiSoC completely freezes. Set of tests shows that using atomic delay function while we wait interface reset helps to avoid such freezes. The easiest way to reproduce this issue: create a station interface, start continous scan with wpa_supplicant and load CPU by something. Or just create multiple station interfaces and put them all in continous scan. This patch partially reverts the commit 1846ac3dbec0 ("ath5k: Use usleep_range where possible"), which replaces initial udelay() by usleep_range(). I do not know actual source of this issue, but all looks like that HW freeze is caused by transaction on internal SoC bus, while wireless block is in reset state. Also I should note that I do not know how many chips are affected, but I did not see this issue with chips, other than AR5312. CC: Jiri Slaby CC: Nick Kossifidis CC: Luis R. Rodriguez Fixes: 1846ac3dbec0 ("ath5k: Use usleep_range where possible") Reported-by: Christophe Prevotaux Tested-by: Christophe Prevotaux Tested-by: Eric Bree Signed-off-by: Sergey Ryazanov --- I would like to sincerely thank Christophe for provided board and for his patience and perseverance in solving problems with the delivery ;) --- drivers/net/wireless/ath/ath5k/reset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath5k/reset.c b/drivers/net/wireless/ath/ath5k/reset.c index a3399c4..b9b651e 100644 --- a/drivers/net/wireless/ath/ath5k/reset.c +++ b/drivers/net/wireless/ath/ath5k/reset.c @@ -478,7 +478,7 @@ ath5k_hw_wisoc_reset(struct ath5k_hw *ah, u32 flags) regval = ioread32(reg); iowrite32(regval | val, reg); regval = ioread32(reg); - usleep_range(100, 150); + udelay(100); /* NB: should be atomic */ /* Bring BB/MAC out of reset */ iowrite32(regval & ~val, reg);