linux-stable/drivers/net/mctp
Jeremy Kerr 9cbd48d5fa mctp i2c: don't count unused / invalid keys for flow release
We're currently hitting the WARN_ON in mctp_i2c_flow_release:

    if (midev->release_count > midev->i2c_lock_count) {
        WARN_ONCE(1, "release count overflow");

This may be hit if we expire a flow before sending the first packet it
contains - as we will not be pairing the increment of release_count
(performed on flow release) with the i2c lock operation (only
performed on actual TX).

To fix this, only release a flow if we've encountered it previously (ie,
dev_flow_state does not indicate NEW), as we will mark the flow as
ACTIVE at the same time as accounting for the i2c lock operation. We
also need to add an INVALID flow state, to indicate when we've done the
release.

Fixes: f5b8abf9fc ("mctp i2c: MCTP I2C binding driver")
Reported-by: Jian Zhang <zhangjian.3032@bytedance.com>
Tested-by: Jian Zhang <zhangjian.3032@bytedance.com>
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Link: https://lore.kernel.org/r/20221110053135.329071-1-jk@codeconstruct.com.au
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-11-11 20:13:27 -08:00
..
Kconfig mctp i2c: MCTP I2C binding driver 2022-02-19 16:18:49 +00:00
Makefile mctp i2c: MCTP I2C binding driver 2022-02-19 16:18:49 +00:00
mctp-i2c.c mctp i2c: don't count unused / invalid keys for flow release 2022-11-11 20:13:27 -08:00
mctp-serial.c mctp: serial: Use netif_rx(). 2022-03-06 11:05:31 +00:00