Skip to contentSkip to conversation

drm/nouveau/i2c: Fix i2c initialization on cards with DCB older than 1.5

PATCH In review Viktor Novotný 1 participant 2 messages Jan 18, 2012 – Feb 3, 2012 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau/i2c: Fix i2c initialization on cards with DCB older than 1.5

---
Hi,
I think I found a bug - my NV11 fails to init i2c ports and is then unable to read EDID. It's because while i2c_table in nouveau_i2c.c:324 returns null for this card, i2c is initialized anyway at line 341 and wrong i2c table format is then selected at line 350. This patch fixes the problem on NV11 and was tested also on NV25. I hope no cards but those with legacy i2c table have i2c table version set to 0.

Regards
Viktor

 drivers/gpu/drm/nouveau/nouveau_i2c.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nouveau_i2c.c +3 -2
index 820ae7f..57bcbc3 100644
@@ -344,14 +344,15 @@ nouveau_i2c_init(struct drm_device *dev)
 		if (i2c[5]) legacy[0][1] = i2c[5];
 		if (i2c[6]) legacy[1][0] = i2c[6];
 		if (i2c[7]) legacy[1][1] = i2c[7];
+		version = 0;
 	}
 
-	if (i2c && version >= 0x30) {
+	if (version >= 0x30) {
 		entry     = i2c[1] + i2c;
 		entries   = i2c[2];
 		recordlen = i2c[3];
 	} else
-	if (i2c) {
+	if (version > 0) {
 		entry     = i2c;
 		entries   = 16;
 		recordlen = 4;
Signature · 1 line
1.7.8.3

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Hi,
did anybody find time to look into this issue? By the way, I think it was introduced by commit 486a45c2.

Regards
Viktor

Quoted 9 lines · Viktor Novotný

---
Hi,
I think I found a bug - my NV11 fails to init i2c ports and is then unable to read EDID. It's because while i2c_table in nouveau_i2c.c:324 returns null for this card, i2c is initialized anyway at line 341 and wrong i2c table format is then selected at line 350. This patch fixes the problem on NV11 and was tested also on NV25. I hope no cards but those with legacy i2c table have i2c table version set to 0.