Commit 396b8044 authored by John Garry's avatar John Garry Committed by Martin K. Petersen

scsi: hisi_sas: move PHY init to hisi_sas_scan_start()

Relocate the PHY init code from LLDD hw init path to
hisi_sas_scan_start().
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarXiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 06ec0fb9
...@@ -167,6 +167,7 @@ struct hisi_sas_hw { ...@@ -167,6 +167,7 @@ struct hisi_sas_hw {
int device_id, int abort_flag, int tag_to_abort); int device_id, int abort_flag, int tag_to_abort);
int (*slot_complete)(struct hisi_hba *hisi_hba, int (*slot_complete)(struct hisi_hba *hisi_hba,
struct hisi_sas_slot *slot, int abort); struct hisi_sas_slot *slot, int abort);
void (*phys_init)(struct hisi_hba *hisi_hba);
void (*phy_enable)(struct hisi_hba *hisi_hba, int phy_no); void (*phy_enable)(struct hisi_hba *hisi_hba, int phy_no);
void (*phy_disable)(struct hisi_hba *hisi_hba, int phy_no); void (*phy_disable)(struct hisi_hba *hisi_hba, int phy_no);
void (*phy_hard_reset)(struct hisi_hba *hisi_hba, int phy_no); void (*phy_hard_reset)(struct hisi_hba *hisi_hba, int phy_no);
...@@ -195,7 +196,6 @@ struct hisi_hba { ...@@ -195,7 +196,6 @@ struct hisi_hba {
u8 sas_addr[SAS_ADDR_SIZE]; u8 sas_addr[SAS_ADDR_SIZE];
int n_phy; int n_phy;
int scan_finished;
spinlock_t lock; spinlock_t lock;
struct timer_list timer; struct timer_list timer;
......
...@@ -493,12 +493,8 @@ static int hisi_sas_slave_configure(struct scsi_device *sdev) ...@@ -493,12 +493,8 @@ static int hisi_sas_slave_configure(struct scsi_device *sdev)
static void hisi_sas_scan_start(struct Scsi_Host *shost) static void hisi_sas_scan_start(struct Scsi_Host *shost)
{ {
struct hisi_hba *hisi_hba = shost_priv(shost); struct hisi_hba *hisi_hba = shost_priv(shost);
int i;
for (i = 0; i < hisi_hba->n_phy; ++i)
hisi_sas_bytes_dmaed(hisi_hba, i);
hisi_hba->scan_finished = 1; hisi_hba->hw->phys_init(hisi_hba);
} }
static int hisi_sas_scan_finished(struct Scsi_Host *shost, unsigned long time) static int hisi_sas_scan_finished(struct Scsi_Host *shost, unsigned long time)
...@@ -506,7 +502,8 @@ static int hisi_sas_scan_finished(struct Scsi_Host *shost, unsigned long time) ...@@ -506,7 +502,8 @@ static int hisi_sas_scan_finished(struct Scsi_Host *shost, unsigned long time)
struct hisi_hba *hisi_hba = shost_priv(shost); struct hisi_hba *hisi_hba = shost_priv(shost);
struct sas_ha_struct *sha = &hisi_hba->sha; struct sas_ha_struct *sha = &hisi_hba->sha;
if (hisi_hba->scan_finished == 0) /* Wait for PHY up interrupt to occur */
if (time < HZ)
return 0; return 0;
sas_drain_work(sha); sas_drain_work(sha);
......
...@@ -1847,8 +1847,6 @@ static int hisi_sas_v1_init(struct hisi_hba *hisi_hba) ...@@ -1847,8 +1847,6 @@ static int hisi_sas_v1_init(struct hisi_hba *hisi_hba)
if (rc) if (rc)
return rc; return rc;
phys_init_v1_hw(hisi_hba);
return 0; return 0;
} }
...@@ -1862,6 +1860,7 @@ static const struct hisi_sas_hw hisi_sas_v1_hw = { ...@@ -1862,6 +1860,7 @@ static const struct hisi_sas_hw hisi_sas_v1_hw = {
.get_free_slot = get_free_slot_v1_hw, .get_free_slot = get_free_slot_v1_hw,
.start_delivery = start_delivery_v1_hw, .start_delivery = start_delivery_v1_hw,
.slot_complete = slot_complete_v1_hw, .slot_complete = slot_complete_v1_hw,
.phys_init = phys_init_v1_hw,
.phy_enable = enable_phy_v1_hw, .phy_enable = enable_phy_v1_hw,
.phy_disable = disable_phy_v1_hw, .phy_disable = disable_phy_v1_hw,
.phy_hard_reset = phy_hard_reset_v1_hw, .phy_hard_reset = phy_hard_reset_v1_hw,
......
...@@ -2864,8 +2864,6 @@ static int hisi_sas_v2_init(struct hisi_hba *hisi_hba) ...@@ -2864,8 +2864,6 @@ static int hisi_sas_v2_init(struct hisi_hba *hisi_hba)
if (rc) if (rc)
return rc; return rc;
phys_init_v2_hw(hisi_hba);
return 0; return 0;
} }
...@@ -2965,6 +2963,7 @@ static const struct hisi_sas_hw hisi_sas_v2_hw = { ...@@ -2965,6 +2963,7 @@ static const struct hisi_sas_hw hisi_sas_v2_hw = {
.get_free_slot = get_free_slot_v2_hw, .get_free_slot = get_free_slot_v2_hw,
.start_delivery = start_delivery_v2_hw, .start_delivery = start_delivery_v2_hw,
.slot_complete = slot_complete_v2_hw, .slot_complete = slot_complete_v2_hw,
.phys_init = phys_init_v2_hw,
.phy_enable = enable_phy_v2_hw, .phy_enable = enable_phy_v2_hw,
.phy_disable = disable_phy_v2_hw, .phy_disable = disable_phy_v2_hw,
.phy_hard_reset = phy_hard_reset_v2_hw, .phy_hard_reset = phy_hard_reset_v2_hw,
......
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