hisi_sas: Misc patches and cleanups
Subsystems (2)
v2 cover hisi_sas: Misc patches and cleanups
This series contains some minor bugfix and general tidying:
- Ignore the soft reset result by calling I_T_nexus after the SATA disk is soft reset
- General minor tidying
Thanks!
Changes since v1:
- Remove patch 1 and come up with a better solution to fix the issue:
https://lore.kernel.org/linux-block/[email protected]/
maybe in libsas or libata.
Yihang Li (4):
scsi: hisi_sas: Use macro instead of magic number
scsi: hisi_sas: Code style cleanup
scsi: hisi_sas: Call I_T_nexus after soft reset for SATA disk
scsi: hisi_sas: Wait until eh is recovered
drivers/scsi/hisi_sas/hisi_sas.h | 50 +++-- drivers/scsi/hisi_sas/hisi_sas_main.c | 81 ++++---- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 2 +- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 6 +- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 253 +++++++++++++++---------- 5 files changed, 229 insertions(+), 163 deletions(-)
Signature · 1 line
2.33.0
PATCH v2 1/4 scsi: hisi_sas: Use macro instead of magic number
The hisi_sas driver has a large number of magic numbers, which is unfriendly to code reading, so macro definitions are used instead.
--- drivers/scsi/hisi_sas/hisi_sas.h | 42 +++-- drivers/scsi/hisi_sas/hisi_sas_main.c | 41 +++-- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 238 +++++++++++++++---------- 3 files changed, 206 insertions(+), 115 deletions(-)
drivers/scsi/hisi_sas/hisi_sas.h +31 -11
@@ -46,6 +46,13 @@#define HISI_SAS_IOST_ITCT_CACHE_DW_SZ 10#define HISI_SAS_FIFO_DATA_DW_SIZE 32 +#define HISI_SAS_REG_MEM_SIZE 4 +#define HISI_SAS_MAX_CDB_LEN 16 +#define HISI_SAS_BLK_QUEUE_DEPTH 64 + +#define BYTE_TO_DW 4 +#define BYTE_TO_DDW 8 +#define HISI_SAS_STATUS_BUF_SZ (sizeof(struct hisi_sas_status_buffer))#define HISI_SAS_COMMAND_TABLE_SZ (sizeof(union hisi_sas_command_table))
@@ -92,6 +99,7 @@#define HISI_SAS_WAIT_PHYUP_TIMEOUT (30 * HZ)#define HISI_SAS_CLEAR_ITCT_TIMEOUT (20 * HZ) +#define HISI_SAS_DELAY_FOR_PHY_DISABLE 100struct hisi_hba ;
@@ -167,6 +175,8 @@ struct hisi_sas_debugfs_fifo {u32 rd_data[HISI_SAS_FIFO_DATA_DW_SIZE ]; }; +#define FRAME_RCVD_BUF 32 +#define SAS_PHY_RESV_SIZE 2struct hisi_sas_phy {struct work_struct works[HISI_PHYES_NUM ];struct hisi_hba *hisi_hba;
@@ -178,10 +188,10 @@ struct hisi_sas_phy {spinlock_t lock;u64 port_id;/* from hw */ u64 frame_rcvd_size; -u8 frame_rcvd[32 ]; +u8 frame_rcvd[FRAME_RCVD_BUF ];u8 phy_attached;u8 in_reset; -u8 reserved[2 ]; +u8 reserved[SAS_PHY_RESV_SIZE ];u32 phy_type;u32 code_violation_err_count;enum sas_linkrate minimum_linkrate;
@@ -349,6 +359,7 @@ struct hisi_sas_hw { };#define HISI_SAS_MAX_DEBUGFS_DUMP (50) +#define HISI_SAS_DEFAULT_DEBUGFS_DUMP 1struct hisi_sas_debugfs_cq {struct hisi_sas_cq *cq;
@@ -529,12 +540,13 @@ struct hisi_sas_cmd_hdr {__le64 dif_prd_table_addr; }; +#define ITCT_RESV_DDW 12struct hisi_sas_itct {__le64 qw0;__le64 sas_addr;__le64 qw2;__le64 qw3; -__le64 qw4_15[12 ]; +__le64 qw4_15[ITCT_RESV_DDW ]; };struct hisi_sas_iost {
@@ -544,22 +556,26 @@ struct hisi_sas_iost {__le64 qw3; }; +#define ERROR_RECORD_BUF_DW 4struct hisi_sas_err_record { -u32 data[4 ]; +u32 data[ERROR_RECORD_BUF_DW ]; }; +#define FIS_RESV_DW 3struct hisi_sas_initial_fis {struct hisi_sas_err_record err_record;struct dev_to_host_fis fis; -u32 rsvd[3 ]; +u32 rsvd[FIS_RESV_DW ]; }; +#define BREAKPOINT_DATA_SIZE 128struct hisi_sas_breakpoint { -u8 data[128 ]; +u8 data[BREAKPOINT_DATA_SIZE ]; }; +#define BREAKPOINT_TAG_NUM 32struct hisi_sas_sata_breakpoint { -struct hisi_sas_breakpoint tag[32 ]; +struct hisi_sas_breakpoint tag[BREAKPOINT_TAG_NUM ]; };struct hisi_sas_sge {
@@ -570,13 +586,15 @@ struct hisi_sas_sge {__le32 data_off; }; +#define SMP_CMD_TABLE_SIZE 44struct hisi_sas_command_table_smp { -u8 bytes[44 ]; +u8 bytes[SMP_CMD_TABLE_SIZE ]; }; +#define DUMMY_BUF_SIZE 12struct hisi_sas_command_table_stp {struct host_to_dev_fis command_fis; -u8 dummy[12 ]; +u8 dummy[DUMMY_BUF_SIZE ];u8 atapi_cdb[ATAPI_CDB_LEN ]; };
@@ -590,12 +608,13 @@ struct hisi_sas_sge_dif_page {struct hisi_sas_sge sge[HISI_SAS_SGE_DIF_PAGE_CNT ]; }__aligned(16) ; +#define PROT_BUF_SIZE 7struct hisi_sas_command_table_ssp {struct ssp_frame_hdr hdr;union {struct {struct ssp_command_iu task; -u32 prot[7 ]; +u32 prot[PROT_BUF_SIZE ]; };struct ssp_tmf_iu ssp_task;struct xfer_rdy_iu xfer_rdy;
@@ -609,9 +628,10 @@ union hisi_sas_command_table {struct hisi_sas_command_table_stp stp; }__aligned(16) ; +#define IU_BUF_SIZE 1024struct hisi_sas_status_buffer {struct hisi_sas_err_record err; -u8 iu[1024 ]; +u8 iu[IU_BUF_SIZE ]; }__aligned(16) ;struct hisi_sas_slot_buf_table {
drivers/scsi/hisi_sas/hisi_sas_main.c +28 -13
123 lines not on this page · raw message
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +147 -91
656 lines not on this page · raw message
Signature · 1 line
2.33.0
PATCH v2 2/4 scsi: hisi_sas: Code style cleanup
In reply to Yihang LiHere are some useless blank lines and symbols, remove them and add spaces around operators.
--- drivers/scsi/hisi_sas/hisi_sas.h | 8 ++++---- drivers/scsi/hisi_sas/hisi_sas_main.c | 11 +++-------- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 2 +- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 6 +++--- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 15 ++++++--------- 5 files changed, 17 insertions(+), 25 deletions(-)
drivers/scsi/hisi_sas/hisi_sas.h +4 -4
@@ -358,7 +358,7 @@ struct hisi_sas_hw {const struct scsi_host_template *sht; }; -#define HISI_SAS_MAX_DEBUGFS_DUMP (50) +#define HISI_SAS_MAX_DEBUGFS_DUMP 50#define HISI_SAS_DEFAULT_DEBUGFS_DUMP 1struct hisi_sas_debugfs_cq {
@@ -459,12 +459,12 @@ struct hisi_hba {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 */ +const struct hisi_sas_hw *hw;/* Low level hw interface */ unsigned long sata_dev_bitmap[BITS_TO_LONGS (HISI_SAS_MAX_DEVICES )];struct work_struct rst_work;u32 phy_state; -u32 intr_coal_ticks;/* Time of interrupt coalesce in us */ -u32 intr_coal_count;/* Interrupt count to coalesce */ +u32 intr_coal_ticks;/* Time of interrupt coalesce in us */ +u32 intr_coal_count;/* Interrupt count to coalesce */ int cq_nvecs;unsigned int *reply_map;
drivers/scsi/hisi_sas/hisi_sas_main.c +3 -8
@@ -124,12 +124,10 @@ u8 hisi_sas_get_ata_protocol(struct sas_task *task) }default : - {if (direction ==DMA_NONE )return HISI_SAS_SATA_PROTOCOL_NONDATA ;return hisi_sas_get_ata_protocol_from_tf (qc); } - } }EXPORT_SYMBOL_GPL (hisi_sas_get_ata_protocol);
@@ -141,7 +139,7 @@ void hisi_sas_sata_done(struct sas_task *task,struct hisi_sas_status_buffer *status_buf =hisi_sas_status_buf_addr_mem (slot);u8 *iu = &status_buf->iu[0 ]; -struct dev_to_host_fis *d2h = (struct dev_to_host_fis *)iu; +struct dev_to_host_fis *d2h = (struct dev_to_host_fis *)iu; resp->frame_len =sizeof (struct dev_to_host_fis );memcpy (&resp->ending_fis[0 ], d2h,sizeof (struct dev_to_host_fis ));
@@ -1948,12 +1946,9 @@ static int hisi_sas_lu_reset(struct domain_device *device, u8 *lun)hisi_sas_dereg_device (hisi_hba, device);if (dev_is_sata (device)) { -struct sas_phy *phy; - - phy =sas_get_local_phy (device); +struct sas_phy *phy =sas_get_local_phy (device); rc =sas_phy_reset (phy, true); -if (rc ==0 )hisi_sas_release_task (hisi_hba, device);sas_put_local_phy (phy);
@@ -2137,7 +2132,7 @@ void hisi_sas_phy_down(struct hisi_hba *hisi_hba, int phy_no, int rdy,hisi_sas_bytes_dmaed (hisi_hba, phy_no, gfp_flags);hisi_sas_port_notify_formed (sas_phy); }else { -struct hisi_sas_port *port = phy->port; +struct hisi_sas_port *port = phy->port;if (test_bit (HISI_SAS_RESETTING_BIT , &hisi_hba->flags) || phy->in_reset) {
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +1 -1
@@ -1759,7 +1759,7 @@ static const struct scsi_host_template sht_v1_hw = { .sg_tablesize = HISI_SAS_SGE_PAGE_CNT, .sdev_init = hisi_sas_sdev_init, .shost_groups = host_v1_hw_groups, - .host_reset = hisi_sas_host_reset, + .host_reset = hisi_sas_host_reset, };static const struct hisi_sas_hw hisi_sas_v1_hw = {
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +3 -3
@@ -2771,7 +2771,7 @@ static irqreturn_t int_phy_updown_v2_hw(int irq_no, void *p) irq_msk = (hisi_sas_read32 (hisi_hba,HGC_INVLD_DQE_INFO ) >>HGC_INVLD_DQE_INFO_FB_CH0_OFF ) &0x1ff ;while (irq_msk) { -if (irq_msk &1 ) { +if (irq_msk &1 ) {u32 reg_value =hisi_sas_phy_read32 (hisi_hba, phy_no,CHL_INT0 );
@@ -3111,7 +3111,7 @@ static irqreturn_t fatal_axi_int_v2_hw(int irq_no, void *p)return IRQ_HANDLED ; } -static irqreturn_t cq_thread_v2_hw (int irq_no,void *p) +static irqreturn_t cq_thread_v2_hw (int irq_no,void *p) {struct hisi_sas_cq *cq = p;struct hisi_hba *hisi_hba = cq->hisi_hba;
@@ -3499,7 +3499,7 @@ static int write_gpio_v2_hw(struct hisi_hba *hisi_hba, u8 reg_type,* numbered drive in the fourth byte. * See SFF-8485 Rev. 0.7 Table 24. */ -void __iomem *reg_addr = hisi_hba->sgpio_regs + +void __iomem *reg_addr = hisi_hba->sgpio_regs + reg_index *4 + phy_no;int data_idx = phy_no +3 - (phy_no %4 ) *2 ;
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +6 -9
@@ -1351,8 +1351,8 @@ static void prep_ssp_v3_hw(struct hisi_hba *hisi_hba,/* map itct entry */ dw1 |= sas_dev->device_id <<CMD_HDR_DEV_ID_OFF ; - dw2 = (((sizeof (struct ssp_command_iu ) +sizeof (struct ssp_frame_hdr ) - +3 ) /BYTE_TO_DW ) <<CMD_HDR_CFL_OFF ) | + dw2 = (((sizeof (struct ssp_command_iu ) +sizeof (struct ssp_frame_hdr ) + +3 ) /BYTE_TO_DW ) <<CMD_HDR_CFL_OFF ) | ((HISI_SAS_MAX_SSP_RESP_SZ /BYTE_TO_DW ) <<CMD_HDR_MRFL_OFF ) | (HDR_SG_MOD <<CMD_HDR_SG_MOD_OFF ); hdr->dw2 =cpu_to_le32 (dw2);
@@ -1749,7 +1749,7 @@ static irqreturn_t int_phy_up_down_bcast_v3_hw(int irq_no, void *p) irq_msk =hisi_sas_read32 (hisi_hba,CHNL_INT_STATUS ) &0x11111111 ;while (irq_msk) { -if (irq_msk &1 ) { +if (irq_msk &1 ) {u32 irq_value =hisi_sas_phy_read32 (hisi_hba, phy_no,CHL_INT0 );u32 phy_state =hisi_sas_read32 (hisi_hba,PHY_STATE );
@@ -1972,8 +1972,7 @@ static irqreturn_t int_chnl_int_v3_hw(int irq_no, void *p)u32 irq_msk;int phy_no =0 ; - irq_msk =hisi_sas_read32 (hisi_hba,CHNL_INT_STATUS ) - &CHNL_INT_STS_MSK ; + irq_msk =hisi_sas_read32 (hisi_hba,CHNL_INT_STATUS ) &CHNL_INT_STS_MSK ;while (irq_msk) {if (irq_msk & (CHNL_INT_STS_INT0_MSK << (phy_no *CHNL_WIDTH )))
@@ -2618,7 +2617,6 @@ static int interrupt_preinit_v3_hw(struct hisi_hba *hisi_hba)if (vectors <0 )return -ENOENT ; - hisi_hba->cq_nvecs = vectors -BASE_VECTORS_V3_HW - hisi_hba->iopoll_q_cnt; shost->nr_hw_queues = hisi_hba->cq_nvecs + hisi_hba->iopoll_q_cnt;
@@ -3325,7 +3323,7 @@ static int debugfs_set_bist_v3_hw(struct hisi_hba *hisi_hba, bool enable)/* some preparations before bist test */ hisi_sas_bist_test_prep_v3_hw (hisi_hba); -/* set linkrate of bit test*/ +/* set linkrate of bit test */ reg_val =hisi_sas_phy_read32 (hisi_hba, phy_no,PROG_PHY_LINK_RATE ); reg_val &= ~CFG_PROG_OOB_PHY_LINK_RATE_MSK ;
@@ -3426,7 +3424,7 @@ static const struct scsi_host_template sht_v3_hw = { .shost_groups = host_v3_hw_groups, .sdev_groups = sdev_groups_v3_hw, .tag_alloc_policy_rr = true, - .host_reset = hisi_sas_host_reset, + .host_reset = hisi_sas_host_reset, .host_tagset = 1, .mq_poll = queue_complete_v3_hw, };
@@ -3679,7 +3677,6 @@ static void debugfs_print_reg_v3_hw(u32 *regs_val, struct seq_file *s, name =debugfs_to_reg_name_v3_hw (off, reg->base_off, reg->lu); -if (name)seq_printf (s,"0x%08x 0x%08x %s\n" , off, regs_val[i], name);
Signature · 1 line
2.33.0
PATCH v2 3/4 scsi: hisi_sas: Call I_T_nexus after soft reset for SATA disk
In reply to Yihang LiIn commit 21c7e972475e ("scsi: hisi_sas: Disable SATA disk phy for severe I_T nexus reset failure"), if the softreset fails upon certain conditions, the PHY connected to the disk is disabled directly. Manual recovery is required, which is inconvenient for users in actual use.
In addition, SATA disks do not support simultaneous connection of multiple hosts. Therefore, when multiple controllers are connected to a SATA disk at the same time, the controller which is connected later failed to issue an ATA softreset to the SATA disk. As a result, the PHY associated with the disk is disabled and cannot be automatically recovered.
Now that, we will not focus on the execution result of softreset. No matter whether the execution is successful or not, we will directly carry out I_T_nexus_reset.
nexus reset failure")
--- drivers/scsi/hisi_sas/hisi_sas_main.c | 29 +++++---------------------- 1 file changed, 5 insertions(+), 24 deletions(-)
drivers/scsi/hisi_sas/hisi_sas_main.c +5 -24
@@ -1897,33 +1897,14 @@ static int hisi_sas_I_T_nexus_reset(struct domain_device *device) }hisi_sas_dereg_device (hisi_hba, device); - rc =hisi_sas_debug_I_T_nexus_reset (device); -if (rc ==TMF_RESP_FUNC_COMPLETE &&dev_is_sata (device)) { -struct sas_phy *local_phy; - +if (dev_is_sata (device)) { rc =hisi_sas_softreset_ata_disk (device); -switch (rc) { -case -ECOMM : - rc = -ENODEV ; -break ; -case TMF_RESP_FUNC_FAILED : -case -EMSGSIZE : -case -EIO : - local_phy =sas_get_local_phy (device); - rc =sas_phy_enable (local_phy,0 ); -if (!rc) { - local_phy->enabled =0 ; -dev_err (dev,"Disabled local phy of ATA disk %016llx due to softreset fail (%d)\n" , -SAS_ADDR (device->sas_addr), rc); - rc = -ENODEV ; - } -sas_put_local_phy (local_phy); -break ; -default : -break ; - } +if (rc ==TMF_RESP_FUNC_FAILED ) +dev_err (dev,"ata disk %016llx reset (%d)\n" , +SAS_ADDR (device->sas_addr), rc); } + rc =hisi_sas_debug_I_T_nexus_reset (device);if ((rc ==TMF_RESP_FUNC_COMPLETE ) || (rc == -ENODEV ))hisi_sas_release_task (hisi_hba, device);
Signature · 1 line
2.33.0
PATCH v2 4/4 scsi: hisi_sas: Wait until eh is recovered
In reply to Yihang LiSATA devices are lost when FLR is performed while the controller and disks are in suspended state.
This is because the libata layer is called to initialize the SATA device during controller resuming. If FLR is executed at this time, the IDENTIFY command fails. As a result, the revalidate fails, and the SATA device is disabled by the libata layer.
So, wait until eh is recovered.
--- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +2 -0
@@ -5130,9 +5130,11 @@ static void hisi_sas_reset_prepare_v3_hw(struct pci_dev *pdev) {struct sas_ha_struct *sha =pci_get_drvdata (pdev);struct hisi_hba *hisi_hba = sha->lldd_ha; +struct Scsi_Host *shost = hisi_hba->shost;struct device *dev = hisi_hba->dev;int rc; +wait_event (shost->host_wait, !scsi_host_in_recovery (shost));dev_info (dev,"FLR prepare\n" );down (&hisi_hba->sem);set_bit (HISI_SAS_RESETTING_BIT , &hisi_hba->flags);
Signature · 1 line
2.33.0
Hi Yihang!
Quoted 4 lines
This series contains some minor bugfix and general tidying:
- Ignore the soft reset result by callingI_T_nexusafter the SATA disk is soft reset
- General minor tidying
v3_hw won't compile after applying this series:
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function ‘debugfs_show_row_64_v3_hw’:drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:3718:27: error: ‘TWO_PARA_PER_LINE’ undeclared (first use in this function)
3718 | if (!(i % TWO_PARA_PER_LINE))
| ^~~~~~~~~~~~~~~~~
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:3718:27: note: each undeclared identifier is reported only once for each function it appears in drivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function ‘debugfs_show_row_32_v3_hw’:drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:3734:27: error: ‘FOUR_PARA_PER_LINE’ undeclared (first use in this function)
3734 | if (!(i % FOUR_PARA_PER_LINE))
| ^~~~~~~~~~~~~~~~~~
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function ‘debugfs_create_files_v3_hw’:
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:3896:19: error: ‘NAME_BUF_SIZE’ undeclared (first use in this function); did you mean ‘PROT_BUF_SIZE’?
3896 | char name[NAME_BUF_SIZE];
| ^~~~~~~~~~~~~
| PROT_BUF_SIZE
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:3896:14: error: unused variable ‘name’ [-Werror=unused-variable]
3896 | char name[NAME_BUF_SIZE];
| ^~~~
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function ‘debugfs_trigger_dump_v3_hw_write’:
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:3974:18: error: ‘DUMP_BUF_SIZE’ undeclared (first use in this function); did you mean ‘DUMMY_BUF_SIZE’?
3974 | char buf[DUMP_BUF_SIZE];
| ^~~~~~~~~~~~~
| DUMMY_BUF_SIZEdrivers/scsi/hisi_sas/hisi_sas_v3_hw.c:3974:14: error: unused variable ‘buf’ [-Werror=unused-variable]
3974 | char buf[DUMP_BUF_SIZE];
| ^~~drivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function ‘debugfs_bist_linkrate_v3_hw_write’:drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4040:19: error: ‘BIST_BUF_SIZE’ undeclared (first use in this function); did you mean ‘PROT_BUF_SIZE’?
4040 | char kbuf[BIST_BUF_SIZE] = {}, *pkbuf;
| ^~~~~~~~~~~~~
| PROT_BUF_SIZE
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4040:14: error: unused variable ‘kbuf’ [-Werror=unused-variable]
4040 | char kbuf[BIST_BUF_SIZE] = {}, *pkbuf;
| ^~~~
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function ‘debugfs_bist_code_mode_v3_hw_write’:
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4115:19: error: ‘BIST_BUF_SIZE’ undeclared (first use in this function); did you mean ‘PROT_BUF_SIZE’?
4115 | char kbuf[BIST_BUF_SIZE] = {}, *pkbuf;
| ^~~~~~~~~~~~~
| PROT_BUF_SIZE
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4115:14: error: unused variable ‘kbuf’ [-Werror=unused-variable]
4115 | char kbuf[BIST_BUF_SIZE] = {}, *pkbuf;
| ^~~~
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function ‘debugfs_bist_mode_v3_hw_write’:
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4247:19: error: ‘BIST_BUF_SIZE’ undeclared (first use in this function); did you mean ‘PROT_BUF_SIZE’?
4247 | char kbuf[BIST_BUF_SIZE] = {}, *pkbuf;
| ^~~~~~~~~~~~~
| PROT_BUF_SIZE
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4247:14: error: unused variable ‘kbuf’ [-Werror=unused-variable]
4247 | char kbuf[BIST_BUF_SIZE] = {}, *pkbuf;
| ^~~~
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function ‘debugfs_phy_down_cnt_init_v3_hw’:
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4794:19: error: ‘NAME_BUF_SIZE’ undeclared (first use in this function); did you mean ‘PROT_BUF_SIZE’?
4794 | char name[NAME_BUF_SIZE];
| ^~~~~~~~~~~~~
| PROT_BUF_SIZE
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4794:14: error: unused variable ‘name’ [-Werror=unused-variable]
4794 | char name[NAME_BUF_SIZE];
| ^~~~cc1: all warnings being treated as errors
Please fix, thanks!
Signature · 1 line
Martin K. Petersen
I will check and fix, thanks for reminder.
Thanks,
Yihang
Quoted 71 lines · Martin K. Petersen
Hi Yihang!
Quoted 4 lines
This series contains some minor bugfix and general tidying:
- Ignore the soft reset result by callingI_T_nexusafter the SATA disk is soft reset
- General minor tidying
v3_hwwon't compile after applying this series:
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function ‘debugfs_show_row_64_v3_hw’:drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:3718:27: error: ‘TWO_PARA_PER_LINE’ undeclared (first use in this function)
3718 | if (!(i %TWO_PARA_PER_LINE))| ^~~~~~~~~~~~~~~~~
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:3718:27: note: each undeclared identifier is reported only once for each function it appears indrivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function ‘debugfs_show_row_32_v3_hw’:drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:3734:27: error: ‘FOUR_PARA_PER_LINE’ undeclared (first use in this function)
3734 | if (!(i %FOUR_PARA_PER_LINE))| ^~~~~~~~~~~~~~~~~~ drivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function ‘debugfs_create_files_v3_hw’: drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:3896:19: error: ‘NAME_BUF_SIZE’ undeclared (first use in this function); did you mean ‘PROT_BUF_SIZE’? 3896 | char name[NAME_BUF_SIZE]; | ^~~~~~~~~~~~~ | PROT_BUF_SIZE drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:3896:14: error: unused variable ‘name’ [-Werror=unused-variable] 3896 | char name[NAME_BUF_SIZE]; | ^~~~ drivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function ‘debugfs_trigger_dump_v3_hw_write’: drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:3974:18: error: ‘DUMP_BUF_SIZE’ undeclared (first use in this function); did you mean ‘DUMMY_BUF_SIZE’? 3974 | char buf[DUMP_BUF_SIZE]; | ^~~~~~~~~~~~~ | DUMMY_BUF_SIZE
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:3974:14: error: unused variable ‘buf’ [-Werror=unused-variable]
3974 | char buf[DUMP_BUF_SIZE];
| ^~~drivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function ‘debugfs_bist_linkrate_v3_hw_write’:drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4040:19: error: ‘BIST_BUF_SIZE’ undeclared (first use in this function); did you mean ‘PROT_BUF_SIZE’?4040 | char kbuf[BIST_BUF_SIZE] = {}, *pkbuf; | ^~~~~~~~~~~~~ | PROT_BUF_SIZE drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4040:14: error: unused variable ‘kbuf’ [-Werror=unused-variable] 4040 | char kbuf[BIST_BUF_SIZE] = {}, *pkbuf; | ^~~~ drivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function ‘debugfs_bist_code_mode_v3_hw_write’: drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4115:19: error: ‘BIST_BUF_SIZE’ undeclared (first use in this function); did you mean ‘PROT_BUF_SIZE’? 4115 | char kbuf[BIST_BUF_SIZE] = {}, *pkbuf; | ^~~~~~~~~~~~~ | PROT_BUF_SIZE drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4115:14: error: unused variable ‘kbuf’ [-Werror=unused-variable] 4115 | char kbuf[BIST_BUF_SIZE] = {}, *pkbuf; | ^~~~ drivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function ‘debugfs_bist_mode_v3_hw_write’: drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4247:19: error: ‘BIST_BUF_SIZE’ undeclared (first use in this function); did you mean ‘PROT_BUF_SIZE’? 4247 | char kbuf[BIST_BUF_SIZE] = {}, *pkbuf; | ^~~~~~~~~~~~~ | PROT_BUF_SIZE drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4247:14: error: unused variable ‘kbuf’ [-Werror=unused-variable] 4247 | char kbuf[BIST_BUF_SIZE] = {}, *pkbuf; | ^~~~ drivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function ‘debugfs_phy_down_cnt_init_v3_hw’: drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4794:19: error: ‘NAME_BUF_SIZE’ undeclared (first use in this function); did you mean ‘PROT_BUF_SIZE’? 4794 | char name[NAME_BUF_SIZE]; | ^~~~~~~~~~~~~ | PROT_BUF_SIZE drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:4794:14: error: unused variable ‘name’ [-Werror=unused-variable] 4794 | char name[NAME_BUF_SIZE]; | ^~~~cc1: all warnings being treated as errors
Please fix, thanks!