From: Nicolin Chen <nicolinc@nvidia.com>
To: "Kiryl Shutsemau (Meta)" <kas@kernel.org>
Cc: Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
"Joerg Roedel" <joro@8bytes.org>,
Jason Gunthorpe <jgg@nvidia.com>,
"Pranjal Shrivastava" <praan@google.com>,
Mostafa Saleh <smostafa@google.com>,
"Thierry Reding" <thierry.reding@kernel.org>,
Krishna Reddy <vdumpa@nvidia.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
Breno Leitao <leitao@debian.org>, Kyle McMartin <jkkm@meta.com>,
Usama Arif <usama.arif@linux.dev>, <kernel-team@meta.com>,
<linux-arm-kernel@lists.infradead.org>, <iommu@lists.linux.dev>,
<linux-tegra@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 2/2] iommu/arm-smmu-v3: Default queue depths to one page in a kdump kernel
Date: Sun, 6 Sep 2026 21:10:32 -0700 [thread overview]
Message-ID: <ap45OJ4RFTLWCo4n@nvidia.com> (raw)
In-Reply-To: <20260902121724.3494954-3-kas@kernel.org>
On Wed, Sep 02, 2026 at 01:17:24PM +0100, Kiryl Shutsemau (Meta) wrote:
> @@ -5208,10 +5216,13 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu)
> return -ENXIO;
> }
>
> - smmu->evtq.q.llq.max_n_shift = min_t(u32, EVTQ_MAX_SZ_SHIFT,
> - FIELD_GET(IDR1_EVTQS, reg));
> - smmu->priq.q.llq.max_n_shift = min_t(u32, PRIQ_MAX_SZ_SHIFT,
> - FIELD_GET(IDR1_PRIQS, reg));
> + hw_shift = min_t(u32, EVTQ_MAX_SZ_SHIFT, FIELD_GET(IDR1_EVTQS, reg));
> + smmu->evtq.q.llq.max_n_shift =
> + arm_smmu_queue_max_n_shift(hw_shift, EVTQ_ENT_SZ_SHIFT, 0);
> +
> + hw_shift = min_t(u32, PRIQ_MAX_SZ_SHIFT, FIELD_GET(IDR1_PRIQS, reg));
> + smmu->priq.q.llq.max_n_shift =
> + arm_smmu_queue_max_n_shift(hw_shift, PRIQ_ENT_SZ_SHIFT, 0);
And I think they read better with two small helpers like cmdq:
static inline u32 arm_smmu_evtq_max_n_shift(u32 ceiling)
{
ceiling = min_t(u32, EVTQ_MAX_SZ_SHIFT, ceiling);
return arm_smmu_queue_max_n_shift(ceiling, EVTQ_ENT_SZ_SHIFT, 0);
}
static inline u32 arm_smmu_priq_max_n_shift(u32 ceiling)
{
ceiling = min_t(u32, PRIQ_MAX_SZ_SHIFT, ceiling);
return arm_smmu_queue_max_n_shift(ceiling, PRIQ_ENT_SZ_SHIFT, 0);
}
Thanks
Nicolin
prev parent reply other threads:[~2026-09-07 4:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 12:17 [PATCH v4 0/2] iommu/arm-smmu-v3: Make the queue depths tunable, and shrink them in a kdump kernel Kiryl Shutsemau (Meta)
2026-09-02 12:17 ` [PATCH v4 1/2] iommu/arm-smmu-v3: Add a cmdq_entries module parameter Kiryl Shutsemau (Meta)
2026-09-02 17:22 ` Nicolin Chen
2026-09-03 14:15 ` Kiryl Shutsemau
2026-09-03 15:09 ` Nicolin Chen
2026-09-04 14:28 ` Kiryl Shutsemau
2026-09-07 4:07 ` Nicolin Chen
2026-09-02 12:17 ` [PATCH v4 2/2] iommu/arm-smmu-v3: Default queue depths to one page in a kdump kernel Kiryl Shutsemau (Meta)
2026-09-07 4:10 ` Nicolin Chen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ap45OJ4RFTLWCo4n@nvidia.com \
--to=nicolinc@nvidia.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@nvidia.com \
--cc=jkkm@meta.com \
--cc=jonathanh@nvidia.com \
--cc=joro@8bytes.org \
--cc=kas@kernel.org \
--cc=kernel-team@meta.com \
--cc=leitao@debian.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=praan@google.com \
--cc=robin.murphy@arm.com \
--cc=smostafa@google.com \
--cc=thierry.reding@kernel.org \
--cc=usama.arif@linux.dev \
--cc=vdumpa@nvidia.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.