Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1436050rwd; Thu, 18 May 2023 11:57:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7IHfQusUmo26JNmzZqMwP//c+AB1b4W5Et9VtRV4qwbVt8aF7ceKtKfnWais7Tu91tyM1l X-Received: by 2002:a17:90b:374a:b0:250:7322:3357 with SMTP id ne10-20020a17090b374a00b0025073223357mr3940865pjb.4.1684436255980; Thu, 18 May 2023 11:57:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684436255; cv=none; d=google.com; s=arc-20160816; b=QRISUOgx8KcICqN+kKeb78klCtpZ237CZyhRlJXrN1UTHqYko5garB1DHY49hH1nUb i0TxX7hz851ve0/hM8DJFQogTuedlayjlpkFpBCcVXkamYUVGi66bOgrdSh7j9FhMjFh AmOiGvRpJig8VdQUaeD7rkVQ7rtlPmEZZYfkrc2HYqIVaHlLX1OD9VbwAP1opgM/cWJJ 1dSHucDIybcwgyjLFCYWllY823ZJYF3ZEQg2k3m3gYSceuxiSsrWLtufhf2hFQkdWLvI a3WM9FZ+sYo0Eh8wT4oHDl0tP9BS+2r1eOFo4FR25+CuQGT76BYt/TdarD5u+ZTtqDKX HTmw== 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=Ht8RdntEily+GKgk89bEEqXSuiTabzJwgELIJ8zSbaw=; b=i1GwdFhpQufE6fB/qJXO4wtCsuISx8ogm7YarebNnuPu0e/ZNZQbUYTjZX8dHA4qPN gIOlCpRsaz5l2UjoS+WknGbccjzX6weEDU/VjfCwAAhgF3frHxiH9SCZHXdRvghmwKze TdCTQJ2IoiYrtzSFISiXaXND6wJ3Y2WrApqV6ylLv4W/Ki3rzMkuX8ovJKb1Y4WGRJWZ uk1bSISbIucalMqjbYmeGmTLn6HmaxBxgOqPEOXiV3gU1muPMJ/poxtRmBBJLQIiYfeN +DarXlDg5PNEVvC9tIYr6SgMS0jmIPeBxPlztwYRt2YETfjAqJKRIwiTFTFfMsNtvSuU IAyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZgXnKkBr; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nn9-20020a17090b38c900b002535ca4650bsi108864pjb.61.2023.05.18.11.57.20; Thu, 18 May 2023 11:57:35 -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=ZgXnKkBr; 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 S230060AbjERSt0 (ORCPT + 99 others); Thu, 18 May 2023 14:49:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230010AbjERStY (ORCPT ); Thu, 18 May 2023 14:49:24 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 661E1E4F; Thu, 18 May 2023 11:49:23 -0700 (PDT) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34IHuYvd009111; Thu, 18 May 2023 18:48:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=Ht8RdntEily+GKgk89bEEqXSuiTabzJwgELIJ8zSbaw=; b=ZgXnKkBrd+exeBOkx6Ik0Husd0o2bc+l2xws0yaktEkH31Sltl99c9DYHQLNbse34BfN kOCbydqLnPuRapEVOnpddor4HfGX4pYgdvKEdNLNajwX3c4FevlrphbBnZb8eYto4sGQ FNgf1ywQqPD8+OyviN5e7T0BdMsmpCqGoJpo2px2ydBRA9/G0t0B5xxN/WCxYeZZ/KQl bwu26We8vJvY0IVaJ6DcC6V2spGBzNytFJcZljippKO8JcesALxZRdnSgp4AihW6V5Jx Qc5hBZ3RDW6DHgr06RMN/NZ0VaBS0vmCop6Phlbu/fA4N9KyqZ4Tg8P8aXcifRBCUsLS iw== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qnc30swc8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 May 2023 18:48:55 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 34IImrVv030047 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 May 2023 18:48:53 GMT Received: from [10.110.64.80] (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Thu, 18 May 2023 11:48:52 -0700 Message-ID: Date: Thu, 18 May 2023 11:48:52 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v3 14/18] firmware: qcom_scm: provide a read-modify-write function To: Mukesh Ojha , , , , , , , , , , , , , , CC: , , , , , References: <1683133352-10046-1-git-send-email-quic_mojha@quicinc.com> <1683133352-10046-15-git-send-email-quic_mojha@quicinc.com> Content-Language: en-US From: Trilok Soni In-Reply-To: <1683133352-10046-15-git-send-email-quic_mojha@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: i8RM0WpSoeg1VDYk_FS0NbrlAD0efXR1 X-Proofpoint-ORIG-GUID: i8RM0WpSoeg1VDYk_FS0NbrlAD0efXR1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_13,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 suspectscore=0 mlxlogscore=856 phishscore=0 adultscore=0 bulkscore=0 mlxscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180153 X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, 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 5/3/2023 10:02 AM, Mukesh Ojha wrote: > It was realized by Srinivas K. that there is a need of > read-modify-write scm exported function so that it can > be used by multiple clients. > > Let's introduce qcom_scm_io_update_field() which masks > out the bits and write the passed value to that > bit-offset. Subsequent patch will use this function. > > Suggested-by: Srinivas Kandagatla > Signed-off-by: Mukesh Ojha > --- > drivers/firmware/qcom_scm.c | 15 +++++++++++++++ > include/linux/firmware/qcom/qcom_scm.h | 2 ++ > 2 files changed, 17 insertions(+) > > diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c > index fde33acd..003cbcb 100644 > --- a/drivers/firmware/qcom_scm.c > +++ b/drivers/firmware/qcom_scm.c > @@ -407,6 +407,21 @@ int qcom_scm_set_remote_state(u32 state, u32 id) > } > EXPORT_SYMBOL(qcom_scm_set_remote_state); > > +int qcom_scm_io_update_field(phys_addr_t addr, unsigned int mask, unsigned int val) > +{ > + unsigned int old, new; > + int ret; > + > + ret = qcom_scm_io_readl(addr, &old); > + if (ret) > + return ret; > + > + new = (old & ~mask) | val << (ffs(mask) - 1); > + > + return qcom_scm_io_writel(addr, new); > +} > +EXPORT_SYMBOL(qcom_scm_io_update_field); EXPORT_SYMBOL_GPL? There are other symbols in this driver marked as EXPORT_SYMBOL only. Can you submit a separate patch to convert them into EXPORT_SYMBOL_GPL. OR I want to know why we are marking them without _GPL. checkpatch should catch this as well? By default we should have all the new additions as EXPORT_SYMBOL_GPL and only few existing APIs w/ exceptions? ---Trilok Soni