]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
scsi: Fix qemu boot hang problem
authorGuenter Roeck <linux@roeck-us.net>
Sun, 10 Aug 2014 12:54:25 +0000 (05:54 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 19 Aug 2014 17:42:26 +0000 (12:42 -0500)
commit480cadc2b7e0fa2bbab20141efb547dfe0c3707c
treee5ca69de3a9f3e4ce8bddcb8bd4be00a87d32759
parent63d871cb0b9e4207044ced0322aa34d859fa463d
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>
drivers/scsi/scsi_lib.c