hwmon: (sht3x) set initial jiffies to last_update
PATCH v2 1/1 hwmon: (sht3x) set initial jiffies to last_update
Handling the wraparound requires the data->last_update to be set to an initial jiffies value. Otherwise on 32-bit systems you will not be able to request a reading till the 5 minute jiffies rollover happens.
---
Changes from v1:
* document more in commit message the reason for the patch
* mark last sample before driver load so initial reading can happen shortly after boot
drivers/hwmon/sht3x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/sht3x.c +1 -1
@@ -720,7 +720,7 @@ static int sht3x_probe(struct i2c_client *client, data->setup.blocking_io = false; data->setup.high_precision = true; data->mode =0 ; - data->last_update =0 ; + data->last_update = jiffies -msecs_to_jiffies (3000 ); data->client = client;crc8_populate_msb (sht3x_crc8_table,SHT3X_CRC8_POLYNOMIAL );
Signature · 1 line
2.7.4
Quoted 22 lines · Matt Ranostay
Handling the wraparound requires the
data->last_updateto be set to an initial jiffies value. Otherwise on 32-bit systems you will not be able to request a reading till the 5 minute jiffies rollover happens.Cc Guenter Roeck <[email protected]>Cc David Frey <[email protected]>Signed-off-by Matt Ranostay <[email protected]>---
Changes from v1:
* document more in commit message the reason for the patch
* mark last sample before driver load so initial reading can happen shortly after bootdrivers/hwmon/sht3x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hwmon/sht3x.c +0
-0
drivers/hwmon/sht3x.c static int sht3x_probe(struct i2c_client *client, · line 726
Quoted 8 lines
drivers/hwmon/sht3x.c +1
-1@@ -720,7 +720,7 @@ static int sht3x_probe(struct i2c_client *client, data->setup.blocking_io = false; data->setup.high_precision = true; data->mode =0 ; - data->last_update =0 ; + data->last_update = jiffies -msecs_to_jiffies (3000 ); data->client = client;crc8_populate_msb (sht3x_crc8_table,SHT3X_CRC8_POLYNOMIAL );
Signature · 2 lines
Jean Delvare SUSE L3 Support
Quoted 7 lines · Matt Ranostay
Handling the wraparound requires the
data->last_updateto be set to an initial jiffies value. Otherwise on 32-bit systems you will not be able to request a reading till the 5 minute jiffies rollover happens.Cc Guenter Roeck <[email protected]>Cc David Frey <[email protected]>Signed-off-by Matt Ranostay <[email protected]>
Applied.
Thanks,
Guenter
Quoted 24 lines
---
Changes from v1:
* document more in commit message the reason for the patch
* mark last sample before driver load so initial reading can happen shortly after bootdrivers/hwmon/sht3x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hwmon/sht3x.c +1
-1@@ -720,7 +720,7 @@ static int sht3x_probe(struct i2c_client *client, data->setup.blocking_io = false; data->setup.high_precision = true; data->mode =0 ; - data->last_update =0 ; + data->last_update = jiffies -msecs_to_jiffies (3000 ); data->client = client;crc8_populate_msb (sht3x_crc8_table,SHT3X_CRC8_POLYNOMIAL );