linux_dsm_epyc7002/drivers/s390/cio
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
..
airq.c
blacklist.c
blacklist.h
ccwgroup.c
ccwreq.c
chp.c s390/cio: dont call css_wait_for_slow_path() inside a lock 2021-07-14 16:55:43 +02:00
chp.h
chsc_sch.c
chsc_sch.h
chsc.c s390/cio: dont call css_wait_for_slow_path() inside a lock 2021-07-14 16:55:43 +02:00
chsc.h s390/cio: Helper functions to read CSSID, IID, and CHID 2020-09-15 13:21:46 -07:00
cio_debug.h
cio.c
cio.h
cmf.c
crw.c
css.c s390 updates for the 5.10 merge window 2020-10-16 12:36:38 -07:00
css.h s390/cio: Helper functions to read CSSID, IID, and CHID 2020-09-15 13:21:46 -07:00
device_fsm.c
device_id.c
device_ops.c s390/cio: Helper functions to read CSSID, IID, and CHID 2020-09-15 13:21:46 -07:00
device_pgid.c
device_status.c
device.c s390/cio: fix use-after-free in ccw_device_destroy_console 2020-12-30 11:53:46 +01:00
device.h s390: remove orphaned function declarations 2020-09-30 12:09:54 +02:00
eadm_sch.c
eadm_sch.h
fcx.c
idset.c s390/cio: Remove unused inline function idset_sch_get_first 2020-05-20 10:22:49 +02:00
idset.h
io_sch.h
ioasm.c
ioasm.h
isc.c
itcw.c
Makefile vfio-ccw: Introduce a new schib region 2020-06-02 13:14:08 +02:00
orb.h
qdio_debug.c s390/qdio: fix statistics for 128 SBALs 2020-07-20 10:55:18 +02:00
qdio_debug.h
qdio_main.c s390/qdio: always use dev_name() for device name in QIB 2020-09-14 10:30:07 +02:00
qdio_setup.c s390/qdio: always use dev_name() for device name in QIB 2020-09-14 10:30:07 +02:00
qdio_thinint.c s390/qdio: consolidate thinint init/exit 2020-04-28 13:49:47 +02:00
qdio.h s390/qdio: remove internal polling in non-thinint path 2020-07-20 10:55:26 +02:00
scm.c
trace.c
trace.h
vfio_ccw_async.c
vfio_ccw_chp.c vfio-ccw: Fix a build error due to missing include of linux/slab.h 2020-07-03 11:41:31 +02:00
vfio_ccw_cp.c vfio-ccw: Check initialized flag in cp_init() 2021-06-03 09:00:46 +02:00
vfio_ccw_cp.h
vfio_ccw_drv.c vfio-ccw: Serialize FSM IDLE state with I/O completion 2021-06-16 12:01:35 +02:00
vfio_ccw_fsm.c vfio-ccw: Reset FSM state to IDLE inside FSM 2021-06-16 12:01:35 +02:00
vfio_ccw_ops.c vfio-ccw: Reset FSM state to IDLE inside FSM 2021-06-16 12:01:35 +02:00
vfio_ccw_private.h vfio-ccw: Wire up the CRW irq and CRW region 2020-06-03 11:28:19 +02:00
vfio_ccw_trace.c vfio-ccw: Add trace for CRW event 2020-06-03 11:28:19 +02:00
vfio_ccw_trace.h vfio-ccw: Add trace for CRW event 2020-06-03 11:28:19 +02:00