Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2355303rdb; Wed, 21 Feb 2024 05:21:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWSsFC8AgVI9X1TyBTQM9DiaZLJAADdYWdlH1st6iFxXF1GAmTvT52W+jvHMcJyYdg/zFOOkDIpHUNo7UySiKuuWiWYH1Dy9ZLZaCHrUw== X-Google-Smtp-Source: AGHT+IHedfyMp4ZL8dZ+Py5y5BS1s0T5EBTisKYm7+KjJc89bybnyAOOC1LOIyXg6CrxnLxYKzDV X-Received: by 2002:ad4:5aa7:0:b0:68f:4a94:8d45 with SMTP id u7-20020ad45aa7000000b0068f4a948d45mr14757657qvg.11.1708521708131; Wed, 21 Feb 2024 05:21:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708521708; cv=pass; d=google.com; s=arc-20160816; b=fKsc72Mk+FVV3uuB4Epy9JcFZ0i3hoQL619rHoIlL64wQG/zq6r466b5CXSJtn1p20 V/FqqvHquSeNIel7pmxAF97Hh/H66iRyvAsKODFzNzFmf/TZsHwXl/wN7iW0AbY3DLki 8j5NroPlIjmo9lzwha6kEzVhTgMdkB5WgCJjhxG0twIkiLDfBIGEURamB9C1XdPeMnUh wn985Q455e0qTs8QJJzMwjz1jzZNgO6xk24bkq/RKepzBPhKr/pSsMyT0JjvsmIPNKNG QUnp21k/OyweaTXSti2LOhdUUonuQDR+MnCDA6y0Q5o14CvSUU1ihvRZaHTi6GhcfFuE KFOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent: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=FbVZNrlJn4dHdK5R921b3kw+ewF8BceDtgjZgZgv1+Y=; fh=oeaqELfZ0fc4wliumByldA4uOtnllq27sp/MkcL1zO4=; b=fmnfY0kJoIx8kwYcU3quX1zt9Ck3DESxN2nlUN7LMAJswlAAD70PefOuGwBwrnu8HA s6nW7z941QGQH2xvF17H61VdZDhS8CNBr2WQi/JFzsUs1NEkm5ceWSvsVnYNAlCtqLtJ jjicALzgkPvc1n1noKhWy3CLYv5e/cs1uqpQH+pFiAmKhECdnDuihoA9kSpDtSPZFsqZ wnQMEzPyzToPdzAJJqb7p9jrmU/qNU1JXipsngvKBIVVdTRxEZNnjeg6RoRDbCm1Lfjv ruJjNDVveVcrZsAG6oTHUe/G/H5NHtVv0IgrJnDnmo9fuSYzKhCUUWC4OS7pB+h/AdwG ffzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lNCLnebn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-74775-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74775-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ke24-20020a056214301800b0068f03325de7si5912552qvb.366.2024.02.21.05.21.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 05:21:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74775-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=@kernel.org header.s=k20201202 header.b=lNCLnebn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-74775-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74775-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 DE3991C212CC for ; Wed, 21 Feb 2024 13:21:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED2977A715; Wed, 21 Feb 2024 13:21:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lNCLnebn" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1083653816; Wed, 21 Feb 2024 13:21:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708521670; cv=none; b=sJg34yxA9+PU0CmGtQsZRouZL00kIhbMKhpLqTBwbbGgzQbUWYJ4r/TqNAtehPKWSLaVlMKg4FKsr5sEsemwN9Hwjfe/MW0jflhhTCJjolQFAc3O7dB4WxBFOjCEoXPd+ojpA2f8G6Np6Aotg5RZ8LfgBp8FAaI6NUC3Euxrsmg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708521670; c=relaxed/simple; bh=vZ/3Z3kWjsvIRSCYP+NqhBkV01COSs3cgT6ojHsts0Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RrZG4hLzEdVvb4cgWlCMh593JvK2yCi6+lKsdssYJcxrBNYQ3xFVhrfEZLQef5FKBsDck1mnQcw5ICzaG2m6IAaTlJHjvxl+/JI0SpS0c8TP7onSGr57sOqqGnzsn4rW/rpE3bmn2ogVadMKERxqgi60dvBD0oquibwePV1LwBA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lNCLnebn; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06DBEC433F1; Wed, 21 Feb 2024 13:21:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708521669; bh=vZ/3Z3kWjsvIRSCYP+NqhBkV01COSs3cgT6ojHsts0Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lNCLnebnbcp9cdVqA+fkBdmc+S9vQFvdUArU7QeU/aR8J7gl8+wshxTVPN7cbgc14 N0aTytKwlkF8rbLP0QGmHj9D2YQzdG5w1Hl/wBjdoRxBZGxwT2f8TittX1DxvXI+vZ VBrckXg9iamrvXsAvN/joX2ifR4tj/HDIeNIZbEtZg0bFK8FcS1v4l5lskjVbIn7td 97Ja5yzOvqE1xHJc4sVL9gHJk4Ol0PiSRc9TrkirxAbVKMJUYwCJdnUyiB/bPKb7Ex UWSMRHQfmAr9kjkF8JyBU2gpNtUlmzGdx36uQ+YC41VnJbZaK2uQX/tEvn6FJ39zRV rfzdU1zIyvwUw== Date: Wed, 21 Feb 2024 13:21:02 +0000 From: Will Deacon To: Bibek Kumar Patro Cc: robin.murphy@arm.com, joro@8bytes.org, dmitry.baryshkov@linaro.org, konrad.dybcio@linaro.org, jsnitsel@redhat.com, quic_bjorande@quicinc.com, mani@kernel.org, quic_eberman@quicinc.com, robdclark@chromium.org, u.kleine-koenig@pengutronix.de, robh@kernel.org, vladimir.oltean@nxp.com, quic_pkondeti@quicinc.com, quic_molvera@quicinc.com, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org, saravanak@google.com Subject: Re: [PATCH v9 4/5] iommu/arm-smmu: add ACTLR data and support for SM8550 Message-ID: <20240221132101.GB7273@willie-the-truck> References: <20240123144543.9405-1-quic_bibekkum@quicinc.com> <20240123144543.9405-5-quic_bibekkum@quicinc.com> <20240213134714.GC28926@willie-the-truck> <201fef09-50ab-436b-af63-4535c7510d15@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: <201fef09-50ab-436b-af63-4535c7510d15@quicinc.com> User-Agent: Mutt/1.10.1 (2018-07-13) On Wed, Feb 21, 2024 at 02:25:26PM +0530, Bibek Kumar Patro wrote: > On 2/13/2024 7:17 PM, Will Deacon wrote: > > On Tue, Jan 23, 2024 at 08:15:42PM +0530, Bibek Kumar Patro wrote: > > > Add ACTLR data table for SM8550 along with support for > > > same including SM8550 specific implementation operations. > > > > > > Signed-off-by: Bibek Kumar Patro > > > --- > > > drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 90 ++++++++++++++++++++++ > > > 1 file changed, 90 insertions(+) > > > > > > diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > > > index 6004c6d9a7b2..db15b1eade97 100644 > > > --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > > > +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c > > > @@ -23,6 +23,86 @@ > > > > > > #define CPRE (1 << 1) > > > #define CMTLB (1 << 0) > > > +#define PREFETCH_SHIFT 8 > > > +#define PREFETCH_DEFAULT 0 > > > +#define PREFETCH_SHALLOW (1 << PREFETCH_SHIFT) > > > +#define PREFETCH_MODERATE (2 << PREFETCH_SHIFT) > > > +#define PREFETCH_DEEP (3 << PREFETCH_SHIFT) > > > +#define PREFETCH_SWITCH_GFX (5 << 3) > > > + > > > +static const struct actlr_config sm8550_apps_actlr_cfg[] = { > > > + { 0x18a0, 0x0000, PREFETCH_SHALLOW | CPRE | CMTLB }, > > > + { 0x18e0, 0x0000, PREFETCH_SHALLOW | CPRE | CMTLB }, > > > + { 0x0800, 0x0020, PREFETCH_DEFAULT | CMTLB }, > > > + { 0x1800, 0x00c0, PREFETCH_DEFAULT | CMTLB }, > > > + { 0x1820, 0x0000, PREFETCH_DEFAULT | CMTLB }, > > > + { 0x1860, 0x0000, PREFETCH_DEFAULT | CMTLB }, > > > + { 0x0c01, 0x0020, PREFETCH_DEEP | CPRE | CMTLB }, > > > + { 0x0c02, 0x0020, PREFETCH_DEEP | CPRE | CMTLB }, > > > + { 0x0c03, 0x0020, PREFETCH_DEEP | CPRE | CMTLB }, > > > + { 0x0c04, 0x0020, PREFETCH_DEEP | CPRE | CMTLB }, > > > + { 0x0c05, 0x0020, PREFETCH_DEEP | CPRE | CMTLB }, > > > + { 0x0c06, 0x0020, PREFETCH_DEEP | CPRE | CMTLB }, > > > > [...] > > > > Isn't this effectively hard-coding the topology of the SoC in the driver? > > Wouldn't it better describing higher-level prefetch properties in the DT > > nodes corresponding to the upstream devices? > > Since prefetch data stored in this table represent settings for the > ACTLR register, and doesn't exactly define the hardware (So in this > manner prefetch data won't exactly be a part of soc topology ?). The first two columns of the table are StreamID/Mask pairs, no? How is that _not_ the SoC topology? I really think it would be better to define some high-level prefetch properties in the DT binding which can be put on the master nodes. > So it seemed apt not to use the device tree for storing the prefetch > property. Hence we reverted from the DT approach (initial proposal in > RFC to piggyback on iommus property to store prefetch settings) back to use > driver for storing this data. > > Some drivers use the same approach for storing their platform specific > data. Examples being > drivers/phy/qualcomm/phy-qcom-qmp-combo.c > drivers/soc/qcom/llcc-qcom.c > These drivers were taken as reference for storing platform specific ACTLR > data. I don't know anything about those drivers, but on the SMMU side we already have ways to describe the topology in the DT and the driver is using them, so I'm struggling to see the need to add these tables as well. But as I said before, if Robin and the DT folks prefer this approach, then I won't get in the way. Will