From patchwork Thu Sep 1 17:47:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Giedrius Statkevi?ius X-Patchwork-Id: 9309829 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2B001607D6 for ; Thu, 1 Sep 2016 21:56:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DCB529558 for ; Thu, 1 Sep 2016 21:56:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 619F82955C; Thu, 1 Sep 2016 21:56:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 043E829558 for ; Thu, 1 Sep 2016 21:56:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751888AbcIAV4N (ORCPT ); Thu, 1 Sep 2016 17:56:13 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36132 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750998AbcIAV4L (ORCPT ); Thu, 1 Sep 2016 17:56:11 -0400 Received: by mail-wm0-f65.google.com with SMTP id i138so392490wmf.3; Thu, 01 Sep 2016 14:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Pt841WTkxD+D6XrX/lIKEihmMN+Vdgt4o5ssTtUfr14=; b=J5FmzCzAAjV8NW86vOlfR79Gy8jNqA5lheh4eON3qXAKnZ3p8msWeAWpWb3YQz25ko LUEdN5lrOZQNSGCI7nI0q5+mMcmHMwBKvOCvt9L5/dwQYDqZCi8pJr8zkz1mD77vjRq6 KBNP/oKbwo5gb68zZCfnxg/SpYB+eN8ta0PfqGCgI3PTP6BiO3mHFeYEY2NCBRsOS3/K QUhLtSqO/oMphNKpvNqWE4Z1eqPFD0KC1s2e07kWLdG2vUn7oRhBQgfpyAq+XDxuwXSv r3d0tZSD+o7wkBptN05l/SFfEhGbvCAv+osfrjDorpK7YvaOaYeYXFUWjEtqVWYxZIQ+ gI7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Pt841WTkxD+D6XrX/lIKEihmMN+Vdgt4o5ssTtUfr14=; b=GR43GbRfIMBepxfCVa4nG4/pRjWJEuGrgoU+Nu8h/Pd6AOVZJe7Ll7FeDKTgVlvhA1 BOeCznnnpJjlXewhFxqU8XcaN85h/BoimZB3u5jcVOrSuirX7Qd/U4bSpY4WECML0TPd lLG2iAcXVjb691DLIS0EAJ4h9miefMHU1VVS5gmfl0KPDMSSND9oeT4hYGFP6wejOKXG UqcSDr012Bu8f0dRZuvwnA52pYfkpI6dVsOUxv/vQnN7v1U6tkvc7T2ImRIf8s51qp+k I3+835tdNEBb55GNTEM4gTKMsU47kP6FZAKaXfoy1AvpniYWy5j6UnUYREOqdEx3ynxH XfJw== X-Gm-Message-State: AE9vXwPHW1KhP7yGGeXcNO3MwaVVUpZfiGypkYFI+hMaGI1SzXmvUFyOPtXQuKcOD19jIQ== X-Received: by 10.194.79.198 with SMTP id l6mr15414782wjx.84.1472752048124; Thu, 01 Sep 2016 10:47:28 -0700 (PDT) Received: from localhost.localdomain (78-57-189-147.static.zebra.lt. [78.57.189.147]) by smtp.gmail.com with ESMTPSA id i129sm2041633wmg.5.2016.09.01.10.47.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Sep 2016 10:47:27 -0700 (PDT) From: =?UTF-8?q?Giedrius=20Statkevi=C4=8Dius?= To: kvalo@codeaurora.org Cc: ath9k-devel@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Miaoqing Pan , Kalle Valo , stable@vger.kernel.org, =?UTF-8?q?Giedrius=20Statkevi=C4=8Dius?= Subject: [PATCH] ath9k: bring back direction setting in ath9k_{start_stop} Date: Thu, 1 Sep 2016 20:47:02 +0300 Message-Id: <20160901174702.8645-1-giedrius.statkevicius@gmail.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A regression was introduced in commit id 79d4db1214a ("ath9k: cleanup led_pin initial") that broken the WLAN status led on my laptop with AR9287 after suspending and resuming. Steps to reproduce: * Suspend (laptop) * Resume (laptop) * Observe that the WLAN led no longer turns ON/OFF depending on the status and is always red Even though for my case it only needs to be set to OUT in ath9k_start but for consistency bring back the IN direction setting as well. Cc: Miaoqing Pan Cc: Kalle Valo Cc: Signed-off-by: Giedrius Statkevičius --- This patch should be applied to all 4.7 and later kernels Another user complaining about probably the same problem: https://bugzilla.kernel.org/show_bug.cgi?id=151711 drivers/net/wireless/ath/ath9k/main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 8b63988..121dc05 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -718,9 +718,12 @@ static int ath9k_start(struct ieee80211_hw *hw) if (!ath_complete_reset(sc, false)) ah->reset_power_on = false; - if (ah->led_pin >= 0) + if (ah->led_pin >= 0) { ath9k_hw_set_gpio(ah, ah->led_pin, (ah->config.led_active_high) ? 1 : 0); + ath9k_hw_gpio_request_out(ah, ah->led_pin, NULL, + AR_GPIO_OUTPUT_MUX_AS_OUTPUT); + } /* * Reset key cache to sane defaults (all entries cleared) instead of @@ -864,9 +867,11 @@ static void ath9k_stop(struct ieee80211_hw *hw) spin_lock_bh(&sc->sc_pcu_lock); - if (ah->led_pin >= 0) + if (ah->led_pin >= 0) { ath9k_hw_set_gpio(ah, ah->led_pin, (ah->config.led_active_high) ? 0 : 1); + ath9k_hw_gpio_request_in(ah, ah->led_pin, NULL); + } ath_prepare_reset(sc);