Skip to contentSkip to conversation

Patch "eeprom: at24: fix reading from 24MAC402/24MAC602" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Dec 4, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

    eeprom: at24: fix reading from 24MAC402/24MAC602

to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:

     eeprom-at24-fix-reading-from-24mac402-24mac602.patch

and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 644a1f19c6c8393d0c4168a5adf79056da6822eb Mon Sep 17 00:00:00 2001

From: Heiner Kallweit <[email protected]>
Date: Mon, 27 Nov 2017 20:46:22 +0100
Subject: eeprom: at24: fix reading from 24MAC402/24MAC602

From: Heiner Kallweit <[email protected]>

commit 644a1f19c6c8393d0c4168a5adf79056da6822eb upstream.

Chip datasheet mentions that word addresses other than the actual start position of the MAC delivers undefined results. So fix this. Current implementation doesn't work due to this wrong offset.

Fixes 0b813658c115 ("eeprom: at24: add support for at24mac series")
---
 drivers/misc/eeprom/at24.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/misc/eeprom/at24.c +2 -1
@@ -365,7 +365,8 @@ static ssize_t at24_eeprom_read_mac(stru
 	memset(msg, 0, sizeof(msg));
 	msg[0].addr = client->addr;
 	msg[0].buf = addrbuf;
-	addrbuf[0] = 0x90 + offset;
+	/* EUI-48 starts from 0x9a, EUI-64 from 0x98 */
+	addrbuf[0] = 0xa0 - at24->chip.byte_len + offset;
 	msg[0].len = 1;
 	msg[1].addr = client->addr;
 	msg[1].flags = I2C_M_RD;

Patches currently in stable-queue which might be from [email protected] are

queue-4.14/eeprom-at24-fix-reading-from-24mac402-24mac602.patch queue-4.14/eeprom-at24-check-at24_read-write-arguments.patch