Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2142575rwb; Mon, 7 Nov 2022 09:36:43 -0800 (PST) X-Google-Smtp-Source: AMsMyM4fMHPCpbTSBwnj/WzlcUwU09ENEkwEobdBEVlS9I3sHhcm9DD1V3ekIlX4cTZq8XXSPxqE X-Received: by 2002:a17:907:1de6:b0:7a5:ea4b:ddbb with SMTP id og38-20020a1709071de600b007a5ea4bddbbmr49282512ejc.757.1667842603435; Mon, 07 Nov 2022 09:36:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667842603; cv=none; d=google.com; s=arc-20160816; b=TMuLa88QTC7/bdfNqrokCu8n6WPSmtQ0MT7/8eemJjFh3EIo90HGlmqBSlOt49+hNK DQhy+i4sb/aoNbVr6HJXHH3ObFl42x2BWXFpY/MA4QtGWJqGhmY3XPS3rzGpUxrjlNcA 6QVH+GFtiK9JndATwXS6P1ydnlC2ea4Y6Cize57AJ/ulCe4URgNPkMLFKNyBIA5VlKjc pRqi6mn/PYoG+ssWL8+qlvDOkBtkNw+rQBBI9FCUFKtZmrxJFqQz6b+oqcjsUjxnymou aXkVXG7BHp8nrfym3HQ9yI/BFYZSU34DvEbSfjfEoUDVX+GinqEpBknKvmLqQjMo8jtT tEvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:user-agent:from :references:in-reply-to:mime-version:dkim-signature; bh=2vBV15/t75rMwmc5x5QmAZ8tvqjlJL8SG6UbJno1k6k=; b=nLyRoyRKhOahDuOgrYgFff3FaPrhpNMpqfJ0xHtoMHqFcUQuMjbz1onm0gTzeoy9J1 H2AlDyl335XfSkwCwemXW1MeS1javIRHtxlZR1GNbBPzphq/9b3HR26Z+cdVFGSUkrQk I5utIcAUEDC1GbJh786whp+QexujiUGBz+lw5Hch4PGc9+H3DC9/LV+zMK5eVTxVh+3R UC5MnQdVUkeMMi5XtJUTTf7rqsRGTGjpszASuqWpRIeUgYy7uRYdBRvXkJQmPve3iPD/ yBXdCTTKBhn9l0rLq4ibXdRZhqSyeivS3JCEJVq5oHt2CCtsAOa4yOPymA2j/MpPhWHu drrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eKf2NTY8; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cn25-20020a0564020cb900b004608b4f28b7si8142647edb.106.2022.11.07.09.36.24; Mon, 07 Nov 2022 09:36:43 -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=@chromium.org header.s=google header.b=eKf2NTY8; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232885AbiKGRfK (ORCPT + 67 others); Mon, 7 Nov 2022 12:35:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231464AbiKGRfJ (ORCPT ); Mon, 7 Nov 2022 12:35:09 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0836F1085 for ; Mon, 7 Nov 2022 09:35:08 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id l12so6621376lfp.6 for ; Mon, 07 Nov 2022 09:35:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:from:to:cc:subject:date:message-id :reply-to; bh=2vBV15/t75rMwmc5x5QmAZ8tvqjlJL8SG6UbJno1k6k=; b=eKf2NTY8glHETLli+gjYNG+IL7W9ro7LFV1OPSmNRquYMgpRtorVcFqvCMK6rfgWAs cF6QvwJC1qhgA6LiF45tB12iNeE+ZX0qgEVYC74n0t9+FbB0YDPFe74JOy4cLjGKERdF GSbeGl7gTWXX8YH8SOEvG4oEVe40EX3D9qUn8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:user-agent:from:references :in-reply-to:mime-version:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2vBV15/t75rMwmc5x5QmAZ8tvqjlJL8SG6UbJno1k6k=; b=He+PvHooIiXplFMSyYSShFdenrTOg+SjWFkkJFtEc+I1Gg7IQ4B3Si99NNlUhH1LNY 253d1/gqrRnH2H+3XXN7Grpc+owVsvxjRu+d7dxikDh+TYzxxZDvkz/LTxDDEDe7L9QE y27KxJnhoJMbxkOHE8sttg2eTMxpBQkuerSy8WmWNZqYI/JX6r28MHHG+AQbAR8tOPvf F18zPMwP0w/w6VF7oFXwbixZpzkomdhvHsIuLQM5WgDgDa+zBaBkRHViiPTkKEU/9zeG bIVw/tDf5RwBYt9AzNO1Jxy5IcMmdhMeRGDqUX4tWn6UpwjdzGrZ1uBeBZRvvIEpGxHi rVaw== X-Gm-Message-State: ACrzQf0rEgw36roBpYiW62w6bT8EcUlHIFrAxwVebr8LRytjVKtG63Hu n86m95p7AbMbrfp0vJ9EO9q3eLTXf7I3RdKr407l1xsm+aU= X-Received: by 2002:ac2:52af:0:b0:4a9:d072:f5c4 with SMTP id r15-20020ac252af000000b004a9d072f5c4mr390873lfm.82.1667842506322; Mon, 07 Nov 2022 09:35:06 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 7 Nov 2022 09:35:05 -0800 MIME-Version: 1.0 In-Reply-To: <20221104082828.14386-1-quic_youghand@quicinc.com> References: <20221104082828.14386-1-quic_youghand@quicinc.com> From: Stephen Boyd User-Agent: alot/0.10 Date: Mon, 7 Nov 2022 09:35:05 -0800 Message-ID: Subject: Re: [PATCH v2] wifi: ath10k: Add WLAN firmware image version info into smem To: Youghandhar Chintala , ath11k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, quic_mpubbise@quicinc.com, linux-arm-msm@vger.kernel.org, kernel test robot Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 Quoting Youghandhar Chintala (2022-11-04 01:28:28) > 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. > > Reported-by: kernel test robot > > Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2.c10-00754-QCAHLSWMTPL-1 > > Signed-off-by: Youghandhar Chintala The trailers go together, no blank lines between them. > > --- > Changes from v1: > - Changed print format specifier to %zu from %i > - Changed ath10k_qmi_add_wlan_ver_smem() API argument > to const char *fw_build_id from char *fw_build_id > - Changed version_string_size with MACRO > --- > 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..928d78f6d494 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,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, const char *fw_build_id) > +{ > + u8 *smem_table_ptr; > + size_t smem_block_size; > + const u32 version_string_size = MAX_BUILD_ID_LEN; Why not make this size_t as well so the type is the same for the comparison with smem_block_size? > + 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"); Is this missing a newline? > + return; > + } > + if (smem_img_idx_wlan + version_string_size > smem_block_size) { > + ath10k_dbg(ar, ATH10K_DBG_QMI, "smem block size too small: %zu", Same newline question. > + smem_block_size); > + return; > + } > + memcpy(smem_table_ptr + smem_img_idx_wlan, fw_build_id, Is it a string? Does it need to be NUL terminated? Should this use some sort of strcpy()? Does the comparison above need to leave a space for the NUL terminator? > + version_string_size); > +} > + > static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi) > { > struct wlfw_cap_resp_msg_v01 *resp;