All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Marcel Holtmann <marcel@holtmann.org>,
	linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
	Rajat Jain <rajatja@google.com>
Subject: Re: [PATCH] Bluetooth: btusb: fix wakeup irq devres lifetime
Date: Thu, 2 Apr 2026 11:35:38 +0200	[thread overview]
Message-ID: <ac44aqMBNGD_X78b@hovoldconsulting.com> (raw)
In-Reply-To: <CABBYNZJeGyDAj2jUOyOA1gHRXDS8LeYzWfT-gQpXfTEzMCH4sw@mail.gmail.com>

Hi Luiz,

On Mon, Mar 30, 2026 at 03:17:33PM -0400, Luiz Augusto von Dentz wrote:

> On Mon, Mar 30, 2026 at 5:33 AM Johan Hovold <johan@kernel.org> wrote:
> > The OOB wakeup irq is device managed but its lifetime is incorrectly
> > tied to the child HCI device rather than the USB interface to which the
> > driver is bound.
> >
> > This should not cause any trouble currently as the interrupt is only
> > enabled during suspend, but it is technically wrong as the reference
> > counted HCI device could remain after the driver has been unbound.
> >
> > Note that the data passed to the interrupt handler is not device managed
> > and is typically freed before the interrupt during disconnect, but this
> > is also safe as long as the interrupt is disabled.

> https://sashiko.dev/#/patchset/20260330093311.1621965-1-johan%40kernel.org
> 
> Not sure if it is valid though.

I'm afraid it is.

I had missed that the devres behaviour changed in 2023 so that managed
resources are now also released when deregistering a device which has no
driver.

The point about a possible race if disconnecting while suspended is also
valid.

I've just sent a v2 here:

	https://lore.kernel.org/lkml/20260402092704.2346710-1-johan@kernel.org/

Johan

      reply	other threads:[~2026-04-02  9:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30  9:33 [PATCH] Bluetooth: btusb: fix wakeup irq devres lifetime Johan Hovold
2026-03-30 10:15 ` bluez.test.bot
2026-03-30 19:17 ` [PATCH] " Luiz Augusto von Dentz
2026-04-02  9:35   ` Johan Hovold [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=ac44aqMBNGD_X78b@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=rajatja@google.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 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.