All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/5] "notify-device" for cross-driver readiness notification
@ 2022-10-26 13:15 Matthias Schiffer
  2022-10-26 13:15 ` [RFC 1/5] misc: introduce notify-device driver Matthias Schiffer
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Matthias Schiffer @ 2022-10-26 13:15 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski
  Cc: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
	Amitkumar Karwar, Ganapathi Bhat, Sharvari Harisangam,
	Xinming Hu, Kalle Valo, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, linux-kernel, linux-bluetooth,
	linux-wireless, netdev, devicetree, linux, Matthias Schiffer

This patch series is obviously missing documentation, MAINTAINERS
entries, etc., but I'd like to solicit some basic feedback on whether
this approach makes sense at all before I proceed. If it does, the
naming is also very much open for bikeshedding - I'm not too happy with
"notify-device".

The basic problem that the notify-device tries to solve is the
synchronization of firmware loading readiness between the Marvell/NXP
WLAN and Bluetooth drivers, but it may also be applicable to other
drivers.

The WLAN and Bluetooth adapters are handled by separate drivers, and may
be connected to the CPU using different interfaces (for example SDIO for
WLAN and UART for Bluetooth). However, both adapters share a single
firmware that may be uploaded via either interface.

For the SDIO+UART case, uploading the firmware via SDIO is usually
preferable, but even when the interface doesn't matter, it seems like a
good idea to clearly define which driver should handle it. To avoid
making the Bluetooth driver more complicated than necessary in this case,
we'd like to defer the probing of the driver until the firmware is ready.

For this purpose, we are introducing a notify-device, with the following
properties:

- The device is created by a driver as soon as some "readiness
  condition" is satisfied
- Creating the device also binds a stub driver, so deferred probes are
  triggered
- Looking up the notify device is possible via OF node / phandle reference

This approach avoids a hard dependency between the WLAN and Bluetooth
driver, and works regardless of the driver load order.

The first patch implementes the notify-device driver itself, and the
rest shows how the device could be hooked up to the mwifiex and hci_mrvl
drivers. A device tree making use of the notify-device could look like
the following:

    &sdhci1 {
        wifi@1 {
            compatible = "marvell,sd8987";
            reg = <1>;
    
            wifi_firmware: firmware-notifier {};
        };
    };

    &main_uart3 {
        bluetooth {
            compatible = "marvell,sd8987-bt";
            firmware-ready = <&wifi_firmware>;
        };
    };


Matthias Schiffer (5):
  misc: introduce notify-device driver
  wireless: mwifiex: signal firmware readiness using notify-device
  bluetooth: hci_mrvl: select firmwares to load by match data
  bluetooth: hci_mrvl: add support for SD8987
  bluetooth: hci_mrvl: allow waiting for firmware load using
    notify-device

 drivers/bluetooth/hci_mrvl.c                |  77 ++++++++++++--
 drivers/misc/Kconfig                        |   4 +
 drivers/misc/Makefile                       |   1 +
 drivers/misc/notify-device.c                | 109 ++++++++++++++++++++
 drivers/net/wireless/marvell/mwifiex/main.c |  14 +++
 drivers/net/wireless/marvell/mwifiex/main.h |   1 +
 include/linux/notify-device.h               |  33 ++++++
 7 files changed, 228 insertions(+), 11 deletions(-)
 create mode 100644 drivers/misc/notify-device.c
 create mode 100644 include/linux/notify-device.h

-- 
2.25.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-10-28  9:11 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 13:15 [RFC 0/5] "notify-device" for cross-driver readiness notification Matthias Schiffer
2022-10-26 13:15 ` [RFC 1/5] misc: introduce notify-device driver Matthias Schiffer
2022-10-26 13:32   ` "notify-device" for cross-driver readiness notification bluez.test.bot
2022-10-26 14:37   ` [RFC 1/5] misc: introduce notify-device driver Greg Kroah-Hartman
2022-10-27 16:33     ` Matthias Schiffer
2022-10-27 16:48       ` Greg Kroah-Hartman
2022-10-28  9:10         ` Matthias Schiffer
2022-10-27  0:04   ` kernel test robot
2022-10-26 13:15 ` [RFC 2/5] wireless: mwifiex: signal firmware readiness using notify-device Matthias Schiffer
2022-10-26 14:47   ` kernel test robot
2022-10-26 13:15 ` [RFC 3/5] bluetooth: hci_mrvl: select firmwares to load by match data Matthias Schiffer
2022-10-26 13:15 ` [RFC 4/5] bluetooth: hci_mrvl: add support for SD8987 Matthias Schiffer
2022-10-27  1:55   ` kernel test robot
2022-10-26 13:15 ` [RFC 5/5] bluetooth: hci_mrvl: allow waiting for firmware load using notify-device Matthias Schiffer
2022-10-26 17:22   ` Krzysztof Kozlowski

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.