Commit bfd7546c authored by Don Brace's avatar Don Brace Committed by Martin K. Petersen

scsi: hpsa: correct logical resets

- driver was not calling done in some cases which causes the volume to
  be offlined.
- avoid doing rescan during a reset.
Reviewed-by: default avatarScott Teel <scott.teel@microsemi.com>
Reviewed-by: default avatarKevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: default avatarDon Brace <don.brace@microsemi.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 18103efc
...@@ -276,6 +276,9 @@ static int hpsa_find_cfg_addrs(struct pci_dev *pdev, void __iomem *vaddr, ...@@ -276,6 +276,9 @@ static int hpsa_find_cfg_addrs(struct pci_dev *pdev, void __iomem *vaddr,
static int hpsa_pci_find_memory_BAR(struct pci_dev *pdev, static int hpsa_pci_find_memory_BAR(struct pci_dev *pdev,
unsigned long *memory_bar); unsigned long *memory_bar);
static int hpsa_lookup_board_id(struct pci_dev *pdev, u32 *board_id); static int hpsa_lookup_board_id(struct pci_dev *pdev, u32 *board_id);
static int wait_for_device_to_become_ready(struct ctlr_info *h,
unsigned char lunaddr[],
int reply_queue);
static int hpsa_wait_for_board_state(struct pci_dev *pdev, void __iomem *vaddr, static int hpsa_wait_for_board_state(struct pci_dev *pdev, void __iomem *vaddr,
int wait_for_ready); int wait_for_ready);
static inline void finish_cmd(struct CommandList *c); static inline void finish_cmd(struct CommandList *c);
...@@ -2540,7 +2543,7 @@ static void complete_scsi_command(struct CommandList *cp) ...@@ -2540,7 +2543,7 @@ static void complete_scsi_command(struct CommandList *cp)
if ((unlikely(hpsa_is_pending_event(cp)))) { if ((unlikely(hpsa_is_pending_event(cp)))) {
if (cp->reset_pending) if (cp->reset_pending)
return hpsa_cmd_resolve_and_free(h, cp); return hpsa_cmd_free_and_done(h, cp, cmd);
if (cp->abort_pending) if (cp->abort_pending)
return hpsa_cmd_abort_and_free(h, cp, cmd); return hpsa_cmd_abort_and_free(h, cp, cmd);
} }
...@@ -3079,6 +3082,8 @@ static int hpsa_do_reset(struct ctlr_info *h, struct hpsa_scsi_dev_t *dev, ...@@ -3079,6 +3082,8 @@ static int hpsa_do_reset(struct ctlr_info *h, struct hpsa_scsi_dev_t *dev,
if (unlikely(rc)) if (unlikely(rc))
atomic_set(&dev->reset_cmds_out, 0); atomic_set(&dev->reset_cmds_out, 0);
else
wait_for_device_to_become_ready(h, scsi3addr, 0);
mutex_unlock(&h->reset_mutex); mutex_unlock(&h->reset_mutex);
return rc; return rc;
...@@ -5563,6 +5568,14 @@ static void hpsa_scan_start(struct Scsi_Host *sh) ...@@ -5563,6 +5568,14 @@ static void hpsa_scan_start(struct Scsi_Host *sh)
if (unlikely(lockup_detected(h))) if (unlikely(lockup_detected(h)))
return hpsa_scan_complete(h); return hpsa_scan_complete(h);
/*
* Do the scan after a reset completion
*/
if (h->reset_in_progress) {
h->drv_req_rescan = 1;
return;
}
hpsa_update_scsi_devices(h); hpsa_update_scsi_devices(h);
hpsa_scan_complete(h); hpsa_scan_complete(h);
...@@ -8590,6 +8603,14 @@ static void hpsa_rescan_ctlr_worker(struct work_struct *work) ...@@ -8590,6 +8603,14 @@ static void hpsa_rescan_ctlr_worker(struct work_struct *work)
if (h->remove_in_progress) if (h->remove_in_progress)
return; return;
/*
* Do the scan after the reset
*/
if (h->reset_in_progress) {
h->drv_req_rescan = 1;
return;
}
if (hpsa_ctlr_needs_rescan(h) || hpsa_offline_devices_ready(h)) { if (hpsa_ctlr_needs_rescan(h) || hpsa_offline_devices_ready(h)) {
scsi_host_get(h->scsi_host); scsi_host_get(h->scsi_host);
hpsa_ack_ctlr_events(h); hpsa_ack_ctlr_events(h);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment