From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6180DC433F5 for ; Thu, 9 Dec 2021 21:23:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231901AbhLIV0g (ORCPT ); Thu, 9 Dec 2021 16:26:36 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28772 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbhLIV0f (ORCPT ); Thu, 9 Dec 2021 16:26:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639084980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vgwc1magvMzj/8M1W9pAQzQB7+9j3HSAE2K13KoLOiQ=; b=c5HRpZ9WpXnyIi+S8G4za/TvPuxJ03qccnwJZx7ISTmt+DOEDFDe3BdUsd6kftXo7wpf5M 4hWSbOH7XcWtWww3Nl1XoMXRQLnwfZMPwP45fmuO17icaLKlzq6lLWJliHB5qWghzH9tuG w4o+QyViF1aZ1s0uuXZ+ubaKROkALM8= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-366-Gn_1WxE4M_eAqCiwCzGlIA-1; Thu, 09 Dec 2021 16:22:59 -0500 X-MC-Unique: Gn_1WxE4M_eAqCiwCzGlIA-1 Received: by mail-wm1-f70.google.com with SMTP id p12-20020a05600c1d8c00b0033a22e48203so2880140wms.6 for ; Thu, 09 Dec 2021 13:22:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=Vgwc1magvMzj/8M1W9pAQzQB7+9j3HSAE2K13KoLOiQ=; b=QPhcBnRXCEUyE0j2jmDVpGn2hXkf/LwtmTG9beTNI5VCP1gLMH3a90x4E+cfcqkFwH TBMg9c3Hh2gixAACRoWu6DBkU3G2aVbWUerJvsbg/JLA19Uzjn7ZugK6O/Cx3t5G6Tud SemOj37nzwGSa3CGpJgRr5tXibkCq7sQiVetIGZfYwpQG76Rehoc1Oa4WqYEPVCvEfyQ BrGPVidC8mEhRRgXcmOyS9U+YtPr7gQKffim62wWvVk5UWc4u0g/XtMR5c6+e72rMSbw NZxkqG/KsZ2tKFSMm3LLTTIi7/h1lkHaKCXYTi//wgMbDVHbmheXD6i7RGriHZ7W5Yys tD8A== X-Gm-Message-State: AOAM533qlIdo+BqYJ2SFWsRYVMj+qAO+2PSoDa3WrZWk1NMWAHBQOeTS Vzs11uxyZcNcTKYLCIzZVVGgiF+e41HzwgHE46XS2Pp8AS8ijGPw+Rss4pDT30gmjP9E9EmJN54 aRacrJquICLRbGxWhiPWTNK39m7nx X-Received: by 2002:a5d:4d8b:: with SMTP id b11mr9190190wru.393.1639084978497; Thu, 09 Dec 2021 13:22:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzEhH9zXTTqyJyrSWANNFF5+2UsCUnbJ3IhG7hh2poI6YaxLYQDArU+ddIxOhcq+6xvoWFlHQ== X-Received: by 2002:a5d:4d8b:: with SMTP id b11mr9190171wru.393.1639084978284; Thu, 09 Dec 2021 13:22:58 -0800 (PST) Received: from redhat.com ([2.55.18.120]) by smtp.gmail.com with ESMTPSA id g13sm1214316wrd.57.2021.12.09.13.22.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 13:22:56 -0800 (PST) Date: Thu, 9 Dec 2021 16:22:52 -0500 From: "Michael S. Tsirkin" To: Marcel Holtmann Cc: Linux Kernel Mailing List , Johan Hedberg , Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH] Bluetooth: virtio_bt: fix device removal Message-ID: <20211209162149-mutt-send-email-mst@kernel.org> References: <20211125174200.133230-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F1465C433EF for ; Thu, 9 Dec 2021 21:23:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 89A6F42289; Thu, 9 Dec 2021 21:23:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hN9HQRCGpXmL; Thu, 9 Dec 2021 21:23:06 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id F2D7742286; Thu, 9 Dec 2021 21:23:05 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id ACDE5C001E; Thu, 9 Dec 2021 21:23:05 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 75F40C0012 for ; Thu, 9 Dec 2021 21:23:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 6C5BE860E2 for ; Thu, 9 Dec 2021 21:23:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Vetl14uxy1ii for ; Thu, 9 Dec 2021 21:23:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 41F2C860E1 for ; Thu, 9 Dec 2021 21:23:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639084980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vgwc1magvMzj/8M1W9pAQzQB7+9j3HSAE2K13KoLOiQ=; b=c5HRpZ9WpXnyIi+S8G4za/TvPuxJ03qccnwJZx7ISTmt+DOEDFDe3BdUsd6kftXo7wpf5M 4hWSbOH7XcWtWww3Nl1XoMXRQLnwfZMPwP45fmuO17icaLKlzq6lLWJliHB5qWghzH9tuG w4o+QyViF1aZ1s0uuXZ+ubaKROkALM8= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-453-uyUIkw33Oi6yMHvcLXdtxw-1; Thu, 09 Dec 2021 16:22:59 -0500 X-MC-Unique: uyUIkw33Oi6yMHvcLXdtxw-1 Received: by mail-wm1-f71.google.com with SMTP id j25-20020a05600c1c1900b00332372c252dso2889678wms.1 for ; Thu, 09 Dec 2021 13:22:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=Vgwc1magvMzj/8M1W9pAQzQB7+9j3HSAE2K13KoLOiQ=; b=Lrtrudm4xq75J3mwwp71WOZhD8+L5oKt5HaLqcVU+6UawTZBev4T2fWoLTqwJ5NoAF gKcXUPuofIzlOB/+mGT6TNGBqi0JhF1/3oViRXpbWFpFedw/z4bkITaQWUIPS+GS4QSj Oa2sPKE96rnFHkcG9BeJ/rnpGhNxMiFsoA/hcAFah8BtoKcyKlY9vsyQfezshVgwa0Te aDhHdVM6l/Bkf0EM6u7+3EEgmPX/oiVU16ixyGSvy4fAmEwxYohIxD6ssgBCMkfONYf3 PlmpKanyMhVd4FlFER2p9XhBCQRT8JYE1T6sqchbuCV/3GJ4KwkX7xiQWn0UXtWx+7Z9 PG1g== X-Gm-Message-State: AOAM5321t9nHF5eDIAdNGvnAp1z6Oabs4ed8xDzMdJYXA/vJzKnatU+w /3crSiLW1UZmH0QHbdAOhS000qPIuPd0yPrtbtR90DuYZW2QMea8xj3wcjRug/BBQXgZD9rD9Ev 3il0tshVzoLdw96LudLe2gHYRS5bVYswMTPbqF8hqSA== X-Received: by 2002:a5d:4d8b:: with SMTP id b11mr9190184wru.393.1639084978458; Thu, 09 Dec 2021 13:22:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzEhH9zXTTqyJyrSWANNFF5+2UsCUnbJ3IhG7hh2poI6YaxLYQDArU+ddIxOhcq+6xvoWFlHQ== X-Received: by 2002:a5d:4d8b:: with SMTP id b11mr9190171wru.393.1639084978284; Thu, 09 Dec 2021 13:22:58 -0800 (PST) Received: from redhat.com ([2.55.18.120]) by smtp.gmail.com with ESMTPSA id g13sm1214316wrd.57.2021.12.09.13.22.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 13:22:56 -0800 (PST) Date: Thu, 9 Dec 2021 16:22:52 -0500 From: "Michael S. Tsirkin" To: Marcel Holtmann Subject: Re: [PATCH] Bluetooth: virtio_bt: fix device removal Message-ID: <20211209162149-mutt-send-email-mst@kernel.org> References: <20211125174200.133230-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Cc: linux-bluetooth@vger.kernel.org, virtualization@lists.linux-foundation.org, Linux Kernel Mailing List , Luiz Augusto von Dentz , Johan Hedberg X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" T24gVGh1LCBOb3YgMjUsIDIwMjEgYXQgMDk6MDI6MDFQTSArMDEwMCwgTWFyY2VsIEhvbHRtYW5u IHdyb3RlOgo+IEhpIE1pY2hhZWwsCj4gCj4gPiBEZXZpY2UgcmVtb3ZhbCBpcyBjbGVhcmx5IG91 dCBvZiB2aXJ0aW8gc3BlYzogaXQgYXR0ZW1wdHMgdG8gcmVtb3ZlCj4gPiB1bnVzZWQgYnVmZmVy cyBmcm9tIGEgVlEgYmVmb3JlIGludm9raW5nIGRldmljZSByZXNldC4gVG8gZml4LCBtYWtlCj4g PiBvcGVuL2Nsb3NlIE5PUHMgYW5kIGRvIGFsbCBjbGVhbnVwL3NldHVwIGluIHByb2JlL3JlbW92 ZS4KPiAKPiBzbyB0aGUgdmlydGJ0X3tvcGVuLGNsb3NlfSBhcyBOT1AgaXMgbm90IHJlYWxseSB3 aGF0IGEgZHJpdmVyIGlzIHN1cHBvc2UKPiB0byBiZSBkb2luZy4gVGhlc2UgYXJlIHRyYW5zcG9y dCBlbmFibGUvZGlzYWJsZSBjYWxsYmFja3MgZnJvbSB0aGUgQlQKPiBDb3JlIHRvd2FyZHMgdGhl IGRyaXZlci4gSXQgbWFwcyB0byBhIGRldmljZSBiZWluZyBlbmFibGVkL2Rpc2FibGVkIGJ5Cj4g c29tZXRoaW5nIGxpa2UgYmx1ZXRvb3RoZCBmb3IgZXhhbXBsZS4gU28gaWYgZGlzYWJsZWQsIEkg ZXhwZWN0IHRoYXQgbm8KPiByZXNvdXJjZXMvcXVldWVzIGFyZSBpbiB1c2UuCj4gCj4gTWF5YmUg SSBtaXN1bmRlcnN0YW5kIHRoZSB2aXJ0aW8gc3BlYyBpbiB0aGF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