Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp963123rdd; Wed, 10 Jan 2024 05:00:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IElMZxZteYVIuQZqwNI4Mixe7Hx+Gse06L4aZ/2d+fUK2Sz/vCOqwjtQzYF5mpXrAXfhRbc X-Received: by 2002:a05:6359:4583:b0:172:ee90:8e1f with SMTP id no3-20020a056359458300b00172ee908e1fmr1018046rwb.34.1704891604103; Wed, 10 Jan 2024 05:00:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704891604; cv=none; d=google.com; s=arc-20160816; b=nUYPsVH9upDxx4ipKCH2KgORvzRgerRpxhOFryjk+YUzvydnJgy+lXoOUHsN1En2SQ 8hcdNIST5Agpm0wZb3R/Wc5HigWGVbVUhLUj/bW+rq+NerRivlRQRDkhYj5kk6S5MpiK 4WBOvpTu17Sb5XRLiG/Ew12vd7d/7ajabAvZmiqzOP4PQfUs7ur0KXVgojODQUgHEl5V 2lv6azEHtVuVSa+2EC1EgwLiYX5/7ShT4L64LWD9V9sFUWHjCNJw38IgoRYkXWviCRHV ghzx3pVvQ+v2TwRCwl1rUQBpdvFCn6C+8rx0UjE0VBERMu3NRz0J4u38bCZjN8eWX9Yl w2cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=7vMT1hFktDJAz+gNb9eLyhKcykMUQ9DQvdKP5jgUOYE=; fh=9yKhg3ZCWr5SAz28UTjyB/LjpCc6qm08hKxAnEuNB54=; b=oiYjMdXeqXU+GJjy0ToBbH26WdA2rQ6g3aDJbCY3fcob20M7LDKrw+C0m8TzUf8UZy ZJ6x5dpkLtdRI/v/RAegdk4eWEz9zRN8NtihjRK/ChN0WkwZ+MF7zwhxo6RVnk3rR4cT I5Fd7ZDDtf3HvnvkUUGrMCQdHWdm9z5eRXO/uibJaxYSpnsU57l9ysNHRb+dFkl+GX+P MKjqiK9eFa4AX80cDFjd3+cjuCLhrTAAoOjFxmpd0eQYVEpMQK+dD2j3GDQGa0Pht1kQ ERwg/NFFQuIzk6CYzHRv/VjZEtHIZry2BfanMJgtrRA0XJh32oBibqNk3oyKgOxIP61y YmmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=pTKqrjD+; spf=pass (google.com: domain of linux-kernel+bounces-22200-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22200-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b11-20020aa7810b000000b006da35e9c76asi3551106pfi.339.2024.01.10.05.00.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 05:00:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22200-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=pTKqrjD+; spf=pass (google.com: domain of linux-kernel+bounces-22200-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22200-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E3EB6B27015 for ; Wed, 10 Jan 2024 12:56:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E6BA248CE2; Wed, 10 Jan 2024 12:56:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="pTKqrjD+" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 D148D48CD9; Wed, 10 Jan 2024 12:55:59 +0000 (UTC) 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 (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40ACekq5010668; Wed, 10 Jan 2024 12:55:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:from:to:cc:references :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=7vMT1hFktDJAz+gNb9eLyhKcykMUQ9DQvdKP5jgUOYE=; b=pT KqrjD+iOnFyCEzjMKBY747zU++IgyPUaVXqCHy4E6ey2aWTyA2WYTtaSjkxXGBOw BEXbvxFk6xRzD/aS5+gtvJva4/RKBepI+OJO107W7Nc6HQ2r7z3tBOWkQ1CHJkIj k38b/G6Ghfyozl/ZGM9rrGJ1PlzzVWfJGwHYhxrPshBLil6ooJRop3yuCQRj0Xbk 4hfrz3pObkliri1w/C8z8cPYMYEdq1kUi4GqVfrz2cEiNSOY7FtG9R1Na5a5zu+y 3UEh8w1MHXZejkAgK0HVj2e5nHCoVPwZ84NLxZ7IHpcM4AdnAj8uqg6Ex4MThK9V pze0+lLjwuRSLMjSoj8w== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vhkem15c9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jan 2024 12:55:34 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40ACtXZ6007220 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jan 2024 12:55:33 GMT Received: from [10.214.66.253] (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 10 Jan 2024 04:55:27 -0800 Message-ID: <4a595815-7fcc-47e2-b22c-dac349af6d79@quicinc.com> Date: Wed, 10 Jan 2024 18:25:24 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 3/5] iommu/arm-smmu: introduction of ACTLR for custom prefetcher settings Content-Language: en-US From: Bibek Kumar Patro To: Pavan Kondeti CC: , , , , , , , , , , , , , , , , , , References: <20240109114220.30243-1-quic_bibekkum@quicinc.com> <20240109114220.30243-4-quic_bibekkum@quicinc.com> <2ad70157-27d1-41df-8866-c226af690cf6@quicinc.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: hiHoHz-1KztRZSPuXEpqyxfs5P7xS_HR X-Proofpoint-GUID: hiHoHz-1KztRZSPuXEpqyxfs5P7xS_HR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxscore=0 mlxlogscore=940 impostorscore=0 phishscore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401100106 On 1/10/2024 4:46 PM, Bibek Kumar Patro wrote: > > > On 1/10/2024 9:36 AM, Pavan Kondeti wrote: [...] >>> @@ -274,6 +321,21 @@ static const struct of_device_id >>> qcom_smmu_client_of_match[] __maybe_unused = { >>>   static int qcom_smmu_init_context(struct arm_smmu_domain *smmu_domain, >>>           struct io_pgtable_cfg *pgtbl_cfg, struct device *dev) >>>   { >>> +    struct arm_smmu_device *smmu = smmu_domain->smmu; >>> +    struct qcom_smmu *qsmmu = to_qcom_smmu(smmu); >>> +    const struct actlr_variant *actlrvar; >>> +    int cbndx = smmu_domain->cfg.cbndx; >>> + >>> +    if (qsmmu->data->actlrvar) { >>> +        actlrvar = qsmmu->data->actlrvar; >>> +        for (; actlrvar->io_start; actlrvar++) { >>> +            if (actlrvar->io_start == smmu->ioaddr) { >>> +                qcom_smmu_set_actlr(dev, smmu, cbndx, >>> actlrvar->actlrcfg); >>> +                break; >>> +            } >>> +        } >>> +    } >>> + >> >> This block and the one in qcom_adreno_smmu_init_context() are exactly >> the same. Possible to do some refactoring? >> > > I will check if this repeated blocks can be accomodated this into > qcom_smmu_set_actlr function if that would be fine. > Also adding to this, this might increase the number of indentation inside qcom_smmu_set_actlr as well, to around 5. So wouldn't this be an issue? Thanks, Bibek