Re: [PATCH v2] pci: quirks: Disable native PCIe hotplug on MSI Claw A8 root bridge
Lukas Wunner <[email protected]>
| Newsgroups | org.kernel.vger.linux-pci,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
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