public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* Clarification on i2c-pca-platform driver timeout
@ 2009-02-23 14:23 Jean Delvare
       [not found] ` <20090223152308.1db394a6-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Jean Delvare @ 2009-02-23 14:23 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Paul Mundt, Linux I2C

Hi Wolfram,

I would like you to clarify the situation when it comes to the value of
the timeout field of struct i2c_pca9564_pf_platform_data:

struct i2c_pca9564_pf_platform_data {
	(...)
	int timeout;		/* timeout = this value * 10us */
};

The only user, board-sh7785lcr.c, sets this value to 100, resulting in
a 1 ms timeout. This seems really short. Is this really intended?

Why is the timeout value defined in such a strange unit?

In the i2c-pca-platform driver, I then see:

static int __devinit i2c_pca_pf_probe(struct platform_device *pdev)
{
	struct i2c_pca_pf_data *i2c;
	(...)
	struct i2c_pca9564_pf_platform_data *platform_data =
				pdev->dev.platform_data;
	(...)
	i2c->adap.timeout = platform_data->timeout;

The problem is that i2c->adap.timeout is supposed to be expressed in
jiffies, not units of 10 us. So there is a conversion missing.

Lastly, you define a timeout value but never use it. Shouldn't you use
wait_event_interruptible_timeout() instead of
wait_event_interruptible() in i2c_pca_pf_waitforcompletion?

An upcoming patch will add code which handles a timeout at i2c-core
level, so it matters to get all i2c bus drivers right first.

Thanks,
-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-24 14:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-23 14:23 Clarification on i2c-pca-platform driver timeout Jean Delvare
     [not found] ` <20090223152308.1db394a6-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-02-23 14:50   ` Wolfram Sang
     [not found]     ` <20090223145027.GA3052-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-02-23 15:52       ` Jean Delvare
     [not found]         ` <20090223165222.6e376e11-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-02-24 14:09           ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox