Commit b2f125bc authored by Kevin Wells's avatar Kevin Wells Committed by Ben Dooks
Browse files

i2c: i2c-pnx: Limit minimum jiffie timeout to 2



Limit minimum jiffie timeout to 2 to prevent early timeout on systems
with low tick rates

Signed-off-by: default avatarKevin Wells <kevin.wells@nxp.com>
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
parent 648f4e3e
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -54,6 +54,9 @@ static inline void i2c_pnx_arm_timer(struct i2c_adapter *adap)
	struct timer_list *timer = &data->mif.timer;
	struct timer_list *timer = &data->mif.timer;
	int expires = I2C_PNX_TIMEOUT / (1000 / HZ);
	int expires = I2C_PNX_TIMEOUT / (1000 / HZ);


	if (expires <= 1)
		expires = 2;

	del_timer_sync(timer);
	del_timer_sync(timer);


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