Linux USB
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Cole Leavitt" <cole@unwrap.rs>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH] USB: hcd-pci: Do not disable an already disabled device on remove
Date: Sun, 18 Oct 2026 16:45:27 +0000	[thread overview]
Message-ID: <sashiko-outbox-176290@kernel.org> (raw)
In-Reply-To: <20261018164134.134106-1-cole@unwrap.rs>

> suspend_common() calls pci_disable_device() and resume_common()
> re-enables the device. If the host controller is hot-removed during
> system resume before its ->resume() callback ran (for example pciehp
> handling a Thunderbolt/USB4 dock or host router that did not come back),
> usb_hcd_pci_remove() drops the enable count a second time:
> 
>   xhci_hcd 0000:b2:00.0: disabling already-disabled device
>   WARNING: drivers/pci/pci.c:2198 at pci_disable_device+0xac/0xc0, CPU#9: irq/128-pciehp/225
>   Call Trace:
>    xhci_pci_remove+0x89/0xd0
>    pci_device_remove+0x4a/0xb0
>    device_release_driver_internal+0x19e/0x200
>    pci_stop_bus_device+0x63/0x70
>    pci_stop_and_remove_bus_device+0x16/0x30
>    pciehp_unconfigure_device+0x96/0x170
>    pciehp_disable_slot+0x66/0x100
>    pciehp_handle_presence_or_link_change+0x62/0x190
>    pciehp_ist+0x14f/0x1d0
> 
> (usb_hcd_pci_remove() tail-calls pci_disable_device(), hence it is not
> in the trace.)
> 
> Only disable the device if it is still enabled.
> 
> Fixes: a0d4922da2e4 ("USB: fix up suspend and resume for PCI host controllers")
> Signed-off-by: Cole Leavitt <cole@unwrap.rs>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261018164134.134106-1-cole@unwrap.rs?part=1


      reply	other threads:[~2026-10-18 16:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-18 16:41 [PATCH] USB: hcd-pci: Do not disable an already disabled device on remove Cole Leavitt
2026-10-18 16:45 ` sashiko-bot [this message]

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=sashiko-outbox-176290@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=cole@unwrap.rs \
    --cc=linux-usb@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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