mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: hcd-pci: avoid double disable on surprise removal
Date: Wed, 21 Oct 2026 09:56:22 +0200	[thread overview]
Message-ID: <fa8e5c37-3663-4576-9dbc-db655038823b@oss.qualcomm.com> (raw)
In-Reply-To: <01f4dc0b-8ed8-46ce-9ff3-df811bd4b84f@rowland.harvard.edu>

On 10/20/26 9:55 PM, Alan Stern wrote:
> On Tue, Oct 20, 2026 at 03:52:28PM -0400, Alan Stern wrote:
>> On Tue, Oct 20, 2026 at 05:05:39PM +0200, Konrad Dybcio wrote:
>>> A PCI HCD can be surprise-removed after suspend_common() disables it
>>> and before resume_common() re-enables it. Avoid a second call to
>>> pci_disable_device() in the remove path when no enable reference
>>> remains.
>>
>> Does the double disable actually cause any problems?

At the very least, from drivers/pci/pci.c:

void pci_disable_device(struct pci_dev *dev)
{
        dev_WARN_ONCE(&dev->dev, atomic_read(&dev->enable_cnt) <= 0,
                      "disabling already-disabled device");


> Also, is your patch any different from this one from two days ago?
> 
> https://lore.kernel.org/linux-usb/20261018164134.134106-1-cole@unwrap.rs/

No, we can take that one instead.

Konrad

      reply	other threads:[~2026-10-21  7:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 15:05 Konrad Dybcio
2026-10-20 19:52 ` Alan Stern
2026-10-20 19:55   ` Alan Stern
2026-10-21  7:56     ` Konrad Dybcio [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=fa8e5c37-3663-4576-9dbc-db655038823b@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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

all inboxes | Powered by JetHome®