From: Jon Hunter <jonathanh@nvidia.com>
To: Krishna Reddy <vdumpa@nvidia.com>
Cc: Sachin Nikam <Snikam@nvidia.com>,
"nicoleotsuka@gmail.com" <nicoleotsuka@gmail.com>,
Mikko Perttunen <mperttunen@nvidia.com>,
Bryan Huntsman <bhuntsman@nvidia.com>,
"will@kernel.org" <will@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Pritesh Raithatha <praithatha@nvidia.com>,
Timo Alho <talho@nvidia.com>,
"iommu@lists.linux-foundation.org"
<iommu@lists.linux-foundation.org>,
Nicolin Chen <nicolinc@nvidia.com>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
Yu-Huan Hsu <YHsu@nvidia.com>,
Thierry Reding <treding@nvidia.com>,
"robin.murphy@arm.com" <robin.murphy@arm.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Bitan Biswas <bbiswas@nvidia.com>
Subject: Re: [PATCH v8 1/3] iommu/arm-smmu: add NVIDIA implementation for dual ARM MMU-500 usage
Date: Tue, 30 Jun 2020 17:32:41 +0100 [thread overview]
Message-ID: <4037efc7-fbed-e8cf-dac7-212c65014e4e@nvidia.com> (raw)
In-Reply-To: <BYAPR12MB282210677459B8D62623C642B36F0@BYAPR12MB2822.namprd12.prod.outlook.com>
On 30/06/2020 17:23, Krishna Reddy wrote:
>>> +struct arm_smmu_device *nvidia_smmu_impl_init(struct arm_smmu_device
>>> +*smmu) {
>>> + unsigned int i;
> ....
>>> + for (i = 1; i < MAX_SMMU_INSTANCES; i++) {
>>> + struct resource *res;
>>> +
>>> + res = platform_get_resource(pdev, IORESOURCE_MEM, i);
>>> + if (!res)
>>> + break;
>
>> Currently this driver is only supported for Tegra194 which I understand has 3 SMMUs. Therefore, I don't feel that we should fail silently here, I think it is better to return an error if all 3 cannot be initialised.
>
> Initialization of all the three SMMU instances is not necessary here.
That is not what I am saying.
> The driver can work with all the possible number of instances 1, 2 and 3 based on the DT config though it doesn't make much sense to use it with 1 instance.
> There is no silent failure here from driver point of view. If there is misconfig in DT, SMMU faults would catch issues.
I disagree and you should return a proper error here.
>>> + nvidia_smmu->bases[i] = devm_ioremap_resource(smmu->dev, res);
>>> + if (IS_ERR(nvidia_smmu->bases[i]))
>>> + return ERR_CAST(nvidia_smmu->bases[i]);
>
>> You want to use PTR_ERR() here.
>
> PTR_ERR() returns long integer.
> This function returns a pointer. ERR_CAST is the right one to use here.
Ah yes, indeed. OK that's fine.
Jon
--
nvpublic
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
WARNING: multiple messages have this Message-ID (diff)
From: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Krishna Reddy <vdumpa-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: Sachin Nikam <Snikam-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
"nicoleotsuka-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
<nicoleotsuka-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Mikko Perttunen
<mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
Bryan Huntsman
<bhuntsman-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
"will-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
<will-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Pritesh Raithatha
<praithatha-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
Timo Alho <talho-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
"iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
Nicolin Chen <nicolinc-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Yu-Huan Hsu <YHsu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
"robin.murphy-5wv7dgnIgG8@public.gmane.org"
<robin.murphy-5wv7dgnIgG8@public.gmane.org>,
"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
Bitan Biswas <bbiswas-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH v8 1/3] iommu/arm-smmu: add NVIDIA implementation for dual ARM MMU-500 usage
Date: Tue, 30 Jun 2020 17:32:41 +0100 [thread overview]
Message-ID: <4037efc7-fbed-e8cf-dac7-212c65014e4e@nvidia.com> (raw)
In-Reply-To: <BYAPR12MB282210677459B8D62623C642B36F0-ZGDeBxoHBPlXmIuPQoPGkAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
On 30/06/2020 17:23, Krishna Reddy wrote:
>>> +struct arm_smmu_device *nvidia_smmu_impl_init(struct arm_smmu_device
>>> +*smmu) {
>>> + unsigned int i;
> ....
>>> + for (i = 1; i < MAX_SMMU_INSTANCES; i++) {
>>> + struct resource *res;
>>> +
>>> + res = platform_get_resource(pdev, IORESOURCE_MEM, i);
>>> + if (!res)
>>> + break;
>
>> Currently this driver is only supported for Tegra194 which I understand has 3 SMMUs. Therefore, I don't feel that we should fail silently here, I think it is better to return an error if all 3 cannot be initialised.
>
> Initialization of all the three SMMU instances is not necessary here.
That is not what I am saying.
> The driver can work with all the possible number of instances 1, 2 and 3 based on the DT config though it doesn't make much sense to use it with 1 instance.
> There is no silent failure here from driver point of view. If there is misconfig in DT, SMMU faults would catch issues.
I disagree and you should return a proper error here.
>>> + nvidia_smmu->bases[i] = devm_ioremap_resource(smmu->dev, res);
>>> + if (IS_ERR(nvidia_smmu->bases[i]))
>>> + return ERR_CAST(nvidia_smmu->bases[i]);
>
>> You want to use PTR_ERR() here.
>
> PTR_ERR() returns long integer.
> This function returns a pointer. ERR_CAST is the right one to use here.
Ah yes, indeed. OK that's fine.
Jon
--
nvpublic
WARNING: multiple messages have this Message-ID (diff)
From: Jon Hunter <jonathanh@nvidia.com>
To: Krishna Reddy <vdumpa@nvidia.com>
Cc: Sachin Nikam <Snikam@nvidia.com>,
"nicoleotsuka@gmail.com" <nicoleotsuka@gmail.com>,
Mikko Perttunen <mperttunen@nvidia.com>,
Bryan Huntsman <bhuntsman@nvidia.com>,
"will@kernel.org" <will@kernel.org>,
"joro@8bytes.org" <joro@8bytes.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Pritesh Raithatha <praithatha@nvidia.com>,
Timo Alho <talho@nvidia.com>,
"iommu@lists.linux-foundation.org"
<iommu@lists.linux-foundation.org>,
Nicolin Chen <nicolinc@nvidia.com>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
Yu-Huan Hsu <YHsu@nvidia.com>,
Thierry Reding <treding@nvidia.com>,
"robin.murphy@arm.com" <robin.murphy@arm.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Bitan Biswas <bbiswas@nvidia.com>
Subject: Re: [PATCH v8 1/3] iommu/arm-smmu: add NVIDIA implementation for dual ARM MMU-500 usage
Date: Tue, 30 Jun 2020 17:32:41 +0100 [thread overview]
Message-ID: <4037efc7-fbed-e8cf-dac7-212c65014e4e@nvidia.com> (raw)
In-Reply-To: <BYAPR12MB282210677459B8D62623C642B36F0@BYAPR12MB2822.namprd12.prod.outlook.com>
On 30/06/2020 17:23, Krishna Reddy wrote:
>>> +struct arm_smmu_device *nvidia_smmu_impl_init(struct arm_smmu_device
>>> +*smmu) {
>>> + unsigned int i;
> ....
>>> + for (i = 1; i < MAX_SMMU_INSTANCES; i++) {
>>> + struct resource *res;
>>> +
>>> + res = platform_get_resource(pdev, IORESOURCE_MEM, i);
>>> + if (!res)
>>> + break;
>
>> Currently this driver is only supported for Tegra194 which I understand has 3 SMMUs. Therefore, I don't feel that we should fail silently here, I think it is better to return an error if all 3 cannot be initialised.
>
> Initialization of all the three SMMU instances is not necessary here.
That is not what I am saying.
> The driver can work with all the possible number of instances 1, 2 and 3 based on the DT config though it doesn't make much sense to use it with 1 instance.
> There is no silent failure here from driver point of view. If there is misconfig in DT, SMMU faults would catch issues.
I disagree and you should return a proper error here.
>>> + nvidia_smmu->bases[i] = devm_ioremap_resource(smmu->dev, res);
>>> + if (IS_ERR(nvidia_smmu->bases[i]))
>>> + return ERR_CAST(nvidia_smmu->bases[i]);
>
>> You want to use PTR_ERR() here.
>
> PTR_ERR() returns long integer.
> This function returns a pointer. ERR_CAST is the right one to use here.
Ah yes, indeed. OK that's fine.
Jon
--
nvpublic
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Jon Hunter <jonathanh@nvidia.com>
To: Krishna Reddy <vdumpa@nvidia.com>
Cc: "joro@8bytes.org" <joro@8bytes.org>,
"will@kernel.org" <will@kernel.org>,
"robin.murphy@arm.com" <robin.murphy@arm.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"iommu@lists.linux-foundation.org"
<iommu@lists.linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
Thierry Reding <treding@nvidia.com>,
"Yu-Huan Hsu" <YHsu@nvidia.com>, Sachin Nikam <Snikam@nvidia.com>,
Pritesh Raithatha <praithatha@nvidia.com>,
Timo Alho <talho@nvidia.com>, Bitan Biswas <bbiswas@nvidia.com>,
Mikko Perttunen <mperttunen@nvidia.com>,
Nicolin Chen <nicolinc@nvidia.com>,
Bryan Huntsman <bhuntsman@nvidia.com>,
"nicoleotsuka@gmail.com" <nicoleotsuka@gmail.com>
Subject: Re: [PATCH v8 1/3] iommu/arm-smmu: add NVIDIA implementation for dual ARM MMU-500 usage
Date: Tue, 30 Jun 2020 17:32:41 +0100 [thread overview]
Message-ID: <4037efc7-fbed-e8cf-dac7-212c65014e4e@nvidia.com> (raw)
In-Reply-To: <BYAPR12MB282210677459B8D62623C642B36F0@BYAPR12MB2822.namprd12.prod.outlook.com>
On 30/06/2020 17:23, Krishna Reddy wrote:
>>> +struct arm_smmu_device *nvidia_smmu_impl_init(struct arm_smmu_device
>>> +*smmu) {
>>> + unsigned int i;
> ....
>>> + for (i = 1; i < MAX_SMMU_INSTANCES; i++) {
>>> + struct resource *res;
>>> +
>>> + res = platform_get_resource(pdev, IORESOURCE_MEM, i);
>>> + if (!res)
>>> + break;
>
>> Currently this driver is only supported for Tegra194 which I understand has 3 SMMUs. Therefore, I don't feel that we should fail silently here, I think it is better to return an error if all 3 cannot be initialised.
>
> Initialization of all the three SMMU instances is not necessary here.
That is not what I am saying.
> The driver can work with all the possible number of instances 1, 2 and 3 based on the DT config though it doesn't make much sense to use it with 1 instance.
> There is no silent failure here from driver point of view. If there is misconfig in DT, SMMU faults would catch issues.
I disagree and you should return a proper error here.
>>> + nvidia_smmu->bases[i] = devm_ioremap_resource(smmu->dev, res);
>>> + if (IS_ERR(nvidia_smmu->bases[i]))
>>> + return ERR_CAST(nvidia_smmu->bases[i]);
>
>> You want to use PTR_ERR() here.
>
> PTR_ERR() returns long integer.
> This function returns a pointer. ERR_CAST is the right one to use here.
Ah yes, indeed. OK that's fine.
Jon
--
nvpublic
next prev parent reply other threads:[~2020-06-30 16:32 UTC|newest]
Thread overview: 149+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-30 0:10 [PATCH v8 0/3] Nvidia Arm SMMUv2 Implementation Krishna Reddy
2020-06-30 0:10 ` Krishna Reddy
2020-06-30 0:10 ` Krishna Reddy
2020-06-30 0:10 ` Krishna Reddy
2020-06-30 0:10 ` [PATCH v8 1/3] iommu/arm-smmu: add NVIDIA implementation for dual ARM MMU-500 usage Krishna Reddy
2020-06-30 0:10 ` Krishna Reddy
2020-06-30 0:10 ` Krishna Reddy
2020-06-30 0:10 ` Krishna Reddy
2020-06-30 0:16 ` Nicolin Chen
2020-06-30 0:16 ` Nicolin Chen
2020-06-30 0:16 ` Nicolin Chen
2020-06-30 0:16 ` Nicolin Chen
2020-06-30 5:54 ` Pritesh Raithatha
2020-06-30 5:54 ` Pritesh Raithatha
2020-06-30 5:54 ` Pritesh Raithatha
2020-06-30 5:54 ` Pritesh Raithatha
2020-06-30 8:19 ` Jon Hunter
2020-06-30 8:19 ` Jon Hunter
2020-06-30 8:19 ` Jon Hunter
2020-06-30 8:19 ` Jon Hunter
2020-06-30 14:53 ` Robin Murphy
2020-06-30 14:53 ` Robin Murphy
2020-06-30 14:53 ` Robin Murphy
2020-06-30 14:53 ` Robin Murphy
2020-06-30 15:17 ` Jon Hunter
2020-06-30 15:17 ` Jon Hunter
2020-06-30 15:17 ` Jon Hunter
2020-06-30 15:17 ` Jon Hunter
2020-07-01 18:18 ` Krishna Reddy
2020-07-01 18:18 ` Krishna Reddy
2020-07-01 18:18 ` Krishna Reddy
2020-07-01 18:18 ` Krishna Reddy
2020-07-01 18:56 ` Robin Murphy
2020-07-01 18:56 ` Robin Murphy
2020-07-01 18:56 ` Robin Murphy
2020-07-01 18:56 ` Robin Murphy
2020-07-01 19:12 ` Krishna Reddy
2020-07-01 19:12 ` Krishna Reddy
2020-07-01 19:12 ` Krishna Reddy
2020-07-01 19:12 ` Krishna Reddy
2020-06-30 17:04 ` Krishna Reddy
2020-06-30 17:04 ` Krishna Reddy
2020-06-30 17:04 ` Krishna Reddy
2020-06-30 17:04 ` Krishna Reddy
2020-06-30 10:17 ` Jon Hunter
2020-06-30 10:17 ` Jon Hunter
2020-06-30 10:17 ` Jon Hunter
2020-06-30 10:17 ` Jon Hunter
2020-06-30 16:23 ` Krishna Reddy
2020-06-30 16:23 ` Krishna Reddy
2020-06-30 16:23 ` Krishna Reddy
2020-06-30 16:23 ` Krishna Reddy
2020-06-30 16:32 ` Jon Hunter [this message]
2020-06-30 16:32 ` Jon Hunter
2020-06-30 16:32 ` Jon Hunter
2020-06-30 16:32 ` Jon Hunter
2020-06-30 16:44 ` Jon Hunter
2020-06-30 16:44 ` Jon Hunter
2020-06-30 16:44 ` Jon Hunter
2020-06-30 16:44 ` Jon Hunter
2020-06-30 17:16 ` Krishna Reddy
2020-06-30 17:16 ` Krishna Reddy
2020-06-30 17:16 ` Krishna Reddy
2020-06-30 17:16 ` Krishna Reddy
2020-06-30 19:03 ` Jon Hunter
2020-06-30 19:03 ` Jon Hunter
2020-06-30 19:03 ` Jon Hunter
2020-06-30 19:03 ` Jon Hunter
2020-06-30 20:21 ` Krishna Reddy
2020-06-30 20:21 ` Krishna Reddy
2020-06-30 20:21 ` Krishna Reddy
2020-06-30 20:21 ` Krishna Reddy
2020-06-30 0:10 ` [PATCH v8 2/3] dt-bindings: arm-smmu: Add binding for Tegra194 SMMU Krishna Reddy
2020-06-30 0:10 ` Krishna Reddy
2020-06-30 0:10 ` Krishna Reddy
2020-06-30 0:10 ` Krishna Reddy
2020-06-30 6:01 ` Pritesh Raithatha
2020-06-30 6:01 ` Pritesh Raithatha
2020-06-30 6:01 ` Pritesh Raithatha
2020-06-30 8:21 ` Jon Hunter
2020-06-30 8:21 ` Jon Hunter
2020-06-30 8:21 ` Jon Hunter
2020-06-30 8:21 ` Jon Hunter
2020-06-30 12:27 ` Robin Murphy
2020-06-30 12:27 ` Robin Murphy
2020-06-30 12:27 ` Robin Murphy
2020-07-01 18:28 ` Krishna Reddy
2020-07-01 18:28 ` Krishna Reddy
2020-07-01 18:28 ` Krishna Reddy
2020-07-01 18:28 ` Krishna Reddy
2020-07-01 18:47 ` Jon Hunter
2020-07-01 18:47 ` Jon Hunter
2020-07-01 18:47 ` Jon Hunter
2020-07-01 18:47 ` Jon Hunter
2020-07-01 19:00 ` Krishna Reddy
2020-07-01 19:00 ` Krishna Reddy
2020-07-01 19:00 ` Krishna Reddy
2020-07-01 19:00 ` Krishna Reddy
2020-07-01 19:31 ` Jon Hunter
2020-07-01 19:31 ` Jon Hunter
2020-07-01 19:31 ` Jon Hunter
2020-07-01 19:31 ` Jon Hunter
2020-07-01 19:39 ` Krishna Reddy
2020-07-01 19:39 ` Krishna Reddy
2020-07-01 19:39 ` Krishna Reddy
2020-07-01 19:39 ` Krishna Reddy
2020-07-02 16:05 ` Robin Murphy
2020-07-02 16:05 ` Robin Murphy
2020-07-02 16:05 ` Robin Murphy
2020-07-02 16:05 ` Robin Murphy
2020-07-01 19:03 ` Robin Murphy
2020-07-01 19:03 ` Robin Murphy
2020-07-01 19:03 ` Robin Murphy
2020-07-01 19:03 ` Robin Murphy
2020-06-30 0:10 ` [PATCH v8 3/3] iommu/arm-smmu: Add global/context fault implementation hooks Krishna Reddy
2020-06-30 0:10 ` Krishna Reddy
2020-06-30 0:10 ` Krishna Reddy
2020-06-30 0:10 ` Krishna Reddy
2020-06-30 0:19 ` Nicolin Chen
2020-06-30 0:19 ` Nicolin Chen
2020-06-30 0:19 ` Nicolin Chen
2020-06-30 0:19 ` Nicolin Chen
2020-06-30 5:58 ` Pritesh Raithatha
2020-06-30 5:58 ` Pritesh Raithatha
2020-06-30 5:58 ` Pritesh Raithatha
2020-06-30 5:58 ` Pritesh Raithatha
2020-06-30 8:37 ` Jon Hunter
2020-06-30 8:37 ` Jon Hunter
2020-06-30 8:37 ` Jon Hunter
2020-06-30 8:37 ` Jon Hunter
2020-06-30 12:13 ` Robin Murphy
2020-06-30 12:13 ` Robin Murphy
2020-06-30 12:13 ` Robin Murphy
2020-06-30 12:42 ` Jon Hunter
2020-06-30 12:42 ` Jon Hunter
2020-06-30 12:42 ` Jon Hunter
2020-06-30 12:42 ` Jon Hunter
2020-07-01 18:48 ` Krishna Reddy
2020-07-01 18:48 ` Krishna Reddy
2020-07-01 18:48 ` Krishna Reddy
2020-07-01 18:48 ` Krishna Reddy
2020-07-01 19:14 ` Robin Murphy
2020-07-01 19:14 ` Robin Murphy
2020-07-01 19:14 ` Robin Murphy
2020-07-01 19:14 ` Robin Murphy
2020-07-01 19:22 ` Krishna Reddy
2020-07-01 19:22 ` Krishna Reddy
2020-07-01 19:22 ` Krishna Reddy
2020-07-01 19:22 ` Krishna Reddy
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=4037efc7-fbed-e8cf-dac7-212c65014e4e@nvidia.com \
--to=jonathanh@nvidia.com \
--cc=Snikam@nvidia.com \
--cc=YHsu@nvidia.com \
--cc=bbiswas@nvidia.com \
--cc=bhuntsman@nvidia.com \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mperttunen@nvidia.com \
--cc=nicoleotsuka@gmail.com \
--cc=nicolinc@nvidia.com \
--cc=praithatha@nvidia.com \
--cc=robin.murphy@arm.com \
--cc=talho@nvidia.com \
--cc=treding@nvidia.com \
--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.