Skip to content

Commit 7363f2d

Browse files
FrankenweenAndi Shyti
authored andcommitted
i2c: pnx: Fix timeout in wait functions
Since commit f63b94b ("i2c: pnx: Fix potential deadlock warning from del_timer_sync() call in isr") jiffies are stored in i2c_pnx_algo_data.timeout, but wait_timeout and wait_reset are still using it as milliseconds. Convert jiffies back to milliseconds to wait for the expected amount of time. Fixes: f63b94b ("i2c: pnx: Fix potential deadlock warning from del_timer_sync() call in isr") Signed-off-by: Vladimir Riabchun <ferr.lambarginio@gmail.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
1 parent fac04ef commit 7363f2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/i2c/busses/i2c-pnx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ enum {
9595

9696
static inline int wait_timeout(struct i2c_pnx_algo_data *data)
9797
{
98-
long timeout = data->timeout;
98+
long timeout = jiffies_to_msecs(data->timeout);
9999
while (timeout > 0 &&
100100
(ioread32(I2C_REG_STS(data)) & mstatus_active)) {
101101
mdelay(1);
@@ -106,7 +106,7 @@ static inline int wait_timeout(struct i2c_pnx_algo_data *data)
106106

107107
static inline int wait_reset(struct i2c_pnx_algo_data *data)
108108
{
109-
long timeout = data->timeout;
109+
long timeout = jiffies_to_msecs(data->timeout);
110110
while (timeout > 0 &&
111111
(ioread32(I2C_REG_CTL(data)) & mcntrl_reset)) {
112112
mdelay(1);

0 commit comments

Comments
 (0)