linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Revert "drm/amdgpu: move nbio sdma_doorbell_range() into sdma code for vega"
@ 2022-10-18  1:07 Shuah Khan
  2022-10-18  1:07 ` [PATCH] Revert "drm/amdgpu: use dirty framebuffer helper" Shuah Khan
  2022-10-18  6:52 ` [PATCH] Revert "drm/amdgpu: move nbio sdma_doorbell_range() into sdma code for vega" Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Shuah Khan @ 2022-10-18  1:07 UTC (permalink / raw)
  To: sashal, gregkh; +Cc: Shuah Khan, alexander.deucher, linux-kernel, stable

This reverts commit 9f55f36f749a7608eeef57d7d72991a9bd557341.

This commit causes repeated WARN_ONs from

drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amd
gpu_dm.c:7391 amdgpu_dm_atomic_commit_tail+0x23b9/0x2430 [amdgpu]

dmesg fills up with the following messages and drm initialization takes
a very long time.

Cc: <stable@vger.kernel.org>    # 5.10
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c |  5 -----
 drivers/gpu/drm/amd/amdgpu/soc15.c     | 25 +++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
index a1a8e026b9fa..1f2e2460e121 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
@@ -1475,11 +1475,6 @@ static int sdma_v4_0_start(struct amdgpu_device *adev)
 		WREG32_SDMA(i, mmSDMA0_CNTL, temp);
 
 		if (!amdgpu_sriov_vf(adev)) {
-			ring = &adev->sdma.instance[i].ring;
-			adev->nbio.funcs->sdma_doorbell_range(adev, i,
-				ring->use_doorbell, ring->doorbell_index,
-				adev->doorbell_index.sdma_doorbell_range);
-
 			/* unhalt engine */
 			temp = RREG32_SDMA(i, mmSDMA0_F32_CNTL);
 			temp = REG_SET_FIELD(temp, SDMA0_F32_CNTL, HALT, 0);
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index abd649285a22..7212b9900e0a 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -1332,6 +1332,25 @@ static int soc15_common_sw_fini(void *handle)
 	return 0;
 }
 
+static void soc15_doorbell_range_init(struct amdgpu_device *adev)
+{
+	int i;
+	struct amdgpu_ring *ring;
+
+	/* sdma/ih doorbell range are programed by hypervisor */
+	if (!amdgpu_sriov_vf(adev)) {
+		for (i = 0; i < adev->sdma.num_instances; i++) {
+			ring = &adev->sdma.instance[i].ring;
+			adev->nbio.funcs->sdma_doorbell_range(adev, i,
+				ring->use_doorbell, ring->doorbell_index,
+				adev->doorbell_index.sdma_doorbell_range);
+		}
+
+		adev->nbio.funcs->ih_doorbell_range(adev, adev->irq.ih.use_doorbell,
+						adev->irq.ih.doorbell_index);
+	}
+}
+
 static int soc15_common_hw_init(void *handle)
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
@@ -1351,6 +1370,12 @@ static int soc15_common_hw_init(void *handle)
 
 	/* enable the doorbell aperture */
 	soc15_enable_doorbell_aperture(adev, true);
+	/* HW doorbell routing policy: doorbell writing not
+	 * in SDMA/IH/MM/ACV range will be routed to CP. So
+	 * we need to init SDMA/IH/MM/ACV doorbell range prior
+	 * to CP ip block init and ring test.
+	 */
+	soc15_doorbell_range_init(adev);
 
 	return 0;
 }
-- 
2.34.1


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

* [PATCH] Revert "drm/amdgpu: use dirty framebuffer helper"
  2022-10-18  1:07 [PATCH] Revert "drm/amdgpu: move nbio sdma_doorbell_range() into sdma code for vega" Shuah Khan
@ 2022-10-18  1:07 ` Shuah Khan
  2022-10-18  6:52 ` [PATCH] Revert "drm/amdgpu: move nbio sdma_doorbell_range() into sdma code for vega" Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Shuah Khan @ 2022-10-18  1:07 UTC (permalink / raw)
  To: gregkh, sashal
  Cc: Shuah Khan, alexander.deucher, hamza.mahfooz, linux-kernel, stable

This reverts commit 867b2b2b6802fb3995a0065fc39e0e7e20d8004d.

With this commit, dmesg fills up with the following messages and drm
initialization takes a very long time. This commit has bee reverted
from 5.4

[drm] Fence fallback timer expired on ring sdma0
[drm] Fence fallback timer expired on ring gfx
[drm] Fence fallback timer expired on ring sdma0
[drm] Fence fallback timer expired on ring gfx
[drm] Fence fallback timer expired on ring sdma0
[drm] Fence fallback timer expired on ring sdma0
[drm] Fence fallback timer expired on ring sdma0
[drm] Fence fallback timer expired on ring gfx

Cc: <stable@vger.kernel.org>    # 5.10
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index 947f50e402ba..7cc7af2a6822 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -35,7 +35,6 @@
 #include <linux/pci.h>
 #include <linux/pm_runtime.h>
 #include <drm/drm_crtc_helper.h>
-#include <drm/drm_damage_helper.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_fb_helper.h>
@@ -499,7 +498,6 @@ bool amdgpu_display_ddc_probe(struct amdgpu_connector *amdgpu_connector,
 static const struct drm_framebuffer_funcs amdgpu_fb_funcs = {
 	.destroy = drm_gem_fb_destroy,
 	.create_handle = drm_gem_fb_create_handle,
-	.dirty = drm_atomic_helper_dirtyfb,
 };
 
 uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev,
-- 
2.34.1


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

* Re: [PATCH] Revert "drm/amdgpu: move nbio sdma_doorbell_range() into sdma code for vega"
  2022-10-18  1:07 [PATCH] Revert "drm/amdgpu: move nbio sdma_doorbell_range() into sdma code for vega" Shuah Khan
  2022-10-18  1:07 ` [PATCH] Revert "drm/amdgpu: use dirty framebuffer helper" Shuah Khan
@ 2022-10-18  6:52 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2022-10-18  6:52 UTC (permalink / raw)
  To: Shuah Khan; +Cc: sashal, alexander.deucher, linux-kernel, stable

On Mon, Oct 17, 2022 at 07:07:45PM -0600, Shuah Khan wrote:
> This reverts commit 9f55f36f749a7608eeef57d7d72991a9bd557341.
> 
> This commit causes repeated WARN_ONs from
> 
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amd
> gpu_dm.c:7391 amdgpu_dm_atomic_commit_tail+0x23b9/0x2430 [amdgpu]
> 
> dmesg fills up with the following messages and drm initialization takes
> a very long time.
> 
> Cc: <stable@vger.kernel.org>    # 5.10
> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
> ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c |  5 -----
>  drivers/gpu/drm/amd/amdgpu/soc15.c     | 25 +++++++++++++++++++++++++
>  2 files changed, 25 insertions(+), 5 deletions(-)

Both reverts now queued up, thanks.

greg k-h

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

end of thread, other threads:[~2022-10-18  6:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-18  1:07 [PATCH] Revert "drm/amdgpu: move nbio sdma_doorbell_range() into sdma code for vega" Shuah Khan
2022-10-18  1:07 ` [PATCH] Revert "drm/amdgpu: use dirty framebuffer helper" Shuah Khan
2022-10-18  6:52 ` [PATCH] Revert "drm/amdgpu: move nbio sdma_doorbell_range() into sdma code for vega" Greg KH

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).