All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerry Snitselaar <jsnitsel@redhat.com>
To: Dave Jiang <dave.jiang@intel.com>
Cc: linux-kernel@vger.kernel.org, Fenghua Yu <fenghua.yu@intel.com>,
	Vinod Koul <vkoul@kernel.org>,
	dmaengine@vger.kernel.org
Subject: Re: [PATCH v2] dmaengine: idxd: avoid deadlock in process_misc_interrupts()
Date: Tue, 23 Aug 2022 17:54:35 -0700	[thread overview]
Message-ID: <20220824005435.jyexxvjxj3z7tc2f@cantor> (raw)
In-Reply-To: <905d3feb-f75b-e91c-f3de-b69718aa5c69@intel.com>

On Tue, Aug 23, 2022 at 09:46:19AM -0700, Dave Jiang wrote:
> 
> On 8/23/2022 9:37 AM, Jerry Snitselaar wrote:
> > idxd_device_clear_state() now grabs the idxd->dev_lock
> > itself, so don't grab the lock prior to calling it.
> > 
> > This was seen in testing after dmar fault occurred on system,
> > resulting in lockup stack traces.
> > 
> > Cc: Fenghua Yu <fenghua.yu@intel.com>
> > Cc: Dave Jiang <dave.jiang@intel.com>
> > Cc: Vinod Koul <vkoul@kernel.org>
> > Cc: dmaengine@vger.kernel.org
> > Fixes: cf4ac3fef338 ("dmaengine: idxd: fix lockdep warning on device driver removal")
> > Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
> 
> Thanks Jerry!
> 
> Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> 

I noticed another problem while looking at this. When the device ends
up in the halted state, and needs an flr or system reset, it calls
idxd_wqs_unmap_portal(). Then if you do a modprobe -r idxd, you hit
the WARN_ON in devm_iounmap(), because the remove code path calls
idxd_wq_portal_unmap(), and wq->portal is null. I'm not sure if it
just needs a simple sanity check in drv_disable_wq() to avoid the call
in the case that it has already been unmapped, or if more cleanup
needs to be done, and possibly a state to differentiate between
halted + soft reset possible, versus halted + flr or system reset
needed.  You get multiple "Device is HALTED" messages during the
removal as well.

Regards,
Jerry


  reply	other threads:[~2022-08-24  0:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-23 16:24 [PATCH] idxd: avoid deadlock in process_misc_interrupts() Jerry Snitselaar
2022-08-23 16:37 ` [PATCH v2] dmaengine: " Jerry Snitselaar
2022-08-23 16:46   ` Dave Jiang
2022-08-24  0:54     ` Jerry Snitselaar [this message]
2022-08-24 17:45       ` Dave Jiang
2022-08-24 18:42         ` Jerry Snitselaar
2022-08-24 21:11           ` Yu, Fenghua
2022-08-24 21:34             ` Jerry Snitselaar
2022-09-04 16:28   ` Vinod Koul
2022-12-12 18:47 ` [PATCH] " Yu, Fenghua
2022-12-12 20:08   ` Jerry Snitselaar

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=20220824005435.jyexxvjxj3z7tc2f@cantor \
    --to=jsnitsel@redhat.com \
    --cc=dave.jiang@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=fenghua.yu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vkoul@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.