<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace">There is a same fix in <a href="https://lore.kernel.org/openbmc/374237cb-1cda-df12-eb9f-7422cab51fc4@linux.alibaba.com/">https://lore.kernel.org/openbmc/374237cb-1cda-df12-eb9f-7422cab51fc4@linux.alibaba.com/</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 31, 2023 at 12:21 PM Joel Stanley <<a href="mailto:joel@jms.id.au">joel@jms.id.au</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, 28 Jul 2023 at 12:40, Lixue Liang <<a href="mailto:lianglixuehao@126.com" target="_blank">lianglixuehao@126.com</a>> wrote:<br>
><br>
> From: Lixue Liang <<a href="mailto:lianglixue@greatwall.com.cn" target="_blank">lianglixue@greatwall.com.cn</a>><br>
><br>
> After waiting for the transmission timeout, the I2C controller will<br>
> continue to transmit data when the bus is idle. Clearing bus->msg will<br>
> avoid kernel panic when accessing the freed msg->buf in<br>
> aspeed_i2c_master_irq.<br>
><br>
> Signed-off-by: Lixue Liang <<a href="mailto:lianglixue@greatwall.com.cn" target="_blank">lianglixue@greatwall.com.cn</a>><br>
> ---<br>
>  drivers/i2c/busses/i2c-aspeed.c | 2 ++<br>
>  1 file changed, 2 insertions(+)<br>
><br>
> diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c<br>
> index 2e5acfeb76c8..c83057497e26 100644<br>
> --- a/drivers/i2c/busses/i2c-aspeed.c<br>
> +++ b/drivers/i2c/busses/i2c-aspeed.c<br>
> @@ -713,6 +713,8 @@ static int aspeed_i2c_master_xfer(struct i2c_adapter *adap,<br>
>                 spin_lock_irqsave(&bus->lock, flags);<br>
>                 if (bus->master_state == ASPEED_I2C_MASTER_PENDING)<br>
>                         bus->master_state = ASPEED_I2C_MASTER_INACTIVE;<br>
> +<br>
> +               bus->msgs = NULL;<br>
<br>
Eddie, is this the same issue you were debugging?<br>
<br>
>                 spin_unlock_irqrestore(&bus->lock, flags);<br>
><br>
>                 return -ETIMEDOUT;<br>
> --<br>
> 2.27.0<br>
><br>
</blockquote></div></div>