[PATCH V4 17/17] drm/amd/pm: unified lock protections in amdgpu_dpm.c

Quan, Evan Evan.Quan at amd.com
Fri Apr 8 12:24:57 UTC 2022


[AMD Official Use Only]

Hi Arthur,

Please give the attached patch a try and let me know the result.

Thanks,
Evan
> -----Original Message-----
> From: Quan, Evan
> Sent: Saturday, April 2, 2022 9:32 AM
> To: 'Arthur Marsh' <arthur.marsh at internode.on.net>
> Cc: Deucher, Alexander <Alexander.Deucher at amd.com>; Koenig, Christian
> <Christian.Koenig at amd.com>; Feng, Kenneth <Kenneth.Feng at amd.com>;
> Lazar, Lijo <Lijo.Lazar at amd.com>; amd-gfx at lists.freedesktop.org
> Subject: RE: [PATCH V4 17/17] drm/amd/pm: unified lock protections in
> amdgpu_dpm.c
> 
> [AMD Official Use Only]
> 
> Thanks for the confirming. I probably know the root cause.
> Let me prepare an official patch for you.
> 
> BR
> Evan
> > -----Original Message-----
> > From: Arthur Marsh <arthur.marsh at internode.on.net>
> > Sent: Friday, April 1, 2022 8:19 PM
> > To: Quan, Evan <Evan.Quan at amd.com>
> > Cc: Deucher, Alexander <Alexander.Deucher at amd.com>; Koenig,
> Christian
> > <Christian.Koenig at amd.com>; Feng, Kenneth <Kenneth.Feng at amd.com>;
> > Lazar, Lijo <Lijo.Lazar at amd.com>; amd-gfx at lists.freedesktop.org;
> > arthur.marsh at internode.on.net
> > Subject: [PATCH V4 17/17] drm/amd/pm: unified lock protections in
> > amdgpu_dpm.c
> >
> > Hi, short answer is that with both patches applied, I am successfully
> > running the amdgpu kernel module on radeonsi (plasma desktop on X.org).
> >
> > I confirmed that CONFIG_LOCKDEP_SUPPORT=y is enabled in the kernel.
> >
> > With the first patch applied and remotely connecting to the machine
> > and loading amdgpu via:
> >
> > modprobe amdgpu si_support=1 gpu_recovery=1
> >
> > the last lines of dmesg were:
> >
> > [  264.095969] [drm] Found UVD firmware Version: 64.0 Family ID: 13 [
> > 264.097779] [drm] PCIE gen 2 link speeds already enabled [
> > 264.648137] [drm] UVD initialized successfully.
> > [  264.648696] amdgpu 0000:01:00.0: amdgpu: SE 1, SH per SE 2, CU per
> > SH 5, active_cu_number 8 [  264.984814] [drm] Initialized amdgpu
> > 3.46.0 20150101 for 0000:01:00.0 on minor 0 [  265.040280] fbcon:
> > amdgpudrmfb (fb0) is primary device
> >
> > After applying the second patch and building and restarting with the
> > new kernel, I could load amdgpu successfuly and start the plasma
> > desktop under X.org, with the last amdgpu load lines being:
> >
> > [  227.736281] fbcon: amdgpudrmfb (fb0) is primary device [
> > 227.760719] Console: switching to colour frame buffer device 240x67 [
> > 227.765024] amdgpu 0000:01:00.0: [drm] fb0: amdgpudrmfb frame buffer
> > device
> >
> > I tried building a kernel with just the second patch and that
> > experienced a lockup after apparently loading amdgpu alright.
> >
> > First and second patches combined:
> >
> > diff --git a/drivers/gpu/drm/amd/pm/amdgpu_dpm.c
> > b/drivers/gpu/drm/amd/pm/amdgpu_dpm.c
> > index 89fbee568be4..e9ebbc9f4cd2 100644
> > --- a/drivers/gpu/drm/amd/pm/amdgpu_dpm.c
> > +++ b/drivers/gpu/drm/amd/pm/amdgpu_dpm.c
> > @@ -80,8 +80,6 @@ int amdgpu_dpm_set_powergating_by_smu(struct
> > amdgpu_device *adev, uint32_t block
> >  		return 0;
> >  	}
> >
> > -	mutex_lock(&adev->pm.mutex);
> > -
> >  	switch (block_type) {
> >  	case AMD_IP_BLOCK_TYPE_UVD:
> >  	case AMD_IP_BLOCK_TYPE_VCE:
> > @@ -102,8 +100,6 @@ int amdgpu_dpm_set_powergating_by_smu(struct
> > amdgpu_device *adev, uint32_t block
> >  	if (!ret)
> >  		atomic_set(&adev->pm.pwr_state[block_type], pwr_state);
> >
> > -	mutex_unlock(&adev->pm.mutex);
> > -
> >  	return ret;
> >  }
> >
> > @@ -423,9 +419,7 @@ void amdgpu_dpm_compute_clocks(struct
> > amdgpu_device *adev)
> >  	if (!pp_funcs->pm_compute_clocks)
> >  		return;
> >
> > -	mutex_lock(&adev->pm.mutex);
> >  	pp_funcs->pm_compute_clocks(adev->powerplay.pp_handle);
> > -	mutex_unlock(&adev->pm.mutex);
> >  }
> >
> >  void amdgpu_dpm_enable_uvd(struct amdgpu_device *adev, bool
> enable)
> >
> > Thanks for the assistance!
> >
> > Arthur.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-drm-amd-pm-fix-the-deadlock-issue-observed-on-SI.patch
Type: application/octet-stream
Size: 6277 bytes
Desc: 0001-drm-amd-pm-fix-the-deadlock-issue-observed-on-SI.patch
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20220408/d7ed6154/attachment.obj>


More information about the amd-gfx mailing list