diff options
author | Julian Wiedmann <jwi@linux.ibm.com> | 2019-11-20 14:20:56 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-11-20 12:29:47 -0800 |
commit | c8183f5489020afc08dd9d88c3e4ee0e3c820733 (patch) | |
tree | eab9d781313d549f49d10f3af84e7ed78f952166 /drivers/s390/net/qeth_core.h | |
parent | 004b39427f945696db30abb2c4e1a3856ffff819 (diff) | |
download | linux-c8183f5489020afc08dd9d88c3e4ee0e3c820733.tar.gz linux-c8183f5489020afc08dd9d88c3e4ee0e3c820733.tar.bz2 linux-c8183f5489020afc08dd9d88c3e4ee0e3c820733.zip |
s390/qeth: fix potential deadlock on workqueue flush
The L2 bridgeport code uses the coarse 'conf_mutex' for guarding access
to its configuration state.
This can result in a deadlock when qeth_l2_stop_card() - called under the
conf_mutex - blocks on flush_workqueue() to wait for the completion of
pending bridgeport workers. Such workers would also need to aquire
the conf_mutex, stalling indefinitely.
Introduce a lock that specifically guards the bridgeport configuration,
so that the workers no longer need the conf_mutex.
Wrapping qeth_l2_promisc_to_bridge() in this fine-grained lock then also
fixes a theoretical race against a concurrent qeth_bridge_port_role_store()
operation.
Fixes: c0a2e4d10d93 ("s390/qeth: conclude all event processing before offlining a card")
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/qeth_core.h')
-rw-r--r-- | drivers/s390/net/qeth_core.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index e4b55f9aa062..65e31df37b1f 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h @@ -839,6 +839,7 @@ struct qeth_card { struct service_level qeth_service_level; struct qdio_ssqd_desc ssqd; debug_info_t *debug; + struct mutex sbp_lock; struct mutex conf_mutex; struct mutex discipline_mutex; struct napi_struct napi; |