* [PATCH] platform/raspberrypi: vchiq: register bus at subsys_initcall
[not found] <CAFERDQ0FpdVvA5VJxOyRAE_pgxnPVmFx1tkZio5R272j6Bs4tg@mail.gmail.com>
@ 2026-10-13 13:14 ` Martin Wetterwald
2026-10-13 16:27 ` Jai Luthra
2026-10-15 21:25 ` Gaston Gonzalez
0 siblings, 2 replies; 4+ messages in thread
From: Martin Wetterwald @ 2026-10-13 13:14 UTC (permalink / raw)
To: Florian Fainelli
Cc: Broadcom internal kernel review list, Jai Luthra,
Greg Kroah-Hartman, Stefan Wahren, Phil Elwell, Laurent Pinchart,
Umang Jain, Kees Cook, linux-rpi-kernel, linux-arm-kernel,
linux-staging, linux-kernel, regressions, Martin Wetterwald
Since the VCHIQ interface was moved out of staging, its bus is no longer
guaranteed to be registered before its client drivers. bcm2835-audio,
still in drivers/staging, registers at device_initcall level and now
runs first:
Driver 'bcm2835-audio' was unable to register with bus_type
'vchiq-bus' because the bus was not initialized.
Register the bus and the platform driver at subsys_initcall so the bus
exists before any client driver, independently of link order. The
platform driver probe already returns -EPROBE_DEFER while the firmware
is not ready, so probing earlier is safe. When built as modules, this is
equivalent to module_init() and nothing changes.
Tested on Raspberry Pi 1B rev2, 1B+, 2B, 3B and 4B with VCHIQ and
bcm2835-audio both builtin and both as modules.
Fixes: aa125180c673 ("platform/raspberrypi: Destage VCHIQ interface")
Reported-by: Martin Wetterwald <martin@wetterwald.eu>
Link: https://lore.kernel.org/r/CAFERDQ0FpdVvA5VJxOyRAE_pgxnPVmFx1tkZio5R272j6Bs4tg@mail.gmail.com/
Closes: https://lore.kernel.org/r/CAFERDQ0FpdVvA5VJxOyRAE_pgxnPVmFx1tkZio5R272j6Bs4tg@mail.gmail.com/
Signed-off-by: Martin Wetterwald <martin@wetterwald.eu>
---
drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c b/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c
index e78641703252..d35f5ac5c2e2 100644
--- a/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c
+++ b/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c
@@ -1462,7 +1462,7 @@ static int __init vchiq_driver_init(void)
return ret;
}
-module_init(vchiq_driver_init);
+subsys_initcall(vchiq_driver_init);
static void __exit vchiq_driver_exit(void)
{
--
2.55.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] platform/raspberrypi: vchiq: register bus at subsys_initcall
2026-10-13 13:14 ` [PATCH] platform/raspberrypi: vchiq: register bus at subsys_initcall Martin Wetterwald
@ 2026-10-13 16:27 ` Jai Luthra
2026-10-15 21:25 ` Gaston Gonzalez
1 sibling, 0 replies; 4+ messages in thread
From: Jai Luthra @ 2026-10-13 16:27 UTC (permalink / raw)
To: Florian Fainelli, Martin Wetterwald
Cc: Broadcom internal kernel review list, Greg Kroah-Hartman,
Stefan Wahren, Phil Elwell, Laurent Pinchart, Umang Jain,
Kees Cook, linux-rpi-kernel, linux-arm-kernel, linux-staging,
linux-kernel, regressions, Martin Wetterwald
Hi Martin,
Thanks for the quick fix.
Quoting Martin Wetterwald (2026-10-13 18:44:35)
> Since the VCHIQ interface was moved out of staging, its bus is no longer
> guaranteed to be registered before its client drivers. bcm2835-audio,
> still in drivers/staging, registers at device_initcall level and now
> runs first:
>
> Driver 'bcm2835-audio' was unable to register with bus_type
> 'vchiq-bus' because the bus was not initialized.
>
> Register the bus and the platform driver at subsys_initcall so the bus
> exists before any client driver, independently of link order. The
> platform driver probe already returns -EPROBE_DEFER while the firmware
> is not ready, so probing earlier is safe. When built as modules, this is
> equivalent to module_init() and nothing changes.
>
> Tested on Raspberry Pi 1B rev2, 1B+, 2B, 3B and 4B with VCHIQ and
> bcm2835-audio both builtin and both as modules.
>
> Fixes: aa125180c673 ("platform/raspberrypi: Destage VCHIQ interface")
> Reported-by: Martin Wetterwald <martin@wetterwald.eu>
> Link: https://lore.kernel.org/r/CAFERDQ0FpdVvA5VJxOyRAE_pgxnPVmFx1tkZio5R272j6Bs4tg@mail.gmail.com/
> Closes: https://lore.kernel.org/r/CAFERDQ0FpdVvA5VJxOyRAE_pgxnPVmFx1tkZio5R272j6Bs4tg@mail.gmail.com/
> Signed-off-by: Martin Wetterwald <martin@wetterwald.eu>
Reviewed-by: Jai Luthra <jai.luthra@ideasonboard.com>
Thanks,
Jai
> ---
> drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c b/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c
> index e78641703252..d35f5ac5c2e2 100644
> --- a/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c
> +++ b/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c
> @@ -1462,7 +1462,7 @@ static int __init vchiq_driver_init(void)
>
> return ret;
> }
> -module_init(vchiq_driver_init);
> +subsys_initcall(vchiq_driver_init);
>
> static void __exit vchiq_driver_exit(void)
> {
> --
> 2.55.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] platform/raspberrypi: vchiq: register bus at subsys_initcall
2026-10-13 13:14 ` [PATCH] platform/raspberrypi: vchiq: register bus at subsys_initcall Martin Wetterwald
2026-10-13 16:27 ` Jai Luthra
@ 2026-10-15 21:25 ` Gaston Gonzalez
2026-10-16 9:00 ` Martin Wetterwald
1 sibling, 1 reply; 4+ messages in thread
From: Gaston Gonzalez @ 2026-10-15 21:25 UTC (permalink / raw)
To: Martin Wetterwald, Florian Fainelli
Cc: Broadcom internal kernel review list, Jai Luthra,
Greg Kroah-Hartman, Stefan Wahren, Phil Elwell, Laurent Pinchart,
Umang Jain, Kees Cook, linux-rpi-kernel, linux-arm-kernel,
linux-staging, linux-kernel, regressions
On Tue Oct 13, 2026 at 10:14 AM -03, Martin Wetterwald wrote:
> Since the VCHIQ interface was moved out of staging, its bus is no longer
> guaranteed to be registered before its client drivers. bcm2835-audio,
> still in drivers/staging, registers at device_initcall level and now
> runs first:
>
> Driver 'bcm2835-audio' was unable to register with bus_type
> 'vchiq-bus' because the bus was not initialized.
>
> Register the bus and the platform driver at subsys_initcall so the bus
> exists before any client driver, independently of link order. The
> platform driver probe already returns -EPROBE_DEFER while the firmware
> is not ready, so probing earlier is safe. When built as modules, this is
> equivalent to module_init() and nothing changes.
>
> Tested on Raspberry Pi 1B rev2, 1B+, 2B, 3B and 4B with VCHIQ and
> bcm2835-audio both builtin and both as modules.
>
> Fixes: aa125180c673 ("platform/raspberrypi: Destage VCHIQ interface")
> Reported-by: Martin Wetterwald <martin@wetterwald.eu>
> Link: https://lore.kernel.org/r/CAFERDQ0FpdVvA5VJxOyRAE_pgxnPVmFx1tkZio5R272j6Bs4tg@mail.gmail.com/
> Closes: https://lore.kernel.org/r/CAFERDQ0FpdVvA5VJxOyRAE_pgxnPVmFx1tkZio5R272j6Bs4tg@mail.gmail.com/
> Signed-off-by: Martin Wetterwald <martin@wetterwald.eu>
> ---
> drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c b/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c
> index e78641703252..d35f5ac5c2e2 100644
> --- a/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c
> +++ b/drivers/platform/raspberrypi/vchiq-interface/vchiq_arm.c
> @@ -1462,7 +1462,7 @@ static int __init vchiq_driver_init(void)
>
> return ret;
> }
> -module_init(vchiq_driver_init);
> +subsys_initcall(vchiq_driver_init);
>
> static void __exit vchiq_driver_exit(void)
> {
Hi,
For Raspberry Pi Zero v1.3:
Tested-by: Gaston Gonzalez <gascoar@gmail.com>
Test setup:
- Branch: patch manually applied in staging-next over commit ec1ecf4f23c5
- Setup: RPi Zero v1.3 connected to a HDMI monitor
- OS: standard raspbian with the desktop environment enabled
- Driver built both as a module and built-in.
- The following command was run to test the sound: 'speaker-test -t wav -c 2'
- Result: Both HDMI audio channels worked correctly
I’d be happy to run any additional tests if needed.
Regards,
Gaston
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] platform/raspberrypi: vchiq: register bus at subsys_initcall
2026-10-15 21:25 ` Gaston Gonzalez
@ 2026-10-16 9:00 ` Martin Wetterwald
0 siblings, 0 replies; 4+ messages in thread
From: Martin Wetterwald @ 2026-10-16 9:00 UTC (permalink / raw)
To: Gaston Gonzalez
Cc: Florian Fainelli, Broadcom internal kernel review list,
Jai Luthra, Greg Kroah-Hartman, Stefan Wahren, Phil Elwell,
Laurent Pinchart, Umang Jain, Kees Cook, linux-rpi-kernel,
linux-arm-kernel, linux-staging, linux-kernel, regressions
On Thu, Oct 15, 2026 at 11:25 PM Gaston Gonzalez <gascoar@gmail.com> wrote:
> Hi,
>
> For Raspberry Pi Zero v1.3:
>
> Tested-by: Gaston Gonzalez <gascoar@gmail.com>
>
> Test setup:
>
> - Branch: patch manually applied in staging-next over commit ec1ecf4f23c5
> - Setup: RPi Zero v1.3 connected to a HDMI monitor
> - OS: standard raspbian with the desktop environment enabled
> - Driver built both as a module and built-in.
> - The following command was run to test the sound: 'speaker-test -t wav -c 2'
> - Result: Both HDMI audio channels worked correctly
Hello Gaston,
Thanks very much for your test!
It's great to have variety in tests because I don't have the Pi Zero, and I
didn't test it through HDMI, I tested through the Headphones jack (which
doesn't exist on the Pi Zero).
Did you also also reproduce the bug without adding my patch?
If the bug is present, cat /proc/asound/cards should reveal bcm2835_hdmi and
bcm2835_headphones are both not present. And you should see this in the dmesg:
> Driver 'bcm2835-audio' was unable to register with bus_type 'vchiq-bus' because the bus was not initialized.
Regarding your test: there are two ways for the sound to go through the HDMI
port:
- One is through the bcm2835-audio driver (using VCHIQ)
- The other way is through the vc4-hdmi (bypassing VCHIQ)
# cat /proc/asound/cards
0 [vc4hdmi ]: vc4-hdmi - vc4-hdmi
vc4-hdmi
1 [HDMI ]: bcm2835_hdmi - bcm2835 HDMI
bcm2835 HDMI
2 [Headphones ]: bcm2835_headpho - bcm2835 Headphones
bcm2835 Headphones
Can you make sure that your HDMI sound is really using bcm2835_hdmi ?
If your sound happens to actually go through vc4-hdmi, then you are not testing
my patch. If you can't see the bcm2835_hdmi, you just need to add:
snd_bcm2835.enable_hdmi=1
to your kernel command line if the driver is built in, or to the modprobe
command as module parameter.
> I’d be happy to run any additional tests if needed.
It would be interesting to test other "clients" of the VCHIQ bus (because I
only tested bcm2835-audio).
But I've just noticed that bcm2835-camera doesn't exist anymore (it was using
VCHIQ via VCHIQ_MMAL).
If I understand correctly, if VCHIQ_MMAL is still there, it's because the
bcm2835-isp and bcm2835-codec drivers will be upstreamed in the future, but
there is not current "client" in the kernel as far as I understand.
The only remaining thing I can think of is /dev/vchiq (CONFIG_VCHIQ_CDEV).
Thanks again for the tests!
Martin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-10-16 9:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CAFERDQ0FpdVvA5VJxOyRAE_pgxnPVmFx1tkZio5R272j6Bs4tg@mail.gmail.com>
2026-10-13 13:14 ` [PATCH] platform/raspberrypi: vchiq: register bus at subsys_initcall Martin Wetterwald
2026-10-13 16:27 ` Jai Luthra
2026-10-15 21:25 ` Gaston Gonzalez
2026-10-16 9:00 ` Martin Wetterwald
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®