• Julian Wiedmann's avatar
    s390/qeth: fix potential deadlock on workqueue flush · c8183f54
    Julian Wiedmann authored
    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: c0a2e4d1 ("s390/qeth: conclude all event processing before offlining a card")
    Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
    Reviewed-by: default avatarAlexandra Winter <wintera@linux.ibm.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c8183f54
qeth_l2_sys.c 11.5 KB