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: <20181016150228.16994-10-nsaenzjulienne@suse.de>
Date:   Tue, 16 Oct 2018 17:02:28 +0200
From:   Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
To:     gregkh@...uxfoundation.org
Cc:     eric@...olt.net, stefan.wahren@...e.com,
        linux-rpi-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        devicetree@...r.kernel.org, robh+dt@...nel.org, tiwai@...e.de,
        nsaenzjulienne@...e.de
Subject: [PATCH 9/9] staging: bcm2835-audio: check for VCHIQ during probe

The audio data is sent to rpi's VideoCore IV trough VCHIQ. We make sure
it's available and that we fail gracefully in case it isn't there.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
---
 drivers/staging/vc04_services/bcm2835-audio/bcm2835.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
index 039565311d10..f4b19a4a974b 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
@@ -294,9 +294,19 @@ static int snd_add_child_devices(struct device *device, u32 numchans)
 static int snd_bcm2835_alsa_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
+	struct device_node *fw_node;
 	u32 numchans;
 	int err;
 
+	fw_node = of_find_compatible_node(NULL, NULL, "brcm,bcm2835-vchiq");
+	if (!fw_node) {
+		dev_err(&pdev->dev, "no vchiq firmware node\n");
+		return -ENODEV;
+	}
+
+	if (!vchi_ready(fw_node))
+		return -EPROBE_DEFER;
+
 	err = of_property_read_u32(dev->of_node, "brcm,pwm-channels",
 				   &numchans);
 	if (err) {
-- 
2.19.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ