diff mbox series

[U-Boot] video: sunxi: de2: fix SimpleFB node creation when DE2 not probed

Message ID 20180727155053.32657-1-icenowy@aosc.io
State Accepted
Commit b29712e941e15c8385cf8f0347b165c148b133bc
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series [U-Boot] video: sunxi: de2: fix SimpleFB node creation when DE2 not probed | expand

Commit Message

Icenowy Zheng July 27, 2018, 3:50 p.m. UTC
Sometimes when a monitor without EDID information is plugged, the DE2
won't be probed (because of lack of timing information), but the HDMI
node is probed, thus a SimpleFB node with invalid information will be
populated.

Also detect whether DE2 is probed when creating SimpleFB node.

Fixes: be5b96f0e411 ("sunxi: setup simplefb for Allwinner DE2")
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
 drivers/video/sunxi/sunxi_de2.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Maxime Ripard July 30, 2018, 7:44 a.m. UTC | #1
On Fri, Jul 27, 2018 at 11:50:53PM +0800, Icenowy Zheng wrote:
> Sometimes when a monitor without EDID information is plugged, the DE2
> won't be probed (because of lack of timing information), but the HDMI
> node is probed, thus a SimpleFB node with invalid information will be
> populated.
> 
> Also detect whether DE2 is probed when creating SimpleFB node.
> 
> Fixes: be5b96f0e411 ("sunxi: setup simplefb for Allwinner DE2")
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>

Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>

Maxime
Jagan Teki July 31, 2018, 6:09 a.m. UTC | #2
On Mon, Jul 30, 2018 at 1:14 PM, Maxime Ripard
<maxime.ripard@bootlin.com> wrote:
> On Fri, Jul 27, 2018 at 11:50:53PM +0800, Icenowy Zheng wrote:
>> Sometimes when a monitor without EDID information is plugged, the DE2
>> won't be probed (because of lack of timing information), but the HDMI
>> node is probed, thus a SimpleFB node with invalid information will be
>> populated.
>>
>> Also detect whether DE2 is probed when creating SimpleFB node.
>>
>> Fixes: be5b96f0e411 ("sunxi: setup simplefb for Allwinner DE2")
>> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>
> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>

Applied to u-boot-sunxi
diff mbox series

Patch

diff --git a/drivers/video/sunxi/sunxi_de2.c b/drivers/video/sunxi/sunxi_de2.c
index 4ed035d556..8333ddc44c 100644
--- a/drivers/video/sunxi/sunxi_de2.c
+++ b/drivers/video/sunxi/sunxi_de2.c
@@ -347,6 +347,9 @@  int sunxi_simplefb_setup(void *blob)
 	if (ret) {
 		debug("DE2 not present\n");
 		return 0;
+	} else if (!device_active(de2)) {
+		debug("DE2 present but not probed\n");
+		return 0;
 	}
 
 	ret = uclass_find_device_by_name(UCLASS_DISPLAY,