virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	virtualization@lists.linux-foundation.org,
	linux-bluetooth@vger.kernel.org,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Subject: Re: [PATCH] Bluetooth: virtio_bt: fix device removal
Date: Tue, 28 Jun 2022 00:59:10 -0400	[thread overview]
Message-ID: <20220628005837-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20220613025539-mutt-send-email-mst@kernel.org>

On Mon, Jun 13, 2022 at 02:58:59AM -0400, Michael S. Tsirkin wrote:
> On Fri, Jan 14, 2022 at 03:12:47PM -0500, Michael S. Tsirkin wrote:
> > On Thu, Dec 16, 2021 at 08:58:31PM +0100, Marcel Holtmann wrote:
> > > Hi Michael,
> > > 
> > > >>>>> Device removal is clearly out of virtio spec: it attempts to remove
> > > >>>>> unused buffers from a VQ before invoking device reset. To fix, make
> > > >>>>> open/close NOPs and do all cleanup/setup in probe/remove.
> > > >>>> 
> > > >>>> so the virtbt_{open,close} as NOP is not really what a driver is suppose
> > > >>>> to be doing. These are transport enable/disable callbacks from the BT
> > > >>>> Core towards the driver. It maps to a device being enabled/disabled by
> > > >>>> something like bluetoothd for example. So if disabled, I expect that no
> > > >>>> resources/queues are in use.
> > > >>>> 
> > > >>>> Maybe I misunderstand the virtio spec in that regard, but I would like
> > > >>>> to keep this fundamental concept of a Bluetooth driver. It does work
> > > >>>> with all other transports like USB, SDIO, UART etc.
> > > >>>> 
> > > >>>>> The cost here is a single skb wasted on an unused bt device - which
> > > >>>>> seems modest.
> > > >>>> 
> > > >>>> There should be no buffer used if the device is powered off. We also don’t
> > > >>>> have any USB URBs in-flight if the transport is not active.
> > > >>>> 
> > > >>>>> NB: with this fix in place driver still suffers from a race condition if
> > > >>>>> an interrupt triggers while device is being reset. Work on a fix for
> > > >>>>> that issue is in progress.
> > > >>>> 
> > > >>>> In the virtbt_close() callback we should deactivate all interrupts.
> > > >>>> 
> > > >>>> Regards
> > > >>>> 
> > > >>>> Marcel
> > > >>> 
> > > >>> So Marcel, do I read it right that you are working on a fix
> > > >>> and I can drop this patch for now?
> > > >> 
> > > >> ping
> > > > 
> > > > 
> > > > If I don't hear otherwise I'll queue my version - it might not
> > > > be ideal but it at least does not violate the spec.
> > > > We can work on not allocating/freeing buffers later
> > > > as appropriate.
> > > 
> > > I have a patch, but it is not fully tested yet.
> > > 
> > > Regards
> > > 
> > > Marcel
> > 
> > ping
> > 
> > it's been a month ...
> > 
> > I'm working on cleaning up module/device removal in virtio and bt
> > is kind of sticking out.
> 
> I am inclined to make this driver depend on BROKEN for now.
> Any objections?

OK patch incoming.

> 
> > -- 
> > MST

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  reply	other threads:[~2022-06-28  4:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-25 17:44 [PATCH] Bluetooth: virtio_bt: fix device removal Michael S. Tsirkin
     [not found] ` <F52F65FE-6A07-486B-8E84-684ED85709E9@holtmann.org>
2021-11-25 20:44   ` Michael S. Tsirkin
     [not found]     ` <C8D84EA4-E9A8-44CC-918F-57640A05C81D@holtmann.org>
2021-11-25 21:23       ` Michael S. Tsirkin
     [not found]         ` <2B9668C9-427B-4D8B-A393-AAB5E50763C5@holtmann.org>
2021-11-26  1:02           ` Michael S. Tsirkin
2021-12-09 21:22   ` Michael S. Tsirkin
2021-12-13 10:44     ` Michael S. Tsirkin
2021-12-13 23:57       ` Michael S. Tsirkin
     [not found]         ` <FF8BA713-6DD2-485B-9ADC-02006126BC60@holtmann.org>
2022-01-14 20:12           ` Michael S. Tsirkin
2022-06-13  6:58             ` Michael S. Tsirkin
2022-06-28  4:59               ` Michael S. Tsirkin [this message]
2022-08-09 21:26 ` Igor Skalkin

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=20220628005837-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=virtualization@lists.linux-foundation.org \
    /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;
as well as URLs for NNTP newsgroup(s).