From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24784C7EE23 for ; Thu, 18 May 2023 18:49:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230032AbjERSt0 (ORCPT ); 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 Precedence: bulk List-ID: X-Mailing-List: linux-hardening@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