From patchwork Fri Apr 12 13:28:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 10898289 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D07201669 for ; Fri, 12 Apr 2019 13:28:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0917286B4 for ; Fri, 12 Apr 2019 13:28:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A492028E12; Fri, 12 Apr 2019 13:28:33 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 52BA6286B4 for ; Fri, 12 Apr 2019 13:28:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:To:From: Subject:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=t9SC5io5FLEQPrRYqUIIBkGjA4WO9RVQqTKQ/98swwQ=; b=EHTTFdzhkTTji3 RlmLTPetgkToUzxcVK29qEPF9mlmey+CbhI8J3NFIU99tg6qj+T+kI0CKh/vxvJeejWeCHjcusuG0 LEnRCDr4uHgz3lvsqPIjc071gAHfWqJFDw9ygckAX5dzxt3SFcF78rhh9eOBsthRuem5X+eEAdvSL 0DteyveImgp4UbIQXLMe6S70p+qttzA7fy02J0p+pjRxvF/lypPIOQIPlYmFXbzPW+kBqCZlPsZh2 NYBklAJIcx+BrDlwKuzU7HcFSMfT31sr0xlcTgLV5H07uWc0gJZvQXDoeoIOd5m7yTl+idVtiZeh4 crw0MMvJ3WkAuRjZRuew==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEwEC-0002Wl-Qo; Fri, 12 Apr 2019 13:28:24 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEwE8-0002T5-L9 for ath10k@lists.infradead.org; Fri, 12 Apr 2019 13:28:22 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 45B7D61577; Fri, 12 Apr 2019 13:28:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1555075700; bh=tvoPqiI+paUAOLZVilty2/u/V2VPLMMSzI9QUfRvf1A=; h=Subject:From:To:Cc:Date:From; b=YtvbuusJBjFwKYni3pKs/U6x+hhvHr/0cJzYMSKanGvRzrQIFyDx8FvoDgq7Gn22D WUF30OSLDz27AbBp75Ju42dOPGqUswm0KWJgCgsUVYOrUfe5JWtdV+V2eRqA9ttCnk W364nZvPIhfz3H1MaLEh68CqhqZiNUNR5r+jxaYw= Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 239386119E; Fri, 12 Apr 2019 13:28:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1555075699; bh=tvoPqiI+paUAOLZVilty2/u/V2VPLMMSzI9QUfRvf1A=; h=Subject:From:To:Cc:Date:From; b=CBweQumdAM3gBr0dIb/2CnW/VhAWIItQtRtQXHq5QXytP1t8rNJM39jDrU2cZe01E Emp3rVS5bdh/ec7pHw1bqeThGxSHSsbT+3NhUy2imNS5xvQgwFLOBP1PbUexiWhgh6 ZyXW4K8mlubTuW9CKbwEpJaL4bL2VI7sfMdVkLx4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 239386119E Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org Subject: [PATCH 1/6] ath10k: sdio: workaround firmware UART pin configuration bug From: Kalle Valo To: ath10k@lists.infradead.org Date: Fri, 12 Apr 2019 16:28:17 +0300 Message-ID: <155507569645.32018.15231567732563770250.stgit@potku.adurom.net> User-Agent: StGit/0.17.1-17-ge4e0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190412_062820_790207_A30C6859 X-CRM114-Status: GOOD ( 12.21 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wen Gong On QCA6174 SDIO devices the SDIO interrupt will fail if UART is disabled from ath10k. SDIO firmware enables UART printouts by default. If ath10k will try to enable UART again the firmware will configure it's GPIO line incorrectly and SDIO interrupts won't work anymore. The workaround is to set UART pin again (19 for QCA6174 SDIO) if uart_print is 0. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00007-QCARMSWP-1. Signed-off-by: Wen Gong Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath10k/core.c | 10 +++++++++- drivers/net/wireless/ath/ath10k/hw.h | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 835b8de92d55..cfd7bb29a1ec 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -2065,8 +2065,16 @@ static int ath10k_init_uart(struct ath10k *ar) return ret; } - if (!uart_print) + if (!uart_print && ar->hw_params.uart_pin_workaround) { + ret = ath10k_bmi_write32(ar, hi_dbg_uart_txpin, + ar->hw_params.uart_pin); + if (ret) { + ath10k_warn(ar, "failed to set UART TX pin: %d", ret); + return ret; + } + return 0; + } ret = ath10k_bmi_write32(ar, hi_dbg_uart_txpin, ar->hw_params.uart_pin); if (ret) { diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h index 71314999aa24..a92fce1bb6f0 100644 --- a/drivers/net/wireless/ath/ath10k/hw.h +++ b/drivers/net/wireless/ath/ath10k/hw.h @@ -606,6 +606,11 @@ struct ath10k_hw_params { /* target supporting fw download via diag ce */ bool fw_diag_ce_download; + + /* need to set uart pin if disable uart print, workaround for a + * firmware bug + */ + bool uart_pin_workaround; }; struct htt_rx_desc;