Re: [PATCH] drm/amdgpu: fix the memory corruption on S3

2017-06-29 Thread Huang Rui
On Thu, Jun 29, 2017 at 04:07:33PM +0800, Michel Dänzer wrote: > On 29/06/17 04:59 PM, Huang Rui wrote: > > On Thu, Jun 29, 2017 at 03:34:57PM +0800, Michel Dänzer wrote: > >> On 29/06/17 04:03 PM, Huang Rui wrote: > >>> psp->cmd will be used on resume phase, so we can not free it on hw_init. >

Re: [PATCH] drm/amdgpu: fix the memory corruption on S3

2017-06-29 Thread Michel Dänzer
On 29/06/17 04:59 PM, Huang Rui wrote: > On Thu, Jun 29, 2017 at 03:34:57PM +0800, Michel Dänzer wrote: >> On 29/06/17 04:03 PM, Huang Rui wrote: >>> psp->cmd will be used on resume phase, so we can not free it on hw_init. >>> Otherwise, a memory corruption will be triggered. >>> >>>

Re: [PATCH] drm/amdgpu: fix the memory corruption on S3

2017-06-29 Thread Christian König
Indeed a nice catch. Just skimming over the PSP code, wouldn't it be simpler to temporary allocate the cmd buffer in psp_np_fw_load()? Doesn't looks like that is used outside that function. Might even be possible to just allocate the buffer on the stack. Regards, Christian. Am 29.06.2017

Re: [PATCH] drm/amdgpu: fix the memory corruption on S3

2017-06-29 Thread Huang Rui
On Thu, Jun 29, 2017 at 03:34:57PM +0800, Michel Dänzer wrote: > On 29/06/17 04:03 PM, Huang Rui wrote: > > psp->cmd will be used on resume phase, so we can not free it on hw_init. > > Otherwise, a memory corruption will be triggered. > > > > Signed-off-by: Huang Rui > > --- >

Re: [PATCH] drm/amdgpu: fix the memory corruption on S3

2017-06-29 Thread Michel Dänzer
On 29/06/17 04:03 PM, Huang Rui wrote: > psp->cmd will be used on resume phase, so we can not free it on hw_init. > Otherwise, a memory corruption will be triggered. > > Signed-off-by: Huang Rui > --- > > Alex, Christian, > > This is the final fix for vega10 S3. The random

[PATCH] drm/amdgpu: fix the memory corruption on S3

2017-06-29 Thread Huang Rui
psp->cmd will be used on resume phase, so we can not free it on hw_init. Otherwise, a memory corruption will be triggered. Signed-off-by: Huang Rui --- Alex, Christian, This is the final fix for vega10 S3. The random memory corruption issue is root caused. Thanks, Ray ---