[3.8.y.z extended stable] Patch "radeon/i2c: do not count reg index in number of i2c byte we are" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Fri Dec 6 23:08:42 UTC 2013


This is a note to let you know that I have just added a patch titled

    radeon/i2c: do not count reg index in number of i2c byte we are

to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.8.y-queue

This patch is scheduled to be released in version 3.8.13.14.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.8.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From 9e06f75bc7e94af88c307b6aa8868bea9a782b55 Mon Sep 17 00:00:00 2001
From: Jerome Glisse <jglisse at redhat.com>
Date: Wed, 6 Nov 2013 17:42:02 -0500
Subject: radeon/i2c: do not count reg index in number of i2c byte we are
 writing.

commit fae009d15a44e5f1d938340facf4b8bc7dc69a09 upstream.

Useless to count the register index in number of bytes we are writing.

Fixes a regression with hw i2c enabled.

Signed-off-by: Jerome Glisse <jglisse at redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 drivers/gpu/drm/radeon/atombios_i2c.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/atombios_i2c.c b/drivers/gpu/drm/radeon/atombios_i2c.c
index 2ca389d..4bb4b7a 100644
--- a/drivers/gpu/drm/radeon/atombios_i2c.c
+++ b/drivers/gpu/drm/radeon/atombios_i2c.c
@@ -55,7 +55,10 @@ static int radeon_process_i2c_ch(struct radeon_i2c_chan *chan,
 			DRM_ERROR("hw i2c: tried to write too many bytes (%d vs 2)\n", num);
 			return -EINVAL;
 		}
-		memcpy(&out, buf, num);
+		if (num > 1) {
+			num--;
+			memcpy(&out, &buf[1], num);
+		}
 		args.lpI2CDataOut = cpu_to_le16(out);
 	} else {
 		if (num > ATOM_MAX_HW_I2C_READ) {
--
1.8.3.2





More information about the kernel-team mailing list