Bug#1022025: two reverts required, submitted to stable review list

2022-10-21 Thread Dan Coleman
On Fri, 21 Oct 2022 13:51:48 + Dan Coleman  wrote:
 > Thanks for sending them! No need for the binary packages, I mostly just want 
 > to see if I can successfully apply patches and get a working kernel.

The patches work! I booted into the new kernel just fine.



Bug#1022025: two reverts required, submitted to stable review list

2022-10-21 Thread Dan Coleman
Thanks for sending them! No need for the binary packages, I mostly just want to 
see if I can successfully apply patches and get a working kernel.

On 10/21/22 08:42 AM, Salvatore Bonaccorso wrote:
> Hi,
>
> On Fri, Oct 21, 2022 at 12:55:09PM +, Dan Coleman wrote:
>> Hey,
>>
>>   > On Thursday, 20 October 2022 22:10:27 CEST Salvatore Bonaccorso wrote:
>>
>>   > > So there are two patches who need to be reverted:
>>   > >
>>   > > 
>> https://lore.kernel.org/stable/20221020153857.565160-1-alexander.deuc...@amd.com/
>>   > > 
>> https://lore.kernel.org/stable/20221020153857.565160-2-alexander.deuc...@amd.com/
>>
>>
>> How do I apply these patches to see if they work for me? Thus far in
>> this bug, I've just seen .patch files.
> Here are those as patches.
>
> If you trust unsigned binary packages build I would put somehwere I
> can provide you those with those two applied. But again, after testing
> make sure you reinstall the meta package and go back to the -18
> version.
>
> Regards,
> Salvatore



Bug#1022025: two reverts required, submitted to stable review list

2022-10-21 Thread Salvatore Bonaccorso
Hi,

On Fri, Oct 21, 2022 at 12:55:09PM +, Dan Coleman wrote:
> Hey,
> 
>  > On Thursday, 20 October 2022 22:10:27 CEST Salvatore Bonaccorso wrote:
> 
>  > > So there are two patches who need to be reverted:
>  > >
>  > > 
> https://lore.kernel.org/stable/20221020153857.565160-1-alexander.deuc...@amd.com/
>  > > 
> https://lore.kernel.org/stable/20221020153857.565160-2-alexander.deuc...@amd.com/
> 
> 
> How do I apply these patches to see if they work for me? Thus far in
> this bug, I've just seen .patch files.

Here are those as patches.

If you trust unsigned binary packages build I would put somehwere I
can provide you those with those two applied. But again, after testing
make sure you reinstall the meta package and go back to the -18
version.

Regards,
Salvatore
From: Alex Deucher 
Date: Thu, 20 Oct 2022 11:38:56 -0400
Subject: Revert "drm/amdgpu: move nbio sdma_doorbell_range() into sdma code
 for vega"
Origin: https://lore.kernel.org/stable/20221020153857.565160-1-alexander.deuc...@amd.com/
Bug-Debian: https://bugs.debian.org/1022025

This reverts commit 9f55f36f749a7608eeef57d7d72991a9bd557341.

This patch was backported incorrectly when Sasha backported it and
the patch that caused the regression that this patch set fixed
was reverted in commit 412b844143e3 ("Revert "PCI/portdrv: Don't disable AER reporting in get_port_device_capability()"").
This isn't necessary and causes a regression so drop it.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2216
Cc: Shuah Khan 
Cc: Sasha Levin 
Signed-off-by: Alex Deucher 
Cc: # 5.10
Tested-By: Diederik de Haas 
---
 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 = >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 = >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.37.2

From: Alex Deucher 
Date: Thu, 20 Oct 2022 11:38:57 -0400
Subject: Revert "drm/amdgpu: make sure to init common IP before gmc"
Origin: https://lore.kernel.org/stable/20221020153857.565160-2-alexander.deuc...@amd.com/
Bug-Debian: https://bugs.debian.org/1022025

This reverts commit 7b0db849ea030a70b8fb9c9afec67c81f955482e.

The patches that this patch depends on were not backported properly
and the patch that caused the regression that this patch set fixed
was reverted in commit 412b844143e3 ("Revert "PCI/portdrv: Don't disable AER reporting in get_port_device_capability()"").
This isn't necessary and causes a regression so drop it.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2216
Cc: Shuah Khan 
Cc: Sasha Levin 
Signed-off-by: Alex Deucher 
Cc: # 5.10
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 14 +++---
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 881045e600af..bde0496d2f15 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ 

Bug#1022025: two reverts required, submitted to stable review list

2022-10-21 Thread Dan Coleman
Hey,

 > On Thursday, 20 October 2022 22:10:27 CEST Salvatore Bonaccorso wrote:

 > > So there are two patches who need to be reverted:
 > >
 > > https://lore.kernel.org/stable/20221020153857.565160-1-alexander.deuc...@amd.com/
 > > https://lore.kernel.org/stable/20221020153857.565160-2-alexander.deuc...@amd.com/


How do I apply these patches to see if they work for me? Thus far in this bug, 
I've just seen .patch files.



Bug#1022025: two reverts required, submitted to stable review list

2022-10-21 Thread Doublychargedhiggs
Confirmed, the two patches work for me too (AMD Ryzen Embedded V1605B with 
Radeon Vega Gfx). 
Kernel rebuilt and now boots like a charm and works without further issues. 
Thanks to all of you!!



Bug#1022025: two reverts required, submitted to stable review list

2022-10-20 Thread Diederik de Haas
On Thursday, 20 October 2022 22:10:27 CEST Salvatore Bonaccorso wrote:
> So there are two patches who need to be reverted:
> 
> https://lore.kernel.org/stable/20221020153857.565160-1-alexander.deuc...@amd.com/
> https://lore.kernel.org/stable/20221020153857.565160-2-alexander.deuc...@amd.com/

https://lore.kernel.org/stable/2651645.mvXUDI8C0e@bagend/ is where I indicated
that applying those 2 patches (IOW reverting 2 commits) fixes the issue for me.

https://mateloos.be/~diederik/kernel/fix-stable-amdgpu-issue-bug-1022025/
is where I uploaded the *.deb files I build. (They'll be removed shortly again)

HTH,
  Diederik

signature.asc
Description: This is a digitally signed message part.


Bug#1022025: two reverts required, submitted to stable review list

2022-10-20 Thread Salvatore Bonaccorso
Hi all,

On Thu, Oct 20, 2022 at 07:41:51PM +, Doublychargedhiggs wrote:
> Did the same as Dan, i.e built the kernel (apt-get install source) with the 
> upstream proposed patch
> 0001-drm-amdgpu-fix-sdma-doorbell-init-ordering-on-APUs.patch
> using the mentioned test-patches script. The kernel really builds, is even 
> installable, but then hangs
> as before at boot, as Dan reported before.
> 
> However, i'm even less experienced kernel builder than Dan (my 1st kernel 
> build ever)... 

So there are two patches who need to be reverted:

https://lore.kernel.org/stable/20221020153857.565160-1-alexander.deuc...@amd.com/
https://lore.kernel.org/stable/20221020153857.565160-2-alexander.deuc...@amd.com/

Salvatore