lkml.org 
[lkml]   [2021]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [patch 33/37] iommu/arm-smmu-v3: Use msi_get_virq()
From
On 2021-11-27 01:22, Thomas Gleixner wrote:
> Let the core code fiddle with the MSI descriptor retrieval.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> ---
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 19 +++----------------
> 1 file changed, 3 insertions(+), 16 deletions(-)
>
> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> @@ -3154,7 +3154,6 @@ static void arm_smmu_write_msi_msg(struc
>
> static void arm_smmu_setup_msis(struct arm_smmu_device *smmu)
> {
> - struct msi_desc *desc;
> int ret, nvec = ARM_SMMU_MAX_MSIS;
> struct device *dev = smmu->dev;
>
> @@ -3182,21 +3181,9 @@ static void arm_smmu_setup_msis(struct a
> return;
> }
>
> - for_each_msi_entry(desc, dev) {
> - switch (desc->msi_index) {
> - case EVTQ_MSI_INDEX:
> - smmu->evtq.q.irq = desc->irq;
> - break;
> - case GERROR_MSI_INDEX:
> - smmu->gerr_irq = desc->irq;
> - break;
> - case PRIQ_MSI_INDEX:
> - smmu->priq.q.irq = desc->irq;
> - break;
> - default: /* Unknown */
> - continue;
> - }
> - }
> + smmu->evtq.q.irq = msi_get_virq(dev, EVTQ_MSI_INDEX);
> + smmu->gerr_irq = msi_get_virq(dev, GERROR_MSI_INDEX);
> + smmu->priq.q.irq = msi_get_virq(dev, PRIQ_MSI_INDEX);

FWIW I've just quickly booted the msi-v1-part-2 branch on a platform
with MSIs but no PRI such that this now sets priq.q.irq to an error
value, and as I predicted it's still happy.

Tested-by: Robin Murphy <robin.murphy@arm.com>

Cheers,
Robin.

> /* Add callback to free MSIs on teardown */
> devm_add_action(dev, arm_smmu_free_msis, dev);
>
> _______________________________________________
> iommu mailing list
> iommu@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/iommu
>

\
 
 \ /
  Last update: 2021-11-29 14:27    [W:0.526 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site