Guenter Roeck 480cadc2b7 scsi: Fix qemu boot hang problem
The latest kernel fails to boot qemu arm images when using scsi
for disk access. Boot gets stuck after the following messages.

brd: module loaded
sym53c8xx 0000:00:0c.0: enabling device (0100 -> 0103)
sym0: <895a> rev 0x0 at pci 0000:00:0c.0 irq 93
sym0: No NVRAM, ID 7, Fast-40, LVD, parity checking
sym0: SCSI BUS has been reset.
scsi host0: sym-2.2.3

Bisect points to commit 71e75c97f97a ("scsi: convert device_busy to
atomic_t"). Code inspection shows the following suspicious change
in scsi_request_fn.

out_delay:
-       if (sdev->device_busy == 0 && !scsi_device_blocked(sdev))
+       if (atomic_read(&sdev->device_busy) && !scsi_device_blocked(sdev))
		blk_delay_queue(q, SCSI_QUEUE_DELAY);
	}

'sdev->device_busy == 0' was replaced with 'atomic_read(&sdev->device_busy)',
meaning the logic was reversed. Changing this expression to
'!atomic_read(&sdev->device_busy)' fixes the problem.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Acked-by: Jens Axboe <axboe@fb.com>
Reviewed-by: Venkatesh Srinivas <venkateshs@google.com>
Reviewed-by: Webb Scales <webbnh@hp.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-08-19 12:42:26 -05:00
..
2014-07-17 22:07:37 +02:00
2014-07-25 17:16:54 -04:00
2014-07-17 22:07:37 +02:00
2014-07-17 22:07:37 +02:00
2014-07-25 17:16:59 -04:00
2014-05-19 19:12:23 +02:00
2014-07-25 17:16:55 -04:00
2014-08-08 15:57:29 -07:00
2014-06-06 07:57:37 -06:00
2014-07-17 22:07:37 +02:00
2014-08-15 18:28:58 -06:00
2014-07-25 17:16:55 -04:00
2014-07-17 22:07:37 +02:00
2014-08-08 15:57:29 -07:00
2014-07-17 22:07:37 +02:00
2014-08-08 15:57:29 -07:00
2014-07-25 07:43:43 -04:00
2014-07-17 22:07:37 +02:00
2014-07-17 22:07:37 +02:00
2014-06-09 18:54:06 -07:00
2014-07-17 22:07:40 +02:00
2014-07-17 22:07:38 +02:00
2014-07-17 22:07:37 +02:00
2014-07-17 22:07:37 +02:00
2014-08-08 15:57:29 -07:00
2014-07-17 22:07:37 +02:00
2014-08-08 15:57:29 -07:00
2014-07-17 22:07:37 +02:00
2014-07-17 22:07:37 +02:00
2014-07-25 17:16:55 -04:00
2014-07-17 22:07:44 +02:00
2014-08-08 15:57:29 -07:00
2014-07-17 22:07:37 +02:00
2014-07-17 22:07:35 +02:00
2014-07-17 22:07:37 +02:00
2014-05-28 18:14:16 +02:00
2014-07-17 22:07:37 +02:00
2014-06-06 07:57:37 -06:00
2014-07-25 17:16:55 -04:00
2014-07-17 22:07:37 +02:00
2014-07-25 17:16:55 -04:00
2014-08-19 12:42:26 -05:00
2014-04-10 15:30:35 -07:00
2014-07-17 22:07:37 +02:00
2014-07-17 22:07:37 +02:00
2013-11-23 22:33:50 -08:00
2014-07-17 22:07:33 +02:00
2014-07-25 07:43:45 -04:00
2014-07-17 22:07:39 +02:00
2014-07-17 22:07:39 +02:00
2014-07-17 22:07:41 +02:00
2014-07-25 17:23:25 -04:00
2014-07-17 22:07:37 +02:00
2014-05-28 12:05:37 +02:00
2014-05-28 12:05:37 +02:00
2014-07-17 22:07:37 +02:00
2014-07-17 22:07:37 +02:00