]> asedeno.scripts.mit.edu Git - linux.git/commit
s390/qeth: fix request-side race during cmd IO timeout
authorJulian Wiedmann <jwi@linux.vnet.ibm.com>
Thu, 19 Apr 2018 10:52:10 +0000 (12:52 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 22 Apr 2018 18:42:32 +0000 (14:42 -0400)
commitdb71bbbd11a4d314f0fa3fbf3369b71cf33ce33c
treeb4d33d750b092082be8932b91608b68be84aafa1
parentbcacfcbc82b4235d280ed9b067aa4567f4a0c756
s390/qeth: fix request-side race during cmd IO timeout

Submitting a cmd IO request (usually on the WRITE device, but for IDX
also on the READ device) is currently done with ccw_device_start()
and a manual timeout in the caller.
On timeout, the caller cleans up the related resources (eg. IO buffer).
But 1) the IO might still be active and utilize those resources, and
    2) when the IO completes, qeth_irq() will attempt to clean up the
       same resources again.

Instead of introducing additional resource locking, switch to
ccw_device_start_timeout() to ensure IO termination after timeout, and
let the IRQ handler alone deal with cleaning up after a request.

This also removes a stray write->irq_pending reset from
clear_ipacmd_list(). The routine doesn't terminate any pending IO on
the WRITE device, so this should be handled properly via IO timeout
in the IRQ handler.

Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_core_main.c
drivers/s390/net/qeth_core_mpc.h
drivers/s390/net/qeth_l2_main.c