Message ID | 20221026102257.19919-1-quic_youghand@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp178920wru; Wed, 26 Oct 2022 03:37:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4M1Gq0L99VemqpZaRZTwbeLfzJvdZbZfHFrEnE7IzF1sqXkvIeJ/l70qJJCASzkmoTHnhy X-Received: by 2002:a65:62da:0:b0:46f:63f:37b4 with SMTP id m26-20020a6562da000000b0046f063f37b4mr13529054pgv.376.1666780650005; Wed, 26 Oct 2022 03:37:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666780649; cv=none; d=google.com; s=arc-20160816; b=JIJCk5AsN7gcHeOKKhAohUvwP34gU3sNvkA3Sg6UNUPwxzFiL+/eOGLHTqu2bFLSMr 2NAi/+2Nx9EgG2Dh9oZ2QYXXiq8LAJYwZR++rHTJKriTsG5NZM4q7oTBvzsM26kNWEmn lUH2d8fUWd3C1cPYdJSZhhG1UILFPaZLKrDa2WhCV3ryHdA7zkCa29vgTCmO9Y5w87cF Yag4jVzVAUzEJA2VEF2c8p7nQemIU7MhLzbaSKqBAVI6TciIRO4XoEt+5s4GMCBdoWth obXD2tlauBQDHFJaUbd1YsLoS/5QGZyfGc3vzkX3oLI8M5Ko+WNxNPre9rLMqEBeLddB rNRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Bhn5uKSIGqfgXgcbX5tTZcEKSxbaiKo2K12VdbAd00I=; b=RTPMmylrdicZcUOgGw9w6XRUKqmvfcFQ0Rdr/s8UFE40m0prtNsi3d8io41G8NFEIq dqxL/tai3QZ4qeKe5tVvIYtiRpakmfUg8Lzjbuo6r4xUWQh52tLgDe4oHwa8j61lFz7m A3d7JdoemCQUF7HRNxaVgxI8rMeOo7dY5rPcLghHN+1DkvBkQ4d2V8CcxYXANWYx4vUP 9mDKgg69erTqcXpf5mo3LxrjtAGOzIP13Jvv4zOR4bQT3GQh9FutX93yRiHUzDbk4O3R kVOzlfe/WqYtQZIlkJKjCZPIval1m1AFbOwLY3tBCXli13JLMUn+aXk2f+jXKcmwo6+g dgrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Xe3w3Yk6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ay7-20020a1709028b8700b00180a7ff784csi5750220plb.360.2022.10.26.03.37.15; Wed, 26 Oct 2022 03:37:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@quicinc.com header.s=qcppdkim1 header.b=Xe3w3Yk6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233349AbiJZKXa (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Wed, 26 Oct 2022 06:23:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230025AbiJZKX2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 26 Oct 2022 06:23:28 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F5EA89ADF; Wed, 26 Oct 2022 03:23:27 -0700 (PDT) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29QABTN8020474; Wed, 26 Oct 2022 10:23:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=Bhn5uKSIGqfgXgcbX5tTZcEKSxbaiKo2K12VdbAd00I=; b=Xe3w3Yk6fnk2KSc/pGc0fJEkEuUsL7ayPJQevF6HEn/RQjTHV64IgthBh3g64ZYwUCcy Rxp1kR6JEzf5m+L3VuV5LMXFFxLZ4h18w85+iXxXKW60KByqX66ZM++ZE9kdi/HB/bLh pg1CbxqEC86rF0yWPvCavLtr8WkMz+ksH4+YjIe7w8NvGy9Uz3fGXD/Eh8J0BGJTbkRX F/zT/2Lv7t4ddY4rfCpL07QA64NWz8zVp+9EufX0WdMDluTb9Fpxi2gL1ltdcZLH+1Ek oFmmln81bxYu65cpIYUZTrvIDl3scml3+ZPBvLnbHkTvkNAQMceiEmFWe/EBDiKicepn 4g== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3kebkdjyb4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Oct 2022 10:23:21 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 29QANKQl015663 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Oct 2022 10:23:20 GMT Received: from youghand-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Wed, 26 Oct 2022 03:23:18 -0700 From: Youghandhar Chintala <quic_youghand@quicinc.com> To: <ath10k@lists.infradead.org> CC: <linux-wireless@vger.kernel.org>, <linux-kernel@vger.kernel.org>, Youghandhar Chintala <quic_youghand@quicinc.com> Subject: [PATCH] wifi: ath10k: Add WLAN firmware image version info into smem Date: Wed, 26 Oct 2022 15:52:57 +0530 Message-ID: <20221026102257.19919-1-quic_youghand@quicinc.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: vG8EtwYAp2uOXlm1qTZ-L2AnEdDsC6aE X-Proofpoint-ORIG-GUID: vG8EtwYAp2uOXlm1qTZ-L2AnEdDsC6aE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-26_05,2022-10-25_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 suspectscore=0 phishscore=0 bulkscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 clxscore=1015 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210260058 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747746187087819664?= X-GMAIL-MSGID: =?utf-8?q?1747746187087819664?= |
Series |
wifi: ath10k: Add WLAN firmware image version info into smem
|
|
Commit Message
Youghandhar Chintala
Oct. 26, 2022, 10:22 a.m. UTC
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 WCN399X targets.
Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2.c10-00754-QCAHLSWMTPL-1
Signed-off-by: Youghandhar Chintala <quic_youghand@quicinc.com>
---
drivers/net/wireless/ath/ath10k/qmi.c | 28 +++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
Comments
Hi Youghandhar, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on kvalo-ath/ath-next] [also build test WARNING on wireless/main wireless-next/main linus/master v6.1-rc2 next-20221026] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Youghandhar-Chintala/wifi-ath10k-Add-WLAN-firmware-image-version-info-into-smem/20221026-182411 base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next patch link: https://lore.kernel.org/r/20221026102257.19919-1-quic_youghand%40quicinc.com patch subject: [PATCH] wifi: ath10k: Add WLAN firmware image version info into smem config: ia64-allyesconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/8faae971fb76b9c21178b19d7e9c37519cda06e1 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Youghandhar-Chintala/wifi-ath10k-Add-WLAN-firmware-image-version-info-into-smem/20221026-182411 git checkout 8faae971fb76b9c21178b19d7e9c37519cda06e1 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/net/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All warnings (new ones prefixed by >>): In file included from drivers/net/wireless/ath/ath10k/qmi.c:21: drivers/net/wireless/ath/ath10k/qmi.c: In function 'ath10k_qmi_add_wlan_ver_smem': >> drivers/net/wireless/ath/ath10k/qmi.c:557:48: warning: format '%i' expects argument of type 'int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] 557 | ath10k_dbg(ar, ATH10K_DBG_QMI, "smem block size too small: %i", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 558 | smem_block_size); | ~~~~~~~~~~~~~~~ | | | size_t {aka long unsigned int} drivers/net/wireless/ath/ath10k/debug.h:286:44: note: in definition of macro 'ath10k_dbg' 286 | __ath10k_dbg(ar, dbg_mask, fmt, ##__VA_ARGS__); \ | ^~~ drivers/net/wireless/ath/ath10k/qmi.c:557:77: note: format string is defined here 557 | ath10k_dbg(ar, ATH10K_DBG_QMI, "smem block size too small: %i", | ~^ | | | int | %li vim +557 drivers/net/wireless/ath/ath10k/qmi.c 541 542 static void ath10k_qmi_add_wlan_ver_smem(struct ath10k *ar, char *fw_build_id) 543 { 544 u8 *smem_table_ptr; 545 size_t smem_block_size; 546 const u32 version_string_size = 128; 547 const u32 smem_img_idx_wlan = ATH10K_SMEM_IMAGE_TABLE_CNSS_INDEX * 128; 548 549 smem_table_ptr = qcom_smem_get(QCOM_SMEM_HOST_ANY, 550 ATH10K_SMEM_IMAGE_VERSION_TABLE, 551 &smem_block_size); 552 if (IS_ERR(smem_table_ptr)) { 553 ath10k_dbg(ar, ATH10K_DBG_QMI, "smem image version table not found"); 554 return; 555 } 556 if (smem_img_idx_wlan + version_string_size > smem_block_size) { > 557 ath10k_dbg(ar, ATH10K_DBG_QMI, "smem block size too small: %i", 558 smem_block_size); 559 return; 560 } 561 memcpy(smem_table_ptr + smem_img_idx_wlan, fw_build_id, 562 version_string_size); 563 } 564
On 10/26/2022 3:22 AM, 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 WCN399X targets. > > Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2.c10-00754-QCAHLSWMTPL-1 > > Signed-off-by: Youghandhar Chintala <quic_youghand@quicinc.com> > --- > drivers/net/wireless/ath/ath10k/qmi.c | 28 +++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > diff --git a/drivers/net/wireless/ath/ath10k/qmi.c b/drivers/net/wireless/ath/ath10k/qmi.c > index 66cb7a1e628a..e88bcfd96859 100644 > --- a/drivers/net/wireless/ath/ath10k/qmi.c > +++ b/drivers/net/wireless/ath/ath10k/qmi.c > @@ -14,6 +14,7 @@ > #include <linux/net.h> > #include <linux/platform_device.h> > #include <linux/qcom_scm.h> > +#include <linux/soc/qcom/smem.h> > #include <linux/string.h> > #include <net/sock.h> > > @@ -22,6 +23,8 @@ > > #define ATH10K_QMI_CLIENT_ID 0x4b4e454c > #define ATH10K_QMI_TIMEOUT 30 > +#define ATH10K_SMEM_IMAGE_VERSION_TABLE 469 > +#define ATH10K_SMEM_IMAGE_TABLE_CNSS_INDEX 13 > > static int ath10k_qmi_map_msa_permission(struct ath10k_qmi *qmi, > struct ath10k_msa_mem_info *mem_info) > @@ -536,6 +539,29 @@ 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, char *fw_build_id) const char *fw_build_id? > +{ > + u8 *smem_table_ptr; > + size_t smem_block_size; > + const u32 version_string_size = 128; should you s/128/MAX_BUILD_ID_LEN/ since that is what is used to size qmi->fw_build_id? or alternately have the caller pass fw_build_id length as a separate param? > + const u32 smem_img_idx_wlan = ATH10K_SMEM_IMAGE_TABLE_CNSS_INDEX * 128; > + > + smem_table_ptr = qcom_smem_get(QCOM_SMEM_HOST_ANY, > + ATH10K_SMEM_IMAGE_VERSION_TABLE, > + &smem_block_size); > + if (IS_ERR(smem_table_ptr)) { > + ath10k_dbg(ar, ATH10K_DBG_QMI, "smem image version table not found"); > + return; > + } > + if (smem_img_idx_wlan + version_string_size > smem_block_size) { > + ath10k_dbg(ar, ATH10K_DBG_QMI, "smem block size too small: %i", > + smem_block_size); > + return; > + } > + memcpy(smem_table_ptr + smem_img_idx_wlan, fw_build_id, > + version_string_size); > +} > + > static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi) > { > struct wlfw_cap_resp_msg_v01 *resp; > @@ -606,6 +632,8 @@ static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi) > qmi->fw_version, qmi->fw_build_timestamp, qmi->fw_build_id); > } > > + ath10k_qmi_add_wlan_ver_smem(ar, qmi->fw_build_id); > + > kfree(resp); > return 0; >
On 10/28/2022 12:19 AM, Jeff Johnson wrote: > On 10/26/2022 3:22 AM, 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 WCN399X targets. >> >> Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2.c10-00754-QCAHLSWMTPL-1 >> >> Signed-off-by: Youghandhar Chintala <quic_youghand@quicinc.com> >> --- >> drivers/net/wireless/ath/ath10k/qmi.c | 28 +++++++++++++++++++++++++++ >> 1 file changed, 28 insertions(+) >> >> diff --git a/drivers/net/wireless/ath/ath10k/qmi.c >> b/drivers/net/wireless/ath/ath10k/qmi.c >> index 66cb7a1e628a..e88bcfd96859 100644 >> --- a/drivers/net/wireless/ath/ath10k/qmi.c >> +++ b/drivers/net/wireless/ath/ath10k/qmi.c >> @@ -14,6 +14,7 @@ >> #include <linux/net.h> >> #include <linux/platform_device.h> >> #include <linux/qcom_scm.h> >> +#include <linux/soc/qcom/smem.h> >> #include <linux/string.h> >> #include <net/sock.h> >> @@ -22,6 +23,8 @@ >> #define ATH10K_QMI_CLIENT_ID 0x4b4e454c >> #define ATH10K_QMI_TIMEOUT 30 >> +#define ATH10K_SMEM_IMAGE_VERSION_TABLE 469 >> +#define ATH10K_SMEM_IMAGE_TABLE_CNSS_INDEX 13 >> static int ath10k_qmi_map_msa_permission(struct ath10k_qmi *qmi, >> struct ath10k_msa_mem_info *mem_info) >> @@ -536,6 +539,29 @@ 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, char >> *fw_build_id) > > const char *fw_build_id? > >> +{ >> + u8 *smem_table_ptr; >> + size_t smem_block_size; >> + const u32 version_string_size = 128; > > should you s/128/MAX_BUILD_ID_LEN/ since that is what is used to size > qmi->fw_build_id? > > or alternately have the caller pass fw_build_id length as a separate > param? > Sure Jeff. Will address it in next version of patch. > >> + const u32 smem_img_idx_wlan = ATH10K_SMEM_IMAGE_TABLE_CNSS_INDEX >> * 128; >> + >> + smem_table_ptr = qcom_smem_get(QCOM_SMEM_HOST_ANY, >> + ATH10K_SMEM_IMAGE_VERSION_TABLE, >> + &smem_block_size); >> + if (IS_ERR(smem_table_ptr)) { >> + ath10k_dbg(ar, ATH10K_DBG_QMI, "smem image version table not >> found"); >> + return; >> + } >> + if (smem_img_idx_wlan + version_string_size > smem_block_size) { >> + ath10k_dbg(ar, ATH10K_DBG_QMI, "smem block size too small: %i", >> + smem_block_size); >> + return; >> + } >> + memcpy(smem_table_ptr + smem_img_idx_wlan, fw_build_id, >> + version_string_size); >> +} >> + >> static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi) >> { >> struct wlfw_cap_resp_msg_v01 *resp; >> @@ -606,6 +632,8 @@ static int ath10k_qmi_cap_send_sync_msg(struct >> ath10k_qmi *qmi) >> qmi->fw_version, qmi->fw_build_timestamp, >> qmi->fw_build_id); >> } >> + ath10k_qmi_add_wlan_ver_smem(ar, qmi->fw_build_id); >> + >> kfree(resp); >> return 0; >
(fixing quotation) "Youghandhar Chintala (Temp)" <quic_youghand@quicinc.com> writes: > On 10/28/2022 12:19 AM, Jeff Johnson wrote: > >> On 10/26/2022 3:22 AM, Youghandhar Chintala wrote: >>> +static void ath10k_qmi_add_wlan_ver_smem(struct ath10k *ar, char >>> *fw_build_id) >> >> const char *fw_build_id? >> >>> +{ >>> + u8 *smem_table_ptr; >>> + size_t smem_block_size; >>> + const u32 version_string_size = 128; >> >> should you s/128/MAX_BUILD_ID_LEN/ since that is what is used to >> size qmi->fw_build_id? >> >> or alternately have the caller pass fw_build_id length as a separate >> param? > > Sure Jeff. Will address it in next version of patch. BTW Youghandhar, your quotes were broken in this mail so your reply was difficult to find. See here: https://patchwork.kernel.org/project/linux-wireless/patch/20221026102257.19919-1-quic_youghand@quicinc.com/ If you are using Outlook, I recommend switching to an application which respects standards more :) For example, some people seem to be happy with Thunderbird.
On 11/1/2022 2:31 PM, Kalle Valo wrote: > (fixing quotation) > > "Youghandhar Chintala (Temp)" <quic_youghand@quicinc.com> writes: > >> On 10/28/2022 12:19 AM, Jeff Johnson wrote: >> >>> On 10/26/2022 3:22 AM, Youghandhar Chintala wrote: >>>> +static void ath10k_qmi_add_wlan_ver_smem(struct ath10k *ar, char >>>> *fw_build_id) >>> const char *fw_build_id? >>> >>>> +{ >>>> + u8 *smem_table_ptr; >>>> + size_t smem_block_size; >>>> + const u32 version_string_size = 128; >>> should you s/128/MAX_BUILD_ID_LEN/ since that is what is used to >>> size qmi->fw_build_id? >>> >>> or alternately have the caller pass fw_build_id length as a separate >>> param? >> Sure Jeff. Will address it in next version of patch. > BTW Youghandhar, your quotes were broken in this mail so your reply was > difficult to find. See here: > > https://patchwork.kernel.org/project/linux-wireless/patch/20221026102257.19919-1-quic_youghand@quicinc.com/ > > If you are using Outlook, I recommend switching to an application which > respects standards more :) For example, some people seem to be happy > with Thunderbird. Thank you so much for your suggestion. I will address it. Currently I am using Thunderbird.
"Youghandhar Chintala (Temp)" <quic_youghand@quicinc.com> writes: > On 11/1/2022 2:31 PM, Kalle Valo wrote: > >> BTW Youghandhar, your quotes were broken in this mail so your reply was >> difficult to find. See here: >> >> https://patchwork.kernel.org/project/linux-wireless/patch/20221026102257.19919-1-quic_youghand@quicinc.com/ >> >> If you are using Outlook, I recommend switching to an application which >> respects standards more :) For example, some people seem to be happy >> with Thunderbird. > > > Thank you so much for your suggestion. I will address it. > > Currently I am using Thunderbird. Good, and now your quotes were correct.
diff --git a/drivers/net/wireless/ath/ath10k/qmi.c b/drivers/net/wireless/ath/ath10k/qmi.c index 66cb7a1e628a..e88bcfd96859 100644 --- a/drivers/net/wireless/ath/ath10k/qmi.c +++ b/drivers/net/wireless/ath/ath10k/qmi.c @@ -14,6 +14,7 @@ #include <linux/net.h> #include <linux/platform_device.h> #include <linux/qcom_scm.h> +#include <linux/soc/qcom/smem.h> #include <linux/string.h> #include <net/sock.h> @@ -22,6 +23,8 @@ #define ATH10K_QMI_CLIENT_ID 0x4b4e454c #define ATH10K_QMI_TIMEOUT 30 +#define ATH10K_SMEM_IMAGE_VERSION_TABLE 469 +#define ATH10K_SMEM_IMAGE_TABLE_CNSS_INDEX 13 static int ath10k_qmi_map_msa_permission(struct ath10k_qmi *qmi, struct ath10k_msa_mem_info *mem_info) @@ -536,6 +539,29 @@ 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, char *fw_build_id) +{ + u8 *smem_table_ptr; + size_t smem_block_size; + const u32 version_string_size = 128; + const u32 smem_img_idx_wlan = ATH10K_SMEM_IMAGE_TABLE_CNSS_INDEX * 128; + + smem_table_ptr = qcom_smem_get(QCOM_SMEM_HOST_ANY, + ATH10K_SMEM_IMAGE_VERSION_TABLE, + &smem_block_size); + if (IS_ERR(smem_table_ptr)) { + ath10k_dbg(ar, ATH10K_DBG_QMI, "smem image version table not found"); + return; + } + if (smem_img_idx_wlan + version_string_size > smem_block_size) { + ath10k_dbg(ar, ATH10K_DBG_QMI, "smem block size too small: %i", + smem_block_size); + return; + } + memcpy(smem_table_ptr + smem_img_idx_wlan, fw_build_id, + version_string_size); +} + static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi) { struct wlfw_cap_resp_msg_v01 *resp; @@ -606,6 +632,8 @@ static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi) qmi->fw_version, qmi->fw_build_timestamp, qmi->fw_build_id); } + ath10k_qmi_add_wlan_ver_smem(ar, qmi->fw_build_id); + kfree(resp); return 0;