Problems encountered by optoe drivers
Code Path:drivers/misc/eeprom/optoe.c
Issue 1:The write_timeout value is fixed at 25ms. In the test of our products, it is found that the 25ms timeout time of some optical modules is not enough, and I2C read and write failures will occur occasionally. Issue 2:When switch optoe’s dev_class from 2 to 1 then 1 to 3, clash occurs.
Regarding this issue, our solution is:
Issue1: It may be related to the module characteristics of different manufacturers. At present, the write_timeout is changed to 50ms in our product, which runs well. Can this parameter be opened to users to set their own timeout time (the default is 25ms, the original logic remains unchanged)? Issue2:below is the issue code:
if (optoe->client[1])
i2c_unregister_device(optoe->client[1]);
optoe->bin.size = ONE_ADDR_EEPROM_SIZE;
optoe->num_addresses = 1;
After run the i2c_unregister_device(optoe->client[1]), optoe->client[1] is needed to set to null.If it is not set to null, clash will occur when switch again. Below is the repaired code.
if (optoe->client[1]) {
i2c_unregister_device(optoe->client[1]);
optoe->client[1] = NULL;
}
optoe->bin.size = ONE_ADDR_EEPROM_SIZE;
optoe->num_addresses = 1;
@prgeor @donboll would one of you be able to take a look at this? I know issue 2 was reported in #317 as well.
@philo-micas please check this fix https://github.com/sonic-net/sonic-linux-kernel/blob/master/patch/driver-support-optoe-dynamic-write-timeout.patch