AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* amdgpu driver halted on suspend of shutdown
@ 2021-09-29  4:50 李真能
  2021-09-29 21:12 ` Alex Deucher
  0 siblings, 1 reply; 4+ messages in thread
From: 李真能 @ 2021-09-29  4:50 UTC (permalink / raw)
  To: Alex Deucher; +Cc: Christian König, Pan, Xinhui, amd-gfx

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


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

* Re: amdgpu driver halted on suspend of shutdown
  2021-09-29  4:50 amdgpu driver halted on suspend of shutdown 李真能
@ 2021-09-29 21:12 ` Alex Deucher
  2021-09-30  1:26   ` 李真能
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Deucher @ 2021-09-29 21:12 UTC (permalink / raw)
  To: 李真能
  Cc: Alex Deucher, Christian König, Pan, Xinhui, amd-gfx list

On Wed, Sep 29, 2021 at 3:25 AM 李真能 <lizhenneng@kylinos.cn> wrote:
>
> 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

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


>
> Graphics card: r7340(amdgpu), rx550
>
> OS: ubuntu 2004
>

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

* Re: amdgpu driver halted on suspend of shutdown
  2021-09-29 21:12 ` Alex Deucher
@ 2021-09-30  1:26   ` 李真能
  2021-09-30  6:30     ` Christian König
  0 siblings, 1 reply; 4+ messages in thread
From: 李真能 @ 2021-09-30  1:26 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Alex Deucher, Christian König, Pan, Xinhui, amd-gfx list

[-- Attachment #1: Type: text/plain, Size: 1679 bytes --]

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!

在 2021/9/30 上午5:12, Alex Deucher 写道:
> On Wed, Sep 29, 2021 at 3:25 AM 李真能 <lizhenneng@kylinos.cn> wrote:
>> 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
> 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
>
>
>> Graphics card: r7340(amdgpu), rx550
>>
>> OS: ubuntu 2004
>>

[-- Attachment #2: Type: text/html, Size: 2381 bytes --]

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

* Re: amdgpu driver halted on suspend of shutdown
  2021-09-30  1:26   ` 李真能
@ 2021-09-30  6:30     ` Christian König
  0 siblings, 0 replies; 4+ messages in thread
From: Christian König @ 2021-09-30  6:30 UTC (permalink / raw)
  To: 李真能, Alex Deucher
  Cc: Alex Deucher, Christian König, Pan, Xinhui, amd-gfx list

[-- Attachment #1: Type: text/plain, Size: 2063 bytes --]

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 李真能:
>
> 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!
>
> 在 2021/9/30 上午5:12, Alex Deucher 写道:
>> On Wed, Sep 29, 2021 at 3:25 AM 李真能<lizhenneng@kylinos.cn>  wrote:
>>> 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
>> 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
>>
>>
>>> Graphics card: r7340(amdgpu), rx550
>>>
>>> OS: ubuntu 2004
>>>


[-- Attachment #2: Type: text/html, Size: 3073 bytes --]

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

end of thread, other threads:[~2021-09-30  6:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-29  4:50 amdgpu driver halted on suspend of shutdown 李真能
2021-09-29 21:12 ` Alex Deucher
2021-09-30  1:26   ` 李真能
2021-09-30  6:30     ` 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