[PATCH] i2c driver changes for 2.5.72

Mark M. Hoffman mhoffman at lightlink.com
Thu Jun 19 04:25:57 CEST 2003


* Greg KH <greg at kroah.com> [2003-06-18 11:25:07 -0700]:
> ChangeSet 1.1318.3.2, 2003/06/16 11:31:43-07:00, margitsw at t-online.de
> 
> [PATCH] I2C: lm85 fixups
> 
> OK Here's the patch which :
> 1) Fixes the race conditions

<cut>

> @@ -437,10 +434,13 @@
>  {
>  	struct i2c_client *client = to_i2c_client(dev);
>  	struct lm85_data *data = i2c_get_clientdata(client);
> +	int	val;
>  
> -	int val = simple_strtol(buf, NULL, 10);
> +	down(&data->update_lock);
> +	val = simple_strtol(buf, NULL, 10);
>  	data->fan_min[nr] = FAN_TO_REG(val);
>  	lm85_write_value(client, LM85_REG_FAN_MIN(nr), data->fan_min[nr]);
> +	up(&data->update_lock);
>  	return count;
>  }

Ugh.  Looks like this sort of fix is needed in every single chip
driver in 2.5.  And the CVS chip drivers have the same problem.

So... are we going to tackle this for the sensors 2.8.0 release?

Regards,

-- 
Mark M. Hoffman
mhoffman at lightlink.com



More information about the lm-sensors mailing list