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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AA243EB64DD for ; Fri, 30 Jun 2023 05:02:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IJaoBd/QXt9QcICGNqKq4LK6UwfvUEo5HU6LuyBfNdY=; b=RT2aLLJJc2ic3k CcmjCmlEdBmKOJ/ukWVRfVijgu0SsE9QjY3FSS7T7mrHPTDi2eRXkkk9uThxITFLVFrU1kVCfXYwJ bl1ggZk6+q4N5YSJvuz5hYRcGg9P0aj2lHycnTZjeXK8v13j5ScCXdk9MJ2UeGDZGe3sLRBkjwvMN YRwOqvNpilVeeIrZHGKSJ2Nlakc19Al2vkaCbrGUxSKz2l8ZtcQEg+Mj5vmB5rY6B/si8QP3LyPB4 +1tbQy4R34eaX3r/HH3mOjvNbJcdztKQPRlN2vZpQX4TeCoxmcY/bzB/Eub1OihX/H0fVE+eO0umD DgQICtvF8XSZbgH+upfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qF6GT-002tkM-0w; Fri, 30 Jun 2023 05:01:49 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qF6GQ-002tjr-0g for linux-arm-kernel@lists.infradead.org; Fri, 30 Jun 2023 05:01:47 +0000 Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35U4Hw1l005240; Fri, 30 Jun 2023 05:01:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=qcppdkim1; bh=rjDgfSlp1sDuC1XATQiCqrnHU+98uhuV3g/V1/6UmAM=; b=K9sNpCOws/ba9cxOZEp3wV15N0xBhrWy05lPPNiIpJjRGV3zcuFhfOsQFtSrJzfp3of0 NUzkG+RPf4pFkWhYvKpJTkNKMN8REVk4kCLjyAS2REGk+fRfbUhMQig62gk6+c6IkuSG kpu89cJM6qPSXIAfb7Swir6XshZMQPDpXkupclazC2vbiOJ1zsUCtrfhEUMyfWGjVt0t kJrfk9wwH4WmkWGondoDlfeCWK2M1ciRJ8M1na5dESLaePjscbEdNcP4kn6kjregAngC Ao6PImrgXuzlKY4Qoo32y7I9FJx7Gab+ooT4+PRBJ+Pa1a4I6vRpzDR1+VClA9KFDyoe 6Q== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rh7s2t397-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 05:01:22 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 35U51LEo031228 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 05:01:21 GMT Received: from hu-pkondeti-hyd.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.1118.7; Thu, 29 Jun 2023 22:01:13 -0700 Date: Fri, 30 Jun 2023 10:31:05 +0530 From: Pavan Kondeti To: Mukesh Ojha CC: , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v4 17/21] firmware: qcom_scm: provide a read-modify-write function Message-ID: References: <1687955688-20809-1-git-send-email-quic_mojha@quicinc.com> <1687955688-20809-18-git-send-email-quic_mojha@quicinc.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1687955688-20809-18-git-send-email-quic_mojha@quicinc.com> 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: kylBj2M89ZrlZqWP_miXkCRX180lB2qY X-Proofpoint-ORIG-GUID: kylBj2M89ZrlZqWP_miXkCRX180lB2qY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-30_02,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 spamscore=0 priorityscore=1501 suspectscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=694 impostorscore=0 mlxscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306300043 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230629_220146_255690_6B36A700 X-CRM114-Status: GOOD ( 22.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 28, 2023 at 06:04:44PM +0530, 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 fde33acd46b7..104d86e49b97 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 & mask); > + > + return qcom_scm_io_writel(addr, new); > +} I believe this API leaves the atomicity part to the client. or how does it work? Thanks, Pavan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel