mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-18 11:54:37 +08:00
SCSI fixes on 20201106
Three driver fixes. Two (alua and hpsa) are in hard to trigger attach/detach situations but the mp3sas one involves a polled to interrupt switch over that could trigger in any high IOPS situation. Signed-off-by: James E.J. Bottomley <jejb@linux.ibm.com> -----BEGIN PGP SIGNATURE----- iJwEABMIAEQWIQTnYEDbdso9F2cI+arnQslM7pishQUCX6XCfiYcamFtZXMuYm90 dG9tbGV5QGhhbnNlbnBhcnRuZXJzaGlwLmNvbQAKCRDnQslM7pishRsrAP4l4Bus CxDEZ1IEKajWDRjOkR2DtsJRfmAcRVc1JNUz5QD/SCBam7vwDFjh4yoNd8RrGY7J xW6xGR0R7L3yX3SyYk4= =6ABy -----END PGP SIGNATURE----- Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Three driver fixes. Two (alua and hpsa) are in hard to trigger attach/detach situations but the mp3sas one involves a polled to interrupt switch over that could trigger in any high IOPS situation" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: mpt3sas: Fix timeouts observed while reenabling IRQ scsi: scsi_dh_alua: Avoid crash during alua_bus_detach() scsi: hpsa: Fix memory leak in hpsa_init_one()
This commit is contained in:
commit
d4fc96832f
@ -658,8 +658,8 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
|
||||
rcu_read_lock();
|
||||
list_for_each_entry_rcu(h,
|
||||
&tmp_pg->dh_list, node) {
|
||||
/* h->sdev should always be valid */
|
||||
BUG_ON(!h->sdev);
|
||||
if (!h->sdev)
|
||||
continue;
|
||||
h->sdev->access_state = desc[0];
|
||||
}
|
||||
rcu_read_unlock();
|
||||
@ -705,7 +705,8 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
|
||||
pg->expiry = 0;
|
||||
rcu_read_lock();
|
||||
list_for_each_entry_rcu(h, &pg->dh_list, node) {
|
||||
BUG_ON(!h->sdev);
|
||||
if (!h->sdev)
|
||||
continue;
|
||||
h->sdev->access_state =
|
||||
(pg->state & SCSI_ACCESS_STATE_MASK);
|
||||
if (pg->pref)
|
||||
@ -1147,7 +1148,6 @@ static void alua_bus_detach(struct scsi_device *sdev)
|
||||
spin_lock(&h->pg_lock);
|
||||
pg = rcu_dereference_protected(h->pg, lockdep_is_held(&h->pg_lock));
|
||||
rcu_assign_pointer(h->pg, NULL);
|
||||
h->sdev = NULL;
|
||||
spin_unlock(&h->pg_lock);
|
||||
if (pg) {
|
||||
spin_lock_irq(&pg->lock);
|
||||
@ -1156,6 +1156,7 @@ static void alua_bus_detach(struct scsi_device *sdev)
|
||||
kref_put(&pg->kref, release_port_group);
|
||||
}
|
||||
sdev->handler_data = NULL;
|
||||
synchronize_rcu();
|
||||
kfree(h);
|
||||
}
|
||||
|
||||
|
@ -8855,7 +8855,7 @@ reinit_after_soft_reset:
|
||||
/* hook into SCSI subsystem */
|
||||
rc = hpsa_scsi_add_host(h);
|
||||
if (rc)
|
||||
goto clean7; /* perf, sg, cmd, irq, shost, pci, lu, aer/h */
|
||||
goto clean8; /* lastlogicals, perf, sg, cmd, irq, shost, pci, lu, aer/h */
|
||||
|
||||
/* Monitor the controller for firmware lockups */
|
||||
h->heartbeat_sample_interval = HEARTBEAT_SAMPLE_INTERVAL;
|
||||
@ -8870,6 +8870,8 @@ reinit_after_soft_reset:
|
||||
HPSA_EVENT_MONITOR_INTERVAL);
|
||||
return 0;
|
||||
|
||||
clean8: /* lastlogicals, perf, sg, cmd, irq, shost, pci, lu, aer/h */
|
||||
kfree(h->lastlogicals);
|
||||
clean7: /* perf, sg, cmd, irq, shost, pci, lu, aer/h */
|
||||
hpsa_free_performant_mode(h);
|
||||
h->access.set_intr_mask(h, HPSA_INTR_OFF);
|
||||
|
@ -1740,6 +1740,13 @@ _base_irqpoll(struct irq_poll *irqpoll, int budget)
|
||||
reply_q->irq_poll_scheduled = false;
|
||||
reply_q->irq_line_enable = true;
|
||||
enable_irq(reply_q->os_irq);
|
||||
/*
|
||||
* Go for one more round of processing the
|
||||
* reply descriptor post queue incase if HBA
|
||||
* Firmware has posted some reply descriptors
|
||||
* while reenabling the IRQ.
|
||||
*/
|
||||
_base_process_reply_queue(reply_q);
|
||||
}
|
||||
|
||||
return num_entries;
|
||||
|
Loading…
Reference in New Issue
Block a user