Skip to content

Commit

Permalink
isci: enable interrupts during controller start, and flush discovery
Browse files Browse the repository at this point in the history
Polling the event queue during scan is an unneeded holdover from the
original driver.

Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com>
[djbw: ensure we flush all port events and domain discovery]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Edmund Nadolski authored and Dan Williams committed Jul 3, 2011
1 parent 0cf89d1 commit 77950f5
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions drivers/scsi/isci/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,32 +113,18 @@ int isci_host_scan_finished(struct Scsi_Host *shost, unsigned long time)
{
struct isci_host *ihost = isci_host_from_sas_ha(SHOST_TO_SAS_HA(shost));

/**
* check interrupt_handler's status and call completion_handler if true,
* link_up events should be coming from the scu core lib, as phy's come
* online. for each link_up from the core, call
* get_received_identify_address_frame, copy the frame into the
* sas_phy object and call libsas notify_port_event(PORTE_BYTES_DMAED).
* continue to return zero from thee scan_finished routine until
* the scic_cb_controller_start_complete() call comes from the core.
**/
if (scic_sds_controller_isr(ihost->core_controller))
scic_sds_controller_completion_handler(ihost->core_controller);

if (test_bit(IHOST_START_PENDING, &ihost->flags) && time < HZ*10) {
dev_dbg(&ihost->pdev->dev,
"%s: ihost->status = %d, time = %ld\n",
__func__, isci_host_get_state(ihost), time);
if (test_bit(IHOST_START_PENDING, &ihost->flags))
return 0;
}

/* todo: use sas_flush_discovery once it is upstream */
scsi_flush_work(shost);

scsi_flush_work(shost);

dev_dbg(&ihost->pdev->dev,
"%s: ihost->status = %d, time = %ld\n",
__func__, isci_host_get_state(ihost), time);

scic_controller_enable_interrupts(ihost->core_controller);

return 1;

}
Expand All @@ -150,8 +136,11 @@ void isci_host_scan_start(struct Scsi_Host *shost)
unsigned long tmo = scic_controller_get_suggested_start_timeout(scic);

set_bit(IHOST_START_PENDING, &ihost->flags);
scic_controller_disable_interrupts(ihost->core_controller);

spin_lock_irq(&ihost->scic_lock);
scic_controller_start(scic, tmo);
scic_controller_enable_interrupts(scic);
spin_unlock_irq(&ihost->scic_lock);
}

void isci_host_stop_complete(struct isci_host *ihost, enum sci_status completion_status)
Expand Down

0 comments on commit 77950f5

Please sign in to comment.