aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4015-drm-amdgpu-add-lock-for-i2c-bus.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4015-drm-amdgpu-add-lock-for-i2c-bus.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4015-drm-amdgpu-add-lock-for-i2c-bus.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4015-drm-amdgpu-add-lock-for-i2c-bus.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4015-drm-amdgpu-add-lock-for-i2c-bus.patch
new file mode 100644
index 00000000..61a25548
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4015-drm-amdgpu-add-lock-for-i2c-bus.patch
@@ -0,0 +1,42 @@
+From 35f31816a1fcb441728ee33103c023cb918fb78d Mon Sep 17 00:00:00 2001
+From: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
+Date: Thu, 10 Oct 2019 16:41:54 +0800
+Subject: [PATCH 4015/4256] drm/amdgpu: add lock for i2c bus
+
+I2C bus must be locked at all time we access the I2C bus.
+
+Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
+Reviewed-by: Rui Teng <rui.teng@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c b/drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c
+index aad83932dd05..15674337144f 100644
+--- a/drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c
++++ b/drivers/gpu/drm/amd/amdgpu/smu_v11_0_i2c.c
+@@ -630,6 +630,10 @@ static int smu_v11_0_i2c_eeprom_i2c_xfer(struct i2c_adapter *i2c_adap,
+ int i, ret;
+ struct amdgpu_ras_eeprom_control *control = to_eeprom_control(i2c_adap);
+
++#if !defined(HAVE_I2C_LOCK_OPERATIONS_STRUCT)
++ lock_bus(i2c_adap, 0);
++#endif
++
+ if (!control->bus_locked) {
+ DRM_ERROR("I2C bus unlocked, stopping transaction!");
+ return -EIO;
+@@ -654,6 +658,10 @@ static int smu_v11_0_i2c_eeprom_i2c_xfer(struct i2c_adapter *i2c_adap,
+ }
+
+ smu_v11_0_i2c_fini(i2c_adap);
++
++#if !defined(HAVE_I2C_LOCK_OPERATIONS_STRUCT)
++ unlock_bus(i2c_adap, 0);
++#endif
+ return num;
+ }
+
+--
+2.17.1
+