]> git.baikalelectronics.ru Git - kernel.git/commit
s390/qeth: Fix deadlock in remove_discipline
authorAlexandra Winter <wintera@linux.ibm.com>
Tue, 21 Sep 2021 14:52:16 +0000 (16:52 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 22 Sep 2021 03:02:24 +0000 (20:02 -0700)
commit0b286607f8b048e4841c9997bd218f95408e17f3
treed659a3705a01cbd6f9936171fe371c07d77c192b
parenta46174487be7e14e5c19233a721ff0207733ab26
s390/qeth: Fix deadlock in remove_discipline

Problem: qeth_close_dev_handler is a worker that tries to acquire
card->discipline_mutex via drv->set_offline() in ccwgroup_set_offline().
Since commit aec9f46caab2
("s390/qeth: fix locking for discipline setup / removal")
qeth_remove_discipline() is called under card->discipline_mutex and
cancels the work and waits for it to finish.

STOPLAN reception with reason code IPA_RC_VEPA_TO_VEB_TRANSITION is the
only situation that schedules close_dev_work. In that situation scheduling
qeth recovery will also result in an offline interface, when resetting the
isolation mode fails, if the external switch is still set to VEB.
And since commit 0b42b521db58 ("s390/qeth: fix deadlock during recovery")
qeth recovery does not aquire card->discipline_mutex anymore.

So we accept the longer pathlength of qeth_schedule_recovery in this
error situation and re-use the existing function.

As a side-benefit this changes the hwtrap to behave like during recovery
instead of like during a user-triggered set_offline.

Fixes: aec9f46caab2 ("s390/qeth: fix locking for discipline setup / removal")
Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
Acked-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/s390/net/qeth_core.h
drivers/s390/net/qeth_core_main.c
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c