Skip to content

Commit

Permalink
i2c: i2c-pnx: Limit minimum jiffie timeout to 2
Browse files Browse the repository at this point in the history
Limit minimum jiffie timeout to 2 to prevent early timeout on systems
with low tick rates

Signed-off-by: Kevin Wells <kevin.wells@nxp.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
  • Loading branch information
Kevin Wells authored and Ben Dooks committed Nov 20, 2009
1 parent 648f4e3 commit b2f125b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/i2c/busses/i2c-pnx.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ static inline void i2c_pnx_arm_timer(struct i2c_adapter *adap)
struct timer_list *timer = &data->mif.timer;
int expires = I2C_PNX_TIMEOUT / (1000 / HZ);

if (expires <= 1)
expires = 2;

del_timer_sync(timer);

dev_dbg(&adap->dev, "Timer armed at %lu plus %u jiffies.\n",
Expand Down

0 comments on commit b2f125b

Please sign in to comment.