Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6172483rwd; Wed, 24 May 2023 11:46:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6N7PZ6buZ3SmqIkFRek2NbMh5/f1Se5V5FMKWsUVmoy1oOUhTjHrvvfGi9vs+rcLb2/Ago X-Received: by 2002:a17:90a:600b:b0:255:ae08:98e5 with SMTP id y11-20020a17090a600b00b00255ae0898e5mr5641917pji.22.1684953996679; Wed, 24 May 2023 11:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684953996; cv=none; d=google.com; s=arc-20160816; b=WMlTP4MJCB6aCJUt0Z83gtiv/g0Csr1lcXB6Un6pffOBJCVCjFmS1gIaQ9K8hrfF6c 2neOEWRWWZgp4nlm+zETk7DYk6tbpagLCi3h1eNJNMTVb//m0M63RMGtS7y2R1BK84Av UV4cwHAquQFqxz4A9zQEccmbUSGMKrkXnpEiwastaO4a4lGFVDevgY+r+IULlD/W4BoP 6j1aPh6quO26HIuJwo10ggBMj47SyZxzwCJaSzxq3UF7W/PB2uuJYIwU72Z6DTRj12RE z4ttri62IF2ozzSJY0QG4QWTIZFaVP89aEN4eD0v5qAVZGglTdpeC9zKDnfxJFjUt5P/ wq3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=tfKnZIxC0JL8VLQrcWzDaxmhfBN8ntq0FbYcgqoCQhc=; b=sHeA78LnOOFzS9kJ4BBYpqq9cH3j2NJqL8QMDHYfuF6V/JACrDFnfdOOVDiNA/qmSY 5T/LDxdSo1YOSMhXt/4QpHEHH7oj7S+CRTVfNqJkbsVAehYenJtf9qBokPpKr4AQlKdR sGjlfXGzkM1N7ZcqZVtHcun7lXyDzk7UqnvolYQsZzqdc5nlQp5DF//Gwgdx15W7cZ5F aBz1dPjQjtA51XG7Zn4EJllHB2M/r+Wn0dmBiJoaEUDL0msRsbvI1LLDUkvAod6eIlq8 BkrID0K2JimufzZ3WvfYrXfropmBFL3SRcvmMPic8dyJ0G7GzpsG0xd62y9hdz1xgTJn Hurg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CF1PzLA2; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pi13-20020a17090b1e4d00b00240263ef11bsi1995212pjb.120.2023.05.24.11.46.22; Wed, 24 May 2023 11:46:36 -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=@linaro.org header.s=google header.b=CF1PzLA2; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236412AbjEXS1L (ORCPT + 99 others); Wed, 24 May 2023 14:27:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236268AbjEXS1J (ORCPT ); Wed, 24 May 2023 14:27:09 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF3A598 for ; Wed, 24 May 2023 11:27:07 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2af2db78b38so16199941fa.3 for ; Wed, 24 May 2023 11:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684952826; x=1687544826; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=tfKnZIxC0JL8VLQrcWzDaxmhfBN8ntq0FbYcgqoCQhc=; b=CF1PzLA2QoGZkxxXO74l+SIe9Dc15AdAkdOyw5EphMID+DJlECU3Pa2TnDHM229WY4 E6O5d+1RSEnM94pf0w1LhcOgnQOR9rM5VEuTzqKtODerUnXpZLBygmfZfVP3Wwb1KnHw 9gakozGT7CqyMm5DtBdp+axBPaaMDMVUNploEzqwK7jO6RGvvi+pVGZVd88JLmjEIFNj q9ws1at8E/Vzaquhg2Eq139aytsNENUmVMzjY8+Bul0so6asKF1aoGfyxPKgARe8yRhN THSSqW9DPpN5wit2iJoIzHg0ElyvEJpcY5wVHbPDzH1QYVlHiTRchcYaYCPw4PhDkgQS mV6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684952826; x=1687544826; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tfKnZIxC0JL8VLQrcWzDaxmhfBN8ntq0FbYcgqoCQhc=; b=kO7WmT622Z5ugKTiJnw2bpTdsNSwBR7YPOmo5vr3t57f4DD14Tt+7MOTrcTD1b4iY1 ccnyCj5Szh07M50fB6EqJzitBq7/d+QSsiT1w30oJPY19BnLregj5ODdmqH0VsUN9hEs qEkBYkdDXzGzLGaRcOwuV+IfyC2T9XVfgKCI+vwSINrqUHrBX4BldzbH28cWB/vbLRXo wTbWxemXgyij7oGYmF06AuSJaNwrFA+OgLZENAEc8UGv8c7gYVrJQxRh0yMDOWGXDiLd LkZcbu0/7+qffW1dHiHibj3hQ1iOIk69sFoB4ydnxaaKdaHoj28zLjrl+4IfeQPD06ga Jfjg== X-Gm-Message-State: AC+VfDyrOofj64dAKbktZlKheiv26ouiLgFVkIP3BAwG6htM/YcrKeZx 06RWYCgqkKHWU12/Nel4FtOozQ== X-Received: by 2002:a2e:87ce:0:b0:2ad:9c36:d4aa with SMTP id v14-20020a2e87ce000000b002ad9c36d4aamr223186ljj.17.1684952826029; Wed, 24 May 2023 11:27:06 -0700 (PDT) Received: from [192.168.1.101] (abyk138.neoplus.adsl.tpnet.pl. [83.9.30.138]) by smtp.gmail.com with ESMTPSA id k23-20020a2e2417000000b002ab1536377fsm2088738ljk.105.2023.05.24.11.27.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 May 2023 11:27:05 -0700 (PDT) Message-ID: Date: Wed, 24 May 2023 20:27:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v2 2/4] soc: qcom: smem: introduce qcom_smem_get_msm_id() To: Trilok Soni , Robert Marko , agross@kernel.org, andersson@kernel.org, ilia.lin@kernel.org, rafael@kernel.org, viresh.kumar@linaro.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org Cc: ansuelsmth@gmail.com References: <20230524162329.819770-1-robimarko@gmail.com> <20230524162329.819770-2-robimarko@gmail.com> <47c0faf0-f855-d3c4-6825-e51a1a1a7c83@quicinc.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: <47c0faf0-f855-d3c4-6825-e51a1a1a7c83@quicinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org On 24.05.2023 20:16, Trilok Soni wrote: > On 5/24/2023 9:23 AM, Robert Marko wrote: >> Introduce a helper to return the SoC SMEM ID, which is used to identify the >> exact SoC model as there may be differences in the same SoC family. >> >> Currently, cpufreq-nvmem does this completely in the driver and there has >> been more interest expresed for other drivers to use this information so >> lets expose a common helper to prevent redoing it in individual drivers >> since this field is present on every SMEM table version. >> >> Signed-off-by: Robert Marko >> --- >>   drivers/soc/qcom/smem.c       | 19 +++++++++++++++++++ >>   include/linux/soc/qcom/smem.h |  2 ++ >>   2 files changed, 21 insertions(+) >> >> diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c >> index 6be7ea93c78c..0d6ba9bce8cb 100644 >> --- a/drivers/soc/qcom/smem.c >> +++ b/drivers/soc/qcom/smem.c >> @@ -14,6 +14,7 @@ >>   #include >>   #include >>   #include >> +#include >>     /* >>    * The Qualcomm shared memory system is a allocate only heap structure that >> @@ -772,6 +773,24 @@ phys_addr_t qcom_smem_virt_to_phys(void *p) >>   } >>   EXPORT_SYMBOL(qcom_smem_virt_to_phys); >>   +/** >> + * qcom_smem_get_msm_id() - return the SoC ID >> + * >> + * Look up SoC ID from HW/SW build ID and return it. >> + */ >> +int qcom_smem_get_msm_id(void) On top of Trilok's point, this should return le32, or at least unsigned int. Konrad >> +{ >> +    size_t len; >> +    struct socinfo *info; >> + >> +    info = qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_HW_SW_BUILD_ID, &len); >> +    if (IS_ERR(info)) >> +        return PTR_ERR(info); >> + >> +    return __le32_to_cpu(info->id); >> +} >> +EXPORT_SYMBOL(qcom_smem_get_msm_id); > > EXPORT_SYMBOL_GPL please? > > Please change it for other symbols in the driver as well w/ separate patch. > > ---Trilok Soni > >