Lines Matching refs:sas_dev

211 	struct hisi_sas_device *sas_dev = &hisi_hba->devices[device_id];  in hisi_sas_slot_task_free()  local
243 spin_lock(&sas_dev->lock); in hisi_sas_slot_task_free()
245 spin_unlock(&sas_dev->lock); in hisi_sas_slot_task_free()
401 struct hisi_sas_device *sas_dev) in hisi_sas_task_deliver() argument
413 spin_lock(&sas_dev->lock); in hisi_sas_task_deliver()
414 list_add_tail(&slot->entry, &sas_dev->list); in hisi_sas_task_deliver()
415 spin_unlock(&sas_dev->lock); in hisi_sas_task_deliver()
420 slot->device_id = sas_dev->device_id; in hisi_sas_task_deliver()
466 struct hisi_sas_device *sas_dev = device->lldd_dev; in hisi_sas_queue_command() local
507 if (DEV_IS_GONE(sas_dev)) { in hisi_sas_queue_command()
508 if (sas_dev) in hisi_sas_queue_command()
510 sas_dev->device_id); in hisi_sas_queue_command()
603 hisi_sas_task_deliver(hisi_hba, slot, dq, sas_dev); in hisi_sas_queue_command()
660 struct hisi_sas_device *sas_dev = NULL; in hisi_sas_alloc_dev() local
672 sas_dev = &hisi_hba->devices[i]; in hisi_sas_alloc_dev()
673 sas_dev->dev_status = HISI_SAS_DEV_INIT; in hisi_sas_alloc_dev()
674 sas_dev->dev_type = device->dev_type; in hisi_sas_alloc_dev()
675 sas_dev->hisi_hba = hisi_hba; in hisi_sas_alloc_dev()
676 sas_dev->sas_device = device; in hisi_sas_alloc_dev()
677 sas_dev->dq = dq; in hisi_sas_alloc_dev()
678 spin_lock_init(&sas_dev->lock); in hisi_sas_alloc_dev()
687 return sas_dev; in hisi_sas_alloc_dev()
743 struct hisi_sas_device *sas_dev = device->lldd_dev; in hisi_sas_tmf_aborted() local
744 struct hisi_hba *hisi_hba = sas_dev->hisi_hba; in hisi_sas_tmf_aborted()
811 struct hisi_sas_device *sas_dev = ddev->lldd_dev; in hisi_sas_slave_alloc() local
821 sas_dev->dev_status = HISI_SAS_DEV_NORMAL; in hisi_sas_slave_alloc()
830 struct hisi_sas_device *sas_dev; in hisi_sas_dev_found() local
835 sas_dev = hisi_hba->hw->alloc_dev(device); in hisi_sas_dev_found()
837 sas_dev = hisi_sas_alloc_dev(device); in hisi_sas_dev_found()
838 if (!sas_dev) { in hisi_sas_dev_found()
844 device->lldd_dev = sas_dev; in hisi_sas_dev_found()
845 hisi_hba->hw->setup_itct(hisi_hba, sas_dev); in hisi_sas_dev_found()
862 sas_dev->device_id, sas_dev->dev_type); in hisi_sas_dev_found()
1105 struct hisi_sas_device *sas_dev = device->lldd_dev; in hisi_sas_release_task() local
1107 spin_lock(&sas_dev->lock); in hisi_sas_release_task()
1108 list_for_each_entry_safe(slot, slot2, &sas_dev->list, entry) in hisi_sas_release_task()
1111 spin_unlock(&sas_dev->lock); in hisi_sas_release_task()
1116 struct hisi_sas_device *sas_dev; in hisi_sas_release_tasks() local
1121 sas_dev = &hisi_hba->devices[i]; in hisi_sas_release_tasks()
1122 device = sas_dev->sas_device; in hisi_sas_release_tasks()
1124 if ((sas_dev->dev_type == SAS_PHY_UNUSED) || in hisi_sas_release_tasks()
1141 hisi_sas_internal_task_abort_dev(struct hisi_sas_device *sas_dev, in hisi_sas_internal_task_abort_dev() argument
1145 struct domain_device *device = sas_dev->sas_device; in hisi_sas_internal_task_abort_dev()
1146 struct hisi_hba *hisi_hba = sas_dev->hisi_hba; in hisi_sas_internal_task_abort_dev()
1165 struct hisi_sas_device *sas_dev = device->lldd_dev; in hisi_sas_dev_gone() local
1171 sas_dev->device_id, sas_dev->dev_type); in hisi_sas_dev_gone()
1175 hisi_sas_internal_task_abort_dev(sas_dev, true); in hisi_sas_dev_gone()
1179 ret = hisi_hba->hw->clear_itct(hisi_hba, sas_dev); in hisi_sas_dev_gone()
1184 hisi_hba->hw->free_device(sas_dev); in hisi_sas_dev_gone()
1188 sas_dev->dev_type = SAS_PHY_UNUSED; in hisi_sas_dev_gone()
1189 sas_dev->sas_device = NULL; in hisi_sas_dev_gone()
1349 struct hisi_sas_device *sas_dev = &hisi_hba->devices[i]; in hisi_sas_refresh_port_id() local
1350 struct domain_device *device = sas_dev->sas_device; in hisi_sas_refresh_port_id()
1356 if ((sas_dev->dev_type == SAS_PHY_UNUSED) in hisi_sas_refresh_port_id()
1378 hisi_hba->hw->setup_itct(hisi_hba, sas_dev); in hisi_sas_refresh_port_id()
1418 struct hisi_sas_device *sas_dev; in hisi_sas_reset_init_all_devices() local
1423 sas_dev = &hisi_hba->devices[i]; in hisi_sas_reset_init_all_devices()
1424 device = sas_dev->sas_device; in hisi_sas_reset_init_all_devices()
1426 if ((sas_dev->dev_type == SAS_PHY_UNUSED) || !device) in hisi_sas_reset_init_all_devices()
1468 struct hisi_sas_device *sas_dev = &hisi_hba->devices[i]; in hisi_sas_terminate_stp_reject() local
1469 struct domain_device *device = sas_dev->sas_device; in hisi_sas_terminate_stp_reject()
1471 if ((sas_dev->dev_type == SAS_PHY_UNUSED) || !device) in hisi_sas_terminate_stp_reject()
1474 rc = hisi_sas_internal_task_abort_dev(sas_dev, false); in hisi_sas_terminate_stp_reject()
1612 struct hisi_sas_device *sas_dev = device->lldd_dev; in hisi_sas_abort_task() local
1619 if (!sas_dev) in hisi_sas_abort_task()
1672 rc = hisi_sas_internal_task_abort_dev(sas_dev, false); in hisi_sas_abort_task()
1683 if ((sas_dev->dev_status == HISI_SAS_DEV_NCQ_ERR) && in hisi_sas_abort_task()
1718 struct hisi_sas_device *sas_dev = device->lldd_dev; in hisi_sas_abort_task_set() local
1723 rc = hisi_sas_internal_task_abort_dev(sas_dev, false); in hisi_sas_abort_task_set()
1740 struct hisi_sas_device *sas_dev = device->lldd_dev; in hisi_sas_debug_I_T_nexus_reset() local
1762 reset_type = (sas_dev->dev_status == HISI_SAS_DEV_INIT || in hisi_sas_debug_I_T_nexus_reset()
1803 struct hisi_sas_device *sas_dev = device->lldd_dev; in hisi_sas_I_T_nexus_reset() local
1808 if (sas_dev->dev_status == HISI_SAS_DEV_NCQ_ERR) in hisi_sas_I_T_nexus_reset()
1809 sas_dev->dev_status = HISI_SAS_DEV_NORMAL; in hisi_sas_I_T_nexus_reset()
1811 rc = hisi_sas_internal_task_abort_dev(sas_dev, false); in hisi_sas_I_T_nexus_reset()
1853 struct hisi_sas_device *sas_dev = device->lldd_dev; in hisi_sas_lu_reset() local
1859 rc = hisi_sas_internal_task_abort_dev(sas_dev, false); in hisi_sas_lu_reset()
1884 sas_dev->device_id, rc); in hisi_sas_lu_reset()
1913 struct hisi_sas_device *sas_dev = &hisi_hba->devices[i]; in hisi_sas_clear_nexus_ha() local
1914 struct domain_device *device = sas_dev->sas_device; in hisi_sas_clear_nexus_ha()
1916 if ((sas_dev->dev_type == SAS_PHY_UNUSED) || !device || in hisi_sas_clear_nexus_ha()