-
Notifications
You must be signed in to change notification settings - Fork 5.2k
vc4-kms: Rework HPD #4716
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
vc4-kms: Rework HPD #4716
Conversation
@6by9 tested at the weekend and cec was fine, and after switching off the TV, it (or receiver) didn't switch back on. |
As discussed with @mripard in #4371, reinstating the ddc_probe will break scrambling being reset after power off if the monitor still reports the EDID, therefore it is not a solution. #4371 (comment) |
Yeah, I think we need to figure out what happens on the CEC bus in such a case to find a good solution |
Looking at those logs confirms that the AVR deasserts HPD, but the EDID is still readable.
in the 5.10 kernel logs, vs numerous
messages in the normal log ie the IRQ has triggered, but no change has been reported, presumably as it read the EDID. In both Kodi logs we have: With PR
Without PR
Does the AVR turn back on if Kodi isn't running? Is it the kernel actions, or related to having CEC active? If you disconnect the HDMI lead from the Pi, turn the AVR and TV off, then plug back in, does the AVR/TV wake up? I'm definitely agreeing with mripard though - reinstating that ddc_probe is the wrong solution and will cause issues with scrambling. This looks to be a CEC connection issue that the ddc_probe was masking. |
Kodi has done it
HDMI 1.4 spec. Supplement 1. CEC Table 8 Message Descriptions for the One Touch Play Feature The TV and CEC switch have therefore done the appropriate thing and come out of standby. |
This will be libcec rather than kodi. I'm guessing it is thinking things have powered on (rather than off) and is sending the active source. But we weren't really powering on. |
A backtrace in The log lines just before the are
I don't see that vendor command triggering an message or power status change, but it's also not easy to follow the flow from just reading the source. |
No.
TV and AVR on. Disconnected HDMI lead. Switched off TV (AVR switched off automatically). Plugged back in hdmi and TV and AVR came on automatically. |
|
Why libcec has specific handling for this Panasonic specific vendor command is odd, but it seems to date back to I'll hook the LG up again with a LibreElec image and see what it does. |
So the LG uses a different command handler in the src/libcec/implementations directory - these appear to be the vendor specific implementations, and https://github.com/Pulse-Eight/libcec/blob/master/src/libcec/devices/CECBusDevice.cpp#L198 chooses which one based on the vendor. Looking at the cec-ctl logs when connecting a powered off TV and AVR to the Pi, the LibCEC powers both up immediately without receiving any messages from either.
IMAGE_VIEW_ON and ACTIVE_SOURCE oblige the TV to wake up. There is a Kodi option called something like "Wake devices up on startup", which may be what is causing libcec to be tricked by the HPD signal. |
The existing logic was flawed in that it could try reading the 2711 specific registers for HPD on a CM1/3 where the HPD GPIO hadn't been defined in DT. Ensure we don't do the 2711 register read on invalid hardware, and then Signed-off-by: Dave Stevenson <[email protected]>
Rebased and dropped patch 2 (adding back the ddc_probe). @mripard could you give a quick review to ensure you agree with these? |
The code looks good to me Your second patch is going to conflict with https://lore.kernel.org/dri-devel/[email protected]/ Both are serving a similar purpose, but the upstream one is probably going to be easier to deal with when rebasing? Anyway, your call :) |
OK, I'll drop patch 2 as your version (which it looks like I still need to review!) does do the same job. It was only a cleanup anyway. |
Patch 2 dropped. Good to go it seems. |
See: raspberrypi/linux#4736 kernel: vc4-kms: Rework HPD See: raspberrypi/linux#4716 kernel: drm/vc4: Add support for composite syncs to vc4_dpi See: raspberrypi/linux#4733 kernel: Pass V4L2_CID_MPEG_VIDEO_H264_MIN_QP/MAX_QP to bcm2835-v4l2-codec See: raspberrypi/linux#4705 kernel: media: i2c: ov5647: Support HFLIP and VFLIP See: raspberrypi/linux#4731 kernel: drivers: bcm2835_isp: Fix div by 0 bug See: raspberrypi/linux#4732 kernel: drivers: bcm2835_isp: Allow multiple users for the ISP driver. See: raspberrypi/linux#4709 kernel: ARM: dts: Update rpi-400 and cm4 dts to match 4-b kernel: ARM: dts: gpio-ranges property is now required See: https://forums.raspberrypi.com/viewtopic.php?t=324585 kernel: ARM: dts: bcm2711: Fix PCIe interrupts See: raspberrypi/linux#4666
See: raspberrypi/linux#4736 kernel: vc4-kms: Rework HPD See: raspberrypi/linux#4716 kernel: drm/vc4: Add support for composite syncs to vc4_dpi See: raspberrypi/linux#4733 kernel: Pass V4L2_CID_MPEG_VIDEO_H264_MIN_QP/MAX_QP to bcm2835-v4l2-codec See: raspberrypi/linux#4705 kernel: media: i2c: ov5647: Support HFLIP and VFLIP See: raspberrypi/linux#4731 kernel: drivers: bcm2835_isp: Fix div by 0 bug See: raspberrypi/linux#4732 kernel: drivers: bcm2835_isp: Allow multiple users for the ISP driver. See: raspberrypi/linux#4709 kernel: ARM: dts: Update rpi-400 and cm4 dts to match 4-b kernel: ARM: dts: gpio-ranges property is now required See: https://forums.raspberrypi.com/viewtopic.php?t=324585 kernel: ARM: dts: bcm2711: Fix PCIe interrupts See: raspberrypi/linux#4666
This fixes the following trace: ================================================================== BUG: KASAN: slab-use-after-free in hci_conn_del+0xba/0x3a0 Write of size 8 at addr ffff88800208e9c8 by task iso-tester/31 CPU: 0 PID: 31 Comm: iso-tester Not tainted 6.3.0-rc2-g991aa4a69a47 #4716 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.1-2.fc36 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x1d/0x70 print_report+0xce/0x610 ? __virt_addr_valid+0xd4/0x150 ? hci_conn_del+0xba/0x3a0 kasan_report+0xdd/0x110 ? hci_conn_del+0xba/0x3a0 hci_conn_del+0xba/0x3a0 hci_conn_hash_flush+0xf2/0x120 hci_dev_close_sync+0x388/0x920 hci_unregister_dev+0x122/0x260 vhci_release+0x4f/0x90 __fput+0x102/0x430 task_work_run+0xf1/0x160 ? __pfx_task_work_run+0x10/0x10 ? mark_held_locks+0x24/0x90 exit_to_user_mode_prepare+0x170/0x180 syscall_exit_to_user_mode+0x19/0x50 do_syscall_64+0x4e/0x90 entry_SYSCALL_64_after_hwframe+0x70/0xda Fixes: 0f00cd3 ("Bluetooth: Free potentially unfreed SCO connection") Link: https://syzkaller.appspot.com/bug?extid=8bb72f86fc823817bc5d Cc: <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
commit 5dc7d23 upstream. This fixes the following trace: ================================================================== BUG: KASAN: slab-use-after-free in hci_conn_del+0xba/0x3a0 Write of size 8 at addr ffff88800208e9c8 by task iso-tester/31 CPU: 0 PID: 31 Comm: iso-tester Not tainted 6.3.0-rc2-g991aa4a69a47 #4716 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.1-2.fc36 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x1d/0x70 print_report+0xce/0x610 ? __virt_addr_valid+0xd4/0x150 ? hci_conn_del+0xba/0x3a0 kasan_report+0xdd/0x110 ? hci_conn_del+0xba/0x3a0 hci_conn_del+0xba/0x3a0 hci_conn_hash_flush+0xf2/0x120 hci_dev_close_sync+0x388/0x920 hci_unregister_dev+0x122/0x260 vhci_release+0x4f/0x90 __fput+0x102/0x430 task_work_run+0xf1/0x160 ? __pfx_task_work_run+0x10/0x10 ? mark_held_locks+0x24/0x90 exit_to_user_mode_prepare+0x170/0x180 syscall_exit_to_user_mode+0x19/0x50 do_syscall_64+0x4e/0x90 entry_SYSCALL_64_after_hwframe+0x70/0xda Fixes: 0f00cd3 ("Bluetooth: Free potentially unfreed SCO connection") Link: https://syzkaller.appspot.com/bug?extid=8bb72f86fc823817bc5d Cc: <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 5dc7d23 upstream. This fixes the following trace: ================================================================== BUG: KASAN: slab-use-after-free in hci_conn_del+0xba/0x3a0 Write of size 8 at addr ffff88800208e9c8 by task iso-tester/31 CPU: 0 PID: 31 Comm: iso-tester Not tainted 6.3.0-rc2-g991aa4a69a47 #4716 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.1-2.fc36 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x1d/0x70 print_report+0xce/0x610 ? __virt_addr_valid+0xd4/0x150 ? hci_conn_del+0xba/0x3a0 kasan_report+0xdd/0x110 ? hci_conn_del+0xba/0x3a0 hci_conn_del+0xba/0x3a0 hci_conn_hash_flush+0xf2/0x120 hci_dev_close_sync+0x388/0x920 hci_unregister_dev+0x122/0x260 vhci_release+0x4f/0x90 __fput+0x102/0x430 task_work_run+0xf1/0x160 ? __pfx_task_work_run+0x10/0x10 ? mark_held_locks+0x24/0x90 exit_to_user_mode_prepare+0x170/0x180 syscall_exit_to_user_mode+0x19/0x50 do_syscall_64+0x4e/0x90 entry_SYSCALL_64_after_hwframe+0x70/0xda Fixes: 0f00cd3 ("Bluetooth: Free potentially unfreed SCO connection") Link: https://syzkaller.appspot.com/bug?extid=8bb72f86fc823817bc5d Cc: <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
Patches 1 & 3 should probably be applied anyway, but patch 2 is for @popcornmix to test for his weird CEC/power cycling issue.