-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drm/vc4: Initialization hangs when HDMI display is *not* connected #4457
Comments
Indeed, @HiassofT reported it on slack earlier this week too, and I'm currently looking into it. I'm not sure why you're saying that this part doesn't make sense though? So far I haven't been able to find what's going on exactly, but it seems to be related to the configuration options on the board. The one used by LibreElec are broken just like yours, but mine aren't for the exact same kernel, board and boot method. Could you share yours? |
Well, there's a reason (clearly stated in the comment) why you added this call that I removed in my quickfix. And while I don't know much about those power management APIs, as far as I understand, that However, like I said, I don't know much about the kernel's PM API, so I might be missing something or maybe my analysis is completely wrong.
I suppose you mean BTW, I used firmware revision |
My bad, I thought you were saying the part you removed didn't make any sense, not that removing it didn't :) I just found out what made it work in my config.txt, it's hdmi_force_hotplug=1, and neither you nor LibreElec are using it, so it seems consistent. Could you try adding it and see if it fixes it on your side too? |
Well... yes and no. When I enable I looked into dmesg and there are some nasty things there in that scenario. |
I've had it occur a couple of times, but it does look like there's some initialisation or resources taken in the firmware that isn't picked up on, and / or leaves the firmware in a weird state. @popcornmix, @6by9 do you know what could cause this? |
I tested whether it would be the video= parameter set by the firmware on the kernel command line that would cause it, but running without hdmi_force_hotplug but with disable_fw_kms_setup doesn't change anything, so it does look like we fail to enable some resource in the kernel and were relying on it to be enabled by the firmware. |
@mripard can you clarify exactly what isn't working for you? I was interpreting this thread as some firmware setup of hdmi is required by kms driver which makes booting with hdmi uplugged (so firmware doesn't do it's setup) and then plugging in hdmi (or using something like But I'm not seeing that. e.g. with:
and and booting with no hdmi connected has no errors in dmesg, and subsequently plugging in hdmi produces expected output. |
@popcornmix the minimal setup to reproduce the issue here is stock cmdline.txt and config.txt only containing the single line
Booting RPi3B+ with no HDMI connected hangs. serial console output with current rpi-update kernel/fw: http://ix.io/3tRY adding Only adding RPi4 doesn't suffer from that, it boots just fine without any HDMI connected. |
@mripard I've added some logging and we hang in
Note: if we boot without hdmi connected, on a Pi0-3, the firmware will configure VEC (composite) output.
Pi4 swaps the default and configures hdmi output unless So the real issue is kms driver needs to setup whatever clocks are required before accessing registers. |
Not sure if this is helpful or even related but blacklisting the |
@mripard confirmed. Writing:
(sets HDMI SM clock to run off OSC) and Pi3 now boots. I think the bug in kms driver is simple. |
Thanks for looking into this. Which block are those registers in? We are already running vc4_hdmi_reset with runtime_pm enabled: linux/drivers/gpu/drm/vc4/vc4_hdmi.c Line 2320 in 2dd846f
Maybe we'd need a delay for the clock to settle? |
(or any non-zero value). I suspect maybe the clock is enabled, but never set to a non-zero value? |
Just confirmed that adding that line to start of |
Fix should be in latest rpi-update kernel. |
Thanks for fixing this. For a upstream solution, i would expect the fix more in clk-bcm2835. But not sure this is possible. |
I tried to do that, but the driver seems to make a point of undershooting every clock frequency that it needs to set, so I was a bit afraid of the side effects. Do you recall why you did so? |
Most of the clock driver has been done by Stephen (different person) and Emma. Unfortunately the documentation of SoC clocks is not public available. So i'm not able to answer your question. |
I ended up reworking the clock driver as part of this series: |
Deleting the old comment as I found it was not entirely correct. As of fresh Arch Linux ARM AArch64 on RPi 3B (5.15.5 kernel):
So |
That doesn't look like the original issue, can you open a new one? |
I was working on #4406, and after rebasing the changes onto the current
rpi-5.10.y
head (e6410af), I found that my Pi3 freezes when trying to initialize thevc4
module. This is not related to my changes, as it happens on e6410af without any changes as well.After some investigation, I found that everything worked fine after connecting an HDMI display. I was then also able to successfully switch to composite output afterwards through
xrandr
.This seems to be somehow related to the 94bc403 commit - the best fix I could find is:
although I don't dare proposing that as a permanent fix, because a) it does not seem to make any sense, b) the Pi still freezes after hot-plugging the HDMI display after having booted without one.
Please excuse me for taking the liberty to tag @mripard in advance - you're the author of that commit, maybe you'll make some sense of it.
Please also note that I did not test any of that behavior on Pi4 (yet).
The text was updated successfully, but these errors were encountered: