public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Nicolin Chen <nicolinc@nvidia.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>,
	kevin.tian@intel.com, robin.murphy@arm.com, joro@8bytes.org,
	will@kernel.org, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 3/3] iommu: Drop sw_msi from iommu_domain
Date: Mon, 24 Mar 2025 10:07:43 -0700	[thread overview]
Message-ID: <20250324170743.GA1339275@ax162> (raw)
In-Reply-To: <Z+GOkl21ZLtE3B/e@nvidia.com>

On Mon, Mar 24, 2025 at 09:55:46AM -0700, Nicolin Chen wrote:
> On Mon, Mar 24, 2025 at 01:40:23PM -0300, Jason Gunthorpe wrote:
> > On Mon, Mar 24, 2025 at 09:25:58AM -0700, Nathan Chancellor wrote:
> > 
> > > I bisected a loss of networking on one of my machines to this change as
> > > commit e009e088d88e ("iommu: Drop sw_msi from iommu_domain") in -next.
> > 
> > Okay wow, I will drop this series from the tree if I don't see a
> > resolution in a few days. We can try again next cycle, thank you for
> > testing and bisect!
> > 
> > > At this change, I see:
> > > 
> > >   [  +0.000000] Linux version 6.14.0-rc2-00033-ge009e088d88e (nathan@ax162) (aarch64-linux-gcc (GCC) 14.2.0, GNU ld (GNU Binutils) 2.42) #1 SMP PREEMPT_DYNAMIC Mon Mar 24 08:57:49 MST 2025
> > >   ...
> > >   [  +0.002355] fsl_mc_bus NXP0008:00: Adding to iommu group 0
> > >   [  +0.000533] fsl_mc_bus NXP0008:00: MC firmware version: 10.28.1
> > >   [  +0.002565] fsl_mc_dprc dprc.1: DMA mask not set
> > >   [  +0.019255] fsl_mc_dprc dprc.1: Adding to iommu group 1
> > >   [  +0.046820] fsl_mc_dprc dprc.1: Failed to allocate IRQs
> > 
> > I guess it is tripping up going through iommu_dma_prepare_msi()
> > somehow?
> > 
> > Maybe fsl bus is special and doesn't manage to set
> > IOMMU_COOKIE_DMA_IOVA for some reason?
> > 
> > I wonder if this is not right:
> > 
> > +               default:
> > +                       ret = -EOPNOTSUPP;
> > +                       break;
> > 
> > And it should be just break instead (return 0) which is what was
> > happening before?
> 
> Yea, I found the diff here too.
> 
> Nathan, would you please give it a try by removing this
> 	ret = -EOPNOTSUPP;
> ?

Can confirm, I tested the following diff and it resolved my issue. If it
goes as a standalone patch:

Tested-by: Nathan Chancellor <nathan@kernel.org>

Thanks for the quick triage!

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 0f4cc15ded1c..2b81166350ae 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -3661,7 +3661,6 @@ int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr)
 			ret = iommufd_sw_msi(group->domain, desc, msi_addr);
 			break;
 		default:
-			ret = -EOPNOTSUPP;
 			break;
 		}
 	}

  parent reply	other threads:[~2025-03-24 17:07 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-06 21:00 [PATCH v4 0/3] iommu: Clean up cookie and sw_msi in struct iommu_domain Nicolin Chen
2025-03-06 21:00 ` [PATCH v4 1/3] iommu: Sort out domain user data Nicolin Chen
2025-03-07  2:28   ` Baolu Lu
2025-03-07  5:57     ` Nicolin Chen
2025-03-07  7:03       ` Baolu Lu
2025-03-07 11:49         ` Robin Murphy
2025-03-07 15:32           ` Jason Gunthorpe
2025-03-17 19:37   ` Jason Gunthorpe
2025-03-06 21:00 ` [PATCH v4 2/3] iommufd: Move iommufd_sw_msi and related functions to driver.c Nicolin Chen
2025-03-12  7:37   ` Tian, Kevin
2025-03-17 20:20   ` Jason Gunthorpe
2025-03-06 21:00 ` [PATCH v4 3/3] iommu: Drop sw_msi from iommu_domain Nicolin Chen
2025-03-17 20:20   ` Jason Gunthorpe
2025-03-24 16:25   ` Nathan Chancellor
2025-03-24 16:40     ` Jason Gunthorpe
2025-03-24 16:55       ` Nicolin Chen
2025-03-24 17:05         ` Nicolin Chen
2025-03-24 17:07         ` Nathan Chancellor [this message]
2025-03-24 20:05           ` Jason Gunthorpe
2025-03-24 20:43             ` Nathan Chancellor
2025-03-24 21:38               ` Nicolin Chen
2025-03-24 22:29                 ` Jason Gunthorpe
2025-03-24 22:45                   ` Nicolin Chen
2025-03-17 20:21 ` [PATCH v4 0/3] iommu: Clean up cookie and sw_msi in struct iommu_domain Jason Gunthorpe
2025-03-20 23:16 ` Jason Gunthorpe

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=20250324170743.GA1339275@ax162 \
    --to=nathan@kernel.org \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolinc@nvidia.com \
    --cc=robin.murphy@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox