Skip to contentSkip to conversation

amdgpu driver halted on suspend of shutdown

DISCUSSION 李真能 3 participants 4 messages Sep 29, 2021 – Sep 30, 2021

lore
Share & tools
lore

李真能

author
#0 lore raw

Hello:

        When I do loop  auto test of reboot, I found  kernel may halt on memcpy_fromio of amdgpu's amdgpu_uvd_suspend, so I remove suspend process in amdgpu_pci_shutdown, and it will fix this bug.

I have 3 questions to ask:

1. In amdgpu_pci_shutdown, the comment explains why we must execute suspend,  so I know VM will call amdgpu driver in which situations, as I know, VM's graphics card is a virtual card;

2. I see a path that is commited by Alex Deucher, the commit message is as follows:

drm/amdgpu: just suspend the hw on pci shutdown

We can't just reuse pci_remove as there may be userspace still doing things.

My question is:In which situations, there may be  userspace till doing things.

3. Why amdgpu driver is halted on memcpy_fromio of amdgpu_uvd_suspend, I haven't launch any video app during reboot test, is it the bug of pci bus?

Test environment:

CPU: arm64

Graphics card: r7340(amdgpu), rx550

OS: ubuntu 2004

#1 lore raw
Quoted 24 lines · 李真能

Hello:

When I do loop auto test of reboot, I found kernel may halt
on memcpy_fromio of amdgpu's amdgpu_uvd_suspend, so I remove suspend process in amdgpu_pci_shutdown, and it will fix this bug.

I have 3 questions to ask:

1. In amdgpu_pci_shutdown, the comment explains why we must execute suspend, so I know VM will call amdgpu driver in which situations, as I know, VM's graphics card is a virtual card;

2. I see a path that is commited by Alex Deucher, the commit message is as follows:

drm/amdgpu: just suspend the hw on pci shutdown

We can't just reuse pci_remove as there may be userspace still
doing things.

My question is:In which situations, there may be userspace till doing things.

Quoted 6 lines

3. Why amdgpu driver is halted on memcpy_fromio of amdgpu_uvd_suspend, I haven't launch any video app during reboot test, is it the bug of pci bus?

Test environment:

CPU: arm64

I suspect the problem is something ARM specific. IIRC, we added the memcpy_fromio() to work around a limitation in ARM related to CPU mappings of PCI BAR memory. The whole point of the PCI shutdown callback is to put the device into a quiescent state (e.g., stop all DMAs and asynchronous engines, etc.). Some of that tear down requires access to PCI BARs.

Alex

Quoted 5 lines

Graphics card: r7340(amdgpu), rx550

OS: ubuntu 2004

author
#2 lore raw

So, Can I remove suspend process in amdgpu_pci_shutdown if  I don't  use amdgpu driver in vm?

Thank you so much foryour reply!

Quoted 44 lines · Alex Deucher
Quoted 23 lines · 李真能

Hello:

When I do loop auto test of reboot, I found kernel may halt
on memcpy_fromio of amdgpu's amdgpu_uvd_suspend, so I remove suspend process in amdgpu_pci_shutdown, and it will fix this bug.

I have 3 questions to ask:

1. In amdgpu_pci_shutdown, the comment explains why we must execute suspend, so I know VM will call amdgpu driver in which situations, as I know, VM's graphics card is a virtual card;

2. I see a path that is commited by Alex Deucher, the commit message is as follows:

drm/amdgpu: just suspend the hw on pci shutdown

We can't just reuse pci_remove as there may be userspace still
doing things.

My question is:In which situations, there may be userspace till doing things.

Quoted 6 lines

3. Why amdgpu driver is halted on memcpy_fromio of amdgpu_uvd_suspend, I haven't launch any video app during reboot test, is it the bug of pci bus?

Test environment:

CPU: arm64

I suspect the problem is something ARM specific. IIRC, we added the memcpy_fromio() to work around a limitation in ARM related to CPU mappings of PCI BAR memory. The whole point of the PCI shutdown callback is to put the device into a quiescent state (e.g., stop all DMAs and asynchronous engines, etc.). Some of that tear down requires access to PCI BARs.

Alex

Quoted 4 lines

Graphics card: r7340(amdgpu), rx550

OS: ubuntu 2004

#3 lore raw

Well you could remove it locally if it solves your problem at hand.

But keep in mind that a lot of ARM boards are simply not compliant to the PCIe specification and the hardware won't work correctly on those in general.

I'm pretty sure you have one of those cases here.

Christian.

Am 30.09.21 um 03:26 schrieb 李真能:

Quoted 50 lines

So, Can I remove suspend process in amdgpu_pci_shutdown if  I don't  use amdgpu driver in vm?

Thank you so much foryour reply!

Quoted 44 lines · Alex Deucher
Quoted 23 lines · 李真能

Hello:

When I do loop auto test of reboot, I found kernel may halt
on memcpy_fromio of amdgpu's amdgpu_uvd_suspend, so I remove suspend process in amdgpu_pci_shutdown, and it will fix this bug.

I have 3 questions to ask:

1. In amdgpu_pci_shutdown, the comment explains why we must execute suspend, so I know VM will call amdgpu driver in which situations, as I know, VM's graphics card is a virtual card;

2. I see a path that is commited by Alex Deucher, the commit message is as follows:

drm/amdgpu: just suspend the hw on pci shutdown

We can't just reuse pci_remove as there may be userspace still
doing things.

My question is:In which situations, there may be userspace till doing things.

Quoted 6 lines

3. Why amdgpu driver is halted on memcpy_fromio of amdgpu_uvd_suspend, I haven't launch any video app during reboot test, is it the bug of pci bus?

Test environment:

CPU: arm64

I suspect the problem is something ARM specific. IIRC, we added the memcpy_fromio() to work around a limitation in ARM related to CPU mappings of PCI BAR memory. The whole point of the PCI shutdown callback is to put the device into a quiescent state (e.g., stop all DMAs and asynchronous engines, etc.). Some of that tear down requires access to PCI BARs.

Alex

Quoted 4 lines

Graphics card: r7340(amdgpu), rx550

OS: ubuntu 2004