Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1646115lqg; Sun, 3 Mar 2024 21:48:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUag3hEqIud+k+AY5rA6BvgRfxALcT05M1XiI6tTK0AhBGCKuozQfzgjLmGsLtarwEUldCCROjz1tD7iIbz4BOCPdCda0ToQzbUJXvZ7Q== X-Google-Smtp-Source: AGHT+IGCDysU5po8J8P90tkhekV+YHMNeIrtkk2nWcDbvj4dAsbLZPLy/2xzK1bSDpK9/IdGS4UL X-Received: by 2002:a05:6a20:a121:b0:1a1:4ea8:1844 with SMTP id q33-20020a056a20a12100b001a14ea81844mr3967831pzk.26.1709531300613; Sun, 03 Mar 2024 21:48:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709531300; cv=pass; d=google.com; s=arc-20160816; b=OE2z2QV3fKrtfCh+wijSRVLQxhL4T8DYMZ4IGBDgW8IG6mfz9ydGAn6hNuUjM4SnhO rkuJA+Dfs0sggAbbl4ASqnteKdYtLOyI34MiNAFyL9PJw01vVQUqfhypocoMeXTww93q CzFXOIIholRA9pBWXafwrBCk0lpHVCfxTOHn7GSFxmhDGPMmfG3+/azp7gY5skWhil1B KgfccrMjRADlWI7Vprq3/tt6ZEWj7h9DrSAfTNWKGnWkT2a2ukskY8K/JdnSVfP2Ijyv wx/bB11IIZ2swPNsEjmBMSxkqYi2WToTE8Zhddh6cmIJvN9ue6VomZy/wV7vHGS5864T TQPA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=0HGg9g3P/i9jEj6DMJ5AkuHF0Bu5U7/pEoE/uLfkva4=; fh=l93zIHXyMEdGgv/YBnM8dl+iIeD4yDszaEdpnp/NB80=; b=P7Rcmc2Qy03REv1nJO3urMgizIeHwebcZVa0GDYRA/W0A8VocB+DmJDDYAxEdCHwrA aAcL7gSt4xg6Hx25sQE5r8Kn8r8kZEOgD+Fx/m5l3xmW8MQm/HEbdC3Y0inuVHyGyS5E 9RwUBhuXpO95zrzxooDu4kmsLXhXthoKsACu322FXabJqm2Zz6dJph/psYCGtz+1gHPX E+wuAsm7cHy0rULnukczRle4YjUO1L0iNlaif2tUkYkHqn4fFp2hcRVHmsnmYhxNBJw+ BNdX6pUWrfAaOoyCgPu5sLbqV6NrN7lBis53IJBwbvJn2Ftr7JlJoi7hTGhUXuPC/pVy Yk8Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=hRtRt05F; 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-90065-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90065-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 90-20020a17090a09e300b0029a6469b14esi9620449pjo.189.2024.03.03.21.48.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 21:48:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90065-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=hRtRt05F; 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-90065-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90065-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 48FA2281289 for ; Mon, 4 Mar 2024 05:48:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 65917C14F; Mon, 4 Mar 2024 05:48:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="hRtRt05F" 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 CAD80BA27; Mon, 4 Mar 2024 05:48:05 +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=1709531287; cv=none; b=C0oAMMJaFLQhaqagT+k6f2X7WwP1fnU9/XiDZPEIZJVdnYPqaK5T+cRmzlU+Ejgqobs/pue1XDHwX9apIBio9kfq5Sb6vWZClHLWTN9XluCU9Lhmrtp9nYjpxbPXB1j3QSKRn0hvkMgt1AmXAhnRSQCBqH1rjqriyWKD/5j499c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709531287; c=relaxed/simple; bh=Kv8Nr3FEIckencu6Ylpi3FmpKkAFdmqr9abFkn55fiI=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=oG0XiIOYhySXLhcbuIbmje1GRhHbKHGH3iOERSfwvYbtk21LCIaAw3GLe1Wlw297wJNXw87HeFrn81iAck/LZ2OvxgpJtyJ41gsGVF+Wwf/RtYCxNFVVZeegO6IwssKbSqborkV0CEE+e5JYQfo5mk8kgnK8jL9txzQyGXWexyU= 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=hRtRt05F; 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 (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4245YJkb026498; Mon, 4 Mar 2024 05:47:54 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=0HGg9g3P/i9jEj6DMJ5AkuHF0Bu5U7/pEoE/uLfkva4=; b=hR tRt05Fn+urAZCp8Y2wVArGbAGyD+fp7HcekU+xCNcOJJmplrcyxt+mvEOWweblqc vtw7bayyexRwOwLoWTFkLiCv5jkljI6G+Zcu/25bhcrYTY3LzlBRxSqMxksauj02 DnyBbG8kYlxrq5psKw0YEz18ryLNYSUK+/CE/f+8h6+KeRzhCmidf0HBJbstN8ry 7moAXPru2WSLrLGEYTDUopQW9HP2lDYQc2pHARXYVfyENyhFVwxwQR9zNL5oAxi1 Qf3sqI0GofXmIQlRA6Amz0DW6UIFP8bUzmJwMOP7ZkiX2fHUNLMy12IRPvHCgb4x J/4fjk0fE20gBAnByJcA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wkstk2vey-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Mar 2024 05:47:54 +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 4245lrvP030149 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 4 Mar 2024 05:47:53 GMT Received: from [10.50.22.179] (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; Sun, 3 Mar 2024 21:47:48 -0800 Message-ID: Date: Mon, 4 Mar 2024 11:17:44 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v2 06/20] media: venus: pm_helpers: Move reset acquisition to common code Content-Language: en-US To: Konrad Dybcio , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Andy Gross , Bjorn Andersson , "Mauro Carvalho Chehab" , Philipp Zabel CC: Marijn Suijten , Stanimir Varbanov , Mauro Carvalho Chehab , , , References: <20230911-topic-mars-v2-0-3dac84b88c4b@linaro.org> <20230911-topic-mars-v2-6-3dac84b88c4b@linaro.org> From: Dikshita Agarwal In-Reply-To: <20230911-topic-mars-v2-6-3dac84b88c4b@linaro.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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: lls06jQDGs_Oyew5LW_S1siVw8vwWBuC X-Proofpoint-ORIG-GUID: lls06jQDGs_Oyew5LW_S1siVw8vwWBuC 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-04_02,2024-03-01_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 impostorscore=0 adultscore=0 malwarescore=0 clxscore=1015 mlxscore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403040041 On 2/10/2024 2:39 AM, Konrad Dybcio wrote: > There is no reason to keep reset_get code local to HFIv4/v6. > > Move it to the common part. > > Signed-off-by: Konrad Dybcio > --- > drivers/media/platform/qcom/venus/core.c | 9 ++++++++- > drivers/media/platform/qcom/venus/pm_helpers.c | 23 ----------------------- > 2 files changed, 8 insertions(+), 24 deletions(-) > > diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c > index 5ab3c414ec0f..0652065cb113 100644 > --- a/drivers/media/platform/qcom/venus/core.c > +++ b/drivers/media/platform/qcom/venus/core.c > @@ -15,6 +15,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -286,7 +287,7 @@ static int venus_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > struct venus_core *core; > - int ret; > + int i, ret; > > core = devm_kzalloc(dev, sizeof(*core), GFP_KERNEL); > if (!core) > @@ -324,6 +325,12 @@ static int venus_probe(struct platform_device *pdev) > if (ret) > return ret; > > + for (i = 0; i < core->res->resets_num; i++) { > + core->resets[i] = devm_reset_control_get_exclusive(dev, core->res->resets[i]); > + if (IS_ERR(core->resets[i])) > + return PTR_ERR(core->resets[i]); > + } > + > if (core->pm_ops->core_get) { > ret = core->pm_ops->core_get(core); > if (ret) > diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c > index 7193075e8c04..6017a9236bff 100644 > --- a/drivers/media/platform/qcom/venus/pm_helpers.c > +++ b/drivers/media/platform/qcom/venus/pm_helpers.c > @@ -939,25 +939,6 @@ static int core_resets_reset(struct venus_core *core) > return ret; > } > > -static int core_resets_get(struct venus_core *core) > -{ > - struct device *dev = core->dev; > - const struct venus_resources *res = core->res; > - unsigned int i; > - int ret; > - > - for (i = 0; i < res->resets_num; i++) { > - core->resets[i] = > - devm_reset_control_get_exclusive(dev, res->resets[i]); > - if (IS_ERR(core->resets[i])) { > - ret = PTR_ERR(core->resets[i]); > - return ret; > - } > - } > - > - return 0; > -} > - resets are applicable to only v6 so it should be ok to keep this only in core_get_v4 which is invoked for v6 as well. common code should be common for all SOCs. > static int core_get_v4(struct venus_core *core) > { > struct device *dev = core->dev; > @@ -981,10 +962,6 @@ static int core_get_v4(struct venus_core *core) > if (ret) > return ret; > > - ret = core_resets_get(core); > - if (ret) > - return ret; > - > if (legacy_binding) > return 0; > >