From patchwork Wed Apr 10 04:30:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Gong X-Patchwork-Id: 10893133 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 6FBEC922 for ; Wed, 10 Apr 2019 04:31:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 533B3289A9 for ; Wed, 10 Apr 2019 04:31:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47E65289E8; Wed, 10 Apr 2019 04:31:19 +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=unavailable 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 D812A289A9 for ; Wed, 10 Apr 2019 04:31:18 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From: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=bcGOvdhT0PytZfbLF5ibjKTtso+brbrCCLrLELcMD2g=; b=G8N 1Kliit0qzC6hzAzytLFQW1r9P/JADPHKM6LDeNaa89rk9Vk4Yr37JMl2hQAIAXE7K9t8J8FYnDbMr 1Tin9ZJ7GItCO9dXDOeGrcnNzMAdIB6Q3XggFAqDtJrTkhDkQZwyBFu+Rk+rHJKy+dJu+G6zDn45E IVBDMh+P7fUqUaUMvpTMn9H2AcYY0LdQA/LIc2rptbujwJMrSy9jKjx8lc+mwgBej/3Xlq6XUwUS1 IOdp8ZUImU04Q0JjuPFVu3jNHVqgQg9VeWBpwK9R/Hnbbg0Zj47ZHvvs+9RN0QMYljLOYXuVP4sjY izGaIf8IXeuoWjRinncFIqeN/NmcvUg==; 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 1hE4tJ-0005d1-En; Wed, 10 Apr 2019 04:31:17 +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 1hE4tE-0005Za-28 for ath10k@lists.infradead.org; Wed, 10 Apr 2019 04:31:16 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id F2532611C3; Wed, 10 Apr 2019 04:31:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1554870671; bh=ImNpd/A83IwqUY8wQ21mLfijwT60NC1UYHmPPpQWilI=; h=From:To:Cc:Subject:Date:From; b=lW7f047eHOrpRJlI11Kim+dPQTGooh0iKx55bt/l7AQo+wRiE21+mzvMPQUn9OuWG awmbIEZU0H27dMmkT/T3r/WqSH6g7Ho0pMECu3yFAwjvYdMZo50M8Cgbxv9lNuZGFu ASb1gYMZLGuPAH0ak94kjZgwJ+g05Le9/YSTKDcY= Received: from localhost.localdomain (unknown [180.166.53.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: wgong@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2EF81602B7; Wed, 10 Apr 2019 04:31:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1554870667; bh=ImNpd/A83IwqUY8wQ21mLfijwT60NC1UYHmPPpQWilI=; h=From:To:Cc:Subject:Date:From; b=OP4havjyDMQ7gYlJUOLQBrHSv+Zg8C9E40+cMS8pd7bdvAH8cYNZj7b4vSBcF9W/+ 6nVXCrowa/SviLjfcshfMlL8EttlB5xd1mxa7tJsVaO08FqZE07bIWucEpdHj/l9P2 a0PmJm6qhkKUaBrslImbBGWJCcQqFe5viYAnxsVM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 2EF81602B7 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=wgong@codeaurora.org From: Wen Gong To: ath10k@lists.infradead.org Subject: [PATCH] ath10k: change swap mail box config for UTF mode of SDIO Date: Wed, 10 Apr 2019 12:30:54 +0800 Message-Id: <1554870654-4236-1-git-send-email-wgong@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190409_213112_361430_4D4A636D X-CRM114-Status: GOOD ( 12.44 ) 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 MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP For SDIO chip, it does not have HTT connect step in boot phase of UTF mode, so it does not need the swap configuration for UTF mode, otherwise it will trigger UTF load fail. For normal mode, it is swap between HTT and WMI, for UTF mode, it does not have HTT, so it can not swap between HTT and WMI. Disable swap mail box for UTF mode will let UTF mode load success. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00007-QCARMSWP-1. Signed-off-by: Wen Gong --- drivers/net/wireless/ath/ath10k/core.c | 11 ++++++++--- drivers/net/wireless/ath/ath10k/sdio.c | 5 +++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 835b8de..79a238c 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -629,7 +629,7 @@ static void ath10k_send_suspend_complete(struct ath10k *ar) complete(&ar->target_suspend); } -static void ath10k_init_sdio(struct ath10k *ar) +static void ath10k_init_sdio(struct ath10k *ar, enum ath10k_firmware_mode mode) { u32 param = 0; @@ -646,7 +646,12 @@ static void ath10k_init_sdio(struct ath10k *ar) * not big enough for mac80211 / native wifi frames. disable it */ param &= ~HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE; - param |= HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET; + + if (mode == ATH10K_FIRMWARE_MODE_UTF) + param &= ~HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET; + else + param |= HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET; + ath10k_bmi_write32(ar, hi_acs_flags, param); /* Explicitly set fwlog prints to zero as target may turn it on @@ -2501,7 +2506,7 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, goto err; if (ar->hif.bus == ATH10K_BUS_SDIO) - ath10k_init_sdio(ar); + ath10k_init_sdio(ar, mode); } ar->htc.htc_ops.target_send_suspend_complete = diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c index fae56c6..bfb125b 100644 --- a/drivers/net/wireless/ath/ath10k/sdio.c +++ b/drivers/net/wireless/ath/ath10k/sdio.c @@ -1637,7 +1637,12 @@ static int ath10k_sdio_hif_swap_mailbox(struct ath10k *ar) ath10k_dbg(ar, ATH10K_DBG_SDIO, "sdio mailbox swap service enabled\n"); ar_sdio->swap_mbox = true; + } else { + ath10k_dbg(ar, ATH10K_DBG_SDIO, + "sdio mailbox swap service disabled\n"); + ar_sdio->swap_mbox = false; } + return 0; }