lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2u46b5uue3jbim7u5c5p3oi7pgkq6vv2q7w3bkzvt3iatwredq@35o6g2rbyheb>
Date: Wed, 4 Feb 2026 10:32:30 -0600
From: Andrew Jones <andrew.jones@....qualcomm.com>
To: Yaxing Guo <guoyaxing@...c.ac.cn>
Cc: tjeznach@...osinc.com, joro@...tes.org, will@...nel.org,
        robin.murphy@....com, pjw@...nel.org, palmer@...belt.com,
        aou@...s.berkeley.edu, alex@...ti.fr, iommu@...ts.linux.dev,
        linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] iommu/riscv: Skip IRQ count check when using MSI
 interrupts

On Fri, Jan 30, 2026 at 02:54:20PM +0800, Yaxing Guo wrote:
> In RISC-V IOMMU platform devices that use MSI interrupts (indicated by the
> presence of 'msi-parent' in the device tree), there are no wired interrupt
> lines, so calling platform_get_irq_count() returns 0 or -ENXIO, causing the
> driver to fail during probe.
> 
> However, MSI interrupts are allocated dynamically via the MSI subsystem and
> do not appear in the device tree 'interrupts' property. Therefore, the
> driver should not require a non-zero IRQ count when 'msi-parent' is present.
> 
> This patch fixes the bug where probe fails when using MSI interrupts
>  (which do not have an 'interrupts' property in the device tree)..
> 
> Fixes: <d5f88acdd6ff> ("iommu/riscv: Add support for platform msi")
> 
> Signed-off-by: Yaxing Guo <guoyaxing@...c.ac.cn>
> ---
>  drivers/iommu/riscv/iommu-platform.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iommu/riscv/iommu-platform.c b/drivers/iommu/riscv/iommu-platform.c
> index 83a28c83f991..8f15b06e8499 100644
> --- a/drivers/iommu/riscv/iommu-platform.c
> +++ b/drivers/iommu/riscv/iommu-platform.c
> @@ -68,12 +68,7 @@ static int riscv_iommu_platform_probe(struct platform_device *pdev)
>  	iommu->caps = riscv_iommu_readq(iommu, RISCV_IOMMU_REG_CAPABILITIES);
>  	iommu->fctl = riscv_iommu_readl(iommu, RISCV_IOMMU_REG_FCTL);
>  
> -	iommu->irqs_count = platform_irq_count(pdev);
> -	if (iommu->irqs_count <= 0)
> -		return dev_err_probe(dev, -ENODEV,
> -				     "no IRQ resources provided\n");
> -	if (iommu->irqs_count > RISCV_IOMMU_INTR_COUNT)
> -		iommu->irqs_count = RISCV_IOMMU_INTR_COUNT;
> +	iommu->irqs_count = RISCV_IOMMU_INTR_COUNT;
>  
>  	igs = FIELD_GET(RISCV_IOMMU_CAPABILITIES_IGS, iommu->caps);
>  	switch (igs) {
> @@ -120,6 +115,13 @@ static int riscv_iommu_platform_probe(struct platform_device *pdev)
>  		fallthrough;
>  
>  	case RISCV_IOMMU_CAPABILITIES_IGS_WSI:
> +		iommu->irqs_count = platform_irq_count(pdev);
> +		if (iommu->irqs_count <= 0)
> +			return dev_err_probe(dev, -ENODEV,
> +					     "no IRQ resources provided\n");
> +		if (iommu->irqs_count > RISCV_IOMMU_INTR_COUNT)
> +			iommu->irqs_count = RISCV_IOMMU_INTR_COUNT;
> +
>  		for (vec = 0; vec < iommu->irqs_count; vec++)
>  			iommu->irqs[vec] = platform_get_irq(pdev, vec);
>  
> -- 
> 2.34.1
>

Reviewed-by: Andrew Jones <andrew.jones@....qualcomm.com>

Thanks,
drew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ