Skip to content
Commit 9cbd48d5 authored by Jeremy Kerr's avatar Jeremy Kerr Committed by Jakub Kicinski
Browse files

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: f5b8abf9

 ("mctp i2c: MCTP I2C binding driver")
Reported-by: default avatarJian Zhang <zhangjian.3032@bytedance.com>
Tested-by: default avatarJian Zhang <zhangjian.3032@bytedance.com>
Signed-off-by: default avatarJeremy Kerr <jk@codeconstruct.com.au>
Link: https://lore.kernel.org/r/20221110053135.329071-1-jk@codeconstruct.com.au
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 0834ced6
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment