1
0
Fork 0
alistair23-linux/drivers/s390/net
Julian Wiedmann 993e42d0f7 s390/qeth: fix tear down of async TX buffers
[ Upstream commit 7ed10e16e5 ]

When qeth_iqd_tx_complete() detects that a TX buffer requires additional
async completion via QAOB, it might fail to replace the queue entry's
metadata (and ends up triggering recovery).

Assume now that the device gets torn down, overruling the recovery.
If the QAOB notification then arrives before the tear down has
sufficiently progressed, the buffer state is changed to
QETH_QDIO_BUF_HANDLED_DELAYED by qeth_qdio_handle_aob().

The tear down code calls qeth_drain_output_queue(), where
qeth_cleanup_handled_pending() will then attempt to replace such a
buffer _again_. If it succeeds this time, the buffer ends up dangling in
its replacement's ->next_pending list ... where it will never be freed,
since there's no further call to qeth_cleanup_handled_pending().

But the second attempt isn't actually needed, we can simply leave the
buffer on the queue and re-use it after a potential recovery has
completed. The qeth_clear_output_buffer() in qeth_drain_output_queue()
will ensure that it's in a clean state again.

Fixes: 72861ae792 ("qeth: recovery through asynchronous delivery")
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-12-02 08:49:51 +01:00
..
Kconfig s390/Kconfig: pedantic cleanups 2019-06-04 15:03:46 +02:00
Makefile s390/qeth: move ethtool code into its own file 2019-02-15 20:35:29 -08:00
ctcm_dbug.c
ctcm_dbug.h
ctcm_fsms.c s390/ctcm: don't use intparm for channel IO 2019-08-20 13:51:46 -07:00
ctcm_fsms.h
ctcm_main.c s390/ctcm: Delete unnecessary checks before the macro call “dev_kfree_skb” 2019-09-16 21:45:32 +02:00
ctcm_main.h
ctcm_mpc.c s390/ctcm: don't use intparm for channel IO 2019-08-20 13:51:46 -07:00
ctcm_mpc.h
ctcm_sysfs.c
fsm.c
fsm.h
ism.h s390/ism: move oddities of device IO to wrapper function 2019-04-29 10:47:01 +02:00
ism_drv.c s390/ism: fix error return code in ism_probe() 2020-05-20 08:20:26 +02:00
lcs.c s390/lcs: don't use intparm for channel IO 2019-08-20 13:51:46 -07:00
lcs.h
netiucv.c
qeth_core.h s390/qeth: fix af_iucv notification race 2020-12-02 08:49:51 +01:00
qeth_core_main.c s390/qeth: fix tear down of async TX buffers 2020-12-02 08:49:51 +01:00
qeth_core_mpc.c s390/qeth: allow cmd callbacks to return errnos 2019-02-12 13:14:24 -05:00
qeth_core_mpc.h s390/qeth: fix dangling IO buffers after halt/clear 2020-01-26 10:01:09 +01:00
qeth_core_sys.c s390/qeth: don't return -ENOTSUPP to userspace 2020-01-12 12:21:44 +01:00
qeth_ethtool.c s390/qeth: add TX NAPI support for IQD devices 2019-08-24 16:39:18 -07:00
qeth_l2.h
qeth_l2_main.c s390/qeth: don't let HW override the configured port role 2020-10-29 09:58:10 +01:00
qeth_l2_sys.c s390/qeth: fix promiscuous mode after reset 2020-01-12 12:21:44 +01:00
qeth_l3.h
qeth_l3_main.c s390/qeth: fix dangling IO buffers after halt/clear 2020-01-26 10:01:09 +01:00
qeth_l3_sys.c s390/qeth: lock the card while changing its hsuid 2020-01-17 19:49:06 +01:00
smsgiucv.c
smsgiucv.h
smsgiucv_app.c