Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1021558rwb; Tue, 29 Nov 2022 08:04:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf6OI3yZhkMirtAjBsbMyHVdo97XeS9myhmOwGyLeSHMA5DLaw+OziwognYCcOBS0m7/L5yO X-Received: by 2002:a17:902:ba87:b0:189:1890:77c3 with SMTP id k7-20020a170902ba8700b00189189077c3mr45459419pls.138.1669737882119; Tue, 29 Nov 2022 08:04:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669737882; cv=none; d=google.com; s=arc-20160816; b=BubwC+n1JXOrTbisPOMPx7J8PJCby+F11d3Be/mVNh6i1y9HBSrRnZfNOOt6sRXiGe GbLSVh0svrBNuUIGOu7SFDzgeJ+ucpw6XIaMsWoAY7ab3AdEPy/WMn7n9UPi/Hz6G2j9 qTBHnnGV9FM5k33TWdl8qB773celkKc4QwC/+IbC4YptBD5ClrspRCy/vYANynIJXvp4 DohGv7K713XeSWPRiKUIHfJF9FwkpdesTA3ldDNrlzFkdnOBDyykJJ5r7CmZ/jRhhFtj QM9/m79oZ6d1q0vYYrAMZlZsH6xTfo28qhFWwYYaSyghZwMAi7KkSlbzHv77Jm4PVW28 7H4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DOf4ioKPW2qI0/5Di7o//dAFaNCWENhPT1TL50yLHTo=; b=eCed186Aq7d4hZEJQi2kKecE8F+aW/qMVbSwdAQPX/zfNFB/nkvKiiiKaS5h+jJNZQ Lpdye2fZjDUxTk3J3AZ0bdJ8UQa3dsoITH1OwLRo2LYZI+5xM92dDlr1AQ5UUahDF5hu N6my9+S+qWfQNJ0YYO1ej8uc9SNPEMQ7m6b8GNmhyM+Nz+jBhB1a9Duh3ST4xGc/XhNz VqwaY03Km9/ksztL/nk+iVuVLBhkCnnwE13KfJkqs9gkWLwtA1UZR2/Zc8LISfYHKdoA Nc+DeteXIHNYiFQa0xgoyR1lSuljsKAk3KHDU4dlXpA/SXKDs/b60PDUuxwkJwx5/k4V f7vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CwujNeHx; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p9-20020a1709026b8900b001787f1922a7si14113620plk.19.2022.11.29.08.04.23; Tue, 29 Nov 2022 08:04:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CwujNeHx; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235498AbiK2QD6 (ORCPT + 67 others); Tue, 29 Nov 2022 11:03:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235812AbiK2QDB (ORCPT ); Tue, 29 Nov 2022 11:03:01 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C37C6930D; Tue, 29 Nov 2022 08:01:19 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 5433CCE136E; Tue, 29 Nov 2022 16:01:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19EE2C433D7; Tue, 29 Nov 2022 16:01:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669737675; bh=8uKzlZTZC2ESrdzmt02/0HkkY8tj+YyjH5lSyh2/YO4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CwujNeHxIeWrco7PrymPAw/sUMvLOyF7r1hnfVrUrfKSGtB6r4VuhrUA9i97muYid TUlzKotRYr5hdhguQlEhlRdgxtkNcRzGUM+W9R0oq/wqlSUS8JyX09P9bAxoIz5onS 4rQSmqgzSw8F78D8WbJfwnD7+dQh0MSaTSP7YTY3zGC1ZWSUYIG+bdN12h2Zy5VZo1 qwrP3O++dnmu47U+btgGwgon7+dD0jKFB5g6lkM7epb2OC7KuD8Q7caFonZuxpcItG vNOILe6ynowSrzgik86daIvwswInLymyYlRpD/XATy0pG+lMjZSkPwTYTwU2+ZLQQ1 /OpJPIpxNzOsA== Date: Tue, 29 Nov 2022 09:01:13 -0700 From: Nathan Chancellor To: Youghandhar Chintala Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, quic_mpubbise@quicinc.com, rameshn@qti.qualcomm.com Subject: Re: [PATCH v4] wifi: ath10k: Store WLAN firmware version in SMEM image table Message-ID: References: <20221117180534.2267-1-quic_youghand@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221117180534.2267-1-quic_youghand@quicinc.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Thu, Nov 17, 2022 at 11:35:34PM +0530, Youghandhar Chintala wrote: > In a SoC based solution, it would be useful to know the versions of the > various binary firmware blobs the system is running on. On a QCOM based > SoC, this info can be obtained from socinfo debugfs infrastructure. For > this to work, respective subsystem drivers have to export the firmware > version information to an SMEM based version information table. > > Having firmware version information at one place will help quickly > figure out the firmware versions of various subsystems on the device > instead of going through builds/logs in an event of a system crash. > > Fill WLAN firmware version information in SMEM version table to be > printed as part of socinfo debugfs infrastructure on a Qualcomm based > SoC. > > This change is applicable only for SNOC/QMI based targets. > > Example: > cat /sys/kernel/debug/qcom_socinfo/cnss/name > QC_IMAGE_VERSION_STRING=WLAN.HL.3.2.2.c10-00754-QCAHLSWMTPL-1 > > Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2.c10-00754-QCAHLSWMTPL-1 > > Signed-off-by: Youghandhar Chintala > --- > Changes from v3: > - Changed patch title > - Changed naming conventions > - Removed MAX_BUILD_ID_LEN usuage > - Added condition to call API > - Changed depends on QCOM_SMEM to select QCOM_SMEM You cannot blindly select user configurable symbols that have dependencies, otherwise you end up with Kconfig warnings. I see the following warning in -next when CONFIG_HWSPINLOCK is disabled: WARNING: unmet direct dependencies detected for QCOM_SMEM Depends on [n]: (ARCH_QCOM [=y] || COMPILE_TEST [=n]) && HWSPINLOCK [=n] Selected by [m]: - ATH10K_SNOC [=m] && NETDEVICES [=y] && WLAN [=y] && WLAN_VENDOR_ATH [=y] && ATH10K [=m] && (ARCH_QCOM [=y] || COMPILE_TEST [=n]) That should likely be changed back to 'depends on'. The reason the other QCOM symbols are selected is because they are not user-selectable, so they have to be selected by the configurations that need them. >> --- drivers/net/wireless/ath/ath10k/Kconfig | 1 + > drivers/net/wireless/ath/ath10k/qmi.c | 35 +++++++++++++++++++++++++ > 2 files changed, 36 insertions(+) > > diff --git a/drivers/net/wireless/ath/ath10k/Kconfig b/drivers/net/wireless/ath/ath10k/Kconfig > index ca007b800f75..e0a51dad8e42 100644 > --- a/drivers/net/wireless/ath/ath10k/Kconfig > +++ b/drivers/net/wireless/ath/ath10k/Kconfig > @@ -44,6 +44,7 @@ config ATH10K_SNOC > tristate "Qualcomm ath10k SNOC support" > depends on ATH10K > depends on ARCH_QCOM || COMPILE_TEST > + select QCOM_SMEM > select QCOM_SCM > select QCOM_QMI_HELPERS > help > diff --git a/drivers/net/wireless/ath/ath10k/qmi.c b/drivers/net/wireless/ath/ath10k/qmi.c > index 66cb7a1e628a..cdcb162f93c2 100644 > --- a/drivers/net/wireless/ath/ath10k/qmi.c > +++ b/drivers/net/wireless/ath/ath10k/qmi.c > @@ -14,6 +14,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -22,6 +23,10 @@ > > #define ATH10K_QMI_CLIENT_ID 0x4b4e454c > #define ATH10K_QMI_TIMEOUT 30 > +#define SMEM_IMAGE_VERSION_TABLE 469 > +#define SMEM_IMAGE_TABLE_CNSS_INDEX 13 > +#define SMEM_IMAGE_VERSION_ENTRY_SIZE 128 > +#define SMEM_IMAGE_VERSION_NAME_SIZE 75 > > static int ath10k_qmi_map_msa_permission(struct ath10k_qmi *qmi, > struct ath10k_msa_mem_info *mem_info) > @@ -536,6 +541,33 @@ int ath10k_qmi_wlan_disable(struct ath10k *ar) > return ath10k_qmi_mode_send_sync_msg(ar, QMI_WLFW_OFF_V01); > } > > +static void ath10k_qmi_add_wlan_ver_smem(struct ath10k *ar, const char *fw_build_id) > +{ > + u8 *table_ptr; > + size_t smem_item_size; > + const u32 smem_img_idx_wlan = SMEM_IMAGE_TABLE_CNSS_INDEX * > + SMEM_IMAGE_VERSION_ENTRY_SIZE; > + > + table_ptr = qcom_smem_get(QCOM_SMEM_HOST_ANY, > + SMEM_IMAGE_VERSION_TABLE, > + &smem_item_size); > + > + if (IS_ERR(table_ptr)) { > + ath10k_err(ar, "smem image version table not found\n"); > + return; > + } > + > + if (smem_img_idx_wlan + SMEM_IMAGE_VERSION_ENTRY_SIZE > > + smem_item_size) { > + ath10k_err(ar, "smem block size too small: %zu\n", > + smem_item_size); > + return; > + } > + > + strscpy(table_ptr + smem_img_idx_wlan, fw_build_id, > + SMEM_IMAGE_VERSION_NAME_SIZE); > +} > + > static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi) > { > struct wlfw_cap_resp_msg_v01 *resp; > @@ -606,6 +638,9 @@ static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi) > qmi->fw_version, qmi->fw_build_timestamp, qmi->fw_build_id); > } > > + if (resp->fw_build_id_valid) > + ath10k_qmi_add_wlan_ver_smem(ar, qmi->fw_build_id); > + > kfree(resp); > return 0; > > -- > 2.38.0 > >