Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp3058070rdb; Tue, 13 Feb 2024 05:54:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVoo94aMzY1xMqBWjyMjHOM5CpvrNc/PyyN75DqPmx5iFezQY+qW6aPDHba5n2DjSIDCHwKhEW8wgDpm0juqyNART7Q1hiMB8a5U+m2zw== X-Google-Smtp-Source: AGHT+IHcppkjuSvklZhOj/gGdemPKPcvGWCj2J5yKokMKJ7Sp+m1aCsgayvHnnfzKmq4tzdZyrBw X-Received: by 2002:a17:90a:986:b0:298:9dbd:2656 with SMTP id 6-20020a17090a098600b002989dbd2656mr2228720pjo.1.1707832476676; Tue, 13 Feb 2024 05:54:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707832476; cv=pass; d=google.com; s=arc-20160816; b=qavsZNawF20dIPI1uVglCwjjIRaHPCUsNlQ7uLQuR6cG+PLinbaMfQzK3eIsj+IJEg GCWiDPfUTR3ZvzFlVb5jo6PdqUpw2ujQqXJgE5K6zKqcg41ZumG4T7L31LWT/SQ4Cx46 f5cPTA6ETjUrDpwS/F+10K48UiMl44iXi9ZBA8CuzxkogjQpn9HVCxRO7Q6BgrIq2vit K8wG0M7FW8R8syl0pn4uaCSEfg0vYXTOfi71dqhEyJ5m3sPmkRjO9HZCIBlp1SLUY0/c P2sN1Ntblpa4+8XDgsn+4/klN7AV7acCsuX/Nj4RMxJcTKr+sR1fmHGQ33lE4ItxmTAD h+ig== 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=hcm2VpCxL5awa3lmDPdn0dwy0sumdAMf8/9EscLb6gQ=; fh=UnfWv5Tf73ppHXBRToE3Yows51gRIEn8Pa6AV8d3kcU=; b=xllPFYXCHads+nhjjkJx6Wk++QUQT6cHRYU5OPq/Mpf2FGsng/Zm/Jnm+5kZojEWvV CiWcn8Ylmzso0O5K+JGNpjA5ihhV6baxlYNUtVaNa5VOwTReM6641dwatOKSNgHkd1T+ AJRHI79G0ZJJ7vjRvcmO9cq4d6jtBlVZdt7j1DQNUVjSMDgx6JQ+o7Khx0Qh0v307/Yn iZB708fJc4AaKIEaViRNVqXq5H+YRfDH/kG4mlK/+ZiTWw33SCPhhrHwFvZU6+nL52rZ iucXoOTWmhrGXIAYibejG1vg/TcdzoUiuJ/5LiFCHba+okwNK9ixviuR176quGyp5SrQ 9ppw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bSwRpVIz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63610-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63610-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXJCQbFrXKVvmnLsLNkn5wZ3We7UPD3to3I1HdGRGnHwHk7bxzUp9yinby4t6HSYwee6KRsI8Cif96MHa54Wo1beA5ovBPOdutPMfEo2A== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id x11-20020a17090a970b00b00298c3984d41si267997pjo.127.2024.02.13.05.54.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 05:54:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63610-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bSwRpVIz; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63610-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63610-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 381D0B2371A for ; Tue, 13 Feb 2024 13:47:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 41DE05647E; Tue, 13 Feb 2024 13:47:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bSwRpVIz" 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 4F9D256465; Tue, 13 Feb 2024 13:47:22 +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=1707832042; cv=none; b=ScnJMz/ae5uFyBFeOxqyi+ppuwnQ/EbEyHx77iQEzQb2DVHdhv74sahqKiWzXUAy1KBBAyihtR44dnthjScIqf850aDuAUAZlsOWrhExkWeaKGMQx9qFAxEmiU2BR8lPaWYOgZAfRaBPAWgxjJPag5DEJpNNB8Dv3l8pCiWz4hA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707832042; c=relaxed/simple; bh=0haMYFvkv9oRSevwsnTH0KPqSIE/ntXnuv7VSZm9rQQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=f5o+uzYVpzNSp1n/VyDIG3IO1M1fCXcPbwOhCkw6GWYPS2LqWpVoYoDPN/jT33cwLdI3IZFsQufNQQdRxTn+tB9ka1ai2No/qB1SFn4wU5MIw0Pck48+wngujdTpKi+rE9YxZ8eKWJfM1xQfQr37ydafoYifFOsOXyBP2Aipurc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bSwRpVIz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B1ABC433F1; Tue, 13 Feb 2024 13:47:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707832041; bh=0haMYFvkv9oRSevwsnTH0KPqSIE/ntXnuv7VSZm9rQQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bSwRpVIzMPTyS4AI7y6/gI/nE+9YiP71nhDxFYlmn6wigUj+hUhRxC66t6PbYOnk6 /ZRmNpRLXX1Jz1KdOQpr1JvjzCNdO9GugwBL4xFSucXY6tDRfLibLgSWaJHNoGBH+x 3J+4VkwB2aFX0h/jGnArc2jo8HOLt+zhNRErXPDRCe6ksXkSLUSSi4yW5ZTTWsbpzD SwrzomUVDgxFrwjd2QMEWpFWwBJkDk3QcWvChzjuVUymKYW92hSWSJTP05+tKVfOan Lbt0XLemE0x2MNmuPzmUPEjLQv3H8eXiJq3u/wpTEibEttktym56I6q8TCBJ3yqH+D 7aZFzW2XPOmxQ== Date: Tue, 13 Feb 2024 13:47:14 +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: <20240213134714.GC28926@willie-the-truck> References: <20240123144543.9405-1-quic_bibekkum@quicinc.com> <20240123144543.9405-5-quic_bibekkum@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: <20240123144543.9405-5-quic_bibekkum@quicinc.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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? Looking back at the prior revisions of this series, it seems like others were in favour of this approach, so if that's the general consensus, then so be it. But is this _really_ what we want in the SMMU driver? It would be good to have an Ack from Robin and a DT maintainer on this mechanism. It just all feels a bit like a step back into the bad old world of platform data to me, where we end up trying to maintain a bunch of random constants that supposedly make things faster for somebody :/ Will