efifb: Check efifb_pci_dev before using it
Subsystems (2)
PATCH 1/1 efifb: Check efifb_pci_dev before using it
On some platforms like Hyper-V and RPi4 with UEFI firmware, efifb is not a PCI device.
So make sure efifb_pci_dev is found before using it.
--- drivers/video/fbdev/efifb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/video/fbdev/efifb.c +4 -2
@@ -575,7 +575,8 @@ static int efifb_probe(struct platform_device *dev) goto err_fb_dealoc; }fb_info (info,"%s frame buffer device\n" , info->fix.id); -pm_runtime_get_sync (&efifb_pci_dev->dev); +if (efifb_pci_dev) +pm_runtime_get_sync (&efifb_pci_dev->dev);return 0 ; err_fb_dealoc:
@@ -602,7 +603,8 @@ static int efifb_remove(struct platform_device *pdev)unregister_framebuffer (info);sysfs_remove_groups (&pdev->dev.kobj, efifb_groups);framebuffer_release (info); -pm_runtime_put (&efifb_pci_dev->dev); +if (efifb_pci_dev) +pm_runtime_put (&efifb_pci_dev->dev);return 0 ; }
Signature · 1 line
2.30.2
Quoted 9 lines · Kai-Heng Feng
On some platforms like Hyper-V and RPi4 with UEFI firmware, efifb is not a PCI device.
So make sure
efifb_pci_devis found before using it.Fixes a6c0fd3d5a8b ("efifb: Ensure graphics device for efifb stays at PCI D0")Signed-off-by Kai-Heng Feng <[email protected]>
Quoted 31 lines
--- drivers/video/fbdev/efifb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/video/fbdev/efifb.c +4
-3@@ -575,7 +575,8 @@ static int efifb_probe(struct platform_device *dev) goto err_fb_dealoc; }fb_info (info,"%s frame buffer device\n" , info->fix.id); -pm_runtime_get_sync (&efifb_pci_dev->dev); +if (efifb_pci_dev) +pm_runtime_get_sync (&efifb_pci_dev->dev);return 0 ; err_fb_dealoc:@@ -602,7 +603,8 @@ static int efifb_remove(struct platform_device *pdev)unregister_framebuffer (info);sysfs_remove_groups (&pdev->dev.kobj, efifb_groups);framebuffer_release (info); -pm_runtime_put (&efifb_pci_dev->dev); +if (efifb_pci_dev) +pm_runtime_put (&efifb_pci_dev->dev);return 0 ; } --2.30.2
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 7 lines · Alex Deucher
Quoted 4 lines · Kai-Heng Feng
On some platforms like Hyper-V and RPi4 with UEFI firmware, efifb is not a PCI device.
Quoted 7 lines
Quoted 5 lines
So make sure
efifb_pci_devis found before using it.Fixes a6c0fd3d5a8b ("efifb: Ensure graphics device for efifb stays at PCI D0")Signed-off-by Kai-Heng Feng <[email protected]>Reviewed-by Alex Deucher <[email protected]>
fbdev is in drm-misc, so maybe you can push this one too? -Daniel
Quoted 40 lines
Quoted 32 lines
--- drivers/video/fbdev/efifb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/video/fbdev/efifb.c +4
-3@@ -575,7 +575,8 @@ static int efifb_probe(struct platform_device *dev) goto err_fb_dealoc; }fb_info (info,"%s frame buffer device\n" , info->fix.id); -pm_runtime_get_sync (&efifb_pci_dev->dev); +if (efifb_pci_dev) +pm_runtime_get_sync (&efifb_pci_dev->dev);return 0 ; err_fb_dealoc:@@ -602,7 +603,8 @@ static int efifb_remove(struct platform_device *pdev)unregister_framebuffer (info);sysfs_remove_groups (&pdev->dev.kobj, efifb_groups);framebuffer_release (info); -pm_runtime_put (&efifb_pci_dev->dev); +if (efifb_pci_dev) +pm_runtime_put (&efifb_pci_dev->dev);return 0 ; } --2.30.2
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 11 lines · Daniel Vetter
Quoted 9 lines · Alex Deucher
Quoted 6 lines · Kai-Heng Feng
On some platforms like Hyper-V and RPi4 with UEFI firmware, efifb is not a PCI device.
So make sure
efifb_pci_devis found before using it.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Fixes a6c0fd3d5a8b ("efifb: Ensure graphics device for efifb stays at PCI D0")Signed-off-by Kai-Heng Feng <[email protected]>Reviewed-by Alex Deucher <[email protected]>fbdev is in drm-misc, so maybe you can push this one too?
Yes, pushed. Thanks!
Alex
Quoted 45 lines
-Daniel
Quoted 32 lines
Quoted 32 lines
--- drivers/video/fbdev/efifb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/video/fbdev/efifb.c +4
-3@@ -575,7 +575,8 @@ static int efifb_probe(struct platform_device *dev) goto err_fb_dealoc; }fb_info (info,"%s frame buffer device\n" , info->fix.id); -pm_runtime_get_sync (&efifb_pci_dev->dev); +if (efifb_pci_dev) +pm_runtime_get_sync (&efifb_pci_dev->dev);return 0 ; err_fb_dealoc:@@ -602,7 +603,8 @@ static int efifb_remove(struct platform_device *pdev)unregister_framebuffer (info);sysfs_remove_groups (&pdev->dev.kobj, efifb_groups);framebuffer_release (info); -pm_runtime_put (&efifb_pci_dev->dev); +if (efifb_pci_dev) +pm_runtime_put (&efifb_pci_dev->dev);return 0 ; } --2.30.2
Quoted 8 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 4 lines
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 17 lines · Alex Deucher
Quoted 15 lines · Daniel Vetter
Quoted 13 lines · Alex Deucher
Quoted 9 lines · Kai-Heng Feng
On some platforms like Hyper-V and RPi4 with UEFI firmware, efifb is not a PCI device.
So make sure
efifb_pci_devis found before using it.Fixes a6c0fd3d5a8b ("efifb: Ensure graphics device for efifb stays at PCI D0")Signed-off-by Kai-Heng Feng <[email protected]>
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Reviewed-by Alex Deucher <[email protected]>fbdev is in drm-misc, so maybe you can push this one too?
Yes, pushed. Thanks!
Can we have this pushed into the branch that gets merged into linux-next. I still don't see this fix in -next and we are unable to do testing on our platform as we hit a boot crash without this as reported in [1]. We prefer running tests on -next without any additional patches or reverts, hence the nagging, sorry for that.
Regards,
Sudeep