Re: [PATCH v8 13/14] iommu/arm-smmu-v3: Report events that belong to devices attached to vIOMMU

Nicolin Chen
2025-03-11T16:27:20Z

On Tue, Mar 11, 2025 at 03:56:38PM +0000, Will Deacon wrote:
> On Tue, Feb 25, 2025 at 09:25:41AM -0800, Nicolin Chen wrote:
> > @@ -1866,7 +1869,14 @@ static int arm_smmu_handle_event(struct arm_smmu_device *smmu,
> > goto out_unlock;
> > }
> >
> > - ret = iommu_report_device_fault(master->dev, &fault_evt);
> > + if (event->stall) {
> > + ret = iommu_report_device_fault(master->dev, &fault_evt);
> > + } else {
> > + if (master->vmaster && !event->s2)
> > + ret = arm_vmaster_report_event(master->vmaster, evt);
> > + else
> > + ret = -EOPNOTSUPP; /* Unhandled events should be pinned */
> > + }
>
> nit: You don't need this extra indentation.

Yea, there was an extra lock in the previous version.

Fixed with:
- if (event->stall) {
+ if (event->stall)
ret = iommu_report_device_fault(master->dev, &fault_evt);
- } else {
- if (master->vmaster && !event->s2)
- ret = arm_vmaster_report_event(master->vmaster, evt);
- else
- ret = -EOPNOTSUPP; /* Unhandled events should be pinned */
- }
+ else if (master->vmaster && !event->s2)
+ ret = arm_vmaster_report_event(master->vmaster, evt);
+ else
+ ret = -EOPNOTSUPP; /* Unhandled events should be pinned */

> Patch looks fine:
>
> Acked-by: Will Deacon <will@kernel.org>

Thanks!

Nicolin