From 70c4c3f32ccf4a887f4d913c89f72ea50ed98deb Mon Sep 17 00:00:00 2001 From: Prince George Date: Tue, 18 Jun 2024 14:50:41 +0000 Subject: [PATCH] Fix optoe's write_max when using native i2c driver Signed-off-by: Prince George --- .../driver-support-optoe-write-max_fix.patch | 34 +++++++++++++++++++ patch/series | 1 + 2 files changed, 35 insertions(+) create mode 100644 patch/driver-support-optoe-write-max_fix.patch diff --git a/patch/driver-support-optoe-write-max_fix.patch b/patch/driver-support-optoe-write-max_fix.patch new file mode 100644 index 000000000..3071b0dd5 --- /dev/null +++ b/patch/driver-support-optoe-write-max_fix.patch @@ -0,0 +1,34 @@ +From f1250392a9dff619b147d8aee0c73c0f6d550713 Mon Sep 17 00:00:00 2001 +From: Prince George +Date: Thu, 13 Jun 2024 14:18:22 +0000 +Subject: [PATCH] Fix optoe's write_max when using native i2c driver + +Signed-off-by: Prince George +--- + drivers/misc/eeprom/optoe.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/misc/eeprom/optoe.c b/drivers/misc/eeprom/optoe.c +index 5a2e71be5..1efd18040 100644 +--- a/drivers/misc/eeprom/optoe.c ++++ b/drivers/misc/eeprom/optoe.c +@@ -1114,7 +1114,7 @@ static int optoe_probe(struct i2c_client *client, + goto exit; + } + +- dev_dbg(&client->dev, "dev_class: %d\n", optoe->dev_class); ++ dev_dbg(&client->dev, "dev_class: %d use_smbus=%d\n", optoe->dev_class, use_smbus); + optoe->use_smbus = use_smbus; + optoe->chip = chip; + optoe->num_addresses = num_addresses; +@@ -1157,7 +1157,7 @@ static int optoe_probe(struct i2c_client *client, + optoe->write_max = write_max; + + /* buffer (data + address at the beginning) */ +- optoe->writebuf = kmalloc(write_max + 2, GFP_KERNEL); ++ optoe->writebuf = kmalloc(OPTOE_PAGE_SIZE + 2, GFP_KERNEL); + if (!optoe->writebuf) { + err = -ENOMEM; + goto exit_kfree; +-- +2.25.1 diff --git a/patch/series b/patch/series index 443b5d316..fab4ccaea 100755 --- a/patch/series +++ b/patch/series @@ -29,6 +29,7 @@ driver-support-optoe-EOF_fix.patch driver-support-optoe-chunk-offset-fix.patch driver-support-optoe-QSFP_DD.patch driver-support-optoe-write-max.patch +driver-support-optoe-write-max_fix.patch driver-support-optoe-twoaddr-a2h-access.patch driver-support-optoe-oneaddr-pageable.patch driver-support-optoe-update-to-linux-6.1.patch