The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Derek John Clark <derekjohn.clark@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	"Pierre-Loup A . Griffais" <pgriffais@valvesoftware.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] pci: quirks: Disable native PCIe hotplug on MSI Claw A8 root bridge
Date: Tue, 11 Aug 2026 07:19:12 +0200	[thread overview]
Message-ID: <anqw0M6cQLEA0J6d@wunner.de> (raw)
In-Reply-To: <CAFqHKTkTYtu7U39W7epZptPWBBC0fQyfA-5mOBTi4RTA1Bb1WA@mail.gmail.com>

On Mon, Aug 10, 2026 at 01:57:58PM -0700, Derek John Clark wrote:
> I was able to drill down further. When the mmc device gets to
> blk_report_disk_dead() in block/genhd.c there is an xa_for_each loop.
> On the second loop of that it seems to hang in bdev_mark_dead(). That
> sets a callback that runs fs_bdev_mark_dead() which then runs
> sync_filesystem(). This is all hit because the "surprise" bool is set
> to false unconditionally in __del_gendisk().
> 
> Commenting out this from __del_gendisk():
> if (!test_bit(GD_DEAD, &disk->state))
>  blk_report_disk_dead(disk, false);
> 
> Avoids the hang.

Thank you so much, you've root-caused the issue:  We're missing a call
to blk_mark_disk_dead() at the top of rtsx_pci_sdmmc_drv_remove()
if the underlying pci_dev is marked disconnected.  Let me get back
to you with a fix in a bit.

> I'm not sure how much further we want to go down into this as we've
> moved quite far out of the driver space and are now well into the
> block subsystem. I'm working on a proof of concept that would allow
> the driver to inform the mmc core that this was a surprise, but I'm
> not sure how that would land. From what I've read the mmc core was
> intentionally detached from higher level drivers, though a few
> notification methods do exist. If I get that fully working I'll post
> it here but it will probably be a few days as I've run into some other
> obligations this week.

It's fine, you don't need to invest any more time into that and
I understand your frustration about how much effort is necessary
to fix this.

The issue you've found affects anyone removing e.g. a Thunderbolt-
attached dock with an MMC card reader during system sleep.  So it's
useful and important to have root-caused and fix that.  Unfortunately
kernel development often means getting sidetracked like this.

> I suppose that is true, but in that case we still wouldn't be able to
> use it as the root fs since it gets removed/re-added during a suspend.
> Would the quirk I submitted not have this compromise?

Okay I wasn't sure that using the MMC card as root filesystem
is even possible on this product.  If that's a potential use case,
it needs a separate fix.  I'll come up with a proposal for that one
as well.

Thanks,

Lukas

  reply	other threads:[~2026-08-11  5:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06 21:48 [PATCH v2] pci: quirks: Disable native PCIe hotplug on MSI Claw A8 root bridge Derek J. Clark
2026-08-07  8:53 ` Lukas Wunner
2026-08-08  0:31   ` Derek John Clark
2026-08-08  8:16     ` Lukas Wunner
2026-08-09  3:34       ` Derek John Clark
2026-08-09  6:22         ` Lukas Wunner
2026-08-10 20:57           ` Derek John Clark
2026-08-11  5:19             ` Lukas Wunner [this message]
2026-08-11  8:59               ` Lukas Wunner
2026-08-11  9:19                 ` Derek J. Clark

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=anqw0M6cQLEA0J6d@wunner.de \
    --to=lukas@wunner.de \
    --cc=bhelgaas@google.com \
    --cc=derekjohn.clark@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=pgriffais@valvesoftware.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