scsi: hisi_sas: Some misc tidy-up
Do some minor tidy-up. Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
246ea3c0ad
commit
01d4e3a2fc
|
@ -683,7 +683,7 @@ static void hisi_sas_bytes_dmaed(struct hisi_hba *hisi_hba, int phy_no)
|
||||||
id->initiator_bits = SAS_PROTOCOL_ALL;
|
id->initiator_bits = SAS_PROTOCOL_ALL;
|
||||||
id->target_bits = phy->identify.target_port_protocols;
|
id->target_bits = phy->identify.target_port_protocols;
|
||||||
} else if (phy->phy_type & PORT_TYPE_SATA) {
|
} else if (phy->phy_type & PORT_TYPE_SATA) {
|
||||||
/*Nothing*/
|
/* Nothing */
|
||||||
}
|
}
|
||||||
|
|
||||||
sas_phy->frame_rcvd_size = phy->frame_rcvd_size;
|
sas_phy->frame_rcvd_size = phy->frame_rcvd_size;
|
||||||
|
@ -1739,7 +1739,7 @@ static int hisi_sas_abort_task_set(struct domain_device *device, u8 *lun)
|
||||||
struct hisi_hba *hisi_hba = dev_to_hisi_hba(device);
|
struct hisi_hba *hisi_hba = dev_to_hisi_hba(device);
|
||||||
struct device *dev = hisi_hba->dev;
|
struct device *dev = hisi_hba->dev;
|
||||||
struct hisi_sas_tmf_task tmf_task;
|
struct hisi_sas_tmf_task tmf_task;
|
||||||
int rc = TMF_RESP_FUNC_FAILED;
|
int rc;
|
||||||
|
|
||||||
rc = hisi_sas_internal_task_abort(hisi_hba, device,
|
rc = hisi_sas_internal_task_abort(hisi_hba, device,
|
||||||
HISI_SAS_INT_ABT_DEV, 0);
|
HISI_SAS_INT_ABT_DEV, 0);
|
||||||
|
@ -2532,22 +2532,19 @@ int hisi_sas_get_fw_info(struct hisi_hba *hisi_hba)
|
||||||
|
|
||||||
if (device_property_read_u32(dev, "ctrl-reset-reg",
|
if (device_property_read_u32(dev, "ctrl-reset-reg",
|
||||||
&hisi_hba->ctrl_reset_reg)) {
|
&hisi_hba->ctrl_reset_reg)) {
|
||||||
dev_err(dev,
|
dev_err(dev, "could not get property ctrl-reset-reg\n");
|
||||||
"could not get property ctrl-reset-reg\n");
|
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device_property_read_u32(dev, "ctrl-reset-sts-reg",
|
if (device_property_read_u32(dev, "ctrl-reset-sts-reg",
|
||||||
&hisi_hba->ctrl_reset_sts_reg)) {
|
&hisi_hba->ctrl_reset_sts_reg)) {
|
||||||
dev_err(dev,
|
dev_err(dev, "could not get property ctrl-reset-sts-reg\n");
|
||||||
"could not get property ctrl-reset-sts-reg\n");
|
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device_property_read_u32(dev, "ctrl-clock-ena-reg",
|
if (device_property_read_u32(dev, "ctrl-clock-ena-reg",
|
||||||
&hisi_hba->ctrl_clock_ena_reg)) {
|
&hisi_hba->ctrl_clock_ena_reg)) {
|
||||||
dev_err(dev,
|
dev_err(dev, "could not get property ctrl-clock-ena-reg\n");
|
||||||
"could not get property ctrl-clock-ena-reg\n");
|
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1690,8 +1690,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
|
||||||
for (j = 0; j < HISI_SAS_PHY_INT_NR; j++, idx++) {
|
for (j = 0; j < HISI_SAS_PHY_INT_NR; j++, idx++) {
|
||||||
irq = platform_get_irq(pdev, idx);
|
irq = platform_get_irq(pdev, idx);
|
||||||
if (!irq) {
|
if (!irq) {
|
||||||
dev_err(dev,
|
dev_err(dev, "irq init: fail map phy interrupt %d\n",
|
||||||
"irq init: fail map phy interrupt %d\n",
|
|
||||||
idx);
|
idx);
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
@ -1699,8 +1698,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
|
||||||
rc = devm_request_irq(dev, irq, phy_interrupts[j], 0,
|
rc = devm_request_irq(dev, irq, phy_interrupts[j], 0,
|
||||||
DRV_NAME " phy", phy);
|
DRV_NAME " phy", phy);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
dev_err(dev, "irq init: could not request "
|
dev_err(dev, "irq init: could not request phy interrupt %d, rc=%d\n",
|
||||||
"phy interrupt %d, rc=%d\n",
|
|
||||||
irq, rc);
|
irq, rc);
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
@ -1737,8 +1735,7 @@ static int interrupt_init_v1_hw(struct hisi_hba *hisi_hba)
|
||||||
rc = devm_request_irq(dev, irq, fatal_interrupts[i], 0,
|
rc = devm_request_irq(dev, irq, fatal_interrupts[i], 0,
|
||||||
DRV_NAME " fatal", hisi_hba);
|
DRV_NAME " fatal", hisi_hba);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
dev_err(dev,
|
dev_err(dev, "irq init: could not request fatal interrupt %d, rc=%d\n",
|
||||||
"irq init: could not request fatal interrupt %d, rc=%d\n",
|
|
||||||
irq, rc);
|
irq, rc);
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2423,9 +2423,7 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot)
|
||||||
slot_err_v2_hw(hisi_hba, task, slot, 2);
|
slot_err_v2_hw(hisi_hba, task, slot, 2);
|
||||||
|
|
||||||
if (ts->stat != SAS_DATA_UNDERRUN)
|
if (ts->stat != SAS_DATA_UNDERRUN)
|
||||||
dev_info(dev, "erroneous completion iptt=%d task=%p dev id=%d "
|
dev_info(dev, "erroneous completion iptt=%d task=%p dev id=%d CQ hdr: 0x%x 0x%x 0x%x 0x%x Error info: 0x%x 0x%x 0x%x 0x%x\n",
|
||||||
"CQ hdr: 0x%x 0x%x 0x%x 0x%x "
|
|
||||||
"Error info: 0x%x 0x%x 0x%x 0x%x\n",
|
|
||||||
slot->idx, task, sas_dev->device_id,
|
slot->idx, task, sas_dev->device_id,
|
||||||
complete_hdr->dw0, complete_hdr->dw1,
|
complete_hdr->dw0, complete_hdr->dw1,
|
||||||
complete_hdr->act, complete_hdr->dw3,
|
complete_hdr->act, complete_hdr->dw3,
|
||||||
|
@ -2502,7 +2500,7 @@ out:
|
||||||
spin_lock_irqsave(&device->done_lock, flags);
|
spin_lock_irqsave(&device->done_lock, flags);
|
||||||
if (test_bit(SAS_HA_FROZEN, &ha->state)) {
|
if (test_bit(SAS_HA_FROZEN, &ha->state)) {
|
||||||
spin_unlock_irqrestore(&device->done_lock, flags);
|
spin_unlock_irqrestore(&device->done_lock, flags);
|
||||||
dev_info(dev, "slot complete: task(%p) ignored\n ",
|
dev_info(dev, "slot complete: task(%p) ignored\n",
|
||||||
task);
|
task);
|
||||||
return sts;
|
return sts;
|
||||||
}
|
}
|
||||||
|
@ -3036,7 +3034,7 @@ static const struct hisi_sas_hw_error axi_error[] = {
|
||||||
{ .msk = BIT(5), .msg = "SATA_AXI_R_ERR" },
|
{ .msk = BIT(5), .msg = "SATA_AXI_R_ERR" },
|
||||||
{ .msk = BIT(6), .msg = "DQE_AXI_R_ERR" },
|
{ .msk = BIT(6), .msg = "DQE_AXI_R_ERR" },
|
||||||
{ .msk = BIT(7), .msg = "CQE_AXI_W_ERR" },
|
{ .msk = BIT(7), .msg = "CQE_AXI_W_ERR" },
|
||||||
{},
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct hisi_sas_hw_error fifo_error[] = {
|
static const struct hisi_sas_hw_error fifo_error[] = {
|
||||||
|
@ -3045,7 +3043,7 @@ static const struct hisi_sas_hw_error fifo_error[] = {
|
||||||
{ .msk = BIT(10), .msg = "GETDQE_FIFO" },
|
{ .msk = BIT(10), .msg = "GETDQE_FIFO" },
|
||||||
{ .msk = BIT(11), .msg = "CMDP_FIFO" },
|
{ .msk = BIT(11), .msg = "CMDP_FIFO" },
|
||||||
{ .msk = BIT(12), .msg = "AWTCTRL_FIFO" },
|
{ .msk = BIT(12), .msg = "AWTCTRL_FIFO" },
|
||||||
{},
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct hisi_sas_hw_error fatal_axi_errors[] = {
|
static const struct hisi_sas_hw_error fatal_axi_errors[] = {
|
||||||
|
@ -3349,8 +3347,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba)
|
||||||
rc = devm_request_irq(dev, irq, phy_interrupts[i], 0,
|
rc = devm_request_irq(dev, irq, phy_interrupts[i], 0,
|
||||||
DRV_NAME " phy", hisi_hba);
|
DRV_NAME " phy", hisi_hba);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
dev_err(dev, "irq init: could not request "
|
dev_err(dev, "irq init: could not request phy interrupt %d, rc=%d\n",
|
||||||
"phy interrupt %d, rc=%d\n",
|
|
||||||
irq, rc);
|
irq, rc);
|
||||||
rc = -ENOENT;
|
rc = -ENOENT;
|
||||||
goto free_phy_int_irqs;
|
goto free_phy_int_irqs;
|
||||||
|
@ -3364,8 +3361,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba)
|
||||||
rc = devm_request_irq(dev, irq, sata_int_v2_hw, 0,
|
rc = devm_request_irq(dev, irq, sata_int_v2_hw, 0,
|
||||||
DRV_NAME " sata", phy);
|
DRV_NAME " sata", phy);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
dev_err(dev, "irq init: could not request "
|
dev_err(dev, "irq init: could not request sata interrupt %d, rc=%d\n",
|
||||||
"sata interrupt %d, rc=%d\n",
|
|
||||||
irq, rc);
|
irq, rc);
|
||||||
rc = -ENOENT;
|
rc = -ENOENT;
|
||||||
goto free_sata_int_irqs;
|
goto free_sata_int_irqs;
|
||||||
|
@ -3377,8 +3373,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba)
|
||||||
rc = devm_request_irq(dev, irq, fatal_interrupts[fatal_no], 0,
|
rc = devm_request_irq(dev, irq, fatal_interrupts[fatal_no], 0,
|
||||||
DRV_NAME " fatal", hisi_hba);
|
DRV_NAME " fatal", hisi_hba);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
dev_err(dev,
|
dev_err(dev, "irq init: could not request fatal interrupt %d, rc=%d\n",
|
||||||
"irq init: could not request fatal interrupt %d, rc=%d\n",
|
|
||||||
irq, rc);
|
irq, rc);
|
||||||
rc = -ENOENT;
|
rc = -ENOENT;
|
||||||
goto free_fatal_int_irqs;
|
goto free_fatal_int_irqs;
|
||||||
|
@ -3393,8 +3388,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba)
|
||||||
rc = devm_request_irq(dev, irq, cq_interrupt_v2_hw, 0,
|
rc = devm_request_irq(dev, irq, cq_interrupt_v2_hw, 0,
|
||||||
DRV_NAME " cq", cq);
|
DRV_NAME " cq", cq);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
dev_err(dev,
|
dev_err(dev, "irq init: could not request cq interrupt %d, rc=%d\n",
|
||||||
"irq init: could not request cq interrupt %d, rc=%d\n",
|
|
||||||
irq, rc);
|
irq, rc);
|
||||||
rc = -ENOENT;
|
rc = -ENOENT;
|
||||||
goto free_cq_int_irqs;
|
goto free_cq_int_irqs;
|
||||||
|
|
|
@ -1950,7 +1950,7 @@ static const struct hisi_sas_hw_error axi_error[] = {
|
||||||
{ .msk = BIT(5), .msg = "SATA_AXI_R_ERR" },
|
{ .msk = BIT(5), .msg = "SATA_AXI_R_ERR" },
|
||||||
{ .msk = BIT(6), .msg = "DQE_AXI_R_ERR" },
|
{ .msk = BIT(6), .msg = "DQE_AXI_R_ERR" },
|
||||||
{ .msk = BIT(7), .msg = "CQE_AXI_W_ERR" },
|
{ .msk = BIT(7), .msg = "CQE_AXI_W_ERR" },
|
||||||
{},
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct hisi_sas_hw_error fifo_error[] = {
|
static const struct hisi_sas_hw_error fifo_error[] = {
|
||||||
|
@ -1959,7 +1959,7 @@ static const struct hisi_sas_hw_error fifo_error[] = {
|
||||||
{ .msk = BIT(10), .msg = "GETDQE_FIFO" },
|
{ .msk = BIT(10), .msg = "GETDQE_FIFO" },
|
||||||
{ .msk = BIT(11), .msg = "CMDP_FIFO" },
|
{ .msk = BIT(11), .msg = "CMDP_FIFO" },
|
||||||
{ .msk = BIT(12), .msg = "AWTCTRL_FIFO" },
|
{ .msk = BIT(12), .msg = "AWTCTRL_FIFO" },
|
||||||
{},
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct hisi_sas_hw_error fatal_axi_error[] = {
|
static const struct hisi_sas_hw_error fatal_axi_error[] = {
|
||||||
|
@ -2207,9 +2207,7 @@ slot_complete_v3_hw(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot)
|
||||||
|
|
||||||
slot_err_v3_hw(hisi_hba, task, slot);
|
slot_err_v3_hw(hisi_hba, task, slot);
|
||||||
if (ts->stat != SAS_DATA_UNDERRUN)
|
if (ts->stat != SAS_DATA_UNDERRUN)
|
||||||
dev_info(dev, "erroneous completion iptt=%d task=%p dev id=%d "
|
dev_info(dev, "erroneous completion iptt=%d task=%p dev id=%d CQ hdr: 0x%x 0x%x 0x%x 0x%x Error info: 0x%x 0x%x 0x%x 0x%x\n",
|
||||||
"CQ hdr: 0x%x 0x%x 0x%x 0x%x "
|
|
||||||
"Error info: 0x%x 0x%x 0x%x 0x%x\n",
|
|
||||||
slot->idx, task, sas_dev->device_id,
|
slot->idx, task, sas_dev->device_id,
|
||||||
dw0, dw1, complete_hdr->act, dw3,
|
dw0, dw1, complete_hdr->act, dw3,
|
||||||
error_info[0], error_info[1],
|
error_info[0], error_info[1],
|
||||||
|
@ -2446,8 +2444,7 @@ static int interrupt_init_v3_hw(struct hisi_hba *hisi_hba)
|
||||||
cq_interrupt_v3_hw, irqflags,
|
cq_interrupt_v3_hw, irqflags,
|
||||||
DRV_NAME " cq", cq);
|
DRV_NAME " cq", cq);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
dev_err(dev,
|
dev_err(dev, "could not request cq%d interrupt, rc=%d\n",
|
||||||
"could not request cq%d interrupt, rc=%d\n",
|
|
||||||
i, rc);
|
i, rc);
|
||||||
rc = -ENOENT;
|
rc = -ENOENT;
|
||||||
goto free_cq_irqs;
|
goto free_cq_irqs;
|
||||||
|
@ -3042,7 +3039,7 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||||
|
|
||||||
hisi_hba->regs = pcim_iomap(pdev, 5, 0);
|
hisi_hba->regs = pcim_iomap(pdev, 5, 0);
|
||||||
if (!hisi_hba->regs) {
|
if (!hisi_hba->regs) {
|
||||||
dev_err(dev, "cannot map register.\n");
|
dev_err(dev, "cannot map register\n");
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
goto err_out_ha;
|
goto err_out_ha;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue