Received: by 10.192.165.148 with SMTP id m20csp828434imm; Fri, 27 Apr 2018 08:09:07 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqy3u/bGKlc9aUpQbsA+Hn5x8gmh5p2G40etsoFaqEaUDtgdab+5VsUvaKDOmHrVw00em4j X-Received: by 2002:a17:902:8345:: with SMTP id z5-v6mr2564215pln.311.1524841747714; Fri, 27 Apr 2018 08:09:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524841747; cv=none; d=google.com; s=arc-20160816; b=lm1xUYUhGyxqLLd8wDcBJUq8EGaJm1tpnC+AHTS8XwOD38Vienvcu6rIKpdQo0OL/Q EPRtLaU7Zyae3Qx61OnQl2AMJFMiXN5vBSErYwVvkGuihZEuC/wW/CwntAzm/Vu818On KM+XQ/GGpavzki7FH8Nr+VuDYnPkMnxq3s9h8v6KUwJOt2tv9GlUPRSNJ/8U+Rb6LfZY 4YhxTqbeW3uj6U19C6lqX8kyF5Zr3aFy/Ztf7D4ulp5WR7R9xASny+91SSnWq5uvkX6X CysvQNoAvcUProfmEltKhwLejO1MrJmPqXBE8xiS6FEu6yzgecPmAeclMmH/VhtHEiPS sarA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=xsUX7GprwjK1XEaAf4Ju7uYUmeS8tvhpz53kquaymwk=; b=BV5QbnQe7uStVdh86OIAPHk6oAj3w/ZiOxnVBAu4NY54x+8BttQ+xdq4GRPzL2lDJa 8vr8nb+jBEELmDZDIVjG9Zryqgn6iSoxmP90WzW4eOCWZij+xba8CrgKUemdp+hYmUnJ +3QRfl9YmURSHfPqTqAmPiUSjD18FZiANL8x/IjOKCLT3fetlwiKByiNKXHqen+EHhkN 47GcZiH6uSyIuo/NZXlb90HeosDnmDc5aT1KGuywn+FjGttgMQBlVUgBVdhYihF16t/J 9B1DCzZjsfhppqx/vG/kgDWi0M+tOJ5jC32Y96ksWm2s5frE5e+U8gk5Q2J2+qK3g3F6 VskA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t75-v6si1322409pgc.566.2018.04.27.08.08.51; Fri, 27 Apr 2018 08:09:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933750AbeD0OEl (ORCPT + 99 others); Fri, 27 Apr 2018 10:04:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:50900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933706AbeD0OEg (ORCPT ); Fri, 27 Apr 2018 10:04:36 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E02772189D; Fri, 27 Apr 2018 14:04:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E02772189D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felix Fietkau , Kalle Valo , Amit Pundir Subject: [PATCH 4.9 16/74] ath9k_hw: check if the chip failed to wake up Date: Fri, 27 Apr 2018 15:58:06 +0200 Message-Id: <20180427135710.573193299@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135709.899303463@linuxfoundation.org> References: <20180427135709.899303463@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Felix Fietkau commit a34d0a0da1abae46a5f6ebd06fb0ec484ca099d9 upstream. In an RFC patch, Sven Eckelmann and Simon Wunderlich reported: "QCA 802.11n chips (especially AR9330/AR9340) sometimes end up in a state in which a read of AR_CFG always returns 0xdeadbeef. This should not happen when when the power_mode of the device is ATH9K_PM_AWAKE." Include the check for the default register state in the existing MAC hang check. Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo Cc: Amit Pundir Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/ath/ath9k/hw.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c @@ -1603,6 +1603,10 @@ bool ath9k_hw_check_alive(struct ath_hw int count = 50; u32 reg, last_val; + /* Check if chip failed to wake up */ + if (REG_READ(ah, AR_CFG) == 0xdeadbeef) + return false; + if (AR_SREV_9300(ah)) return !ath9k_hw_detect_mac_hang(ah);