From patchwork Fri Sep 25 18:29:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 11800497 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B596F112C for ; Fri, 25 Sep 2020 18:30:43 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 58C6420878 for ; Fri, 25 Sep 2020 18:30:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vzKmt1mZ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="HVUBpvOg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58C6420878 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.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=OahEUeIW2KPe/quT1wzCFMT1m1C2p0a3XLUCQHrr6sM=; b=vzKmt1mZObm0Pbw5T6cKShv+Aw SRIBquLVZp4rFA+pkoQ5BLE3fH+IwQ+MH/WMl+bXvs4a9EKQm6mIDerDlvcS99TRj7ZKP3pSI3UXk bpEl5A6JJ1YGO1r2VAekKN5R3aq/tu5526qh4ZKHNy1BxdILIJ0tdSJ+B0074nwhHXFvltN9lFI66 gOVwTJUaxkimetiJjmjVWP4dRQRgzQ5SC8iQlXHj5QriwdjdPKSYJClWhiJztr/CBm8DggHI1K1OM DV3CSn38BC0ucgQZ+PZM4kUUOxuv5LPJ04GNDaUeMsH4xWf15HTXLwGSJed7gfYOAiPmTRLfzAa+z 3VP/qTvw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLsTk-0004pm-8v; Fri, 25 Sep 2020 18:29:56 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLsTi-0004p1-E4 for ath10k@lists.infradead.org; Fri, 25 Sep 2020 18:29:55 +0000 Received: by mail-pf1-x443.google.com with SMTP id z18so4015888pfg.0 for ; Fri, 25 Sep 2020 11:29:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:author; bh=Rhv9HZEtrEL141zSMGw1g065/LfSYNOus3HpsgDc4Os=; b=HVUBpvOg+s0a1z2RzoKEIEFlCJWP5rVxDKxRmwxMKnABEXn383FnVD5FLFSLg4M3yY DiJztuPhznDB7e0NReBuNguMYtpthbjZWDgz321egNY6GGLm0jEyz48oTlgao0R0tQDO 21XRe3aF8XrGRVp5TH1ENC7Cl346shsAgl/ySE4HlZOISGRz8JWlooVQQBcsRwJzbILi HH7HWhjb1BTRHpFtmSJZ/YBhEQiPHWyV8FSc2DBvNXW5lXG8sMVhBHmAzw1WZAHXK/a2 Y0ezbxZxbV5PzAIcLN12G8u+Lc+veBcqtiAJR9ZuPeIyRnnZ1wy7vecPxyT7XU7hkI/p WbFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:author; bh=Rhv9HZEtrEL141zSMGw1g065/LfSYNOus3HpsgDc4Os=; b=pvsz5W44AUqPYKSNC2s1XmiYmR+S11LQQJfy4AXDoR8Dt+YcWacMOUbrD843zch545 KE/DAZXnoOr9gRuCuLuaAYNvJCI5tiIHfkRIGDoBMZbYU22lKULJu86QhiAYJ2IBXcBL /jr9tiU4Yz2s6ClzhA5P7sCM5301eceid9dXTx+bLVsS8fORnKMyVAO22aeu6GJsQOaV C8yNqJ+/0/o3ZD4QHrOosmizBFDRZHM8hSztnFdTzUqdzLnXUbm+sBlsGskOKjqLL229 +mgHdokrcsYFmecNMDOTMF3uvamvgPRyUrAdPCiYbFdlq3m23IkmdCP6K6n2P9lcDOtx EyKA== X-Gm-Message-State: AOAM530xUZ8HgFJd+1z0akXOYEHnF3kpo4AS+DGdBqwy15C9va0y1ES5 CGdXJ21ho989Fqz+2vaT7Ri+uQ== X-Google-Smtp-Source: ABdhPJyT6RQYB9DC4di8a/7z5wXawdsq8FSxpEdIKmdSgymgn9ER5Udfvz37BcVVx/UkrRoJ02vI2g== X-Received: by 2002:a17:902:c404:b029:d2:564a:e41d with SMTP id k4-20020a170902c404b02900d2564ae41dmr681548plk.23.1601058589772; Fri, 25 Sep 2020 11:29:49 -0700 (PDT) Received: from localhost.localdomain ([2405:201:6803:60dd:c56a:3b96:e0d6:72b4]) by smtp.gmail.com with ESMTPSA id f4sm2806762pgk.19.2020.09.25.11.29.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Sep 2020 11:29:48 -0700 (PDT) From: Amit Pundir To: Kalle Valo , David S Miller , Jakub Kicinski , Rob Herring , Bjorn Andersson , Jeffrey Hugo Subject: [PATCH] ath10k: Introduce a devicetree quirk to skip host cap QMI requests Date: Fri, 25 Sep 2020 23:59:41 +0530 Message-Id: <1601058581-19461-1-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 Author: Amit Pundir X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200925_142954_482712_B1D6ECFB X-CRM114-Status: GOOD ( 18.33 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:443 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Konrad Dybcio , ath10k@lists.infradead.org, lkml , John Stultz , Sumit Semwal MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org There are firmware versions which do not support host capability QMI request. We suspect either the host cap is not implemented or there may be firmware specific issues, but apparently there seem to be a generation of firmware that has this particular behavior. For example, firmware build on Xiaomi Poco F1 (sdm845) phone: "QC_IMAGE_VERSION_STRING=WLAN.HL.2.0.c3-00257-QCAHLSWMTPLZ-1" If we do not skip the host cap QMI request on Poco F1, then we get a QMI_ERR_MALFORMED_MSG_V01 error message in the ath10k_qmi_host_cap_send_sync(). But this error message is not fatal to the firmware nor to the ath10k driver and we can still bring up the WiFi services successfully if we just ignore it. Hence introducing this DeviceTree quirk to skip host capability QMI request for the firmware versions which do not support this feature. Suggested-by: Bjorn Andersson Signed-off-by: Amit Pundir Reviewed-by: Bjorn Andersson --- .../devicetree/bindings/net/wireless/qcom,ath10k.txt | 5 +++++ drivers/net/wireless/ath/ath10k/qmi.c | 13 ++++++++++--- drivers/net/wireless/ath/ath10k/snoc.c | 3 +++ drivers/net/wireless/ath/ath10k/snoc.h | 1 + 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt index 65ee68efd574..135c7ecd4487 100644 --- a/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt +++ b/Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt @@ -86,6 +86,11 @@ Optional properties: Value type: Definition: Quirk specifying that the firmware expects the 8bit version of the host capability QMI request +- qcom,snoc-host-cap-skip-quirk: + Usage: Optional + Value type: + Definition: Quirk specifying that the firmware wants to skip the host + capability QMI request - qcom,xo-cal-data: xo cal offset to be configured in xo trim register. - qcom,msa-fixed-perm: Boolean context flag to disable SCM call for statically diff --git a/drivers/net/wireless/ath/ath10k/qmi.c b/drivers/net/wireless/ath/ath10k/qmi.c index 5468a41e928e..5adff7695e18 100644 --- a/drivers/net/wireless/ath/ath10k/qmi.c +++ b/drivers/net/wireless/ath/ath10k/qmi.c @@ -770,6 +770,7 @@ ath10k_qmi_ind_register_send_sync_msg(struct ath10k_qmi *qmi) static void ath10k_qmi_event_server_arrive(struct ath10k_qmi *qmi) { struct ath10k *ar = qmi->ar; + struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); int ret; ret = ath10k_qmi_ind_register_send_sync_msg(qmi); @@ -781,9 +782,15 @@ static void ath10k_qmi_event_server_arrive(struct ath10k_qmi *qmi) return; } - ret = ath10k_qmi_host_cap_send_sync(qmi); - if (ret) - return; + /* + * Skip the host capability request for the firmware versions which + * do not support this feature. + */ + if (!test_bit(ATH10K_SNOC_FLAG_SKIP_HOST_CAP_QUIRK, &ar_snoc->flags)) { + ret = ath10k_qmi_host_cap_send_sync(qmi); + if (ret) + return; + } ret = ath10k_qmi_msa_mem_info_send_sync_msg(qmi); if (ret) diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c index 354d49b1cd45..4efbf1339c80 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.c +++ b/drivers/net/wireless/ath/ath10k/snoc.c @@ -1281,6 +1281,9 @@ static void ath10k_snoc_quirks_init(struct ath10k *ar) if (of_property_read_bool(dev->of_node, "qcom,snoc-host-cap-8bit-quirk")) set_bit(ATH10K_SNOC_FLAG_8BIT_HOST_CAP_QUIRK, &ar_snoc->flags); + + if (of_property_read_bool(dev->of_node, "qcom,snoc-host-cap-skip-quirk")) + set_bit(ATH10K_SNOC_FLAG_SKIP_HOST_CAP_QUIRK, &ar_snoc->flags); } int ath10k_snoc_fw_indication(struct ath10k *ar, u64 type) diff --git a/drivers/net/wireless/ath/ath10k/snoc.h b/drivers/net/wireless/ath/ath10k/snoc.h index a3dd06f6ac62..2a0045f0af7e 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.h +++ b/drivers/net/wireless/ath/ath10k/snoc.h @@ -47,6 +47,7 @@ enum ath10k_snoc_flags { ATH10K_SNOC_FLAG_UNREGISTERING, ATH10K_SNOC_FLAG_RECOVERY, ATH10K_SNOC_FLAG_8BIT_HOST_CAP_QUIRK, + ATH10K_SNOC_FLAG_SKIP_HOST_CAP_QUIRK, }; struct clk_bulk_data;