Message ID | 20220922175821.4184622-6-andrew@lunn.ch (mailing list archive) |
---|---|
State | RFC |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | DSA: Move parts of inband signalling into the DSA | expand |
diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c index 2f92cabe21af..fdf27306d169 100644 --- a/drivers/net/dsa/qca/qca8k-8xxx.c +++ b/drivers/net/dsa/qca/qca8k-8xxx.c @@ -145,9 +145,9 @@ static void qca8k_rw_reg_ack_handler(struct dsa_switch *ds, struct sk_buff *skb) cmd = FIELD_GET(QCA_HDR_MGMT_CMD, mgmt_ethhdr->command); len = FIELD_GET(QCA_HDR_MGMT_LENGTH, mgmt_ethhdr->command); - /* Make sure the seq match the requested packet */ + /* Make sure the seq match the requested packet. If not, drop. */ if (mgmt_ethhdr->seq == mgmt_eth_data->seq) - mgmt_eth_data->ack = true; + return; if (cmd == MDIO_READ) { mgmt_eth_data->data[0] = mgmt_ethhdr->mdio_data;
A response with the wrong sequence number is likely to be a late arriving responses, which the driver has already given up waiting for. Drop it rather than signalling the complete. If the complete was signalled, this late response could take the place of the genuine reply which is soon to follow. Signed-off-by: Andrew Lunn <andrew@lunn.ch> --- drivers/net/dsa/qca/qca8k-8xxx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)