lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <fa9cdbe5906fdcfcb37dbe682f3f46ce4b2e1b73.1666786471.git.matthias.schiffer@ew.tq-group.com>
Date:   Wed, 26 Oct 2022 15:15:34 +0200
From:   Matthias Schiffer <matthias.schiffer@...tq-group.com>
To:     Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>
Cc:     Marcel Holtmann <marcel@...tmann.org>,
        Johan Hedberg <johan.hedberg@...il.com>,
        Luiz Augusto von Dentz <luiz.dentz@...il.com>,
        Amitkumar Karwar <amitkarwar@...il.com>,
        Ganapathi Bhat <ganapathi017@...il.com>,
        Sharvari Harisangam <sharvari.harisangam@....com>,
        Xinming Hu <huxinming820@...il.com>,
        Kalle Valo <kvalo@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, linux-kernel@...r.kernel.org,
        linux-bluetooth@...r.kernel.org, linux-wireless@...r.kernel.org,
        netdev@...r.kernel.org, devicetree@...r.kernel.org,
        linux@...tq-group.com,
        Matthias Schiffer <matthias.schiffer@...tq-group.com>
Subject: [RFC 5/5] bluetooth: hci_mrvl: allow waiting for firmware load using notify-device

Signed-off-by: Matthias Schiffer <matthias.schiffer@...tq-group.com>
---
 drivers/bluetooth/hci_mrvl.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/bluetooth/hci_mrvl.c b/drivers/bluetooth/hci_mrvl.c
index b7d764e6010f..dc55053574a9 100644
--- a/drivers/bluetooth/hci_mrvl.c
+++ b/drivers/bluetooth/hci_mrvl.c
@@ -12,6 +12,7 @@
 #include <linux/skbuff.h>
 #include <linux/firmware.h>
 #include <linux/module.h>
+#include <linux/notify-device.h>
 #include <linux/tty.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
@@ -433,9 +434,25 @@ static int mrvl_serdev_probe(struct serdev_device *serdev)
 		return -ENOMEM;
 
 	if (IS_ENABLED(CONFIG_OF)) {
+		struct device_node *firmware_ready_node;
+		struct device *firmware_ready;
+
 		mrvldev->info = of_device_get_match_data(&serdev->dev);
 		if (!mrvldev->info)
 			return -ENODEV;
+
+		firmware_ready_node = of_parse_phandle(serdev->dev.of_node,
+						       "firmware-ready", 0);
+		if (firmware_ready_node) {
+			firmware_ready =
+				notify_device_find_by_of_node(firmware_ready_node);
+			if (!firmware_ready)
+				return -EPROBE_DEFER;
+			if (IS_ERR(firmware_ready))
+				return PTR_ERR(firmware_ready);
+			put_device(firmware_ready);
+		}
+
 	}
 
 	mrvldev->hu.serdev = serdev;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ