1. 11 Nov, 2020 7 commits
    • Lee Jones's avatar
      scsi: lpfc: lpfc_attr: Fix-up a bunch of kernel-doc misdemeanours · a738bd9b
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       from drivers/scsi/lpfc/lpfc_attr.c:26:
       inlined from ‘lpfc_stat_data_ctrl_store’ at drivers/scsi/lpfc/lpfc_attr.c:4165:3:
       drivers/scsi/lpfc/lpfc_attr.c:2537: warning: Function parameter or member 'attr' not described in 'lpfc_vport_param_init'
       drivers/scsi/lpfc/lpfc_attr.c:2537: warning: Function parameter or member 'default' not described in 'lpfc_vport_param_init'
       drivers/scsi/lpfc/lpfc_attr.c:2537: warning: Function parameter or member 'minval' not described in 'lpfc_vport_param_init'
       drivers/scsi/lpfc/lpfc_attr.c:2537: warning: Function parameter or member 'maxval' not described in 'lpfc_vport_param_init'
       drivers/scsi/lpfc/lpfc_attr.c:2537: warning: Excess function parameter 'phba' description in 'lpfc_vport_param_init'
       drivers/scsi/lpfc/lpfc_attr.c:2537: warning: Excess function parameter 'val' description in 'lpfc_vport_param_init'
       drivers/scsi/lpfc/lpfc_attr.c:2792: warning: Function parameter or member 'dev' not described in 'lpfc_soft_wwpn_store'
       drivers/scsi/lpfc/lpfc_attr.c:2886: warning: Function parameter or member 'dev' not described in 'lpfc_soft_wwnn_store'
       drivers/scsi/lpfc/lpfc_attr.c:2886: warning: Function parameter or member 'attr' not described in 'lpfc_soft_wwnn_store'
       drivers/scsi/lpfc/lpfc_attr.c:2886: warning: Excess function parameter 'cdev' description in 'lpfc_soft_wwnn_store'
       drivers/scsi/lpfc/lpfc_attr.c:3224: warning: Function parameter or member 'vpt_wwpn' not described in 'lpfc_oas_lun_state_set'
       drivers/scsi/lpfc/lpfc_attr.c:3224: warning: Function parameter or member 'tgt_wwpn' not described in 'lpfc_oas_lun_state_set'
       drivers/scsi/lpfc/lpfc_attr.c:3224: warning: Function parameter or member 'pri' not described in 'lpfc_oas_lun_state_set'
       drivers/scsi/lpfc/lpfc_attr.c:3224: warning: Excess function parameter 'ndlp' description in 'lpfc_oas_lun_state_set'
       drivers/scsi/lpfc/lpfc_attr.c:3264: warning: Function parameter or member 'lun_pri' not described in 'lpfc_oas_lun_get_next'
       drivers/scsi/lpfc/lpfc_attr.c:3302: warning: Function parameter or member 'pri' not described in 'lpfc_oas_lun_state_change'
       drivers/scsi/lpfc/lpfc_attr.c:3376: warning: Function parameter or member 'count' not described in 'lpfc_oas_lun_store'
       drivers/scsi/lpfc/lpfc_attr.c:3835: warning: Function parameter or member 'vport' not described in 'lpfc_tgt_queue_depth_set'
       drivers/scsi/lpfc/lpfc_attr.c:3835: warning: Excess function parameter 'phba' description in 'lpfc_tgt_queue_depth_set'
       drivers/scsi/lpfc/lpfc_attr.c:4026: warning: Function parameter or member 'dev' not described in 'lpfc_topology_store'
       drivers/scsi/lpfc/lpfc_attr.c:4026: warning: Function parameter or member 'attr' not described in 'lpfc_topology_store'
       drivers/scsi/lpfc/lpfc_attr.c:4026: warning: Function parameter or member 'buf' not described in 'lpfc_topology_store'
       drivers/scsi/lpfc/lpfc_attr.c:4026: warning: Function parameter or member 'count' not described in 'lpfc_topology_store'
       drivers/scsi/lpfc/lpfc_attr.c:4026: warning: Excess function parameter 'phba' description in 'lpfc_topology_store'
       drivers/scsi/lpfc/lpfc_attr.c:4026: warning: Excess function parameter 'val' description in 'lpfc_topology_store'
       drivers/scsi/lpfc/lpfc_attr.c:4148: warning: Function parameter or member 'attr' not described in 'lpfc_stat_data_ctrl_store'
       drivers/scsi/lpfc/lpfc_attr.c:4302: warning: Function parameter or member 'attr' not described in 'lpfc_stat_data_ctrl_show'
       drivers/scsi/lpfc/lpfc_attr.c:4383: warning: Function parameter or member 'buf' not described in 'sysfs_drvr_stat_data_read'
       drivers/scsi/lpfc/lpfc_attr.c:4383: warning: Excess function parameter 'buff' description in 'sysfs_drvr_stat_data_read'
       drivers/scsi/lpfc/lpfc_attr.c:4476: warning: Function parameter or member 'dev' not described in 'lpfc_link_speed_store'
       drivers/scsi/lpfc/lpfc_attr.c:4476: warning: Function parameter or member 'attr' not described in 'lpfc_link_speed_store'
       drivers/scsi/lpfc/lpfc_attr.c:4476: warning: Function parameter or member 'buf' not described in 'lpfc_link_speed_store'
       drivers/scsi/lpfc/lpfc_attr.c:4476: warning: Function parameter or member 'count' not described in 'lpfc_link_speed_store'
       drivers/scsi/lpfc/lpfc_attr.c:4476: warning: Excess function parameter 'phba' description in 'lpfc_link_speed_store'
       drivers/scsi/lpfc/lpfc_attr.c:4476: warning: Excess function parameter 'val' description in 'lpfc_link_speed_store'
       drivers/scsi/lpfc/lpfc_attr.c:7117: warning: Function parameter or member 'verbose' not described in 'lpfc_hba_log_verbose_init'
      
      Link: https://lore.kernel.org/r/20201102142359.561122-6-lee.jones@linaro.org
      Cc: James Smart <james.smart@broadcom.com>
      Cc: Dick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      a738bd9b
    • Lee Jones's avatar
      scsi: lpfc: lpfc_attr: Demote kernel-doc format for redefined functions · 9176ad27
      Lee Jones authored
      Kernel-doc does not understand this use-case.
      
      Fixes the following W=1 kernel build warning(s):
      
       from drivers/scsi/lpfc/lpfc_attr.c:26:
       inlined from ‘lpfc_stat_data_ctrl_store’ at drivers/scsi/lpfc/lpfc_attr.c:4164:3:
       drivers/scsi/lpfc/lpfc_attr.c:2315: warning: Excess function parameter 'dev' description in 'lpfc_param_show'
       drivers/scsi/lpfc/lpfc_attr.c:2315: warning: Excess function parameter 'buf' description in 'lpfc_param_show'
       drivers/scsi/lpfc/lpfc_attr.c:2343: warning: Excess function parameter 'dev' description in 'lpfc_param_hex_show'
       drivers/scsi/lpfc/lpfc_attr.c:2343: warning: Excess function parameter 'buf' description in 'lpfc_param_hex_show'
       drivers/scsi/lpfc/lpfc_attr.c:2377: warning: Function parameter or member 'attr' not described in 'lpfc_param_init'
       drivers/scsi/lpfc/lpfc_attr.c:2377: warning: Function parameter or member 'default' not described in 'lpfc_param_init'
       drivers/scsi/lpfc/lpfc_attr.c:2377: warning: Function parameter or member 'minval' not described in 'lpfc_param_init'
       drivers/scsi/lpfc/lpfc_attr.c:2377: warning: Function parameter or member 'maxval' not described in 'lpfc_param_init'
       drivers/scsi/lpfc/lpfc_attr.c:2377: warning: Excess function parameter 'phba' description in 'lpfc_param_init'
       drivers/scsi/lpfc/lpfc_attr.c:2377: warning: Excess function parameter 'val' description in 'lpfc_param_init'
       drivers/scsi/lpfc/lpfc_attr.c:2414: warning: Function parameter or member 'attr' not described in 'lpfc_param_set'
       drivers/scsi/lpfc/lpfc_attr.c:2414: warning: Function parameter or member 'default' not described in 'lpfc_param_set'
       drivers/scsi/lpfc/lpfc_attr.c:2414: warning: Function parameter or member 'minval' not described in 'lpfc_param_set'
       drivers/scsi/lpfc/lpfc_attr.c:2414: warning: Function parameter or member 'maxval' not described in 'lpfc_param_set'
       drivers/scsi/lpfc/lpfc_attr.c:2414: warning: Excess function parameter 'phba' description in 'lpfc_param_set'
       drivers/scsi/lpfc/lpfc_attr.c:2414: warning: Excess function parameter 'val' description in 'lpfc_param_set'
       drivers/scsi/lpfc/lpfc_attr.c:2454: warning: Excess function parameter 'dev' description in 'lpfc_param_store'
       drivers/scsi/lpfc/lpfc_attr.c:2454: warning: Excess function parameter 'buf' description in 'lpfc_param_store'
       drivers/scsi/lpfc/lpfc_attr.c:2454: warning: Excess function parameter 'count' description in 'lpfc_param_store'
       drivers/scsi/lpfc/lpfc_attr.c:2478: warning: Excess function parameter 'dev' description in 'lpfc_vport_param_show'
       drivers/scsi/lpfc/lpfc_attr.c:2478: warning: Excess function parameter 'buf' description in 'lpfc_vport_param_show'
       drivers/scsi/lpfc/lpfc_attr.c:2503: warning: Excess function parameter 'dev' description in 'lpfc_vport_param_hex_show'
       drivers/scsi/lpfc/lpfc_attr.c:2503: warning: Excess function parameter 'buf' description in 'lpfc_vport_param_hex_show'
       drivers/scsi/lpfc/lpfc_attr.c:2536: warning: Function parameter or member 'attr' not described in 'lpfc_vport_param_init'
       drivers/scsi/lpfc/lpfc_attr.c:2536: warning: Function parameter or member 'default' not described in 'lpfc_vport_param_init'
       drivers/scsi/lpfc/lpfc_attr.c:2536: warning: Function parameter or member 'minval' not described in 'lpfc_vport_param_init'
       drivers/scsi/lpfc/lpfc_attr.c:2536: warning: Function parameter or member 'maxval' not described in 'lpfc_vport_param_init'
       drivers/scsi/lpfc/lpfc_attr.c:2536: warning: Excess function parameter 'phba' description in 'lpfc_vport_param_init'
       drivers/scsi/lpfc/lpfc_attr.c:2536: warning: Excess function parameter 'val' description in 'lpfc_vport_param_init'
       drivers/scsi/lpfc/lpfc_attr.c:2572: warning: Function parameter or member 'attr' not described in 'lpfc_vport_param_set'
       drivers/scsi/lpfc/lpfc_attr.c:2572: warning: Function parameter or member 'default' not described in 'lpfc_vport_param_set'
       drivers/scsi/lpfc/lpfc_attr.c:2572: warning: Function parameter or member 'minval' not described in 'lpfc_vport_param_set'
       drivers/scsi/lpfc/lpfc_attr.c:2572: warning: Function parameter or member 'maxval' not described in 'lpfc_vport_param_set'
       drivers/scsi/lpfc/lpfc_attr.c:2572: warning: Excess function parameter 'phba' description in 'lpfc_vport_param_set'
       drivers/scsi/lpfc/lpfc_attr.c:2572: warning: Excess function parameter 'val' description in 'lpfc_vport_param_set'
       drivers/scsi/lpfc/lpfc_attr.c:2607: warning: Function parameter or member 'attr' not described in 'lpfc_vport_param_store'
       drivers/scsi/lpfc/lpfc_attr.c:2607: warning: Excess function parameter 'cdev' description in 'lpfc_vport_param_store'
       drivers/scsi/lpfc/lpfc_attr.c:2607: warning: Excess function parameter 'buf' description in 'lpfc_vport_param_store'
       drivers/scsi/lpfc/lpfc_attr.c:2607: warning: Excess function parameter 'count' description in 'lpfc_vport_param_store'
       drivers/scsi/lpfc/lpfc_attr.c:7081: warning: Function parameter or member 'field' not described in 'lpfc_rport_show_function'
       drivers/scsi/lpfc/lpfc_attr.c:7081: warning: Function parameter or member 'format_string' not described in 'lpfc_rport_show_function'
       drivers/scsi/lpfc/lpfc_attr.c:7081: warning: Function parameter or member 'sz' not described in 'lpfc_rport_show_function'
       drivers/scsi/lpfc/lpfc_attr.c:7081: warning: Function parameter or member 'cast' not described in 'lpfc_rport_show_function'
       drivers/scsi/lpfc/lpfc_attr.c:7081: warning: Excess function parameter 'cdev' description in 'lpfc_rport_show_function'
       drivers/scsi/lpfc/lpfc_attr.c:7081: warning: Excess function parameter 'buf' description in 'lpfc_rport_show_function'
      
      Link: https://lore.kernel.org/r/20201102142359.561122-5-lee.jones@linaro.org
      Cc: James Smart <james.smart@broadcom.com>
      Cc: Dick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      9176ad27
    • Lee Jones's avatar
      scsi: lpfc: lpfc_scsi: Fix a whole host of kernel-doc issues · eceee00e
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/scsi/lpfc/lpfc_scsi.c:331: warning: Function parameter or member 'num_to_alloc' not described in 'lpfc_new_scsi_buf_s3'
       drivers/scsi/lpfc/lpfc_scsi.c:331: warning: Excess function parameter 'num_to_allocate' description in 'lpfc_new_scsi_buf_s3'
       drivers/scsi/lpfc/lpfc_scsi.c:507: warning: Function parameter or member 'idx' not described in 'lpfc_sli4_io_xri_aborted'
       drivers/scsi/lpfc/lpfc_scsi.c:593: warning: Function parameter or member 'ndlp' not described in 'lpfc_get_scsi_buf_s3'
       drivers/scsi/lpfc/lpfc_scsi.c:593: warning: Function parameter or member 'cmnd' not described in 'lpfc_get_scsi_buf_s3'
       drivers/scsi/lpfc/lpfc_scsi.c:632: warning: Function parameter or member 'ndlp' not described in 'lpfc_get_scsi_buf_s4'
       drivers/scsi/lpfc/lpfc_scsi.c:632: warning: Function parameter or member 'cmnd' not described in 'lpfc_get_scsi_buf_s4'
       drivers/scsi/lpfc/lpfc_scsi.c:744: warning: Function parameter or member 'ndlp' not described in 'lpfc_get_scsi_buf'
       drivers/scsi/lpfc/lpfc_scsi.c:744: warning: Function parameter or member 'cmnd' not described in 'lpfc_get_scsi_buf'
       drivers/scsi/lpfc/lpfc_scsi.c:986: warning: Function parameter or member 'new_guard' not described in 'lpfc_bg_err_inject'
       drivers/scsi/lpfc/lpfc_scsi.c:1393: warning: Function parameter or member 'txop' not described in 'lpfc_sc_to_bg_opcodes'
       drivers/scsi/lpfc/lpfc_scsi.c:1393: warning: Function parameter or member 'rxop' not described in 'lpfc_sc_to_bg_opcodes'
       drivers/scsi/lpfc/lpfc_scsi.c:1393: warning: Excess function parameter 'txopt' description in 'lpfc_sc_to_bg_opcodes'
       drivers/scsi/lpfc/lpfc_scsi.c:1393: warning: Excess function parameter 'rxopt' description in 'lpfc_sc_to_bg_opcodes'
       drivers/scsi/lpfc/lpfc_scsi.c:1473: warning: Function parameter or member 'txop' not described in 'lpfc_bg_err_opcodes'
       drivers/scsi/lpfc/lpfc_scsi.c:1473: warning: Function parameter or member 'rxop' not described in 'lpfc_bg_err_opcodes'
       drivers/scsi/lpfc/lpfc_scsi.c:1473: warning: Excess function parameter 'txopt' description in 'lpfc_bg_err_opcodes'
       drivers/scsi/lpfc/lpfc_scsi.c:1473: warning: Excess function parameter 'rxopt' description in 'lpfc_bg_err_opcodes'
       drivers/scsi/lpfc/lpfc_scsi.c:1565: warning: Function parameter or member 'datasegcnt' not described in 'lpfc_bg_setup_bpl'
       drivers/scsi/lpfc/lpfc_scsi.c:1565: warning: Excess function parameter 'datacnt' description in 'lpfc_bg_setup_bpl'
       drivers/scsi/lpfc/lpfc_scsi.c:1951: warning: Function parameter or member 'datasegcnt' not described in 'lpfc_bg_setup_sgl'
       drivers/scsi/lpfc/lpfc_scsi.c:1951: warning: Function parameter or member 'lpfc_cmd' not described in 'lpfc_bg_setup_sgl'
       drivers/scsi/lpfc/lpfc_scsi.c:1951: warning: Excess function parameter 'datacnt' description in 'lpfc_bg_setup_sgl'
       drivers/scsi/lpfc/lpfc_scsi.c:2131: warning: Function parameter or member 'lpfc_cmd' not described in 'lpfc_bg_setup_sgl_prot'
       drivers/scsi/lpfc/lpfc_scsi.c:4476: warning: Function parameter or member 't' not described in 'lpfc_poll_timeout'
       drivers/scsi/lpfc/lpfc_scsi.c:4476: warning: Excess function parameter 'ptr' description in 'lpfc_poll_timeout'
       drivers/scsi/lpfc/lpfc_scsi.c:4503: warning: Function parameter or member 'shost' not described in 'lpfc_queuecommand'
       drivers/scsi/lpfc/lpfc_scsi.c:4503: warning: Excess function parameter 'done' description in 'lpfc_queuecommand'
       drivers/scsi/lpfc/lpfc_scsi.c:5035: warning: Function parameter or member 'cmnd' not described in 'lpfc_send_taskmgmt'
       drivers/scsi/lpfc/lpfc_scsi.c:5035: warning: Excess function parameter 'rdata' description in 'lpfc_send_taskmgmt'
       drivers/scsi/lpfc/lpfc_scsi.c:5688: warning: Function parameter or member 'phba' not described in 'lpfc_create_device_data'
       drivers/scsi/lpfc/lpfc_scsi.c:5688: warning: Function parameter or member 'pri' not described in 'lpfc_create_device_data'
       drivers/scsi/lpfc/lpfc_scsi.c:5688: warning: Excess function parameter 'pha' description in 'lpfc_create_device_data'
       drivers/scsi/lpfc/lpfc_scsi.c:5730: warning: Function parameter or member 'phba' not described in 'lpfc_delete_device_data'
       drivers/scsi/lpfc/lpfc_scsi.c:5730: warning: Excess function parameter 'pha' description in 'lpfc_delete_device_data'
       drivers/scsi/lpfc/lpfc_scsi.c:5762: warning: Function parameter or member 'phba' not described in '__lpfc_get_device_data'
       drivers/scsi/lpfc/lpfc_scsi.c:5762: warning: Excess function parameter 'pha' description in '__lpfc_get_device_data'
       drivers/scsi/lpfc/lpfc_scsi.c:5818: warning: Function parameter or member 'phba' not described in 'lpfc_find_next_oas_lun'
       drivers/scsi/lpfc/lpfc_scsi.c:5818: warning: Function parameter or member 'found_lun_pri' not described in 'lpfc_find_next_oas_lun'
       drivers/scsi/lpfc/lpfc_scsi.c:5818: warning: Excess function parameter 'pha' description in 'lpfc_find_next_oas_lun'
       drivers/scsi/lpfc/lpfc_scsi.c:5909: warning: Function parameter or member 'phba' not described in 'lpfc_enable_oas_lun'
       drivers/scsi/lpfc/lpfc_scsi.c:5909: warning: Function parameter or member 'pri' not described in 'lpfc_enable_oas_lun'
       drivers/scsi/lpfc/lpfc_scsi.c:5909: warning: Excess function parameter 'pha' description in 'lpfc_enable_oas_lun'
       drivers/scsi/lpfc/lpfc_scsi.c:5968: warning: Function parameter or member 'phba' not described in 'lpfc_disable_oas_lun'
       drivers/scsi/lpfc/lpfc_scsi.c:5968: warning: Function parameter or member 'pri' not described in 'lpfc_disable_oas_lun'
       drivers/scsi/lpfc/lpfc_scsi.c:5968: warning: Excess function parameter 'pha' description in 'lpfc_disable_oas_lun'
      
      Link: https://lore.kernel.org/r/20201102142359.561122-4-lee.jones@linaro.org
      Cc: James Smart <james.smart@broadcom.com>
      Cc: Dick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      eceee00e
    • Lee Jones's avatar
      scsi: mpt3sas: mpt3sas_scsih: Fix function documentation formatting · e330c969
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/scsi/mpt3sas/mpt3sas_scsih.c:2778: warning: Function parameter or member 'ioc' not described in 'scsih_tm_cmd_map_status'
       drivers/scsi/mpt3sas/mpt3sas_scsih.c:2778: warning: Function parameter or member 'channel' not described in 'scsih_tm_cmd_map_status'
       drivers/scsi/mpt3sas/mpt3sas_scsih.c:2829: warning: Function parameter or member 'ioc' not described in 'scsih_tm_post_processing'
       drivers/scsi/mpt3sas/mpt3sas_scsih.c:2829: warning: Function parameter or member 'channel' not described in 'scsih_tm_post_processing'
      
      Link: https://lore.kernel.org/r/20201102142359.561122-3-lee.jones@linaro.org
      Cc: Sathya Prakash <sathya.prakash@broadcom.com>
      Cc: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
      Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
      Cc: MPT-FusionLinux.pdl@avagotech.com
      Cc: MPT-FusionLinux.pdl@broadcom.com
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      e330c969
    • Lee Jones's avatar
      scsi: aic7xxx: aic79xx_osm: Remove unused variable 'saved_scsiid' · b2ed1bab
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/scsi/aic7xxx/aic79xx_osm.c: In function ‘ahd_linux_queue_abort_cmd’:
       drivers/scsi/aic7xxx/aic79xx_osm.c:2143:9: warning: variable ‘saved_scsiid’ set but not used [-Wunused-but-set-variable]
      
      Link: https://lore.kernel.org/r/20201102142359.561122-2-lee.jones@linaro.org
      Cc: Hannes Reinecke <hare@suse.com>
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      b2ed1bab
    • Lee Jones's avatar
      scsi: pm8001: pm8001_sas: Fix strncpy() warning when space is not left for NUL · 412b51ff
      Lee Jones authored
      This string is not NUL terminated.
      
      Fixes the following W=1 kernel build warning(s):
      
       from drivers/scsi/pm8001/pm8001_sas.c:41:
       In function ‘strncpy’,
       inlined from ‘pm8001_issue_ssp_tmf’ at drivers/scsi/pm8001/pm8001_sas.c:919:2:
       include/linux/string.h:297:30: warning: ‘__builtin_strncpy’ specified bound 8 equals destination size [-Wstringop-truncation]
       297 | #define __underlying_strncpy __builtin_strncpy
       | ^
       include/linux/string.h:307:9: note: in expansion of macro ‘__underlying_strncpy’
       307 | return __underlying_strncpy(p, q, size);
       | ^~~~~~~~~~~~~~~~~~~~
      
      Link: https://lore.kernel.org/r/20201102102544.1018706-2-lee.jones@linaro.org
      Cc: Jack Wang <jinpu.wang@cloud.ionos.com>
      Acked-by: default avatarJack Wang <jinpu.wang@cloud.ionos.com>
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      412b51ff
    • Lee Jones's avatar
      scsi: arcmsr: Stop __builtin_strncpy complaining about a lack of space for NUL · d2a2f379
      Lee Jones authored
      SCSI strings like inqdata are not NUL terminated.
      
      Fixes the following W=1 kernel build warning(s):
      
       In file included from include/linux/bitmap.h:9,
       from include/linux/nodemask.h:95,
       from include/linux/mmzone.h:17,
       from include/linux/gfp.h:6,
       from include/linux/umh.h:4,
       from include/linux/kmod.h:9,
       from include/linux/module.h:16,
       from drivers/scsi/arcmsr/arcmsr_hba.c:47:
       In function ‘strncpy’,
       inlined from ‘arcmsr_handle_virtual_command’ at drivers/scsi/arcmsr/arcmsr_hba.c:3055:3:
       include/linux/string.h:297:30: warning: ‘__builtin_strncpy’ output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
       297 | #define __underlying_strncpy __builtin_strncpy
       | ^
       include/linux/string.h:307:9: note: in expansion of macro ‘__underlying_strncpy’
       307 | return __underlying_strncpy(p, q, size);
       | ^~~~~~~~~~~~~~~~~~~~
       In function ‘strncpy’,
       inlined from ‘arcmsr_handle_virtual_command’ at drivers/scsi/arcmsr/arcmsr_hba.c:3053:3:
       include/linux/string.h:297:30: warning: ‘__builtin_strncpy’ output truncated before terminating nul copying 16 bytes from a string of the same length [-Wstringop-truncation]
       297 | #define __underlying_strncpy __builtin_strncpy
       | ^
       include/linux/string.h:307:9: note: in expansion of macro ‘__underlying_strncpy’
       307 | return __underlying_strncpy(p, q, size);
       | ^~~~~~~~~~~~~~~~~~~~
       In function ‘strncpy’,
       inlined from ‘arcmsr_handle_virtual_command’ at drivers/scsi/arcmsr/arcmsr_hba.c:3051:3:
       include/linux/string.h:297:30: warning: ‘__builtin_strncpy’ output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation]
       297 | #define __underlying_strncpy __builtin_strncpy
       | ^
       include/linux/string.h:307:9: note: in expansion of macro ‘__underlying_strncpy’
       307 | return __underlying_strncpy(p, q, size);
       | ^~~~~~~~~~~~~~~~~~~~
      
      Link: https://lore.kernel.org/r/20201102102544.1018706-1-lee.jones@linaro.org
      Cc: support@areca.com.tw
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      d2a2f379
  2. 05 Nov, 2020 23 commits
  3. 04 Nov, 2020 10 commits
    • Sreekanth Reddy's avatar
    • Sreekanth Reddy's avatar
      scsi: mpt3sas: Add module parameter multipath_on_hba · 324c122f
      Sreekanth Reddy authored
      Add module parameter multipath_on_hba to enable/disable multi-port path
      topology support.  By default this feature is enabled on SAS3.5 HBA device
      and disabled on SAS3 &SAS2.5 HBA devices.
      
      When this feature is disabled then driver uses a default
      PhysicalPort(PortID) number i.e. 255 instead of the PhysicalPort number
      provided by HBA firmware.
      
      Link: https://lore.kernel.org/r/20201027130847.9962-14-sreekanth.reddy@broadcom.comSigned-off-by: default avatarSreekanth Reddy <sreekanth.reddy@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      324c122f
    • Sreekanth Reddy's avatar
      scsi: mpt3sas: Handle vSES vphy object during HBA reset · ffa381d6
      Sreekanth Reddy authored
      During HBA reset the Port ID of vSES device may change. As a result, it is
      necessary to refresh virtual_phy objects after reset.
      
      Each Port's vphy_list table needs to be updated after updating the
      HBA port table. The algorithm is as follows:
      
       - Loop over each port entry from HBA port table
         * Loop over each virtual phy entry from port's vphys_list table
           - Mark virtual phy entry as dirty by setting dirty bit in virtual phy
             entry's flags field
       - Read SASIOUnitPage0 page
       - Loop over each HBA Phy's Phy data from SASIOUnitPage0
          * If phy's remote attached device is not SES device then continue with
            processing next HBA Phy's Phy data;
          * Read SASPhyPage0 data for this Phy number and determine whether
            current phy is a virtual phy or not. If it is not a virtual phy then
            continue with next Phy data;
          * Get the current phy's remote attached vSES device's SAS Address;
          * Loop over each port entry from HBA port table
            - If Port's vphys_mask field is zero then continue with
              next Port entry,
            - Loop over each virtual phy entry from Port's vphy_list table
            - If the current phy's remote SAS Address is different from
              virtual phy entry's SAS Address then continue with next
              virtual phy entry,
            - Set bit corresponding to current phy number in virtual phy
              entry's phy_mask field,
            - Get the HBA port table's Port entry corresponding to
              Phy data's 'Port' value,
              * If there is no Port entry corresponding to Phy data's
      	 'Port' value in HBA port table then create a new port entry
      	 and add it to HBA port table.
            - If this retrieved Port entry is the same as the current Port
              entry then don't do anything, just clear the dirty bit from
              virtual phy entry's flag field and continue with processing
              next HBA Phy's Phy data.
            - If this retrieved Port entry is different from the current Port
              entry then move the current virtual phy entry from current Port's
              vphys_list to retrieved Port entry's vphys_list.
              * Clear current phy bit in current Port entry's vphys_mask and
                set the current phy bit in the retrieved Port entry's
                vphys_mask field.
              * Clear the dirty bit from virtual phy entry's flag field and
                continue with next HBA Phy's Phy data.
       - Delete the 'virtual phy' entries and HBA's 'Port table' entries which
         are still marked as 'dirty'.
      
      Link: https://lore.kernel.org/r/20201027130847.9962-13-sreekanth.reddy@broadcom.comSigned-off-by: default avatarSreekanth Reddy <sreekanth.reddy@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      ffa381d6
    • Sreekanth Reddy's avatar
      scsi: mpt3sas: Add bypass_dirty_port_flag parameter · 34b0a785
      Sreekanth Reddy authored
      Added a new parameter bypass_dirty_port_flag in function
      mpt3sas_get_port_by_id(). When this parameter is set to one then search for
      matching hba port entry from port_table_list even when this hba_port entry
      is marked as dirty.
      
      Link: https://lore.kernel.org/r/20201027130847.9962-12-sreekanth.reddy@broadcom.comSigned-off-by: default avatarSreekanth Reddy <sreekanth.reddy@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      34b0a785
    • Sreekanth Reddy's avatar
      scsi: mpt3sas: Handling HBA vSES device · ccc59923
      Sreekanth Reddy authored
      Each direct attached device will have a unique Port ID, but with an
      exception. HBA vSES may use the same Port ID of another direct attached
      device Port's ID. As a result, special handling is needed for vSES.
      
      Create a virtual_phy object when a new HBA vSES device is detected and add
      this virtual_phy object to vphys_list of port ID's hba_port object.  When
      the HBA vSES device is removed then remove the corresponding virtual_phy
      object from its parent's hba_port's vphy_list and free this virtual_vphy
      object.
      
      In hba_port object add vphy_mask field to hold the list of HBA phy bits
      which are assigned to vSES devices. Also add vphy_list list to hold list of
      virtual_phy objects which holds the same portID of current hba_port's
      portID.
      
      Also, add a hba_vphy field in _sas_phy object to determine whether this
      _sas_phy object belongs to vSES device or not.
      
       - Allocate a virtual_phy object whenever a virtual phy is detected while
         processing the SASIOUnitPage0's phy data. And this allocated virtual_phy
         object to corresponding PortID's hba_port's vphy_list.
      
       - When a vSES device is added to the SML then initialize the corresponding
         virtual_phy objects's sas_address field with vSES device's SAS Address.
      
       - Free this virtual_phy object during driver unload time and when this
         vSES device is removed.
      
      Link: https://lore.kernel.org/r/20201027130847.9962-11-sreekanth.reddy@broadcom.comSigned-off-by: default avatarSreekanth Reddy <sreekanth.reddy@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      ccc59923
    • Sreekanth Reddy's avatar
      scsi: mpt3sas: Set valid PhysicalPort in SMPPassThrough · 9d0348a9
      Sreekanth Reddy authored
      The driver currently sets PhysicalPort field to 0xFF for SMPPassthrough
      Request message. In zoning topologies this SMPPassthrough command always
      operates on devices in one zone (default zone) even when user issues SMP
      command for other zone drives.
      
      Define _transport_get_port_id_by_rphy() and
      _transport_get_port_id_by_sas_phy() helper functions to get Physical Port
      number from sas_rphy & sas_phy respectively for SMPPassthrough request
      message so that SMP Passthrough request message is sent to intended zone
      device.
      
      Link: https://lore.kernel.org/r/20201027130847.9962-10-sreekanth.reddy@broadcom.comSigned-off-by: default avatarSreekanth Reddy <sreekanth.reddy@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      9d0348a9
    • Sreekanth Reddy's avatar
      scsi: mpt3sas: Update hba_port objects after host reset · a5e99fda
      Sreekanth Reddy authored
      During host reset there is a chance that the Port number allocated by the
      firmware for the attached devices may change. Also, it may be possible that
      some HBA phy's can go down/come up after reset. As a result, the driver
      can't just trust the HBA Port table that it has populated before host reset
      as valid. Instead it has to update the HBA Port table in such a way that it
      shouldn't disturb the drives which are still accessible even after host
      reset.
      
      Use the following algorithm to update the HBA Port table during host reset:
      
      I. After host reset operation and before marking the devices as
         responding/non-responding, create a temporary Port table called "New
         Port table" by parsing each of the HBA phy's Phy data info read from SAS
         IOUnit Page0:
      
         a. Check whether Phy's negotiated link rate is greater than 1.5Gbps, if
            not go to next Phy;
      
         b. Get the SAS Address of the attached device;
      
         c. Create a new entry in the "New Port table" with SAS Address field
            filled with attached device's SAS Address, port number with Phy's
            Port number (read from SAS IOUnit Page0) and enable bit in the 'Phy
            mask' field corresponding to current Phy number.  New entry is
            created only if the driver can't find an entry in the "New Port
            table" which matches with attached device 'SAS Address' & 'Port
            Number'. If it finds an entry with matches with attached device 'SAS
            Address' & 'Port Number' then the driver takes that matched entry and
            will enable current Phy number bit in the 'Phy mask' field;
      
         d. After parsing all the HBA phy's info, the driver will have complete
            Port table info in "New Port table".
      
      II. Mark all the existing sas_device & sas_expander device structures as
          'dirty'.
      
      III. Mark each entry of the HBA Port lists as 'dirty'.
      
      IV. Take each entry from 'New Port table' one by one and check whether the
          entry has any corresponding matched entry (which is marked as 'dirty')
          in the HBA Port table or not.  While looking for a corresponding
          matched entry, look for matched entry in the sequence from top row to
          bottom row listed in the following table. If you find any matched entry
          (according to any of the rules tabulated below) then perform the action
          mentioned in the 'Action' column in that matched rule.
      
          ===========================================================================
          |Search  |SAS     | Phy Mask | Port    | Possibilities| Action            |
          |every   |Address |    or    | Number  |              | required          |
          |entry   |matched?| subset of| matched?|              |                   |
          |in below|        | phy mask |         |              |                   |
          |sequence|        | matched? |         |              |                   |
          ===========================================================================
          |  1     |matched | matched  | matched | nothing      |* unmark HBA port  |
          |        |        |          |         | changed      |table entry as     |
          |        |        |          |         |              |dirty              |
          ---------------------------------------------------------------------------
          |  2     |matched | matched  | not     | port number  |* Update port      |
          |        |        |          | matched | is changed   |number in the      |
          |        |        |          |         |              |matched port table |
          |        |        |          |         |              |entry              |
          |        |        |          |         |              |* unmask HBA port  |
          |        |        |          |         |              |table entry as     |
          |        |        |          |         |              |dirty              |
          ---------------------------------------------------------------------------
          |  3.a   |matched | subset of| matched |some phys     |* Add these new    |
          |        |        | phy mask | (or)    |might have    |phys to current    |
          |        |        | matched  | not     |enabled which |port in STL        |
          |        |        |          | matched |are previously|* Update phy mask  |
          |        |        |          | (but    |disabled      |field in HBA's port|
          |        |        |          | first   |              |table's matched    |
          |        |        |          | look for|              |entry,             |
          |        |        |          | matched |              |* Update port      |
          |        |        |          | one)    |              |number in the      |
          |	     |	      |		 | 	   |		  |matched port       |
          |        |        |          |         |              |table entry (if    |
          |        |        |          |         |              |port number is     |
          |        |        |          |         |              |changed),          |
          |        |        |          |         |              |* Unmask HBA port  |
          |        |        |          |         |              |table entry as     |
          |        |        |          |         |              |dirty              |
          ---------------------------------------------------------------------------
          |  3.b   |matched | subset of| matched |some phys     |*Remove these phys |
          |        |        | phy mask | (or)    |might have    |from current port  |
          |        |        | matched  | not     |disabled which|in STL             |
          |        |        |          | matched |are previously|* Update phy mask  |
          |        |        |          | (but    |enabled       |field in HBA's port|
          |        |        |          | first   |              |tables's matched   |
          |        |        |          | look for|              |entry,             |
          |        |        |          | matched |              |*Update port number|
          |        |        |          | one)    |              |in the matched port|
          |        |        |          |         |              |table entry (if    |
          |        |        |          |         |              |port number is     |
          |        |        |          |         |              |changed),          |
          |        |        |          |         |              |* Unmask HBA port  |
          |        |        |          |         |              |table entry as     |
          |        |        |          |         |              |dirty              |
          ---------------------------------------------------------------------------
          |  4     |matched | not      | matched |A cable       |*Remove old phys & |
          |        |        | matched  | (or)    |attached to an|new phys to current|
          |        |        |          | not     |expander is   |port in STL        |
          |        |        |          | matched |changed to    |* Update phy mask  |
          |        |        |          |         |another HBA   |field in HBA's port|
          |        |        |          |         |port during   |tables's matched   |
          |        |        |          |         |reset         |entry,             |
          |        |        |          |         |              |*Update port number|
          |        |        |          |         |              |in the matched port|
          |        |        |          |         |              |table entry (if    |
          |        |        |          |         |              |port number is     |
          |        |        |          |         |              |changed),          |
          |        |        |          |         |              |* Unmask HBA port  |
          |        |        |          |         |              |table entry as     |
          |        |        |          |         |              |dirty              |
          ---------------------------------------------------------------------------
      
      V. Delete the hba_port objects which are still marked as dirty.
      
      Link: https://lore.kernel.org/r/20201027130847.9962-9-sreekanth.reddy@broadcom.comReported-by: default avatarkernel test robot <lkp@intel.com>
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarSreekanth Reddy <sreekanth.reddy@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      a5e99fda
    • Sreekanth Reddy's avatar
      scsi: mpt3sas: Get sas_device objects using device's rphy · 6df6be91
      Sreekanth Reddy authored
      In the following scsi_host_template and sas_function_template callback
      functions the driver does not have PhysicalPort number information to
      retrieve the sas_device object using SAS Address & PhysicalPort number. In
      these callback functions the device's rphy object is used to retrieve
      sas_device object for the device.
      
      .target_alloc,
      .get_enclosure_identifier
      .get_bay_identifier
      
      When a rphy (of type sas_rphy) object is allocated then its address is
      saved in corresponding sas_device object's rphy field. In
      __mpt3sas_get_sdev_by_rphy(), the driver loops over all the sas_device
      objects from sas_device_list list to retrieve the sas_device objects whose
      rphy matches the provided rphy.
      
      Link: https://lore.kernel.org/r/20201027130847.9962-8-sreekanth.reddy@broadcom.comSigned-off-by: default avatarSreekanth Reddy <sreekanth.reddy@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      6df6be91
    • Sreekanth Reddy's avatar
      scsi: mpt3sas: Rename transport_del_phy_from_an_existing_port() · c71ccf93
      Sreekanth Reddy authored
      Renamed _transport_add_phy_to_an_existing_port() to
      mpt3sas_transport_add_phy_to_an_existing_port() and
      _transport_del_phy_from_an_existing_port() to
      mpt3sas_transport_del_phy_from_an_existing_port() as the driver needs to
      call these functions from outside mpt3sas_transport.c file.
      
      Added extra function argument 'port' of type struct hba_port to above
      functions and check for portID before adding/removing the phy from the
      _sas_port object.  I.e. add/remove the phy from _sas_port object only if
      _sas_port's port object and phy's port object are the same.
      
      Link: https://lore.kernel.org/r/20201027130847.9962-7-sreekanth.reddy@broadcom.comSigned-off-by: default avatarSreekanth Reddy <sreekanth.reddy@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      c71ccf93
    • Sreekanth Reddy's avatar
      scsi: mpt3sas: Get device objects using sas_address & portID · 7d310f24
      Sreekanth Reddy authored
      Currently driver retrieves the sas_device/sas_expander objects from
      corresponding object's lists using just device's SAS Address.
      
      Make driver retrieve the objects from the corresponding objects list using
      device's SAS Address and PhysicalPort (or PortID) number. PhysicalPort
      number is the port number of the HBA through which this device is accessed.
      
      Link: https://lore.kernel.org/r/20201027130847.9962-6-sreekanth.reddy@broadcom.comSigned-off-by: default avatarSreekanth Reddy <sreekanth.reddy@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      7d310f24