mirror of https://github.com/OpenIPC/firmware.git
39 lines
969 B
Diff
39 lines
969 B
Diff
--- linux-4.9.37/drivers/scsi/scsi_lib.c 2017-07-12 16:42:41.000000000 +0300
|
|
+++ linux-4.9.y/drivers/scsi/scsi_lib.c 2021-06-07 13:01:34.000000000 +0300
|
|
@@ -1420,7 +1420,7 @@
|
|
if (scsi_host_in_recovery(shost))
|
|
return 0;
|
|
|
|
- busy = atomic_inc_return(&shost->host_busy) - 1;
|
|
+ busy = atomic_read(&shost->host_busy);
|
|
if (atomic_read(&shost->host_blocked) > 0) {
|
|
if (busy)
|
|
goto starved;
|
|
@@ -1429,7 +1429,7 @@
|
|
* unblock after host_blocked iterates to zero
|
|
*/
|
|
if (atomic_dec_return(&shost->host_blocked) > 0)
|
|
- goto out_dec;
|
|
+ goto out;
|
|
|
|
SCSI_LOG_MLQUEUE(3,
|
|
shost_printk(KERN_INFO, shost,
|
|
@@ -1449,6 +1449,7 @@
|
|
spin_unlock_irq(shost->host_lock);
|
|
}
|
|
|
|
+ atomic_inc(&shost->host_busy);
|
|
return 1;
|
|
|
|
starved:
|
|
@@ -1456,8 +1457,7 @@
|
|
if (list_empty(&sdev->starved_entry))
|
|
list_add_tail(&sdev->starved_entry, &shost->starved_list);
|
|
spin_unlock_irq(shost->host_lock);
|
|
-out_dec:
|
|
- atomic_dec(&shost->host_busy);
|
|
+out:
|
|
return 0;
|
|
}
|
|
|