From patchwork Tue Feb 3 21:55:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Ryazanov X-Patchwork-Id: 436055 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D263614012E for ; Wed, 4 Feb 2015 08:55:22 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 69D65280520; Tue, 3 Feb 2015 22:52:43 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id BF30328003F for ; Tue, 3 Feb 2015 22:52:38 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .gmail. - helo: .mail-lb0-f170.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -8.5 Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Tue, 3 Feb 2015 22:52:37 +0100 (CET) Received: by mail-lb0-f170.google.com with SMTP id w7so41152563lbi.1 for ; Tue, 03 Feb 2015 13:55:08 -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=HgSY/mYU26SEsXzF2CPh3hkaCaCqvzkJZ77mkV+8dgA=; b=L7q2zx031IHgaHANLkm3syDtlDB37g4SHaBBM7uvSicgevk1BIILM6rRwb4/aHJs9a ZO+IpEDHA7otEXxHgW8wvvLes31RDwnHNPil1Eq7ddiHvJ1doJQLbeQlWCljjEg/O4hc XNjkQ3/x72jvFngATFlXiOLPCIS3znKo3a+iVH4f1rse0nS+ISYegEtaLUeYVkoYF9iq 0rFkwqZzcM6zUo8sH0k1RdlJzLQkC3p6pbYGuT6HausYKfb2ImpLDmHT0tBJ18DARr17 wXdjKxHfTaycVK1QpixBxFIHo0yCYyZX4LrRG5RmBqWW0QGnbJ1V6yIW9iMhZCyN5M6P P3sQ== X-Received: by 10.112.110.103 with SMTP id hz7mr27418859lbb.62.1423000508770; Tue, 03 Feb 2015 13:55:08 -0800 (PST) Received: from rsa-laptop.internal.lan ([217.25.229.52]) by mx.google.com with ESMTPSA id xn1sm5280535lbb.27.2015.02.03.13.55.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Feb 2015 13:55:08 -0800 (PST) From: Sergey Ryazanov To: Felix Fietkau Date: Wed, 4 Feb 2015 00:55:03 +0300 Message-Id: <1423000503-23818-1-git-send-email-ryazanov.s.a@gmail.com> X-Mailer: git-send-email 2.0.4 Cc: OpenWrt Development List Subject: [OpenWrt-Devel] [PATCH] ath5k: fix spontaneus AR5312 freezes X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Signed-off-by: Sergey Ryazanov --- .../330-ath5k-fix-spontaneus-AR5312-freezes.patch | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 package/kernel/mac80211/patches/330-ath5k-fix-spontaneus-AR5312-freezes.patch diff --git a/package/kernel/mac80211/patches/330-ath5k-fix-spontaneus-AR5312-freezes.patch b/package/kernel/mac80211/patches/330-ath5k-fix-spontaneus-AR5312-freezes.patch new file mode 100644 index 0000000..aacadba --- /dev/null +++ b/package/kernel/mac80211/patches/330-ath5k-fix-spontaneus-AR5312-freezes.patch @@ -0,0 +1,45 @@ +From: Sergey Ryazanov +Date: Tue, 3 Feb 2015 22:37:26 +0300 +Subject: [PATCH] ath5k: fix spontaneus AR5312 freezes + +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 +--- +--- 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 + 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);