Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp587945lqt; Mon, 18 Mar 2024 18:18:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWkDjcaepIctNVWDKkXNTebDyPS7u4vissw18EGRCWaIgaOCQekU2Hqm5T3cDsiCS+yPSNYrP2ogJBuES7+4bI8FtDODivMmo58M0KEKQ== X-Google-Smtp-Source: AGHT+IHCRnPSpQV4dK1XFL7ZMN/0Pg6zsmgnf3WDjtc1aL3VBZvPHHtqbDkEBsD+6DlhMEYYGsyZ X-Received: by 2002:a0c:8c0c:0:b0:696:36dd:2020 with SMTP id n12-20020a0c8c0c000000b0069636dd2020mr64099qvb.11.1710811080276; Mon, 18 Mar 2024 18:18:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710811080; cv=pass; d=google.com; s=arc-20160816; b=DPxj8FvTIgUl2hcwZ7b95z9NvAJVkl5pF2cBkOk8hseL0I2k9AbrJXmotiBriCTLth TjcxMTEEMXXkKObKKRRhYpTnwI5u42RUkh4diEylUl25c/F+ZtBImKCrn4wdP19D9pmV 2taA8ffdL0YNg3K0NqwgkFIFOGMN+kithlyup364hmGWVKJ72h4WiQjKVkcku3AwfASQ edpZa1srMh1dsMXLzTFsOX9UEtzFhV37Fv/LvtjRxxxLz0qDqQT3V9TckrksTEbZrNIu SyEtWW2irNsvNnkydLJfLzCcspu9qIry58Cl9jaBLkVrxdOg3WJC/cLLmyG08R1vDecf XkSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=H7x/R1+R+BCgNC4W4I1mPHO8Zw8WK5UeRiKPms7Hmh8=; fh=KS65iFw6q5dkOL3kk8/CHhs9jZ5M/xMtevGRvOxxh/o=; b=b/wK1zmQ5sKp9LTMoB2kaiLPBjhp0dv46HtNQeOpGrka+pddEUsp/Qx5JhcgXm/Y2B yQT+hYbN0sIk8GkVraNdBWjJ/WdvkFe4cNR8G/cQ7cDfkHCDZekdXqTxBQYLePigY9cr zm7jOqrhe7cGoxmO+wkvu4aXXauBYQRLRHxh1HiMVDgAUAoOz25Z1pq3jgtWZAvfvyZR TurMTK7fbCFx+S0kixcaYhGMjXAVsYrxjSI/0r8yn/fqqlkGtsHU4jRDJxKgjbodJVFP TSVyl4Rhe92w26Xrgu/OQPzoacZb5oxfO1XzO1Wyo0Oyv7PCCdkgChP0Q0iaD0FSCL1g tcTw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=aOaQxjbW; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-106878-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106878-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a12-20020a056214062c00b0068f572929b0si9723908qvx.78.2024.03.18.18.18.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 18:18:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-106878-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=aOaQxjbW; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-106878-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106878-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E78A81C2159A for ; Tue, 19 Mar 2024 01:17:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9B26A5F; Tue, 19 Mar 2024 01:17:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="aOaQxjbW" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66F10F4FC; Tue, 19 Mar 2024 01:17:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710811071; cv=none; b=oSlgXsS8UnxiNxH+C48PF8gggQuOgsaX5Omh4K2TdjL0Ve3dchHCOd4ASQu4rMeQlyakuztvTw0J+qdjV44koa95GJHAcZJEKXe4TgRTr42Xh14q9aBnadyChAoFUc4VNXyXjm3P9N8wLMvsE4pxo6Z98gpF47HR/ZwVxmZ3P3M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710811071; c=relaxed/simple; bh=296Aa5IYrw+k3OBNGji0A97d7DKH3UDMwHn5T5Ph/hw=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=glwPceXkCE7vRwyBAi+N4FGgytPVEWBlrE4K7M0j4ERZ7LmhzxtL0wLj2MaSpLEYI6aaqM6ICKJktAsF8XXi3v+SaYsUqU9vLf1Zxguwhe/T76qrCBcypqi2dH49+hVpt7QijsBumKjWaVrXxSVzONonsE8yEO1iPcvU3f6JWTo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=aOaQxjbW; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42J0kunb023937; Tue, 19 Mar 2024 01:17:47 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=H7x/R1+R+BCgNC4W4I1mP HO8Zw8WK5UeRiKPms7Hmh8=; b=aOaQxjbWAt+CWON7aJhaxV05LSf5wBy2Z6Ow2 5ItxFn+JRmfiSlIdG6BCaBNOb2xUUizP0T9AvudL1o7IMndgO+ot4Wu7aIVkfyFv tHmZX9NqSwHmSlNnHAvJY48ALQzK/zrkqZHsqFSI2B7Gzzzg+8vWeh6cIYAxj9xt KUVUQag8akV3jq0OabFy2wI6MIfg6TBctsj2DOpCEruoDGxJUA2yDRdVOBkswqoe ynN+DUAsxoz9xVhGU8LVNpii5ttgP+vKFjo+40kuJoykXEbr3+ctZZDurYb3Op8f rcvNgWNsq5wDbaebJLsSVHFKjQ3I95i2AZxFNl+1sLo0tQn6g== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wxmnjsnrx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Mar 2024 01:17:46 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42J1Hkdk025641 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Mar 2024 01:17:46 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.40; Mon, 18 Mar 2024 18:17:43 -0700 Date: Tue, 19 Mar 2024 06:47:40 +0530 From: Pavan Kondeti To: Mukesh Ojha CC: Bjorn Andersson , , , , , Subject: Re: [PATCH v12 7/9] firmware: qcom: scm: Fix __scm->dev assignement Message-ID: <03367100-1ad4-4d83-8200-5879550398be@quicinc.com> References: <20240227155308.18395-1-quic_mojha@quicinc.com> <20240227155308.18395-8-quic_mojha@quicinc.com> <260371ff-da7a-8406-0511-4019f6b860bf@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <260371ff-da7a-8406-0511-4019f6b860bf@quicinc.com> X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: jnpVEGgqOve90oQlCkE5ZPbPm_TRA_JO X-Proofpoint-ORIG-GUID: jnpVEGgqOve90oQlCkE5ZPbPm_TRA_JO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-18_12,2024-03-18_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 clxscore=1011 mlxscore=0 lowpriorityscore=0 mlxlogscore=987 phishscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2403140001 definitions=main-2403190008 On Mon, Mar 18, 2024 at 06:38:20PM +0530, Mukesh Ojha wrote: > > > On 3/3/2024 12:55 AM, Bjorn Andersson wrote: > > On Tue, Feb 27, 2024 at 09:23:06PM +0530, Mukesh Ojha wrote: > > > qcom_scm_is_available() gives wrong indication if __scm > > > is initialized but __scm->dev is not. > > > > > > Fix this appropriately by making sure if __scm is > > > initialized and then it is associated with its > > > device. > > > > > > > This seems like a bug fix, and should as such have a Fixes: tag and > > probably Cc: stable@vger.kernel.org > > > > > Signed-off-by: Mukesh Ojha > > > --- > > > drivers/firmware/qcom/qcom_scm.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c > > > index 6c252cddd44e..6f14254c0c10 100644 > > > --- a/drivers/firmware/qcom/qcom_scm.c > > > +++ b/drivers/firmware/qcom/qcom_scm.c > > > @@ -1859,6 +1859,7 @@ static int qcom_scm_probe(struct platform_device *pdev) > > > if (!scm) > > > return -ENOMEM; > > > + scm->dev = &pdev->dev; > > > ret = qcom_scm_find_dload_address(&pdev->dev, &scm->dload_mode_addr); > > > if (ret < 0) > > > return ret; > > > @@ -1895,7 +1896,6 @@ static int qcom_scm_probe(struct platform_device *pdev) > > > return ret; > > > __scm = scm; > > > - __scm->dev = &pdev->dev; > > > > Is it sufficient to just move the line up, or do we need a barrier of > > some sort here? > > Would be good to use, smp_mb() before the assignment > __scm = scm > along with moving below line > __scm->dev = &pdev->dev > Full memory barrier is not needed here. store variant is sufficient. WRITE_ONCE() + smp_store_release() will fit here no? Thanks, Pavan