Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[202311] [optoe] Fix optoe's write_max when using native i2c driver #409

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions patch/driver-support-optoe-write-max_fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From f1250392a9dff619b147d8aee0c73c0f6d550713 Mon Sep 17 00:00:00 2001
From: Prince George <[email protected]>
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 <[email protected]>
---
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
1 change: 1 addition & 0 deletions patch/series
Original file line number Diff line number Diff line change
Expand Up @@ -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-dynamic-write-timeout.patch
Expand Down