aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hisi_sas/hisi_sas.h
diff options
context:
space:
mode:
authorXiang Chen <chenxiang66@hisilicon.com>2017-03-23 01:25:18 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2017-03-23 11:12:01 -0400
commit06ec0fb97c028102c95d52422fd6dc5ac701039f (patch)
treec28bb8ca5a68622bb4a8e78348f2ec78eaa10c2c /drivers/scsi/hisi_sas/hisi_sas.h
parentscsi: hisi_sas: add to_hisi_sas_port() (diff)
downloadlinux-dev-06ec0fb97c028102c95d52422fd6dc5ac701039f.tar.xz
linux-dev-06ec0fb97c028102c95d52422fd6dc5ac701039f.zip
scsi: hisi_sas: add controller reset
There are some scenarios that we need to warm-reset to reset registers of SAS controller. During reset we disable interrupts/DQs/PHYs, and after reset we re-init the hardware and rescan the topology to see if anything changed. Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com> Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/hisi_sas/hisi_sas.h')
-rw-r--r--drivers/scsi/hisi_sas/hisi_sas.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h
index a018a8afa894..fd76a02873a5 100644
--- a/drivers/scsi/hisi_sas/hisi_sas.h
+++ b/drivers/scsi/hisi_sas/hisi_sas.h
@@ -31,6 +31,7 @@
#define HISI_SAS_QUEUE_SLOTS 512
#define HISI_SAS_MAX_ITCT_ENTRIES 2048
#define HISI_SAS_MAX_DEVICES HISI_SAS_MAX_ITCT_ENTRIES
+#define HISI_SAS_RESET_BIT 0
#define HISI_SAS_STATUS_BUF_SZ \
(sizeof(struct hisi_sas_err_record) + 1024)
@@ -175,6 +176,7 @@ struct hisi_sas_hw {
void (*free_device)(struct hisi_hba *hisi_hba,
struct hisi_sas_device *dev);
int (*get_wideport_bitmap)(struct hisi_hba *hisi_hba, int port_id);
+ int (*soft_reset)(struct hisi_hba *hisi_hba);
int max_command_entries;
int complete_hdr_size;
};
@@ -233,7 +235,9 @@ struct hisi_hba {
struct hisi_sas_breakpoint *sata_breakpoint;
dma_addr_t sata_breakpoint_dma;
struct hisi_sas_slot *slot_info;
+ unsigned long flags;
const struct hisi_sas_hw *hw; /* Low level hw interface */
+ struct work_struct rst_work;
};
/* Generic HW DMA host memory structures */
@@ -356,4 +360,7 @@ extern void hisi_sas_phy_down(struct hisi_hba *hisi_hba, int phy_no, int rdy);
extern void hisi_sas_slot_task_free(struct hisi_hba *hisi_hba,
struct sas_task *task,
struct hisi_sas_slot *slot);
+extern void hisi_sas_init_mem(struct hisi_hba *hisi_hba);
+extern void hisi_sas_rescan_topology(struct hisi_hba *hisi_hba, u32 old_state,
+ u32 state);
#endif