Commit b5a9fa20 authored by Luo Jiaxing's avatar Luo Jiaxing Committed by Martin K. Petersen

scsi: hisi_sas: Rename HISI_SAS_{RESET -> RESETTING}_BIT

HISI_SAS_RESET_BIT means that the controller is being reset, and so the
name is a bit vague. Rename it to HISI_SAS_RESETTING_BIT.

Link: https://lore.kernel.org/r/1629799260-120116-4-git-send-email-john.garry@huawei.comSigned-off-by: default avatarLuo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 089226ef
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#define HISI_SAS_QUEUE_SLOTS 4096 #define HISI_SAS_QUEUE_SLOTS 4096
#define HISI_SAS_MAX_ITCT_ENTRIES 1024 #define HISI_SAS_MAX_ITCT_ENTRIES 1024
#define HISI_SAS_MAX_DEVICES HISI_SAS_MAX_ITCT_ENTRIES #define HISI_SAS_MAX_DEVICES HISI_SAS_MAX_ITCT_ENTRIES
#define HISI_SAS_RESET_BIT 0 #define HISI_SAS_RESETTING_BIT 0
#define HISI_SAS_REJECT_CMD_BIT 1 #define HISI_SAS_REJECT_CMD_BIT 1
#define HISI_SAS_PM_BIT 2 #define HISI_SAS_PM_BIT 2
#define HISI_SAS_HW_FAULT_BIT 3 #define HISI_SAS_HW_FAULT_BIT 3
......
...@@ -724,7 +724,7 @@ static int hisi_sas_init_device(struct domain_device *device) ...@@ -724,7 +724,7 @@ static int hisi_sas_init_device(struct domain_device *device)
*/ */
local_phy = sas_get_local_phy(device); local_phy = sas_get_local_phy(device);
if (!scsi_is_sas_phy_local(local_phy) && if (!scsi_is_sas_phy_local(local_phy) &&
!test_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags)) { !test_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags)) {
unsigned long deadline = ata_deadline(jiffies, 20000); unsigned long deadline = ata_deadline(jiffies, 20000);
struct sata_device *sata_dev = &device->sata_dev; struct sata_device *sata_dev = &device->sata_dev;
struct ata_host *ata_host = sata_dev->ata_host; struct ata_host *ata_host = sata_dev->ata_host;
...@@ -1072,7 +1072,7 @@ static void hisi_sas_dev_gone(struct domain_device *device) ...@@ -1072,7 +1072,7 @@ static void hisi_sas_dev_gone(struct domain_device *device)
sas_dev->device_id, sas_dev->dev_type); sas_dev->device_id, sas_dev->dev_type);
down(&hisi_hba->sem); down(&hisi_hba->sem);
if (!test_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags)) { if (!test_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags)) {
hisi_sas_internal_task_abort(hisi_hba, device, hisi_sas_internal_task_abort(hisi_hba, device,
HISI_SAS_INT_ABT_DEV, 0, true); HISI_SAS_INT_ABT_DEV, 0, true);
...@@ -1576,7 +1576,7 @@ void hisi_sas_controller_reset_done(struct hisi_hba *hisi_hba) ...@@ -1576,7 +1576,7 @@ void hisi_sas_controller_reset_done(struct hisi_hba *hisi_hba)
hisi_sas_reset_init_all_devices(hisi_hba); hisi_sas_reset_init_all_devices(hisi_hba);
up(&hisi_hba->sem); up(&hisi_hba->sem);
scsi_unblock_requests(shost); scsi_unblock_requests(shost);
clear_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags); clear_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags);
hisi_sas_rescan_topology(hisi_hba, hisi_hba->phy_state); hisi_sas_rescan_topology(hisi_hba, hisi_hba->phy_state);
} }
...@@ -1587,7 +1587,7 @@ static int hisi_sas_controller_prereset(struct hisi_hba *hisi_hba) ...@@ -1587,7 +1587,7 @@ static int hisi_sas_controller_prereset(struct hisi_hba *hisi_hba)
if (!hisi_hba->hw->soft_reset) if (!hisi_hba->hw->soft_reset)
return -1; return -1;
if (test_and_set_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags)) if (test_and_set_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags))
return -1; return -1;
if (hisi_sas_debugfs_enable && hisi_hba->debugfs_itct[0].itct) if (hisi_sas_debugfs_enable && hisi_hba->debugfs_itct[0].itct)
...@@ -1611,7 +1611,7 @@ static int hisi_sas_controller_reset(struct hisi_hba *hisi_hba) ...@@ -1611,7 +1611,7 @@ static int hisi_sas_controller_reset(struct hisi_hba *hisi_hba)
clear_bit(HISI_SAS_REJECT_CMD_BIT, &hisi_hba->flags); clear_bit(HISI_SAS_REJECT_CMD_BIT, &hisi_hba->flags);
up(&hisi_hba->sem); up(&hisi_hba->sem);
scsi_unblock_requests(shost); scsi_unblock_requests(shost);
clear_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags); clear_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags);
return rc; return rc;
} }
...@@ -2251,7 +2251,7 @@ void hisi_sas_phy_down(struct hisi_hba *hisi_hba, int phy_no, int rdy, ...@@ -2251,7 +2251,7 @@ void hisi_sas_phy_down(struct hisi_hba *hisi_hba, int phy_no, int rdy,
} else { } else {
struct hisi_sas_port *port = phy->port; struct hisi_sas_port *port = phy->port;
if (test_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags) || if (test_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags) ||
phy->in_reset) { phy->in_reset) {
dev_info(dev, "ignore flutter phy%d down\n", phy_no); dev_info(dev, "ignore flutter phy%d down\n", phy_no);
return; return;
......
...@@ -1422,7 +1422,7 @@ static irqreturn_t int_bcast_v1_hw(int irq, void *p) ...@@ -1422,7 +1422,7 @@ static irqreturn_t int_bcast_v1_hw(int irq, void *p)
goto end; goto end;
} }
if (!test_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags)) if (!test_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags))
sas_notify_port_event(sas_phy, PORTE_BROADCAST_RCVD, sas_notify_port_event(sas_phy, PORTE_BROADCAST_RCVD,
GFP_ATOMIC); GFP_ATOMIC);
......
...@@ -2824,7 +2824,7 @@ static void phy_bcast_v2_hw(int phy_no, struct hisi_hba *hisi_hba) ...@@ -2824,7 +2824,7 @@ static void phy_bcast_v2_hw(int phy_no, struct hisi_hba *hisi_hba)
hisi_sas_phy_write32(hisi_hba, phy_no, SL_RX_BCAST_CHK_MSK, 1); hisi_sas_phy_write32(hisi_hba, phy_no, SL_RX_BCAST_CHK_MSK, 1);
bcast_status = hisi_sas_phy_read32(hisi_hba, phy_no, RX_PRIMS_STATUS); bcast_status = hisi_sas_phy_read32(hisi_hba, phy_no, RX_PRIMS_STATUS);
if ((bcast_status & RX_BCAST_CHG_MSK) && if ((bcast_status & RX_BCAST_CHG_MSK) &&
!test_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags)) !test_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags))
sas_notify_port_event(sas_phy, PORTE_BROADCAST_RCVD, sas_notify_port_event(sas_phy, PORTE_BROADCAST_RCVD,
GFP_ATOMIC); GFP_ATOMIC);
hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT0, hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT0,
......
...@@ -1617,7 +1617,7 @@ static irqreturn_t phy_bcast_v3_hw(int phy_no, struct hisi_hba *hisi_hba) ...@@ -1617,7 +1617,7 @@ static irqreturn_t phy_bcast_v3_hw(int phy_no, struct hisi_hba *hisi_hba)
hisi_sas_phy_write32(hisi_hba, phy_no, SL_RX_BCAST_CHK_MSK, 1); hisi_sas_phy_write32(hisi_hba, phy_no, SL_RX_BCAST_CHK_MSK, 1);
bcast_status = hisi_sas_phy_read32(hisi_hba, phy_no, RX_PRIMS_STATUS); bcast_status = hisi_sas_phy_read32(hisi_hba, phy_no, RX_PRIMS_STATUS);
if ((bcast_status & RX_BCAST_CHG_MSK) && if ((bcast_status & RX_BCAST_CHG_MSK) &&
!test_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags)) !test_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags))
sas_notify_port_event(sas_phy, PORTE_BROADCAST_RCVD, sas_notify_port_event(sas_phy, PORTE_BROADCAST_RCVD,
GFP_ATOMIC); GFP_ATOMIC);
hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT0, hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT0,
...@@ -4851,7 +4851,7 @@ static void hisi_sas_reset_prepare_v3_hw(struct pci_dev *pdev) ...@@ -4851,7 +4851,7 @@ static void hisi_sas_reset_prepare_v3_hw(struct pci_dev *pdev)
int rc; int rc;
dev_info(dev, "FLR prepare\n"); dev_info(dev, "FLR prepare\n");
set_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags); set_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags);
hisi_sas_controller_reset_prepare(hisi_hba); hisi_sas_controller_reset_prepare(hisi_hba);
rc = disable_host_v3_hw(hisi_hba); rc = disable_host_v3_hw(hisi_hba);
...@@ -4897,7 +4897,7 @@ static int _suspend_v3_hw(struct device *device) ...@@ -4897,7 +4897,7 @@ static int _suspend_v3_hw(struct device *device)
return -ENODEV; return -ENODEV;
} }
if (test_and_set_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags)) if (test_and_set_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags))
return -1; return -1;
scsi_block_requests(shost); scsi_block_requests(shost);
...@@ -4908,7 +4908,7 @@ static int _suspend_v3_hw(struct device *device) ...@@ -4908,7 +4908,7 @@ static int _suspend_v3_hw(struct device *device)
if (rc) { if (rc) {
dev_err(dev, "PM suspend: disable host failed rc=%d\n", rc); dev_err(dev, "PM suspend: disable host failed rc=%d\n", rc);
clear_bit(HISI_SAS_REJECT_CMD_BIT, &hisi_hba->flags); clear_bit(HISI_SAS_REJECT_CMD_BIT, &hisi_hba->flags);
clear_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags); clear_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags);
scsi_unblock_requests(shost); scsi_unblock_requests(shost);
return rc; return rc;
} }
...@@ -4947,7 +4947,7 @@ static int _resume_v3_hw(struct device *device) ...@@ -4947,7 +4947,7 @@ static int _resume_v3_hw(struct device *device)
} }
phys_init_v3_hw(hisi_hba); phys_init_v3_hw(hisi_hba);
sas_resume_ha(sha); sas_resume_ha(sha);
clear_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags); clear_bit(HISI_SAS_RESETTING_BIT, &hisi_hba->flags);
return 0; return 0;
} }
......
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