Files
i2som-imx-linux/include/linux
Martin Peschke db59af9637 zfcp: fix lock imbalance by reworking request queue locking
commit d79ff14262 upstream.

This patch adds wait_event_interruptible_lock_irq_timeout(), which is a
straight-forward descendant of wait_event_interruptible_timeout() and
wait_event_interruptible_lock_irq().

The zfcp driver used to call wait_event_interruptible_timeout()
in combination with some intricate and error-prone locking. Using
wait_event_interruptible_lock_irq_timeout() as a replacement
nicely cleans up that locking.

This rework removes a situation that resulted in a locking imbalance
in zfcp_qdio_sbal_get():

BUG: workqueue leaked lock or atomic: events/1/0xffffff00/10
    last function: zfcp_fc_wka_port_offline+0x0/0xa0 [zfcp]

It was introduced by commit c2af7545aa
"[SCSI] zfcp: Do not wait for SBALs on stopped queue", which had a new
code path related to ZFCP_STATUS_ADAPTER_QDIOUP that took an early exit
without a required lock being held. The problem occured when a
special, non-SCSI I/O request was being submitted in process context,
when the adapter's queues had been torn down. In this case the bug
surfaced when the Fibre Channel port connection for a well-known address
was closed during a concurrent adapter shut-down procedure, which is a
rare constellation.

This patch also fixes these warnings from the sparse tool (make C=1):

drivers/s390/scsi/zfcp_qdio.c:224:12: warning: context imbalance in
 'zfcp_qdio_sbal_check' - wrong count at exit
drivers/s390/scsi/zfcp_qdio.c:244:5: warning: context imbalance in
 'zfcp_qdio_sbal_get' - unexpected unlock

Last but not least, we get rid of that crappy lock-unlock-lock
sequence at the beginning of the critical section.

It is okay to call zfcp_erp_adapter_reopen() with req_q_lock held.

Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>
Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2013-09-10 01:57:28 +01:00
..
2012-11-16 16:46:48 +00:00
2013-09-10 01:57:27 +01:00
2012-02-20 12:46:20 -08:00
2012-08-02 14:37:54 +01:00
2011-11-07 23:54:53 +01:00
2011-10-31 20:19:04 +00:00
2012-02-29 16:31:24 -08:00
2013-01-03 03:32:57 +00:00
2011-11-23 11:33:07 +01:00
2013-03-06 03:23:57 +00:00
2013-08-02 22:14:47 +02:00
2012-08-10 00:11:14 +01:00
2012-07-25 04:11:19 +01:00
2013-03-06 03:24:27 +00:00
2013-04-25 20:25:38 +01:00
2012-04-02 09:52:34 -07:00
2012-10-10 03:30:45 +01:00
2013-01-03 03:32:54 +00:00
2011-11-02 16:06:57 -07:00
2013-05-13 15:02:33 +01:00
2013-07-27 05:34:29 +01:00
2013-04-25 20:25:40 +01:00
2012-01-25 16:13:17 -08:00
2012-02-06 09:41:06 -08:00
2013-07-27 05:34:32 +01:00
2011-11-22 16:37:01 -05:00
2011-11-02 16:07:02 -07:00
2011-11-29 11:59:50 +00:00
2013-09-10 01:57:09 +01:00
2013-01-16 01:13:25 +00:00
2012-07-12 04:31:59 +01:00
2011-10-31 17:30:47 -07:00
2011-10-31 17:30:44 -07:00
2011-11-02 16:07:02 -07:00
2012-07-25 04:11:32 +01:00
2011-11-02 16:07:02 -07:00
2013-08-02 22:14:52 +02:00