Lines Matching refs:sas_dev

211 	struct hisi_sas_device *sas_dev = &hisi_hba->devices[device_id];  in hisi_sas_slot_task_free()  local
242 spin_lock(&sas_dev->lock); in hisi_sas_slot_task_free()
244 spin_unlock(&sas_dev->lock); in hisi_sas_slot_task_free()
397 struct hisi_sas_device *sas_dev) in hisi_sas_task_deliver() argument
409 spin_lock(&sas_dev->lock); in hisi_sas_task_deliver()
410 list_add_tail(&slot->entry, &sas_dev->list); in hisi_sas_task_deliver()
411 spin_unlock(&sas_dev->lock); in hisi_sas_task_deliver()
416 slot->device_id = sas_dev->device_id; in hisi_sas_task_deliver()
462 struct hisi_sas_device *sas_dev = device->lldd_dev; in hisi_sas_queue_command() local
503 if (DEV_IS_GONE(sas_dev)) { in hisi_sas_queue_command()
504 if (sas_dev) in hisi_sas_queue_command()
506 sas_dev->device_id); in hisi_sas_queue_command()
588 hisi_sas_task_deliver(hisi_hba, slot, dq, sas_dev); in hisi_sas_queue_command()
645 struct hisi_sas_device *sas_dev = NULL; in hisi_sas_alloc_dev() local
657 sas_dev = &hisi_hba->devices[i]; in hisi_sas_alloc_dev()
658 sas_dev->dev_status = HISI_SAS_DEV_INIT; in hisi_sas_alloc_dev()
659 sas_dev->dev_type = device->dev_type; in hisi_sas_alloc_dev()
660 sas_dev->hisi_hba = hisi_hba; in hisi_sas_alloc_dev()
661 sas_dev->sas_device = device; in hisi_sas_alloc_dev()
662 sas_dev->dq = dq; in hisi_sas_alloc_dev()
663 spin_lock_init(&sas_dev->lock); in hisi_sas_alloc_dev()
672 return sas_dev; in hisi_sas_alloc_dev()
679 struct hisi_sas_device *sas_dev = device->lldd_dev; in hisi_sas_tmf_aborted() local
680 struct hisi_hba *hisi_hba = sas_dev->hisi_hba; in hisi_sas_tmf_aborted()
747 struct hisi_sas_device *sas_dev = ddev->lldd_dev; in hisi_sas_slave_alloc() local
757 sas_dev->dev_status = HISI_SAS_DEV_NORMAL; in hisi_sas_slave_alloc()
766 struct hisi_sas_device *sas_dev; in hisi_sas_dev_found() local
771 sas_dev = hisi_hba->hw->alloc_dev(device); in hisi_sas_dev_found()
773 sas_dev = hisi_sas_alloc_dev(device); in hisi_sas_dev_found()
774 if (!sas_dev) { in hisi_sas_dev_found()
780 device->lldd_dev = sas_dev; in hisi_sas_dev_found()
781 hisi_hba->hw->setup_itct(hisi_hba, sas_dev); in hisi_sas_dev_found()
798 sas_dev->device_id, sas_dev->dev_type); in hisi_sas_dev_found()
1048 struct hisi_sas_device *sas_dev = device->lldd_dev; in hisi_sas_release_task() local
1050 list_for_each_entry_safe(slot, slot2, &sas_dev->list, entry) in hisi_sas_release_task()
1056 struct hisi_sas_device *sas_dev; in hisi_sas_release_tasks() local
1061 sas_dev = &hisi_hba->devices[i]; in hisi_sas_release_tasks()
1062 device = sas_dev->sas_device; in hisi_sas_release_tasks()
1064 if ((sas_dev->dev_type == SAS_PHY_UNUSED) || in hisi_sas_release_tasks()
1081 hisi_sas_internal_task_abort_dev(struct hisi_sas_device *sas_dev, in hisi_sas_internal_task_abort_dev() argument
1085 struct domain_device *device = sas_dev->sas_device; in hisi_sas_internal_task_abort_dev()
1086 struct hisi_hba *hisi_hba = sas_dev->hisi_hba; in hisi_sas_internal_task_abort_dev()
1105 struct hisi_sas_device *sas_dev = device->lldd_dev; in hisi_sas_dev_gone() local
1111 sas_dev->device_id, sas_dev->dev_type); in hisi_sas_dev_gone()
1115 hisi_sas_internal_task_abort_dev(sas_dev, true); in hisi_sas_dev_gone()
1119 ret = hisi_hba->hw->clear_itct(hisi_hba, sas_dev); in hisi_sas_dev_gone()
1124 hisi_hba->hw->free_device(sas_dev); in hisi_sas_dev_gone()
1128 sas_dev->dev_type = SAS_PHY_UNUSED; in hisi_sas_dev_gone()
1129 sas_dev->sas_device = NULL; in hisi_sas_dev_gone()
1289 struct hisi_sas_device *sas_dev = &hisi_hba->devices[i]; in hisi_sas_refresh_port_id() local
1290 struct domain_device *device = sas_dev->sas_device; in hisi_sas_refresh_port_id()
1296 if ((sas_dev->dev_type == SAS_PHY_UNUSED) in hisi_sas_refresh_port_id()
1318 hisi_hba->hw->setup_itct(hisi_hba, sas_dev); in hisi_sas_refresh_port_id()
1358 struct hisi_sas_device *sas_dev; in hisi_sas_reset_init_all_devices() local
1363 sas_dev = &hisi_hba->devices[i]; in hisi_sas_reset_init_all_devices()
1364 device = sas_dev->sas_device; in hisi_sas_reset_init_all_devices()
1366 if ((sas_dev->dev_type == SAS_PHY_UNUSED) || !device) in hisi_sas_reset_init_all_devices()
1408 struct hisi_sas_device *sas_dev = &hisi_hba->devices[i]; in hisi_sas_terminate_stp_reject() local
1409 struct domain_device *device = sas_dev->sas_device; in hisi_sas_terminate_stp_reject()
1411 if ((sas_dev->dev_type == SAS_PHY_UNUSED) || !device) in hisi_sas_terminate_stp_reject()
1414 rc = hisi_sas_internal_task_abort_dev(sas_dev, false); in hisi_sas_terminate_stp_reject()
1524 struct hisi_sas_device *sas_dev = device->lldd_dev; in hisi_sas_abort_task() local
1531 if (!sas_dev) in hisi_sas_abort_task()
1584 rc = hisi_sas_internal_task_abort_dev(sas_dev, false); in hisi_sas_abort_task()
1595 if ((sas_dev->dev_status == HISI_SAS_DEV_NCQ_ERR) && in hisi_sas_abort_task()
1630 struct hisi_sas_device *sas_dev = device->lldd_dev; in hisi_sas_abort_task_set() local
1635 rc = hisi_sas_internal_task_abort_dev(sas_dev, false); in hisi_sas_abort_task_set()
1652 struct hisi_sas_device *sas_dev = device->lldd_dev; in hisi_sas_debug_I_T_nexus_reset() local
1674 reset_type = (sas_dev->dev_status == HISI_SAS_DEV_INIT || in hisi_sas_debug_I_T_nexus_reset()
1715 struct hisi_sas_device *sas_dev = device->lldd_dev; in hisi_sas_I_T_nexus_reset() local
1720 if (sas_dev->dev_status == HISI_SAS_DEV_NCQ_ERR) in hisi_sas_I_T_nexus_reset()
1721 sas_dev->dev_status = HISI_SAS_DEV_NORMAL; in hisi_sas_I_T_nexus_reset()
1723 rc = hisi_sas_internal_task_abort_dev(sas_dev, false); in hisi_sas_I_T_nexus_reset()
1765 struct hisi_sas_device *sas_dev = device->lldd_dev; in hisi_sas_lu_reset() local
1771 rc = hisi_sas_internal_task_abort_dev(sas_dev, false); in hisi_sas_lu_reset()
1796 sas_dev->device_id, rc); in hisi_sas_lu_reset()
1825 struct hisi_sas_device *sas_dev = &hisi_hba->devices[i]; in hisi_sas_clear_nexus_ha() local
1826 struct domain_device *device = sas_dev->sas_device; in hisi_sas_clear_nexus_ha()
1828 if ((sas_dev->dev_type == SAS_PHY_UNUSED) || !device || in hisi_sas_clear_nexus_ha()