On Mon, Aug 08, 2022 at 12:11:52AM +0200, Igor Skalkin wrote:According to specification [1], "For the device-specific configuration space, the driver MUST use 8 bit wide accesses for 8 bit wide fields, 16 bit wide and aligned accesses for 16 bit wide fields and 32 bit wide and aligned accesses for 32 and 64 bit wide fields.". Current version of the configuration structure: struct virtio_bt_config { __u8 type; __u16 vendor; __u16 msft_opcode; } __attribute__((packed)); has both 16bit fields non-aligned. This commit fixes it. [1] https://ddec1-0-en-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=""> Signed-off-by: Igor Skalkin <Igor.Skalkin@xxxxxxxxxxxxxxx>This is all true enough, but the problem is 1. changing uapi like this can't be done, will break userspace 2. the driver has more issues and no one seems to want to maintain it. I posted a patch "Bluetooth: virtio_bt: mark broken" and intend to merge it for this release.
This is very sad. We already use this driver in our projects.
Our virtio bluetooth device has two backends - HCI_USER socket backend for one
platform and uart backend for the other, and works well (after applying your
"[PATCH] Bluetooth: virtio_bt: fix device remove") patch, so this "device
removal" problem can probably be considered solved .
We could help with the rest of the problems you listed that can be solved
(specification, QEMU support).
And the only problem that is difficult to solve (because of the need to change
UAPI header files) is just this one with unaligned configuration fields.
At the moment, it does not reproduce, because without VIRTIO_BT_F_VND_HCI
(Indicates vendor command support) feature negotiated, the driver does not
read the non-aligned configuration fields.
So, what would you advise us to do? Continuing to use the "marked broken"
driver, start writing a specification for a new from scratch, better one?
Or is there any way to bring this one back to life?
--- include/uapi/linux/virtio_bt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/virtio_bt.h b/include/uapi/linux/virtio_bt.h index a7bd48daa9a9..adc03709cc4f 100644 --- a/include/uapi/linux/virtio_bt.h +++ b/include/uapi/linux/virtio_bt.h @@ -23,9 +23,9 @@ enum virtio_bt_config_vendor { }; struct virtio_bt_config { - __u8 type; __u16 vendor; __u16 msft_opcode; + __u8 type; } __attribute__((packed)); #endif /* _UAPI_LINUX_VIRTIO_BT_H */ -- 2.34.1
Best regards,
Igor Skalkin
Software Engineer
OpenSynergy GmbH
Rotherstr. 20, 10245 Berlin
igor.skalkin@xxxxxxxxxxxxxxx
www.opensynergy.com
registered: Amtsgericht Charlottenburg, HRB 108616B
General Management: Rolf Morich, Stefaan Sonck Thiebaut
Please mind our privacy notice pursuant to Art. 13 GDPR. // Unsere Hinweise zum Datenschutz gem. Art. 13 DSGVO finden Sie hier.
_______________________________________________ Virtualization mailing list Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linuxfoundation.org/mailman/listinfo/virtualization