Linux IOMMU Development
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Joerg Roedel <joro@8bytes.org>, Kevin Tian <kevin.tian@intel.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Lu Baolu <baolu.lu@linux.intel.com>
Cc: iommu@lists.linux.dev
Subject: Re: lockdep splat with intel iommu
Date: Fri, 24 Mar 2023 18:01:28 -0300	[thread overview]
Message-ID: <ZB4PqK6p64xuNxRn@nvidia.com> (raw)
In-Reply-To: <Y1qOqBXgll9qa7Hm@nvidia.com>

On Thu, Oct 27, 2022 at 10:59:04AM -0300, Jason Gunthorpe wrote:
> I'm seeing this at every boot, on v6.1-rc2
> 
> I've just realized it means lockdep is turned off for the actual
> testing I want to do. Very annoying
> 
> Lu, is there a solution yet? I saw some patches for a different
> lockdep splat but not this one.
> 
> [    0.604492] ======================================================
> [    0.604838] WARNING: possible circular locking dependency detected
> [    0.605221] 6.1.0-rc2+ #24 Not tainted
> [    0.605432] ------------------------------------------------------
> [    0.605734] swapper/0/1 is trying to acquire lock:
> [    0.605985] ffff8880069ab8a0 (&md->mutex){+.+.}-{3:3}, at: msi_get_virq+0x99/0x150
> [    0.606281] 
> [    0.606281] but task is already holding lock:
> [    0.606281] ffffffff82676890 (cpu_hotplug_lock){++++}-{0:0}, at: init_vqs+0x6db/0x940
> [    0.606281] 
> [    0.606281] which lock already depends on the new lock.

Lu, did you ever figure this out? It still happens.

It is because dmar_global_lock is held while calling
iommu_device_register() and also held during
intel_irq_remapping_alloc()

iommu_device_register() eventually obtains the cpu_hotplug_lock to
setup the DMA API

intel_irq_remapping_alloc() is called by drivers under the
cpu_hotplug_lock to setup their interrupts

To fix it you cannot use the same lock in both places

Jason

  parent reply	other threads:[~2023-03-24 21:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-27 13:59 lockdep splat with intel iommu Jason Gunthorpe
2022-10-29  8:22 ` Baolu Lu
2022-10-29 16:06   ` Jason Gunthorpe
2022-10-30  8:41     ` Baolu Lu
2022-10-31 12:11       ` Jason Gunthorpe
2023-03-24 21:01 ` Jason Gunthorpe [this message]
2023-03-25  8:49   ` Baolu Lu

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=ZB4PqK6p64xuNxRn@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=robin.murphy@arm.com \
    /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