From: Nicolin Chen <nicolinc@nvidia.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: <will@kernel.org>, <robin.murphy@arm.com>, <joro@8bytes.org>,
<jean-philippe@linaro.org>, <apopple@nvidia.com>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <iommu@lists.linux.dev>
Subject: Re: [PATCH] iommu/arm-smmu-v3: Add a configurable tlbi_range_max_n_shift for TLBI
Date: Wed, 16 Aug 2023 10:09:20 -0700 [thread overview]
Message-ID: <ZN0CciT2hBISXxoJ@Asurada-Nvidia> (raw)
In-Reply-To: <ZNy6Pw/Jxn6jsIxl@nvidia.com>
On Wed, Aug 16, 2023 at 08:59:59AM -0300, Jason Gunthorpe wrote:
> On Mon, Aug 14, 2023 at 02:57:01PM -0700, Nicolin Chen wrote:
> > +static ssize_t tlbi_range_max_n_shift_show(struct device *dev,
> > + struct device_attribute *attr,
> > + char *buf)
> > +{
> > + struct arm_smmu_device *smmu = dev_get_drvdata(dev->parent);
> > +
> > + return sprintf(buf, "%u\n", smmu->tlbi_range_max_n_shift);
> > +}
>
> sysfs_emit and missing newline
Will replace and add a new line.
> > +static ssize_t tlbi_range_max_n_shift_store(struct device *dev,
> > + struct device_attribute *attr,
> > + const char *buf, size_t size)
> > +{
> > + struct arm_smmu_device *smmu = dev_get_drvdata(dev->parent);
> > + unsigned int max_n_shift;
> > + int ret;
> > +
> > + ret = kstrtou32(buf, 0, &max_n_shift);
> > + if (ret)
> > + return ret;
> > + if (max_n_shift > VA_BITS || max_n_shift < PAGE_SHIFT)
> > + return -EINVAL;
> > + smmu->tlbi_range_max_n_shift = max_n_shift;
> > + return size;
>
> This seems convoluted for a uapi, you should just make it
> 'invalidate_threshold' in bytes or something simpler.
Hmm. That'd be a direct 64-bit size configuration, and very likely
to be at upper 32-bit range, so I feel the value would be very big
that might be hard to read.
With that said, I can rename the uAPI, yet still keep the bitshift
configuration.
> > +static struct attribute_group arm_smmu_group = {
> > + .name = "arm-smmu-v3",
> > + .attrs = arm_smmu_attrs,
> > +};
>
> Do we really need the subdirectory?
OK. Let me try unfolding it.
Thanks!
Nicolin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-08-16 17:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-14 21:57 [PATCH] iommu/arm-smmu-v3: Add a configurable tlbi_range_max_n_shift for TLBI Nicolin Chen
2023-08-16 11:59 ` Jason Gunthorpe
2023-08-16 17:09 ` Nicolin Chen [this message]
2023-08-16 17:34 ` Jason Gunthorpe
2023-08-16 17:37 ` Nicolin Chen
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=ZN0CciT2hBISXxoJ@Asurada-Nvidia \
--to=nicolinc@nvidia.com \
--cc=apopple@nvidia.com \
--cc=iommu@lists.linux.dev \
--cc=jean-philippe@linaro.org \
--cc=jgg@nvidia.com \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox