linux_dsm_epyc7002/drivers/s390
Vineeth Vijayan 38a2ba82e2 s390/cio: dont call css_wait_for_slow_path() inside a lock
commit c749d8c018daf5fba6dfac7b6c5c78b27efd7d65 upstream.

Currently css_wait_for_slow_path() gets called inside the chp->lock.
The path-verification-loop of slowpath inside this lock could lead to
deadlock as reported by the lockdep validator.

The ccw_device_get_chp_desc() during the instance of a device-set-online
would try to acquire the same 'chp->lock' to read the chp->desc.
The instance of this function can get called from multiple scenario,
like probing or setting-device online manually. This could, in some
corner-cases lead to the deadlock.

lockdep validator reported this as,

        CPU0                    CPU1
        ----                    ----
   lock(&chp->lock);
                                lock(kn->active#43);
                                lock(&chp->lock);
   lock((wq_completion)cio);

The chp->lock was introduced to serialize the access of struct
channel_path. This lock is not needed for the css_wait_for_slow_path()
function, so invoke the slow-path function outside this lock.

Fixes: b730f3a933 ("[S390] cio: add lock to struct channel_path")
Cc: <stable@vger.kernel.org>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-07-14 16:55:43 +02:00
..
block s390/dasd: fix hanging IO request during DASD driver unbind 2021-03-17 17:06:28 +01:00
char s390 updates for the 5.10 merge window 2020-10-16 12:36:38 -07:00
cio s390/cio: dont call css_wait_for_slow_path() inside a lock 2021-07-14 16:55:43 +02:00
crypto s390/ap: Fix hanging ioctl caused by wrong msg counter 2021-06-23 14:42:51 +02:00
net s390/qeth: schedule TX NAPI on QAOB completion 2021-03-25 09:04:13 +01:00
scsi s390 updates for the 5.10 merge window 2020-10-16 12:36:38 -07:00
virtio virtio/s390: implement virtio-ccw revision 2 correctly 2021-03-04 11:38:42 +01:00
Makefile s390: remove pointless drivers-y in drivers/s390/Makefile 2019-09-16 13:21:51 +02:00