linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] drm/radeon: Call radeon_suspend_kms() in radeon_pci_shutdown() for Loongson64
@ 2021-06-09  3:55 Tiezhu Yang
  2021-06-23  8:14 ` Tiezhu Yang
  0 siblings, 1 reply; 3+ messages in thread
From: Tiezhu Yang @ 2021-06-09  3:55 UTC (permalink / raw)
  To: Alex Deucher, christian.koenig, David Airlie, Daniel Vetter
  Cc: amd-gfx, dri-devel, linux-kernel, Xuefeng Li, Jianmin Lv

On the Loongson64 platform used with Radeon GPU, shutdown or reboot failed
when console=tty is in the boot cmdline.

radeon_suspend_kms() puts the hw in the suspend state, especially set fb
state as FBINFO_STATE_SUSPENDED:

	if (fbcon) {
		console_lock();
		radeon_fbdev_set_suspend(rdev, 1);
		console_unlock();
	}

Then avoid to do any more fb operations in the related functions:

	if (p->state != FBINFO_STATE_RUNNING)
		return;

So call radeon_suspend_kms() in radeon_pci_shutdown() for Loongson64 to fix
this issue, it looks like some kind of workaround like powerpc.

Co-developed-by: Jianmin Lv <lvjianmin@loongson.cn>
Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---

v3: Fix typo "becauase" in the original comment

 drivers/gpu/drm/radeon/radeon_drv.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index efeb115..40aece3 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -386,13 +386,13 @@ radeon_pci_shutdown(struct pci_dev *pdev)
 	if (radeon_device_is_virtual())
 		radeon_pci_remove(pdev);
 
-#ifdef CONFIG_PPC64
+#if defined(CONFIG_PPC64) || defined(CONFIG_MACH_LOONGSON64)
 	/*
 	 * Some adapters need to be suspended before a
 	 * shutdown occurs in order to prevent an error
-	 * during kexec.
-	 * Make this power specific becauase it breaks
-	 * some non-power boards.
+	 * during kexec, shutdown or reboot.
+	 * Make this power and Loongson specific because
+	 * it breaks some other boards.
 	 */
 	radeon_suspend_kms(pci_get_drvdata(pdev), true, true, false);
 #endif
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] drm/radeon: Call radeon_suspend_kms() in radeon_pci_shutdown() for Loongson64
  2021-06-09  3:55 [PATCH v3] drm/radeon: Call radeon_suspend_kms() in radeon_pci_shutdown() for Loongson64 Tiezhu Yang
@ 2021-06-23  8:14 ` Tiezhu Yang
  2021-06-23  8:25   ` Christian König
  0 siblings, 1 reply; 3+ messages in thread
From: Tiezhu Yang @ 2021-06-23  8:14 UTC (permalink / raw)
  To: alexander.deucher, christian.koenig
  Cc: yangtiezhu, airlied, amd-gfx, daniel, dri-devel, linux-kernel,
	lixuefeng, lvjianmin

Hi Alex and Christian,

Any comments?
Can this patch be accepted or anything else I need to improve?

https://lore.kernel.org/patchwork/patch/1443649/

Thanks,
Tiezhu


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] drm/radeon: Call radeon_suspend_kms() in radeon_pci_shutdown() for Loongson64
  2021-06-23  8:14 ` Tiezhu Yang
@ 2021-06-23  8:25   ` Christian König
  0 siblings, 0 replies; 3+ messages in thread
From: Christian König @ 2021-06-23  8:25 UTC (permalink / raw)
  To: Tiezhu Yang, alexander.deucher
  Cc: airlied, amd-gfx, daniel, dri-devel, linux-kernel, lixuefeng, lvjianmin

Looks good to me.

Somebody could try to investigate further why that is necessary on the 
platform, but radeon is only in maintenance mode without new feature 
developed.

Regards,
Christian.

Am 23.06.21 um 10:14 schrieb Tiezhu Yang:
> Hi Alex and Christian,
>
> Any comments?
> Can this patch be accepted or anything else I need to improve?
>
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Fpatchwork%2Fpatch%2F1443649%2F&amp;data=04%7C01%7Cchristian.koenig%40amd.com%7C2162309822114d2e41b108d9361ef26c%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637600328822651335%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=2uxyAGk6sHO3lqw0FX6HITY%2Fbj%2BzEMfSIcqbzmiguMs%3D&amp;reserved=0 
>
>
> Thanks,
> Tiezhu
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-23  8:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09  3:55 [PATCH v3] drm/radeon: Call radeon_suspend_kms() in radeon_pci_shutdown() for Loongson64 Tiezhu Yang
2021-06-23  8:14 ` Tiezhu Yang
2021-06-23  8:25   ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).