-
Notifications
You must be signed in to change notification settings - Fork 5.2k
RPi3 B 1.2: 'flip_done timed out' when turning monitor off and on again #4962
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
Comments
Can you try running |
@popcornmix I could reproduce this issue with |
That's good. That should be default kernel pretty soon. |
It doesn't sound good if @simnalamburt can reproduce the issue with 5.15.30. |
Sorry - I misread his post. I'll see if I can reproduce. |
I didn't see this on my monitor when switching into/out of standby. (note: what happens to hotplug signal and ability to read edid in each of these cases tends to be monitor specific). |
Transferred to linux kernel issues and added KMS label. |
I have a look, but not seen anything obvious. Increasing the timeout to 10s doesn't help. aside: we are setting I have seen the failure when replugging hdmi cable, but it's not happening every time. @mripard @timg236 any thoughts? 10 hdmi unplug/replug cycles on Pi4 hasn't triggered it. |
@z0rti adding |
@mripard before the failure (from /sys/kernel/debug/clk/clk_summary):
and after:
So I guess fw-clk-pixel is not running in the failure mode, and you can't switch hdmi mode (through |
I had a look this morning, but couldn't reproduce it here
I'm not sure I understand the difference between the last two. Did you unplug the HDMI cable on the first, and the power plug on the last? I'll look at the code to see if there's anything obvious |
The only case where this could happen is if one of the functions in vc4_hdmi_encoder_pre_crtc_configure that can error (clk_set_rate, clk_set_min_rate, clk_prepare_enable or pm_runtime_resume_and_get) does return an error. Can you print the rest of the logs before that warning? All these functions should have an error message logged if they fail. |
Another thing I just remembered, we don't use the hotplug interrupts on the 3B and the polling interval is 10s so plugging/unplugging the monitor fairly fast might be ignored and lead to inconsistent behaviours. |
There are no logged error messages before the WARN. e.g. http://sprunge.us/HmP3nh I just tried unplugging. Waiting a few minutes. Replugging and it failed in the same way: http://sprunge.us/TOxFuc |
With all drm debug enabled: http://sprunge.us/TpeHh4 |
I'm a bit puzzled by this bug. I did more testing today and neither my 3B or 3B+ shows it on any of the three monitors I tested it with. Which kind of display did you test it with? |
@mripard did you try unplugging hdmi cable? (and replugging ten seconds later). |
I've done that for about 45 minutes now on a 3B, with and without X running, and making sure the kernel would detect the monitor status properly. I'm still not seeing the issue. Could you share your config.txt file and the mode it's happening in? Is it with X running? |
Just tried at work (so different pi/sdcard and monitor), Failed on second replug.
I'm on a 3B+. |
I am seeing this with 5.15.32-v8+ using a KVM switch. |
I've tested an upstream kernel (5.18-rc6) and couldn't reproduce this. The comparable downstream kernel did have this issue, so I may be able to bisect it. |
Also with: |
I have got the same issue when TV is switched to another source or disabled for a longer time (day or so). |
Can you try adding |
Sounds like it will completely disable HDMI port ? . If yes it is not a solution for me. |
Do you think @popcornmix would have suggested it if that's what it does? From https://wiki.archlinux.org/title/kernel_mode_setting:
|
Ah... forgive me. You are right, I forgot that capital letter has different action. It looks like overscan from /boot/config.txt stop working after adding video parameter but that's ok as temporary solution. |
New install. RPI can't turn screen back on after it puts it to sleep.
Relevant logs:
I see this has been open since March. Any updates? What other information can I provide that might be helpful? |
I can reproduce (although @mripard cannot). I've narrowed it down to the disable/enable of the HDMI domain (removing the mailbox call avoids the issue). I suspect the reset of PM_HDMI requires some HDMI registers to be re-set up, although visibly the registers exposed through debug sysfs are unchanged after the operation. In the fkms world, the same power down/up code is run and doesn't have the issue (but the code for shutting down and restarting the various display related parts of chip is quite different there). Until the issue is fully resolved I believe this is a workaround. |
Thanks or the tip but that didn't work. I'm seeing the same errors. |
I think I've run into this issue too. If left alone long enough, Pi would deactivate the display, but would not reactivate on keypresses or mouse movement. Running a fairly fresh copy of Raspberry Pi OS 64-bit (Bullseye) on a Raspberry Pi 3 Model B Rev 1.2. I think the only modifications to the default config have been re-enabling Glamor so I can work with cameras.
After a bunch of experimenting, the smallest number of steps to quickly and reliably reproduce (aside from waiting for the screensaver to timeout) is this:
The display does not reactivate. When the error does show, here's a typical example (
The good news is that adding Hope this is helpful. |
Hi to everyone. Setup info:
Description:
Also I did noticed that My workaround resolution:
The crucial for me was In result clock never goes down, even if monitor is not turned on (RPi even rebooted with turned off monitor due to power outage). Hope this will be helpful as a temporary solution |
kernel: Revert usbnet: smsc95xx: Avoid link settings race on interrupt reception kernel: Revert usbnet: smsc95xx: Forward PHY interrupts to PHY driver to avoid polling kernel: Revert usbnet: smsc95xx: Fix deadlock on runtime resume See: raspberrypi/linux#5145 kernel: defconfigs: Add CONFIG_MUX_GPIO See: raspberrypi/linux#5147 kernel: media: i2c: arducam-pivariety: Add custom controls See: raspberrypi/linux#5148 firmware: Fix USB boot See: #1744 firmware: video decode/MJPEG fixes See: http://git/vc4/vc4/-/merge_requests/1548 firmware: power: Restore VEC and PIXEL clocks after HDMI domain power cycle See: raspberrypi/linux#4962
kernel: Revert usbnet: smsc95xx: Avoid link settings race on interrupt reception kernel: Revert usbnet: smsc95xx: Forward PHY interrupts to PHY driver to avoid polling kernel: Revert usbnet: smsc95xx: Fix deadlock on runtime resume See: raspberrypi/linux#5145 kernel: defconfigs: Add CONFIG_MUX_GPIO See: raspberrypi/linux#5147 kernel: media: i2c: arducam-pivariety: Add custom controls See: raspberrypi/linux#5148 firmware: Fix USB boot See: raspberrypi/firmware#1744 firmware: video decode/MJPEG fixes See: http://git/vc4/vc4/-/merge_requests/1548 firmware: power: Restore VEC and PIXEL clocks after HDMI domain power cycle See: raspberrypi/linux#4962
rpi-update has a potential firmware fix for this. Please update and report if it's fixed. |
So far, so good... The screen woke up after sleep. I'll try it a few more times. Edit: Two successful wake ups now. I'm happy. Thank you! |
I'll be able to check on next week |
@popcornmix what was causing the issue? |
The request kernel request It wasn't clear what the best solution for this is. We have chosen to restore those clocks to the frequency they were when HDMI domain was disabled, when we get the enable call (that could cause a surprise if clocks are changed whilst disabled). An alternative would be for the kernel to restore these clocks itself when enabling the domain which may be safer, but the mix of VEC and HDMI may be ugly. It appears from a comment in the firmware code that PLLH is in the HDMI power domain, and PLLH provides both the VEC and pixel clock (one or the other), so they should be stopped as part of powering down. |
But there's is a dedicated VEC power domain, right?
The rate itself isn't really important, we can choose to set it to whatever we'd like in Linux (and we should pretty close to doing that already?). But yeah, Linux clock API comes with the expectation that it won't be shutdown while it's enabled (in the clock framework).
So we effectively have a dependency of the VEC power domain on the HDMI one? |
I can confirm that issue has been fixed for me as well. Now if X goes to screensaver and turns off monitor clocks went down to 0 and afterwards, on wake up, successully restores backward to previous value. |
No, I don't believe so (in a hardware sense). Software treats HDMI and VEC domains identically:
|
More specifically they are really the same domain as they share the same hardware resource (PLLH). |
So, if it is reference counted, I'm not sure what the original issue that got addressed by the new firmware was? Was the power domain itself reference counted, but not the clock side? |
Yes, clock are set to zero when all users of Someone needs to start clocks again. With the recent firmware update that is done by firmware (restoring VEC and PIXEL clocks to values they had when domain went down). |
Ok, thanks for the explanation :) |
…7924 https://build.opensuse.org/request/show/1007924 by user mbrugger + RBrownFactory - Update to 2b3cef2f4 (2022-09-30): * firmware: isp: Workaround for very unpleasant artifacts in the sharpening block * firmware: arm_loader: Raise maximum gzipped kernel size * firmware: arm-loader: Indicate tryboot status via /proc/device-tree/chosen/bootloader/tryboot * firmware: arm_loader: Increase TFTP block size to 1468 bytes See: raspberrypi/rpi-eeprom#375 * firmware: Add kernel= logging * firmware: camera_auto_detect changes See: #1750 * firmware: Fix USB boot See: #1744 * firmware: video decode/MJPEG fixes See: http://git/vc4/vc4/-/merge_requests/1548 * firmware: power: Restore VEC and PIXEL clocks after HDMI domain power cycle See: raspberrypi/linux#4962 * firmware: arm_loader: Never set warranty bit See: #1741 * firmware: vcfw: c
Closing as believed to be fixed. |
Just for understanding: is there a way to know from firmware version and/or linux kernel version if running with the fix for this? Thank you! |
The fix was in firmware here: If |
Looks like this has made it into current Raspberry Pi OS even without running
Thanks again @popcornmix ! |
it started for me after firmware update fine before |
This issue only affected pi0-3 and is fixed. |
- firmware: board_info: Handle misprogrammed 3B rev 1.2s - firmware: mmal: Add mapping for IL OMX_IndexParamBrcmEnableIJGTableScaling param - firmware: Handle overlay parameters embedded in overlay_map.dtb See: raspberrypi/linux#4860 - firmware: firmware: Add HDMI_PORTS trait - firmware: arm_dt: Fix rpi-poe overlay parameters See: #1689 - firmware: jpeghw: Skip APP0 AVI1 headers, regardless of length See: https://forums.raspberrypi.com/viewtopic.php?p=1975448 - firmware: camera_subsystem: Report ignored interfaces due to libcamera - See: #1679 - firmware: Export os_prefix, overlay_prefix, rsts and boot-mode on all models - firmware: vcfw/hdmi_i2c: Initialise all instances from hdmi_i2c_init - firmware: dtoverlay: Add support for string escape sequences See: https://forums.raspberrypi.com/viewtopic.php?t=330792 - firmware: isp: R and B order must be swapped when reading VC_IMAGE_RGBA32 into the ISP See: http://git/vc4/vc4/-/merge_requests/1430 - firmware: dtoverlay: Fix path rebasing and exports - firmware: dtoverlay: Fix clang warnings - firmware: arm_loader_dvfs: Make arm only see its own boosts, fixed and min clocks - firmware: arm_loader: Support longer file paths See: #1720 - firmware: arm_loader_dvfs: Support CLOCK_HDMI as boostable clock See: raspberrypi/linux#5016 - firmware: dtblob: Use a cached alias to reduce boot time - firmware: hdmi: Reduce the number of EDID retries if hotplug is not detected - firmware: variants: Add mjpg_encode to the standard firmware image - firmware: vcgencmd display_power and camera_auto_detect fixes - firmware: arm_loader_dvfs: Only add clocks to boostable list when they have been boosted See: #1726 - firmware: arm_dt: Try upstream DTB files if downstream absent - firmware: arm_loader: Delay the USB controller switchover - firmware: Fix for vc_image YUYV family to YUV422 planar conversion function - firmware: arm_loader_dvfs: Only add clocks to boostable list when they have been boosted See: #1726 - firmware: arm_dt: Try upstream DTB files if downstream absent - firmware: arm_loader: Delay the USB controller switchover - firmware: Fix for vc_image YUYV family to YUV422 planar conversion function - firmware: arm_dt: camera_auto_detect cam0 flag needs to look at Unicam instance, not port - firmware: platform: over-voltage Zero 2 W by two pips See: #1723 - firmware: hello_pi: Fix some build issues See: #1728 - firmware: video_decode: Stop decode on a colourspace change See: raspberrypi/linux#5059 - firmware: video_encode: Fix subsample image alignment assert - firmware: tc358762_DSI: Don't start the PV and DSI before the HVS - firmware: arm-dt: Export log buffer addresses to /proc/chosen/log - firmware: arm_loader: Fix GET_CLOCKS to not overwrite client buffer See: #1688 - firmware: arm_loader: Declare program_sdhost_use_dma - firmware: arm_loader: initramfs over NVME fix See: #1731 - firmware: Disable BT flow control pins for Pi3 rev1.3 - firmware: power: Fix failover to secondary PMIC interface functions See: https://forums.raspberrypi.com/viewtopic.php?t=338429 - firmware: arm_loader: Correct GPIO expander initial state via SET_GPIO_CONFIG See: raspberrypi/linux#5107 - firmware: platform: Set min_frequency for HDMI SM clock on Pi0-3 - firmware: arm_loader: Never set warranty bit See: #1741 - firmware: vcfw: camera_subsystem: Fix loop counter for powering up devices See: https://forums.raspberrypi.com/viewtopic.php?t=338917 - firmware: ldconfig: Add [cm4s] conditional - firmware: Fix USB boot See: #1744 - firmware: video decode/MJPEG fixes See: http://git/vc4/vc4/-/merge_requests/1548 - firmware: power: Restore VEC and PIXEL clocks after HDMI domain power cycle See: raspberrypi/linux#4962 - firmware: isp: Workaround for very unpleasant artifacts in the sharpening block - firmware: arm_loader: Raise maximum gzipped kernel size - firmware: arm-loader: Indicate tryboot status via /proc/device-tree/chosen/bootloader/tryboot - firmware: arm_loader: Increase TFTP block size to 1468 bytes See: raspberrypi/rpi-eeprom#375 - firmware: Add kernel= logging - firmware: camera_auto_detect changes See: #1750 - firmware: board_info: Fix Pi 400 PHY addresses See: #1754 - firmware: il: isp: Correct order buffers were returned in - firmware: isp: Run ISP without hi-res output buffer - firmware: arm_dt: Export the bootloader EEPROM RSA public key via device-tree - firmware: Add tryboot A_B mode - firmware: ldconfig: Add all, none, tryboot section support to autoboot.txt for start.elf - firmware: arm-dt: bootloader: Pass the original partition number when booting a ramdisk - firmware: arm_loader: HAT EEPROM support for GPIO bank 1 See: #1756 - firmware: arm_loader: Add vcmailbox support for 256bit OTP customer device key See: raspberrypi/usbboot#163 - firmware: il: video_encode: MJPEG is not conditional on being RASPBERRYPI_FULL - firmware: arm_loader: Improvements to Compute Module audio See: https://forums.raspberrypi.com/viewtopic.php?p=2052680 - firmware: arm_loader: Fix GPIO bank 1 support See: #1756 - firmware: arm_loader: PWM1 is not available on GPIO 45 - firmware: power: Always read the uncached voltage for AIN and USB_PD See: https://forums.raspberrypi.com/viewtopic.php?p=2059832#p2059832 - firmware: Use new SDHCI controller instead of legacy arasan See: #1763 - firmware: Add D flag to video= cmdline option when hotplug is forced - firmware: Actually rebuild firmware described in previous commit - firmware: hdmi_2711: Make some clock setup unconditional so booting without hdmi setup is possible - firmware: arm_dispmanx: Correct support for NV21, and add support for YV16 See: #1767 - firmware: arm_dispmanx: Fix FKMS to adopt pre-multiplied alpha See: #1773 - firmware: il isp: Correct histogram masks for updated group 2 regions - firmware: video_decode: Convert the active lines, not the padded buffer - firmware: bootloader: Raise CMA cap to 512MB on a 64-bit Pi4 - firmware: bootloader: Prefer 64-bit kernels on Pi 4s See: https://forums.raspberrypi.com/viewtopic.php?p=2088935#p2088935 - firmware: platform: clocks: Replace m2mc with hdmi for state machine clock on 2711 - firmware: bootloader: Fix automatic 64bit selection on Pi3s See: https://forums.raspberrypi.com/viewtopic.php?p=2089764#p2089764 - firmware: Handle 64-bitness of named kernels See: #1792 - firmware: gencmd: Add a fallback to mailbox interface if vchiq is not available - firmware: arm_loader: Set local-bd-address if 6 zeroes found - firmware: arm_loader: Really check for a zero local-bd-address See: raspberrypi/linux#5437 - firmware: arm_dt: Don't overwrite existing i2c aliases See: raspberrypi/linux#5428 - firmware: arm_loader: Reduce CMA warning severity See: #1807
I got this error with my RPi3 using 'dtoverlay=vc4-kms-v3d' (on bullseye)
I'm using 'hdmi_mode=4' in config.txt
It boots up fine (HDMI monitor is on)
but when i turn the monitor off and on again i don't get a picture anymore, until i do a hard reset (pull power off)
So i'm currently using 'dtoverlay=vc4-fkms-v3d' where this doesn't happen.
The text was updated successfully, but these errors were encountered: