drm/amdgpu: fix undefined preprocessor identifier 'CONFIG_ARM64'
Subsystems (3)
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: fix undefined preprocessor identifier 'CONFIG_ARM64'
Check if the identifer is defined.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +2 -2
@@ -294,9 +294,9 @@ struct amdgpu_video_codec_info;static inline bool is_virtual_machine (void ) { -#ifdef CONFIG_X86 +#if defined(CONFIG_X86 )return boot_cpu_has (X86_FEATURE_HYPERVISOR ); -#elif CONFIG_ARM64 +#elif defined(CONFIG_ARM64 )return !is_kernel_in_hyp_mode ();#else return false;
Signature · 1 line
2.34.1
Alex Deucher
maintainerPATCH 1/1 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.
--- drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 3 +++ drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 3 +++ drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 3 +++ drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 3 +++ 4 files changed, 12 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +3 -0
@@ -2070,6 +2070,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 ;
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +3 -0
@@ -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 ;
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +3 -0
@@ -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 ;
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +3 -0
@@ -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 ;
Signature · 1 line
2.34.1
Re: [PATCH] drm/amdgpu/swsmu/i2c: return an error if the SMU is not running
Regards,
Luben
Quoted 61 lines · Alex Deucher
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.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 3 +++ drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 3 +++ drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 3 +++ drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 3 +++ 4 files changed, 12 insertions(+)drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +3
-0@@ -2070,6 +2070,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 ;drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +3
-0@@ -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 ;drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +3
-0@@ -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 ;drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +0
-0
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c static int aldebaran_i2c_xfer(struct i2c_adapter *i2c_adap, · line 1481
Quoted 9 lines
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +3
-0@@ -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 ;
Regards,
Signature · 1 line
Luben