diff mbox series

[1/1] UBUNTU: SAUCE: efifb: Ensure graphics device for efifb stays at PCI D0

Message ID 20210203164100.1679886-2-kai.heng.feng@canonical.com
State New
Headers show
Series Fix broken efifb on graphics device without driver | expand

Commit Message

Kai-Heng Feng Feb. 3, 2021, 4:41 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1914411

We are seeing root ports on some desktop boards support D3cold for
discrete graphics card. So when efifb is in use while graphics device
isn't bound to a driver, PCI and ACPI will put the graphics to D3cold
when runtime suspend kicks in, makes efifb stop working.

So ensure the graphics device won't be runtime suspended, to keep efifb
work all the time.

Link: https://lore.kernel.org/linux-fbdev/20210129084327.986630-1-kai.heng.feng@canonical.com/
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 drivers/video/fbdev/efifb.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Kleber Sacilotto de Souza Feb. 11, 2021, 10:20 a.m. UTC | #1
On 03.02.21 17:41, Kai-Heng Feng wrote:
> BugLink: https://bugs.launchpad.net/bugs/1914411
> 
> We are seeing root ports on some desktop boards support D3cold for
> discrete graphics card. So when efifb is in use while graphics device
> isn't bound to a driver, PCI and ACPI will put the graphics to D3cold
> when runtime suspend kicks in, makes efifb stop working.
> 
> So ensure the graphics device won't be runtime suspended, to keep efifb
> work all the time.
> 
> Link: https://lore.kernel.org/linux-fbdev/20210129084327.986630-1-kai.heng.feng@canonical.com/
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

> ---
>   drivers/video/fbdev/efifb.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
> index e57c00824965..19edd7206409 100644
> --- a/drivers/video/fbdev/efifb.c
> +++ b/drivers/video/fbdev/efifb.c
> @@ -16,6 +16,7 @@
>   #include <linux/platform_device.h>
>   #include <linux/printk.h>
>   #include <linux/screen_info.h>
> +#include <linux/pm_runtime.h>
>   #include <video/vga.h>
>   #include <asm/efi.h>
>   #include <drm/drm_utils.h> /* For drm_get_panel_orientation_quirk */
> @@ -575,6 +576,7 @@ 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);
>   	return 0;
>   
>   err_fb_dealoc:
> @@ -601,6 +603,7 @@ 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);
>   
>   	return 0;
>   }
>
Marcelo Henrique Cerri Feb. 11, 2021, 12:53 p.m. UTC | #2
Acked-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>

On Thu, Feb 04, 2021 at 12:41:00AM +0800, Kai-Heng Feng wrote:
> BugLink: https://bugs.launchpad.net/bugs/1914411
> 
> We are seeing root ports on some desktop boards support D3cold for
> discrete graphics card. So when efifb is in use while graphics device
> isn't bound to a driver, PCI and ACPI will put the graphics to D3cold
> when runtime suspend kicks in, makes efifb stop working.
> 
> So ensure the graphics device won't be runtime suspended, to keep efifb
> work all the time.
> 
> Link: https://lore.kernel.org/linux-fbdev/20210129084327.986630-1-kai.heng.feng@canonical.com/
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
>  drivers/video/fbdev/efifb.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
> index e57c00824965..19edd7206409 100644
> --- a/drivers/video/fbdev/efifb.c
> +++ b/drivers/video/fbdev/efifb.c
> @@ -16,6 +16,7 @@
>  #include <linux/platform_device.h>
>  #include <linux/printk.h>
>  #include <linux/screen_info.h>
> +#include <linux/pm_runtime.h>
>  #include <video/vga.h>
>  #include <asm/efi.h>
>  #include <drm/drm_utils.h> /* For drm_get_panel_orientation_quirk */
> @@ -575,6 +576,7 @@ 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);
>  	return 0;
>  
>  err_fb_dealoc:
> @@ -601,6 +603,7 @@ 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);
>  
>  	return 0;
>  }
> -- 
> 2.29.2
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
diff mbox series

Patch

diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
index e57c00824965..19edd7206409 100644
--- a/drivers/video/fbdev/efifb.c
+++ b/drivers/video/fbdev/efifb.c
@@ -16,6 +16,7 @@ 
 #include <linux/platform_device.h>
 #include <linux/printk.h>
 #include <linux/screen_info.h>
+#include <linux/pm_runtime.h>
 #include <video/vga.h>
 #include <asm/efi.h>
 #include <drm/drm_utils.h> /* For drm_get_panel_orientation_quirk */
@@ -575,6 +576,7 @@  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);
 	return 0;
 
 err_fb_dealoc:
@@ -601,6 +603,7 @@  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);
 
 	return 0;
 }