Lines Matching refs:ha

358 void sas_prep_resume_ha(struct sas_ha_struct *ha)  in sas_prep_resume_ha()  argument
362 set_bit(SAS_HA_REGISTERED, &ha->state); in sas_prep_resume_ha()
363 set_bit(SAS_HA_RESUMING, &ha->state); in sas_prep_resume_ha()
366 for (i = 0; i < ha->num_phys; i++) { in sas_prep_resume_ha()
367 struct asd_sas_phy *phy = ha->sas_phy[i]; in sas_prep_resume_ha()
375 static int phys_suspended(struct sas_ha_struct *ha) in phys_suspended() argument
379 for (i = 0; i < ha->num_phys; i++) { in phys_suspended()
380 struct asd_sas_phy *phy = ha->sas_phy[i]; in phys_suspended()
389 static void sas_resume_insert_broadcast_ha(struct sas_ha_struct *ha) in sas_resume_insert_broadcast_ha() argument
393 for (i = 0; i < ha->num_phys; i++) { in sas_resume_insert_broadcast_ha()
394 struct asd_sas_port *port = ha->sas_port[i]; in sas_resume_insert_broadcast_ha()
413 static void _sas_resume_ha(struct sas_ha_struct *ha, bool drain) in _sas_resume_ha() argument
424 i = phys_suspended(ha); in _sas_resume_ha()
426 dev_info(ha->dev, "waiting up to 25 seconds for %d phy%s to resume\n", in _sas_resume_ha()
428 wait_event_timeout(ha->eh_wait_q, phys_suspended(ha) == 0, tmo); in _sas_resume_ha()
429 for (i = 0; i < ha->num_phys; i++) { in _sas_resume_ha()
430 struct asd_sas_phy *phy = ha->sas_phy[i]; in _sas_resume_ha()
442 scsi_unblock_requests(ha->shost); in _sas_resume_ha()
444 sas_drain_work(ha); in _sas_resume_ha()
445 clear_bit(SAS_HA_RESUMING, &ha->state); in _sas_resume_ha()
447 sas_queue_deferred_work(ha); in _sas_resume_ha()
451 sas_resume_insert_broadcast_ha(ha); in _sas_resume_ha()
454 void sas_resume_ha(struct sas_ha_struct *ha) in sas_resume_ha() argument
456 _sas_resume_ha(ha, true); in sas_resume_ha()
461 void sas_resume_ha_no_sync(struct sas_ha_struct *ha) in sas_resume_ha_no_sync() argument
463 _sas_resume_ha(ha, false); in sas_resume_ha_no_sync()
467 void sas_suspend_ha(struct sas_ha_struct *ha) in sas_suspend_ha() argument
471 sas_disable_events(ha); in sas_suspend_ha()
472 scsi_block_requests(ha->shost); in sas_suspend_ha()
473 for (i = 0; i < ha->num_phys; i++) { in sas_suspend_ha()
474 struct asd_sas_port *port = ha->sas_port[i]; in sas_suspend_ha()
480 mutex_lock(&ha->drain_mutex); in sas_suspend_ha()
481 __sas_drain_work(ha); in sas_suspend_ha()
482 mutex_unlock(&ha->drain_mutex); in sas_suspend_ha()
525 struct sas_ha_struct *ha = SHOST_TO_SAS_HA(shost); in queue_phy_reset() local
532 pm_runtime_get_sync(ha->dev); in queue_phy_reset()
538 spin_lock_irq(&ha->lock); in queue_phy_reset()
539 sas_queue_work(ha, &d->reset_work); in queue_phy_reset()
540 spin_unlock_irq(&ha->lock); in queue_phy_reset()
542 rc = sas_drain_work(ha); in queue_phy_reset()
546 pm_runtime_put_sync(ha->dev); in queue_phy_reset()
554 struct sas_ha_struct *ha = SHOST_TO_SAS_HA(shost); in queue_phy_enable() local
561 pm_runtime_get_sync(ha->dev); in queue_phy_enable()
567 spin_lock_irq(&ha->lock); in queue_phy_enable()
568 sas_queue_work(ha, &d->enable_work); in queue_phy_enable()
569 spin_unlock_irq(&ha->lock); in queue_phy_enable()
571 rc = sas_drain_work(ha); in queue_phy_enable()
575 pm_runtime_put_sync(ha->dev); in queue_phy_enable()
643 struct sas_ha_struct *sas_ha = phy->ha; in sas_alloc_event()
653 if (atomic_read(&phy->event_nr) > phy->ha->event_thres) { in sas_alloc_event()