mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 17:27:01 +00:00
- Improve retry and timeout performance for the isch driver
- adm1021 device detection option
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
--- a/drivers/hwmon/adm1021.c 2014-12-14 08:24:02.000000000 -0800
|
||||
+++ b/drivers/hwmon/adm1021.c 2016-10-13 10:48:10.045055678 -0700
|
||||
@@ -105,6 +105,7 @@ static struct adm1021_data *adm1021_upda
|
||||
/* (amalysh) read only mode, otherwise any limit's writing confuse BIOS */
|
||||
static int read_only;
|
||||
|
||||
+static int detect = 1;
|
||||
|
||||
static const struct i2c_device_id adm1021_id[] = {
|
||||
{ "adm1021", adm1021 },
|
||||
@@ -295,6 +296,9 @@ static int adm1021_detect(struct i2c_cli
|
||||
"smbus byte data not supported!\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
+ if(detect == 0) {
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
|
||||
status = i2c_smbus_read_byte_data(client, ADM1021_REG_STATUS);
|
||||
conv_rate = i2c_smbus_read_byte_data(client,
|
||||
@@ -510,6 +514,8 @@ MODULE_LICENSE("GPL");
|
||||
|
||||
module_param(read_only, bool, 0);
|
||||
MODULE_PARM_DESC(read_only, "Don't set any values, read only mode");
|
||||
+module_param(detect, bool, 1);
|
||||
+MODULE_PARM_DESC(detect, "Enable or disable device detection.");
|
||||
|
||||
module_init(sensors_adm1021_init)
|
||||
module_exit(sensors_adm1021_exit)
|
||||
@@ -0,0 +1,36 @@
|
||||
--- a/drivers/i2c/busses/i2c-isch.c 2014-12-14 08:24:02.000000000 -0800
|
||||
+++ b/drivers/i2c/busses/i2c-isch.c 2016-10-13 08:02:44.564840300 -0700
|
||||
@@ -47,7 +47,7 @@
|
||||
#define SMBBLKDAT (0x20 + sch_smba)
|
||||
|
||||
/* Other settings */
|
||||
-#define MAX_TIMEOUT 500
|
||||
+#define MAX_RETRIES 5000
|
||||
|
||||
/* I2C constants */
|
||||
#define SCH_QUICK 0x00
|
||||
@@ -68,7 +68,7 @@ static int sch_transaction(void)
|
||||
{
|
||||
int temp;
|
||||
int result = 0;
|
||||
- int timeout = 0;
|
||||
+ int retries = 0;
|
||||
|
||||
dev_dbg(&sch_adapter.dev, "Transaction (pre): CNT=%02x, CMD=%02x, "
|
||||
"ADD=%02x, DAT0=%02x, DAT1=%02x\n", inb(SMBHSTCNT),
|
||||
@@ -100,12 +100,12 @@ static int sch_transaction(void)
|
||||
outb(inb(SMBHSTCNT) | 0x10, SMBHSTCNT);
|
||||
|
||||
do {
|
||||
- msleep(1);
|
||||
+ usleep_range(100, 200);
|
||||
temp = inb(SMBHSTSTS) & 0x0f;
|
||||
- } while ((temp & 0x08) && (timeout++ < MAX_TIMEOUT));
|
||||
+ } while ((temp & 0x08) && (retries++ < MAX_RETRIES));
|
||||
|
||||
/* If the SMBus is still busy, we give up */
|
||||
- if (timeout > MAX_TIMEOUT) {
|
||||
+ if (retries > MAX_RETRIES) {
|
||||
dev_err(&sch_adapter.dev, "SMBus Timeout!\n");
|
||||
result = -ETIMEDOUT;
|
||||
}
|
||||
@@ -251,3 +251,5 @@ platform-accton-as7716_32x-device-drivers.patch
|
||||
driver-broadcom-tigon3.patch
|
||||
mgmt-port-init-config.patch
|
||||
arch-intel-reboot-cf9-cold.patch
|
||||
drivers-hwmon-adm1021-detect.patch
|
||||
drivers-i2c-busses-i2c-isch-timeout.patch
|
||||
|
||||
Reference in New Issue
Block a user