Re: [PATCH 2.6] I2C: New chip driver: sis5595

From: Jean Delvare
Date: Tue Feb 01 2005 - 06:58:40 EST



Hi Alexey,

> Maybe you should call sis5595_update_device() in initialization function
> and get rid of "value" field. It's sole purpose to fill "struct sis5595"
> when it's known that "last_updated" field contains crap.

I assume you meant "valid" field.

Doesn't work. If you discard the "valid" field and call the update
function at init time, you cannot be sure that the update function will
actually do something. It all depends on the jiffies value relative to
last_updated (0 at this point). This is exactly what "valid" is there
for.

An alternative is to add a parameter to the update function, that would
force the update to happen regardless of time consideration. This
doesn't really change anything though, you simply remove a structure
member and replace it with a function parameter. How does it help?

Third possibility would be to initialize "last_updated" to anything
less than jiffies-(HZ+HZ/2) at init time, so as to be sure that the next
update will occur. Is it doable? Or maybe if we initialize
"last_updated" to the max possible jiffies count, it'll have the same
effect. But is it doable?

At any rate, the exact same issue exists in every over existing hardware
monitoring driver. If we change our mind we'll do it for all drivers,
not only this new one (sis5595), so Aurelien's patch is fine with me.

Thanks,
--
Jean Delvare
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/