mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
drm/amdgpu/swsmu/i2c: return an error if the SMU is not running
Return an error if someone tries to use the i2c bus when the SMU is not running. Otherwise we can end up sending commands to the SMU which will either get ignored or could cause other issues depending on what state the GPU and SMU are in. Cc: Luben.Tuikov@amd.com Reviewed-by: Luben Tuikov <luben.tuikov@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
3ed893396b
commit
e281d5940a
4 changed files with 12 additions and 0 deletions
|
@ -2071,6 +2071,9 @@ static int arcturus_i2c_xfer(struct i2c_adapter *i2c_adap,
|
|||
int i, j, r, c;
|
||||
u16 dir;
|
||||
|
||||
if (!adev->pm.dpm_enabled)
|
||||
return -EBUSY;
|
||||
|
||||
req = kzalloc(sizeof(*req), GFP_KERNEL);
|
||||
if (!req)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -2754,6 +2754,9 @@ static int navi10_i2c_xfer(struct i2c_adapter *i2c_adap,
|
|||
int i, j, r, c;
|
||||
u16 dir;
|
||||
|
||||
if (!adev->pm.dpm_enabled)
|
||||
return -EBUSY;
|
||||
|
||||
req = kzalloc(sizeof(*req), GFP_KERNEL);
|
||||
if (!req)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -3449,6 +3449,9 @@ static int sienna_cichlid_i2c_xfer(struct i2c_adapter *i2c_adap,
|
|||
int i, j, r, c;
|
||||
u16 dir;
|
||||
|
||||
if (!adev->pm.dpm_enabled)
|
||||
return -EBUSY;
|
||||
|
||||
req = kzalloc(sizeof(*req), GFP_KERNEL);
|
||||
if (!req)
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -1473,6 +1473,9 @@ static int aldebaran_i2c_xfer(struct i2c_adapter *i2c_adap,
|
|||
int i, j, r, c;
|
||||
u16 dir;
|
||||
|
||||
if (!adev->pm.dpm_enabled)
|
||||
return -EBUSY;
|
||||
|
||||
req = kzalloc(sizeof(*req), GFP_KERNEL);
|
||||
if (!req)
|
||||
return -ENOMEM;
|
||||
|
|
Loading…
Add table
Reference in a new issue