Re: [PATCH v4 07/13] iommu: Add iommu_at[de]tach_device_shared() for multi-device groups

2021-12-23 Thread Lu Baolu
Hi Jason, On 2021/12/24 10:50, Jason Gunthorpe wrote: On Fri, Dec 24, 2021 at 09:30:17AM +0800, Lu Baolu wrote: Hi Jason, On 12/23/21 10:03 PM, Jason Gunthorpe wrote: I think it would be clear why iommu_group_set_dma_owner(), which actually does detatch, is not the same thing as iommu_attach_

Re: [PATCH v4 07/13] iommu: Add iommu_at[de]tach_device_shared() for multi-device groups

2021-12-23 Thread Lu Baolu
On 12/23/21 4:26 AM, Robin Murphy wrote: On 21/12/2021 6:46 pm, Jason Gunthorpe wrote: On Tue, Dec 21, 2021 at 04:50:56PM +, Robin Murphy wrote: this proposal is the worst of both worlds, in that drivers still have to be just as aware of groups in order to know whether to call the _shared

Re: [PATCH v4 07/13] iommu: Add iommu_at[de]tach_device_shared() for multi-device groups

2021-12-23 Thread Jason Gunthorpe via iommu
On Fri, Dec 24, 2021 at 09:30:17AM +0800, Lu Baolu wrote: > Hi Jason, > > On 12/23/21 10:03 PM, Jason Gunthorpe wrote: > > > > I think it would be clear why iommu_group_set_dma_owner(), which > > > > actually does detatch, is not the same thing as iommu_attach_device(). > > > iommu_device_set_dma_

Re: [PATCH v4 07/13] iommu: Add iommu_at[de]tach_device_shared() for multi-device groups

2021-12-23 Thread Lu Baolu
Hi Jason, On 12/23/21 10:03 PM, Jason Gunthorpe wrote: I think it would be clear why iommu_group_set_dma_owner(), which actually does detatch, is not the same thing as iommu_attach_device(). iommu_device_set_dma_owner() will eventually call iommu_group_set_dma_owner(). I didn't get why iommu_gr

Re: [PATCH 1/2] iommu/arm-smmu: Use platform_irq_count() to get the interrupt count

2021-12-23 Thread Lad, Prabhakar
Hi Robin, Thank you for the review. On Thu, Dec 23, 2021 at 2:14 PM Robin Murphy wrote: > > On 2021-12-23 13:00, Lad Prabhakar wrote: > > platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static > > allocation of IRQ resources in DT core code, this causes an issue > > when using hierarch

Re: [PATCH 2/2] iommu/arm-smmu: Propagate errors from platform_get_irq()

2021-12-23 Thread Robin Murphy
On 2021-12-23 13:00, Lad Prabhakar wrote: The driver overrides the error code returned by platform_get_irq() to -ENODEV. Switch to propagating the error code upstream so that errors such as -EPROBE_DEFER are handled. I wouldn't usually expect an SMMU to be wired up to a secondary interrupt con

Re: [PATCH 1/2] iommu/arm-smmu: Use platform_irq_count() to get the interrupt count

2021-12-23 Thread Robin Murphy
On 2021-12-23 13:00, Lad Prabhakar wrote: platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup an

Re: [PATCH v4 07/13] iommu: Add iommu_at[de]tach_device_shared() for multi-device groups

2021-12-23 Thread Jason Gunthorpe via iommu
On Thu, Dec 23, 2021 at 01:53:24PM +0800, Lu Baolu wrote: > > This series is going in the direction of eliminating > > iommu_attach_group() as part of the driver > > interface. iommu_attach_group() is repurposed to only be useful for > > VFIO. > > We can also remove iommu_attach_group() in VFIO b

[PATCH 2/2] iommu/arm-smmu: Propagate errors from platform_get_irq()

2021-12-23 Thread Lad Prabhakar
The driver overrides the error code returned by platform_get_irq() to -ENODEV. Switch to propagating the error code upstream so that errors such as -EPROBE_DEFER are handled. Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq") Signed-off-by: Lad Prabhakar --- drivers/iommu/arm/

[PATCH 0/2] iommu/arm-smmu: Use platform_irq_count()

2021-12-23 Thread Lad Prabhakar
Hi All, This patch series aims to drop using platform_get_resource() for IRQ types in preparation for removal of static setup of IRQ resource from DT core code. Dropping usage of platform_get_resource() was agreed based on the discussion [0]. [0] https://patchwork.kernel.org/project/linux-renesa

[PATCH 1/2] iommu/arm-smmu: Use platform_irq_count() to get the interrupt count

2021-12-23 Thread Lad Prabhakar
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparatio

Re: [PATCH v3 5/5] iommu/nvidia-grace-cmdqv: Limit CMDs for guest owned VINTF

2021-12-23 Thread Robin Murphy
On 2021-12-22 22:52, Nicolin Chen wrote: On Wed, Dec 22, 2021 at 12:32:29PM +, Robin Murphy wrote: External email: Use caution opening links or attachments On 2021-11-19 07:19, Nicolin Chen via iommu wrote: When VCMDQs are assigned to a VINTF that is owned by a guest, not hypervisor (HYP_