From: Jason Gunthorpe <jgg@nvidia.com>
To: Nicolin Chen <nicolinc@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 08:59:59 -0300 [thread overview]
Message-ID: <ZNy6Pw/Jxn6jsIxl@nvidia.com> (raw)
In-Reply-To: <20230814215701.5455-1-nicolinc@nvidia.com>
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
> +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.
> +
> +static struct attribute_group arm_smmu_group = {
> + .name = "arm-smmu-v3",
> + .attrs = arm_smmu_attrs,
> +};
Do we really need the subdirectory?
Jason
_______________________________________________
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 12:00 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 [this message]
2023-08-16 17:09 ` Nicolin Chen
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=ZNy6Pw/Jxn6jsIxl@nvidia.com \
--to=jgg@nvidia.com \
--cc=apopple@nvidia.com \
--cc=iommu@lists.linux.dev \
--cc=jean-philippe@linaro.org \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolinc@nvidia.com \
--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