Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

i2c: testunit: avoid re-issued work after read message

The to-be-fixed commit rightfully prevented that the registers will be
cleared. However, the index must be cleared. Otherwise a read message
will re-issue the last work. Fix it and add a comment describing the
situation.

Fixes: c422b6a63024 ("i2c: testunit: don't erase registers after STOP")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

+7
+7
drivers/i2c/i2c-slave-testunit.c
··· 118 118 queue_delayed_work(system_long_wq, &tu->worker, 119 119 msecs_to_jiffies(10 * tu->regs[TU_REG_DELAY])); 120 120 } 121 + 122 + /* 123 + * Reset reg_idx to avoid that work gets queued again in case of 124 + * STOP after a following read message. But do not clear TU regs 125 + * here because we still need them in the workqueue! 126 + */ 127 + tu->reg_idx = 0; 121 128 break; 122 129 123 130 case I2C_SLAVE_WRITE_REQUESTED: