All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	linux-bluetooth@vger.kernel.org,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] Bluetooth: virtio_bt: fix device removal
Date: Thu, 9 Dec 2021 16:22:52 -0500	[thread overview]
Message-ID: <20211209162149-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <F52F65FE-6A07-486B-8E84-684ED85709E9@holtmann.org>

On Thu, Nov 25, 2021 at 09:02:01PM +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?

-- 
MST


WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-bluetooth@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	Johan Hedberg <johan.hedberg@gmail.com>
Subject: Re: [PATCH] Bluetooth: virtio_bt: fix device removal
Date: Thu, 9 Dec 2021 16:22:52 -0500	[thread overview]
Message-ID: <20211209162149-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <F52F65FE-6A07-486B-8E84-684ED85709E9@holtmann.org>

On Thu, Nov 25, 2021 at 09:02:01PM +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?

-- 
MST

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

  parent reply	other threads:[~2021-12-09 21:23 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-25 17:44 [PATCH] Bluetooth: virtio_bt: fix device removal Michael S. Tsirkin
2021-11-25 17:44 ` Michael S. Tsirkin
2021-11-25 20:02 ` Marcel Holtmann
2021-11-25 20:44   ` Michael S. Tsirkin
2021-11-25 20:44     ` Michael S. Tsirkin
2021-11-25 21:01     ` Marcel Holtmann
2021-11-25 21:23       ` Michael S. Tsirkin
2021-11-25 21:23         ` Michael S. Tsirkin
2021-11-25 21:58         ` Marcel Holtmann
2021-11-26  1:02           ` Michael S. Tsirkin
2021-11-26  1:02             ` Michael S. Tsirkin
2021-12-09 21:22   ` Michael S. Tsirkin [this message]
2021-12-09 21:22     ` Michael S. Tsirkin
2021-12-13 10:44     ` Michael S. Tsirkin
2021-12-13 10:44       ` Michael S. Tsirkin
2021-12-13 23:57       ` Michael S. Tsirkin
2021-12-13 23:57         ` Michael S. Tsirkin
2021-12-16 19:58         ` Marcel Holtmann
2022-01-14 20:12           ` Michael S. Tsirkin
2022-01-14 20:12             ` Michael S. Tsirkin
2022-06-13  6:58             ` Michael S. Tsirkin
2022-06-13  6:58               ` Michael S. Tsirkin
2022-06-28  4:59               ` Michael S. Tsirkin
2022-06-28  4:59                 ` Michael S. Tsirkin
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=20211209162149-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 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.