2020-07-13 08:03:31

by Lee Jones

[permalink] [raw]
Subject: [PATCH v2 00/24] Set 3: Fix another set of SCSI related W=1 warnings

This set is part of a larger effort attempting to clean-up W=1
kernel builds, which are currently overwhelmingly riddled with
niggly little warnings.

Slowly working through the SCSI related ones. There are many.

This brings the total of W=1 SCSI wanings from 1690 in v5.8-rc1 to 1109.

Changelog:

v1 => v2
- Collected *-bys
- Removed inert function-calls when removing unused variables
- As suggested by James Bottomley

Lee Jones (24):
scsi: aacraid: aachba: Repair two kerneldoc headers
scsi: aacraid: commctrl: Fix a few kerneldoc issues
scsi: aacraid: dpcsup: Fix logical bug when !DBG
scsi: aacraid: dpcsup: Remove unused variable 'status'
scsi: aacraid: dpcsup: Demote partially documented function header
scsi: aic94xx: aic94xx_seq: Document 'lseq' and repair
asd_update_port_links() header
scsi: aacraid: commsup: Fix a bunch of function header issues
scsi: aic94xx: aic94xx_scb: Fix a couple of formatting and bitrot
issues
scsi: aacraid: rx: Fill in the very parameter descriptions for
rx_sync_cmd()
scsi: pm8001: pm8001_ctl: Provide descriptions for the many
undocumented 'attr's
scsi: ipr: Fix a mountain of kerneldoc misdemeanours
scsi: virtio_scsi: Demote seemingly unintentional kerneldoc header
scsi: ipr: Remove a bunch of set but checked variables
scsi: ipr: Fix struct packed-not-aligned issues
scsi: myrs: Demote obvious misuse of kerneldoc to standard comment
blocks
scsi: megaraid: Fix a whole bunch of function header formatting issues
scsi: be2iscsi: be_iscsi: Fix API/documentation slip
scsi: be2iscsi: be_main: Fix misdocumentation of 'pcontext'
scsi: be2iscsi: be_mgmt: Add missing function parameter description
scsi: lpfc: lpfc_nvme: Correct some pretty obvious misdocumentation
scsi: aic7xxx: aic79xx_osm: Remove unused variable 'ahd'
scsi: aic7xxx: aic79xx_osm: Remove unused variables 'wait' and
'paused'
scsi: aic7xxx: aic79xx_osm: Fix 'amount_xferred' set but not used
issue
scsi: aic7xxx: aic79xx_osm: Remove set but unused variabes
'saved_scsiid' and 'saved_modes'

drivers/scsi/aacraid/aachba.c | 5 +-
drivers/scsi/aacraid/commctrl.c | 14 +-
drivers/scsi/aacraid/commsup.c | 12 +-
drivers/scsi/aacraid/dpcsup.c | 15 +-
drivers/scsi/aacraid/rx.c | 12 +-
drivers/scsi/aic7xxx/aic79xx_osm.c | 14 +-
drivers/scsi/aic94xx/aic94xx_scb.c | 6 +-
drivers/scsi/aic94xx/aic94xx_seq.c | 6 +-
drivers/scsi/be2iscsi/be_iscsi.c | 11 +-
drivers/scsi/be2iscsi/be_main.c | 4 +-
drivers/scsi/be2iscsi/be_mgmt.c | 3 +-
drivers/scsi/ipr.c | 90 +++++++-----
drivers/scsi/ipr.h | 4 +-
drivers/scsi/lpfc/lpfc_nvme.c | 38 +++--
drivers/scsi/megaraid.c | 218 ++++++++++++++---------------
drivers/scsi/myrs.c | 34 ++---
drivers/scsi/pm8001/pm8001_ctl.c | 14 ++
drivers/scsi/virtio_scsi.c | 2 +-
18 files changed, 273 insertions(+), 229 deletions(-)

--
2.25.1


2020-07-13 08:03:44

by Lee Jones

[permalink] [raw]
Subject: [PATCH v2 24/24] scsi: aic7xxx: aic79xx_osm: Remove set but unused variabes 'saved_scsiid' and 'saved_modes'

Haven't been used since 2006.

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:2155:17: warning: variable ‘saved_modes’ set but not used [-Wunused-but-set-variable]
drivers/scsi/aic7xxx/aic79xx_osm.c:2148:9: warning: variable ‘saved_scsiid’ set but not used [-Wunused-but-set-variable]

Cc: Hannes Reinecke <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/scsi/aic7xxx/aic79xx_osm.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index 3782a20d58885..140c4e74ddd7e 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -2141,14 +2141,12 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd *cmd)
u_int saved_scbptr;
u_int active_scbptr;
u_int last_phase;
- u_int saved_scsiid;
u_int cdb_byte;
int retval;
int was_paused;
int paused;
int wait;
int disconnected;
- ahd_mode_state saved_modes;
unsigned long flags;

pending_scb = NULL;
@@ -2239,7 +2237,6 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd *cmd)
goto done;
}

- saved_modes = ahd_save_modes(ahd);
ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
last_phase = ahd_inb(ahd, LASTPHASE);
saved_scbptr = ahd_get_scbptr(ahd);
@@ -2257,7 +2254,6 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd *cmd)
* passed in command. That command is currently active on the
* bus or is in the disconnected state.
*/
- saved_scsiid = ahd_inb(ahd, SAVED_SCSIID);
if (last_phase != P_BUSFREE
&& SCB_GET_TAG(pending_scb) == active_scbptr) {

--
2.25.1

2020-07-13 08:04:00

by Lee Jones

[permalink] [raw]
Subject: [PATCH v2 12/24] scsi: virtio_scsi: Demote seemingly unintentional kerneldoc header

This is the only use of kerneldoc in the sourcefile and no
descriptions are provided.

Fixes the following W=1 kernel build warning(s):

drivers/scsi/virtio_scsi.c:109: warning: Function parameter or member 'vscsi' not described in 'virtscsi_complete_cmd'
drivers/scsi/virtio_scsi.c:109: warning: Function parameter or member 'buf' not described in 'virtscsi_complete_cmd'

Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: Stefan Hajnoczi <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
Acked-by: Paolo Bonzini <[email protected]>
---
drivers/scsi/virtio_scsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
index 0e0910c5b9424..56875467e4984 100644
--- a/drivers/scsi/virtio_scsi.c
+++ b/drivers/scsi/virtio_scsi.c
@@ -100,7 +100,7 @@ static void virtscsi_compute_resid(struct scsi_cmnd *sc, u32 resid)
scsi_set_resid(sc, resid);
}

-/**
+/*
* virtscsi_complete_cmd - finish a scsi_cmd and invoke scsi_done
*
* Called with vq_lock held.
--
2.25.1

2020-07-13 08:04:09

by Lee Jones

[permalink] [raw]
Subject: [PATCH v2 18/24] scsi: be2iscsi: be_main: Fix misdocumentation of 'pcontext'

Also demote unintentional kerneldoc header.

Fixes the following W=1 kernel build warning(s):

drivers/scsi/be2iscsi/be_main.c:986: warning: Function parameter or member 'pcontext' not described in 'alloc_wrb_handle'
drivers/scsi/be2iscsi/be_main.c:986: warning: Excess function parameter 'pwrb_context' description in 'alloc_wrb_handle'
drivers/scsi/be2iscsi/be_main.c:1409: warning: Function parameter or member 'beiscsi_conn' not described in 'beiscsi_complete_pdu'
drivers/scsi/be2iscsi/be_main.c:1409: warning: Function parameter or member 'phdr' not described in 'beiscsi_complete_pdu'
drivers/scsi/be2iscsi/be_main.c:1409: warning: Function parameter or member 'pdata' not described in 'beiscsi_complete_pdu'
drivers/scsi/be2iscsi/be_main.c:1409: warning: Function parameter or member 'dlen' not described in 'beiscsi_complete_pdu'

Cc: Subbu Seetharaman <[email protected]>
Cc: Ketan Mukadam <[email protected]>
Cc: Jitendra Bhivare <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
drivers/scsi/be2iscsi/be_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 9b81cfbbc5c53..8dc2e0824ad78 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -977,7 +977,7 @@ beiscsi_get_wrb_handle(struct hwi_wrb_context *pwrb_context,
* alloc_wrb_handle - To allocate a wrb handle
* @phba: The hba pointer
* @cid: The cid to use for allocation
- * @pwrb_context: ptr to ptr to wrb context
+ * @pcontext: ptr to ptr to wrb context
*
* This happens under session_lock until submission to chip
*/
@@ -1394,7 +1394,7 @@ static void hwi_complete_cmd(struct beiscsi_conn *beiscsi_conn,
spin_unlock_bh(&session->back_lock);
}

-/**
+/*
* ASYNC PDUs include
* a. Unsolicited NOP-In (target initiated NOP-In)
* b. ASYNC Messages
--
2.25.1

2020-07-13 08:04:15

by Lee Jones

[permalink] [raw]
Subject: [PATCH v2 05/24] scsi: aacraid: dpcsup: Demote partially documented function header

This should be populated by someone who knows the meaning of all the params.

Fixes the following W=1 kernel build warning(s):

drivers/scsi/aacraid/dpcsup.c:272: warning: Function parameter or member 'isAif' not described in 'aac_intr_normal'
drivers/scsi/aacraid/dpcsup.c:272: warning: Function parameter or member 'isFastResponse' not described in 'aac_intr_normal'
drivers/scsi/aacraid/dpcsup.c:272: warning: Function parameter or member 'aif_fib' not described in 'aac_intr_normal'

Cc: Adaptec OEM Raid Solutions <[email protected]>
Cc: "PMC-Sierra, Inc" <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/scsi/aacraid/dpcsup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/aacraid/dpcsup.c b/drivers/scsi/aacraid/dpcsup.c
index 749f8e740ece1..fbe334c59f376 100644
--- a/drivers/scsi/aacraid/dpcsup.c
+++ b/drivers/scsi/aacraid/dpcsup.c
@@ -258,7 +258,7 @@ static void aac_aif_callback(void *context, struct fib * fibptr)
}


-/**
+/*
* aac_intr_normal - Handle command replies
* @dev: Device
* @index: completion reference
--
2.25.1

2020-07-13 08:04:36

by Lee Jones

[permalink] [raw]
Subject: [PATCH v2 11/24] scsi: ipr: Fix a mountain of kerneldoc misdemeanours

Mainly misspellings and/or missing function parameter descriptions.

Fixes the following W=1 kernel build warning(s):

drivers/scsi/ipr.c:10100:15: warning: variable ‘int_reg’ set but not used [-Wunused-but-set-variable]
drivers/scsi/ipr.c:679: warning: Function parameter or member 'fast_done' not described in 'ipr_init_ipr_cmnd'
drivers/scsi/ipr.c:697: warning: Function parameter or member 'hrrq' not described in '__ipr_get_free_ipr_cmnd'
drivers/scsi/ipr.c:697: warning: Excess function parameter 'ioa_cfg' description in '__ipr_get_free_ipr_cmnd'
drivers/scsi/ipr.c:1297: warning: Function parameter or member 'buffer' not described in '__ipr_format_res_path'
drivers/scsi/ipr.c:1297: warning: Excess function parameter 'buf' description in '__ipr_format_res_path'
drivers/scsi/ipr.c:1321: warning: Function parameter or member 'buffer' not described in 'ipr_format_res_path'
drivers/scsi/ipr.c:1321: warning: Excess function parameter 'buf' description in 'ipr_format_res_path'
drivers/scsi/ipr.c:1400: warning: Excess function parameter 'cfgtew' description in 'ipr_clear_res_target'
drivers/scsi/ipr.c:2679: warning: Function parameter or member 't' not described in 'ipr_timeout'
drivers/scsi/ipr.c:2679: warning: Excess function parameter 'ipr_cmd' description in 'ipr_timeout'
drivers/scsi/ipr.c:2712: warning: Function parameter or member 't' not described in 'ipr_oper_timeout'
drivers/scsi/ipr.c:2712: warning: Excess function parameter 'ipr_cmd' description in 'ipr_oper_timeout'
drivers/scsi/ipr.c:3494: warning: Function parameter or member 'attr' not described in 'ipr_show_fw_version'
drivers/scsi/ipr.c:3528: warning: Function parameter or member 'attr' not described in 'ipr_show_log_level'
drivers/scsi/ipr.c:3551: warning: Function parameter or member 'attr' not described in 'ipr_store_log_level'
drivers/scsi/ipr.c:3551: warning: Function parameter or member 'count' not described in 'ipr_store_log_level'
drivers/scsi/ipr.c:3586: warning: Function parameter or member 'attr' not described in 'ipr_store_diagnostics'
drivers/scsi/ipr.c:3642: warning: Function parameter or member 'dev' not described in 'ipr_show_adapter_state'
drivers/scsi/ipr.c:3642: warning: Function parameter or member 'attr' not described in 'ipr_show_adapter_state'
drivers/scsi/ipr.c:3642: warning: Excess function parameter 'class_dev' description in 'ipr_show_adapter_state'
drivers/scsi/ipr.c:3671: warning: Function parameter or member 'attr' not described in 'ipr_store_adapter_state'
drivers/scsi/ipr.c:3722: warning: Function parameter or member 'attr' not described in 'ipr_store_reset_adapter'
drivers/scsi/ipr.c:3783: warning: Function parameter or member 'attr' not described in 'ipr_store_iopoll_weight'
drivers/scsi/ipr.c:3783: warning: Function parameter or member 'count' not described in 'ipr_store_iopoll_weight'
drivers/scsi/ipr.c:3883: warning: Function parameter or member 'sglist' not described in 'ipr_free_ucode_buffer'
drivers/scsi/ipr.c:3883: warning: Excess function parameter 'p_dnld' description in 'ipr_free_ucode_buffer'
drivers/scsi/ipr.c:4074: warning: Function parameter or member 'dev' not described in 'ipr_store_update_fw'
drivers/scsi/ipr.c:4074: warning: Function parameter or member 'attr' not described in 'ipr_store_update_fw'
drivers/scsi/ipr.c:4074: warning: Excess function parameter 'class_dev' description in 'ipr_store_update_fw'
drivers/scsi/ipr.c:4149: warning: Function parameter or member 'attr' not described in 'ipr_show_fw_type'
drivers/scsi/ipr.c:4489: warning: Excess function parameter 'reason' description in 'ipr_change_queue_depth'
drivers/scsi/ipr.c:4660: warning: Function parameter or member 'attr' not described in 'ipr_show_raw_mode'
drivers/scsi/ipr.c:4688: warning: Function parameter or member 'attr' not described in 'ipr_store_raw_mode'
drivers/scsi/ipr.c:4688: warning: Function parameter or member 'count' not described in 'ipr_store_raw_mode'
drivers/scsi/ipr.c:5069: warning: Function parameter or member 'ipr_cmd' not described in 'ipr_cmnd_is_free'
drivers/scsi/ipr.c:5108: warning: Function parameter or member 'ioa_cfg' not described in 'ipr_wait_for_ops'
drivers/scsi/ipr.c:5108: warning: Excess function parameter 'ipr_cmd' description in 'ipr_wait_for_ops'
drivers/scsi/ipr.c:5272: warning: Function parameter or member 'deadline' not described in 'ipr_sata_reset'
drivers/scsi/ipr.c:5453: warning: Function parameter or member 't' not described in 'ipr_abort_timeout'
drivers/scsi/ipr.c:5453: warning: Excess function parameter 'ipr_cmd' description in 'ipr_abort_timeout'
drivers/scsi/ipr.c:5578: warning: Function parameter or member 'shost' not described in 'ipr_scan_finished'
drivers/scsi/ipr.c:5578: warning: Function parameter or member 'elapsed_time' not described in 'ipr_scan_finished'
drivers/scsi/ipr.c:5578: warning: Excess function parameter 'scsi_cmd' description in 'ipr_scan_finished'
drivers/scsi/ipr.c:5704: warning: Function parameter or member 'number' not described in 'ipr_isr_eh'
drivers/scsi/ipr.c:6278: warning: Function parameter or member 'ipr_cmd' not described in 'ipr_gen_sense'
drivers/scsi/ipr.c:6278: warning: Excess function parameter 'ioasa' description in 'ipr_gen_sense'
drivers/scsi/ipr.c:6278: warning: Excess function parameter 'sense_buf' description in 'ipr_gen_sense'
drivers/scsi/ipr.c:6711: warning: Function parameter or member 'host' not described in 'ipr_ioa_info'
drivers/scsi/ipr.c:6711: warning: Excess function parameter 'scsi_host' description in 'ipr_ioa_info'
drivers/scsi/ipr.c:7606: warning: Function parameter or member 'res_handle' not described in 'ipr_build_mode_sense'
drivers/scsi/ipr.c:7606: warning: Excess function parameter 'res' description in 'ipr_build_mode_sense'
drivers/scsi/ipr.c:7947: warning: Function parameter or member 'ipr_cmd' not described in 'ipr_ioafp_set_caching_parameters'
drivers/scsi/ipr.c:7986: warning: Function parameter or member 'flags' not described in 'ipr_ioafp_inquiry'
drivers/scsi/ipr.c:7986: warning: Function parameter or member 'page' not described in 'ipr_ioafp_inquiry'
drivers/scsi/ipr.c:7986: warning: Function parameter or member 'dma_addr' not described in 'ipr_ioafp_inquiry'
drivers/scsi/ipr.c:7986: warning: Function parameter or member 'xfer_len' not described in 'ipr_ioafp_inquiry'
drivers/scsi/ipr.c:8280: warning: Function parameter or member 't' not described in 'ipr_reset_timer_done'
drivers/scsi/ipr.c:8280: warning: Excess function parameter 'ipr_cmd' description in 'ipr_reset_timer_done'
drivers/scsi/ipr.c:9486: warning: bad line:
drivers/scsi/ipr.c:9609: warning: Function parameter or member 'ioa_cfg' not described in 'ipr_free_all_resources'
drivers/scsi/ipr.c:9609: warning: Excess function parameter 'ipr_cmd' description in 'ipr_free_all_resources'
drivers/scsi/ipr.c:10071: warning: Function parameter or member 'irq' not described in 'ipr_test_intr'
drivers/scsi/ipr.c:10071: warning: Function parameter or member 'devp' not described in 'ipr_test_intr'
drivers/scsi/ipr.c:10071: warning: Excess function parameter 'pdev' description in 'ipr_test_intr'
drivers/scsi/ipr.c:10098: warning: Function parameter or member 'ioa_cfg' not described in 'ipr_test_msi'
drivers/scsi/ipr.c:10538: warning: Function parameter or member 'pdev' not described in 'ipr_probe'
drivers/scsi/ipr.c:10538: warning: Function parameter or member 'dev_id' not described in 'ipr_probe'
drivers/scsi/ipr.c:10794: warning: Function parameter or member 'ipr_cmd' not described in 'ipr_halt_done'
drivers/scsi/ipr.c:10805: warning: Function parameter or member 'nb' not described in 'ipr_halt'
drivers/scsi/ipr.c:10805: warning: Function parameter or member 'event' not described in 'ipr_halt'
drivers/scsi/ipr.c:10805: warning: Function parameter or member 'buf' not described in 'ipr_halt'

Cc: Brian King <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
---
drivers/scsi/ipr.c | 73 ++++++++++++++++++++++++++++++++--------------
1 file changed, 51 insertions(+), 22 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 7d86f4ca266c8..f85020904099e 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -670,6 +670,7 @@ static void ipr_reinit_ipr_cmnd(struct ipr_cmnd *ipr_cmd)
/**
* ipr_init_ipr_cmnd - Initialize an IPR Cmnd block
* @ipr_cmd: ipr command struct
+ * @fast_done: fast done function call-back
*
* Return value:
* none
@@ -687,7 +688,7 @@ static void ipr_init_ipr_cmnd(struct ipr_cmnd *ipr_cmd,

/**
* __ipr_get_free_ipr_cmnd - Get a free IPR Cmnd block
- * @ioa_cfg: ioa config struct
+ * @hrrq: hrr queue
*
* Return value:
* pointer to ipr command struct
@@ -1287,7 +1288,7 @@ static int ipr_is_same_device(struct ipr_resource_entry *res,
/**
* __ipr_format_res_path - Format the resource path for printing.
* @res_path: resource path
- * @buf: buffer
+ * @buffer: buffer
* @len: length of buffer provided
*
* Return value:
@@ -1310,7 +1311,7 @@ static char *__ipr_format_res_path(u8 *res_path, char *buffer, int len)
* ipr_format_res_path - Format the resource path for printing.
* @ioa_cfg: ioa config struct
* @res_path: resource path
- * @buf: buffer
+ * @buffer: buffer
* @len: length of buffer provided
*
* Return value:
@@ -1391,7 +1392,6 @@ static void ipr_update_res_entry(struct ipr_resource_entry *res,
* ipr_clear_res_target - Clear the bit in the bit map representing the target
* for the resource.
* @res: resource entry struct
- * @cfgtew: config table entry wrapper struct
*
* Return value:
* none
@@ -2667,7 +2667,7 @@ static void ipr_process_error(struct ipr_cmnd *ipr_cmd)

/**
* ipr_timeout - An internally generated op has timed out.
- * @ipr_cmd: ipr command struct
+ * @t: Timer context used to fetch ipr command struct
*
* This function blocks host requests and initiates an
* adapter reset.
@@ -2700,7 +2700,7 @@ static void ipr_timeout(struct timer_list *t)

/**
* ipr_oper_timeout - Adapter timed out transitioning to operational
- * @ipr_cmd: ipr command struct
+ * @t: Timer context used to fetch ipr command struct
*
* This function blocks host requests and initiates an
* adapter reset.
@@ -3484,6 +3484,7 @@ static struct bin_attribute ipr_trace_attr = {
/**
* ipr_show_fw_version - Show the firmware version
* @dev: class device struct
+ * @attr: device attribute (unused)
* @buf: buffer
*
* Return value:
@@ -3518,6 +3519,7 @@ static struct device_attribute ipr_fw_version_attr = {
/**
* ipr_show_log_level - Show the adapter's error logging level
* @dev: class device struct
+ * @attr: device attribute (unused)
* @buf: buffer
*
* Return value:
@@ -3540,7 +3542,9 @@ static ssize_t ipr_show_log_level(struct device *dev,
/**
* ipr_store_log_level - Change the adapter's error logging level
* @dev: class device struct
+ * @attr: device attribute (unused)
* @buf: buffer
+ * @count: buffer size
*
* Return value:
* number of bytes printed to buffer
@@ -3571,6 +3575,7 @@ static struct device_attribute ipr_log_level_attr = {
/**
* ipr_store_diagnostics - IOA Diagnostics interface
* @dev: device struct
+ * @attr: device attribute (unused)
* @buf: buffer
* @count: buffer size
*
@@ -3631,7 +3636,8 @@ static struct device_attribute ipr_diagnostics_attr = {

/**
* ipr_show_adapter_state - Show the adapter's state
- * @class_dev: device struct
+ * @dev: device struct
+ * @attr: device attribute (unused)
* @buf: buffer
*
* Return value:
@@ -3657,6 +3663,7 @@ static ssize_t ipr_show_adapter_state(struct device *dev,
/**
* ipr_store_adapter_state - Change adapter state
* @dev: device struct
+ * @attr: device attribute (unused)
* @buf: buffer
* @count: buffer size
*
@@ -3708,6 +3715,7 @@ static struct device_attribute ipr_ioa_state_attr = {
/**
* ipr_store_reset_adapter - Reset the adapter
* @dev: device struct
+ * @attr: device attribute (unused)
* @buf: buffer
* @count: buffer size
*
@@ -3749,6 +3757,7 @@ static int ipr_iopoll(struct irq_poll *iop, int budget);
/**
* ipr_show_iopoll_weight - Show ipr polling mode
* @dev: class device struct
+ * @attr: device attribute (unused)
* @buf: buffer
*
* Return value:
@@ -3772,7 +3781,9 @@ static ssize_t ipr_show_iopoll_weight(struct device *dev,
/**
* ipr_store_iopoll_weight - Change the adapter's polling mode
* @dev: class device struct
+ * @attr: device attribute (unused)
* @buf: buffer
+ * @count: buffer size
*
* Return value:
* number of bytes printed to buffer
@@ -3871,7 +3882,7 @@ static struct ipr_sglist *ipr_alloc_ucode_buffer(int buf_len)

/**
* ipr_free_ucode_buffer - Frees a microcode download buffer
- * @p_dnld: scatter/gather list pointer
+ * @sglist: scatter/gather list pointer
*
* Free a DMA'able ucode download buffer previously allocated with
* ipr_alloc_ucode_buffer
@@ -4059,7 +4070,8 @@ static int ipr_update_ioa_ucode(struct ipr_ioa_cfg *ioa_cfg,

/**
* ipr_store_update_fw - Update the firmware on the adapter
- * @class_dev: device struct
+ * @dev: device struct
+ * @attr: device attribute (unused)
* @buf: buffer
* @count: buffer size
*
@@ -4139,6 +4151,7 @@ static struct device_attribute ipr_update_fw_attr = {
/**
* ipr_show_fw_type - Show the adapter's firmware type.
* @dev: class device struct
+ * @attr: device attribute (unused)
* @buf: buffer
*
* Return value:
@@ -4480,7 +4493,6 @@ static int ipr_free_dump(struct ipr_ioa_cfg *ioa_cfg) { return 0; };
* ipr_change_queue_depth - Change the device's queue depth
* @sdev: scsi device struct
* @qdepth: depth to set
- * @reason: calling context
*
* Return value:
* actual depth set
@@ -4650,6 +4662,7 @@ static struct device_attribute ipr_resource_type_attr = {
/**
* ipr_show_raw_mode - Show the adapter's raw mode
* @dev: class device struct
+ * @attr: device attribute (unused)
* @buf: buffer
*
* Return value:
@@ -4677,7 +4690,9 @@ static ssize_t ipr_show_raw_mode(struct device *dev,
/**
* ipr_store_raw_mode - Change the adapter's raw mode
* @dev: class device struct
+ * @attr: device attribute (unused)
* @buf: buffer
+ * @count: buffer size
*
* Return value:
* number of bytes printed to buffer
@@ -5060,7 +5075,7 @@ static int ipr_match_lun(struct ipr_cmnd *ipr_cmd, void *device)

/**
* ipr_cmnd_is_free - Check if a command is free or not
- * @ipr_cmd ipr command struct
+ * @ipr_cmd: ipr command struct
*
* Returns:
* true / false
@@ -5096,7 +5111,7 @@ static int ipr_match_res(struct ipr_cmnd *ipr_cmd, void *resource)

/**
* ipr_wait_for_ops - Wait for matching commands to complete
- * @ipr_cmd: ipr command struct
+ * @ioa_cfg: ioa config struct
* @device: device to match (sdev)
* @match: match function to use
*
@@ -5261,6 +5276,7 @@ static int ipr_device_reset(struct ipr_ioa_cfg *ioa_cfg,
* ipr_sata_reset - Reset the SATA port
* @link: SATA link to reset
* @classes: class of the attached device
+ * @deadline: unused
*
* This function issues a SATA phy reset to the affected ATA link.
*
@@ -5440,7 +5456,7 @@ static void ipr_bus_reset_done(struct ipr_cmnd *ipr_cmd)

/**
* ipr_abort_timeout - An abort task has timed out
- * @ipr_cmd: ipr command struct
+ * @t: Timer context used to fetch ipr command struct
*
* This function handles when an abort task times out. If this
* happens we issue a bus reset since we have resources tied
@@ -5569,7 +5585,8 @@ static int ipr_cancel_op(struct scsi_cmnd *scsi_cmd)

/**
* ipr_eh_abort - Abort a single op
- * @scsi_cmd: scsi command struct
+ * @shost: scsi host struct
+ * @elapsed_time: elapsed time
*
* Return value:
* 0 if scan in progress / 1 if scan is complete
@@ -5696,6 +5713,7 @@ static irqreturn_t ipr_handle_other_interrupt(struct ipr_ioa_cfg *ioa_cfg,
* ipr_isr_eh - Interrupt service routine error handler
* @ioa_cfg: ioa config struct
* @msg: message to log
+ * @number: various meanings depending on the caller/message
*
* Return value:
* none
@@ -6268,8 +6286,7 @@ static void ipr_dump_ioasa(struct ipr_ioa_cfg *ioa_cfg,

/**
* ipr_gen_sense - Generate SCSI sense data from an IOASA
- * @ioasa: IOASA
- * @sense_buf: sense data buffer
+ * @ipr_cmd: ipr command struct
*
* Return value:
* none
@@ -6702,7 +6719,7 @@ static int ipr_ioctl(struct scsi_device *sdev, unsigned int cmd,

/**
* ipr_info - Get information about the card/driver
- * @scsi_host: scsi host struct
+ * @host: scsi host struct
*
* Return value:
* pointer to buffer with description string
@@ -7592,7 +7609,7 @@ static int ipr_ioafp_mode_select_page28(struct ipr_cmnd *ipr_cmd)
/**
* ipr_build_mode_sense - Builds a mode sense command
* @ipr_cmd: ipr command struct
- * @res: resource entry struct
+ * @res_handle: resource entry struct
* @parm: Byte 2 of mode sense command
* @dma_addr: DMA address of mode sense buffer
* @xfer_len: Size of DMA buffer
@@ -7939,6 +7956,7 @@ static void ipr_build_ioa_service_action(struct ipr_cmnd *ipr_cmd,
/**
* ipr_ioafp_set_caching_parameters - Issue Set Cache parameters service
* action
+ * @ipr_cmd: ipr command struct
*
* Return value:
* none
@@ -7975,6 +7993,10 @@ static int ipr_ioafp_set_caching_parameters(struct ipr_cmnd *ipr_cmd)
/**
* ipr_ioafp_inquiry - Send an Inquiry to the adapter.
* @ipr_cmd: ipr command struct
+ * @flags: flags to send
+ * @page: page to inquire
+ * @dma_addr: DMA address
+ * @xfer_len: transfer data length
*
* This utility function sends an inquiry to the adapter.
*
@@ -8265,7 +8287,7 @@ static int ipr_ioafp_identify_hrrq(struct ipr_cmnd *ipr_cmd)

/**
* ipr_reset_timer_done - Adapter reset timer function
- * @ipr_cmd: ipr command struct
+ * @t: Timer context used to fetch ipr command struct
*
* Description: This function is used in adapter reset processing
* for timing events. If the reset_cmd pointer in the IOA
@@ -9483,7 +9505,6 @@ static pci_ers_result_t ipr_pci_error_detected(struct pci_dev *pdev,
* Description: This is the second phase of adapter initialization
* This function takes care of initilizing the adapter to the point
* where it can accept new commands.
-
* Return value:
* 0 on success / -EIO on failure
**/
@@ -9597,7 +9618,7 @@ static void ipr_free_irqs(struct ipr_ioa_cfg *ioa_cfg)

/**
* ipr_free_all_resources - Free all allocated resources for an adapter.
- * @ipr_cmd: ipr command struct
+ * @ioa_cfg: ioa config struct
*
* This function frees all allocated resources for the
* specified adapter.
@@ -10059,7 +10080,8 @@ static int ipr_request_other_msi_irqs(struct ipr_ioa_cfg *ioa_cfg,

/**
* ipr_test_intr - Handle the interrupt generated in ipr_test_msi().
- * @pdev: PCI device struct
+ * @devp: PCI device struct
+ * @irq: IRQ number
*
* Description: Simply set the msi_received flag to 1 indicating that
* Message Signaled Interrupts are supported.
@@ -10085,6 +10107,7 @@ static irqreturn_t ipr_test_intr(int irq, void *devp)

/**
* ipr_test_msi - Test for Message Signaled Interrupt (MSI) support.
+ * @ioa_cfg: ioa config struct
* @pdev: PCI device struct
*
* Description: This routine sets up and initiates a test interrupt to determine
@@ -10530,6 +10553,8 @@ static void ipr_remove(struct pci_dev *pdev)

/**
* ipr_probe - Adapter hot plug add entry point
+ * @pdev: pci device struct
+ * @dev_id: pci device ID
*
* Return value:
* 0 on success / non-zero on failure
@@ -10786,6 +10811,7 @@ static struct pci_driver ipr_driver = {

/**
* ipr_halt_done - Shutdown prepare completion
+ * @ipr_cmd: ipr command struct
*
* Return value:
* none
@@ -10797,6 +10823,9 @@ static void ipr_halt_done(struct ipr_cmnd *ipr_cmd)

/**
* ipr_halt - Issue shutdown prepare to all adapters
+ * @nb: Notifier block
+ * @event: Notifier event
+ * @buf: Notifier data (unused)
*
* Return value:
* NOTIFY_OK on success / NOTIFY_DONE on failure
--
2.25.1

2020-07-13 11:24:00

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: [PATCH v2 12/24] scsi: virtio_scsi: Demote seemingly unintentional kerneldoc header

On Mon, Jul 13, 2020 at 08:59:49AM +0100, Lee Jones wrote:
> This is the only use of kerneldoc in the sourcefile and no
> descriptions are provided.
>
> Fixes the following W=1 kernel build warning(s):
>
> drivers/scsi/virtio_scsi.c:109: warning: Function parameter or member 'vscsi' not described in 'virtscsi_complete_cmd'
> drivers/scsi/virtio_scsi.c:109: warning: Function parameter or member 'buf' not described in 'virtscsi_complete_cmd'
>
> Cc: "Michael S. Tsirkin" <[email protected]>
> Cc: Jason Wang <[email protected]>
> Cc: Stefan Hajnoczi <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>
> Acked-by: Paolo Bonzini <[email protected]>

Acked-by: Michael S. Tsirkin <[email protected]>

Pls merge with the rest of the patches (which tree is this for?)

> ---
> drivers/scsi/virtio_scsi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
> index 0e0910c5b9424..56875467e4984 100644
> --- a/drivers/scsi/virtio_scsi.c
> +++ b/drivers/scsi/virtio_scsi.c
> @@ -100,7 +100,7 @@ static void virtscsi_compute_resid(struct scsi_cmnd *sc, u32 resid)
> scsi_set_resid(sc, resid);
> }
>
> -/**
> +/*
> * virtscsi_complete_cmd - finish a scsi_cmd and invoke scsi_done
> *
> * Called with vq_lock held.
> --
> 2.25.1

2020-07-13 11:57:22

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 12/24] scsi: virtio_scsi: Demote seemingly unintentional kerneldoc header

On Mon, 13 Jul 2020, Michael S. Tsirkin wrote:

> On Mon, Jul 13, 2020 at 08:59:49AM +0100, Lee Jones wrote:
> > This is the only use of kerneldoc in the sourcefile and no
> > descriptions are provided.
> >
> > Fixes the following W=1 kernel build warning(s):
> >
> > drivers/scsi/virtio_scsi.c:109: warning: Function parameter or member 'vscsi' not described in 'virtscsi_complete_cmd'
> > drivers/scsi/virtio_scsi.c:109: warning: Function parameter or member 'buf' not described in 'virtscsi_complete_cmd'
> >
> > Cc: "Michael S. Tsirkin" <[email protected]>
> > Cc: Jason Wang <[email protected]>
> > Cc: Stefan Hajnoczi <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Lee Jones <[email protected]>
> > Acked-by: Paolo Bonzini <[email protected]>
>
> Acked-by: Michael S. Tsirkin <[email protected]>

Thank you Michael.

> Pls merge with the rest of the patches (which tree is this for?)

My assumption is that Martin will take all of these (and the other
sets) via the SCSI repo.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2020-07-14 07:47:03

by Hannes Reinecke

[permalink] [raw]
Subject: Re: [PATCH v2 24/24] scsi: aic7xxx: aic79xx_osm: Remove set but unused variabes 'saved_scsiid' and 'saved_modes'

On 7/13/20 10:00 AM, Lee Jones wrote:
> Haven't been used since 2006.
>
> 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:2155:17: warning: variable ‘saved_modes’ set but not used [-Wunused-but-set-variable]
> drivers/scsi/aic7xxx/aic79xx_osm.c:2148:9: warning: variable ‘saved_scsiid’ set but not used [-Wunused-but-set-variable]
>
> Cc: Hannes Reinecke <[email protected]>
> Signed-off-by: Lee Jones <[email protected]>
> ---
> drivers/scsi/aic7xxx/aic79xx_osm.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
> index 3782a20d58885..140c4e74ddd7e 100644
> --- a/drivers/scsi/aic7xxx/aic79xx_osm.c
> +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
> @@ -2141,14 +2141,12 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd *cmd)
> u_int saved_scbptr;
> u_int active_scbptr;
> u_int last_phase;
> - u_int saved_scsiid;
> u_int cdb_byte;
> int retval;
> int was_paused;
> int paused;
> int wait;
> int disconnected;
> - ahd_mode_state saved_modes;
> unsigned long flags;
>
> pending_scb = NULL;
> @@ -2239,7 +2237,6 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd *cmd)
> goto done;
> }
>
> - saved_modes = ahd_save_modes(ahd);
> ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
> last_phase = ahd_inb(ahd, LASTPHASE);
> saved_scbptr = ahd_get_scbptr(ahd);
> @@ -2257,7 +2254,6 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd *cmd)
> * passed in command. That command is currently active on the
> * bus or is in the disconnected state.
> */
> - saved_scsiid = ahd_inb(ahd, SAVED_SCSIID);
> if (last_phase != P_BUSFREE
> && SCB_GET_TAG(pending_scb) == active_scbptr) {
>
>
Reviewed-by: Hannes Reinecke <[email protected]>

Cheers,

Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
[email protected] +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), GF: Felix Imendörffer

2020-07-14 15:44:58

by James Bottomley

[permalink] [raw]
Subject: Re: [PATCH v2 24/24] scsi: aic7xxx: aic79xx_osm: Remove set but unused variabes 'saved_scsiid' and 'saved_modes'

On Tue, 2020-07-14 at 09:46 +0200, Hannes Reinecke wrote:
> On 7/13/20 10:00 AM, Lee Jones wrote:
> > Haven't been used since 2006.
> >
> > 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:2155:17: warning: variable
> > ‘saved_modes’ set but not used [-Wunused-but-set-variable]
> > drivers/scsi/aic7xxx/aic79xx_osm.c:2148:9: warning: variable
> > ‘saved_scsiid’ set but not used [-Wunused-but-set-variable]
> >
> > Cc: Hannes Reinecke <[email protected]>
> > Signed-off-by: Lee Jones <[email protected]>
> > ---
> > drivers/scsi/aic7xxx/aic79xx_osm.c | 4 ----
> > 1 file changed, 4 deletions(-)
> >
> > diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c
> > b/drivers/scsi/aic7xxx/aic79xx_osm.c
> > index 3782a20d58885..140c4e74ddd7e 100644
> > --- a/drivers/scsi/aic7xxx/aic79xx_osm.c
> > +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
> > @@ -2141,14 +2141,12 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd
> > *cmd)
> > u_int saved_scbptr;
> > u_int active_scbptr;
> > u_int last_phase;
> > - u_int saved_scsiid;
> > u_int cdb_byte;
> > int retval;
> > int was_paused;
> > int paused;
> > int wait;
> > int disconnected;
> > - ahd_mode_state saved_modes;
> > unsigned long flags;
> >
> > pending_scb = NULL;
> > @@ -2239,7 +2237,6 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd
> > *cmd)
> > goto done;
> > }
> >
> > - saved_modes = ahd_save_modes(ahd);
> > ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
> > last_phase = ahd_inb(ahd, LASTPHASE);
> > saved_scbptr = ahd_get_scbptr(ahd);
> > @@ -2257,7 +2254,6 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd
> > *cmd)
> > * passed in command. That command is currently active on
> > the
> > * bus or is in the disconnected state.
> > */
> > - saved_scsiid = ahd_inb(ahd, SAVED_SCSIID);
> > if (last_phase != P_BUSFREE
> > && SCB_GET_TAG(pending_scb) == active_scbptr) {
> >
> >
>
> Reviewed-by: Hannes Reinecke <[email protected]>

Hey, you don't get to do that ... I asked you to figure out why we're
missing an ahd_restore_modes(). Removing the ahd_save_modes() is
cosmetic: it gets rid of a warning but doesn't fix the problem. I'd
rather keep the warning until the problem is fixed and the problem is
we need a mode save/restore around the ahd_set_modes() which is only
partially implemented in this function.

James

2020-07-14 21:43:03

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 24/24] scsi: aic7xxx: aic79xx_osm: Remove set but unused variabes 'saved_scsiid' and 'saved_modes'

On Tue, 14 Jul 2020, James Bottomley wrote:

> On Tue, 2020-07-14 at 09:46 +0200, Hannes Reinecke wrote:
> > On 7/13/20 10:00 AM, Lee Jones wrote:
> > > Haven't been used since 2006.
> > >
> > > 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:2155:17: warning: variable
> > > ‘saved_modes’ set but not used [-Wunused-but-set-variable]
> > > drivers/scsi/aic7xxx/aic79xx_osm.c:2148:9: warning: variable
> > > ‘saved_scsiid’ set but not used [-Wunused-but-set-variable]
> > >
> > > Cc: Hannes Reinecke <[email protected]>
> > > Signed-off-by: Lee Jones <[email protected]>
> > > ---
> > > drivers/scsi/aic7xxx/aic79xx_osm.c | 4 ----
> > > 1 file changed, 4 deletions(-)
> > >
> > > diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c
> > > b/drivers/scsi/aic7xxx/aic79xx_osm.c
> > > index 3782a20d58885..140c4e74ddd7e 100644
> > > --- a/drivers/scsi/aic7xxx/aic79xx_osm.c
> > > +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
> > > @@ -2141,14 +2141,12 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd
> > > *cmd)
> > > u_int saved_scbptr;
> > > u_int active_scbptr;
> > > u_int last_phase;
> > > - u_int saved_scsiid;
> > > u_int cdb_byte;
> > > int retval;
> > > int was_paused;
> > > int paused;
> > > int wait;
> > > int disconnected;
> > > - ahd_mode_state saved_modes;
> > > unsigned long flags;
> > >
> > > pending_scb = NULL;
> > > @@ -2239,7 +2237,6 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd
> > > *cmd)
> > > goto done;
> > > }
> > >
> > > - saved_modes = ahd_save_modes(ahd);
> > > ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
> > > last_phase = ahd_inb(ahd, LASTPHASE);
> > > saved_scbptr = ahd_get_scbptr(ahd);
> > > @@ -2257,7 +2254,6 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd
> > > *cmd)
> > > * passed in command. That command is currently active on
> > > the
> > > * bus or is in the disconnected state.
> > > */
> > > - saved_scsiid = ahd_inb(ahd, SAVED_SCSIID);
> > > if (last_phase != P_BUSFREE
> > > && SCB_GET_TAG(pending_scb) == active_scbptr) {
> > >
> > >
> >
> > Reviewed-by: Hannes Reinecke <[email protected]>
>
> Hey, you don't get to do that ... I asked you to figure out why we're
> missing an ahd_restore_modes(). Removing the ahd_save_modes() is
> cosmetic: it gets rid of a warning but doesn't fix the problem. I'd
> rather keep the warning until the problem is fixed and the problem is
> we need a mode save/restore around the ahd_set_modes() which is only
> partially implemented in this function.

I had a look. Traced it back to the dawn of time (time == Git), then
delved even further back by downloading and trawling through ~10-15
tarballs. It looks as though drivers/scsi/aic7xxx/aic79xx_osm.c was
upstreamed in v2.5.60, nearly 20 years ago. 'saved_modes' has been
unused since at least then. If no one has complained in 2 decades,
I'd say it probably isn't an issue worth perusing.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2020-07-14 23:12:02

by James Bottomley

[permalink] [raw]
Subject: Re: [PATCH v2 24/24] scsi: aic7xxx: aic79xx_osm: Remove set but unused variabes 'saved_scsiid' and 'saved_modes'

On Tue, 2020-07-14 at 22:39 +0100, Lee Jones wrote:
> On Tue, 14 Jul 2020, James Bottomley wrote:
>
> > On Tue, 2020-07-14 at 09:46 +0200, Hannes Reinecke wrote:
> > > On 7/13/20 10:00 AM, Lee Jones wrote:
> > > > Haven't been used since 2006.
> > > >
> > > > 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:2155:17: warning: variable
> > > > ‘saved_modes’ set but not used [-Wunused-but-set-variable]
> > > > drivers/scsi/aic7xxx/aic79xx_osm.c:2148:9: warning: variable
> > > > ‘saved_scsiid’ set but not used [-Wunused-but-set-variable]
> > > >
> > > > Cc: Hannes Reinecke <[email protected]>
> > > > Signed-off-by: Lee Jones <[email protected]>
> > > > ---
> > > > drivers/scsi/aic7xxx/aic79xx_osm.c | 4 ----
> > > > 1 file changed, 4 deletions(-)
> > > >
> > > > diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c
> > > > b/drivers/scsi/aic7xxx/aic79xx_osm.c
> > > > index 3782a20d58885..140c4e74ddd7e 100644
> > > > --- a/drivers/scsi/aic7xxx/aic79xx_osm.c
> > > > +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
> > > > @@ -2141,14 +2141,12 @@ ahd_linux_queue_abort_cmd(struct
> > > > scsi_cmnd
> > > > *cmd)
> > > > u_int saved_scbptr;
> > > > u_int active_scbptr;
> > > > u_int last_phase;
> > > > - u_int saved_scsiid;
> > > > u_int cdb_byte;
> > > > int retval;
> > > > int was_paused;
> > > > int paused;
> > > > int wait;
> > > > int disconnected;
> > > > - ahd_mode_state saved_modes;
> > > > unsigned long flags;
> > > >
> > > > pending_scb = NULL;
> > > > @@ -2239,7 +2237,6 @@ ahd_linux_queue_abort_cmd(struct
> > > > scsi_cmnd
> > > > *cmd)
> > > > goto done;
> > > > }
> > > >
> > > > - saved_modes = ahd_save_modes(ahd);
> > > > ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
> > > > last_phase = ahd_inb(ahd, LASTPHASE);
> > > > saved_scbptr = ahd_get_scbptr(ahd);
> > > > @@ -2257,7 +2254,6 @@ ahd_linux_queue_abort_cmd(struct
> > > > scsi_cmnd
> > > > *cmd)
> > > > * passed in command. That command is currently
> > > > active on
> > > > the
> > > > * bus or is in the disconnected state.
> > > > */
> > > > - saved_scsiid = ahd_inb(ahd, SAVED_SCSIID);
> > > > if (last_phase != P_BUSFREE
> > > > && SCB_GET_TAG(pending_scb) == active_scbptr) {
> > > >
> > > >
> > >
> > > Reviewed-by: Hannes Reinecke <[email protected]>
> >
> > Hey, you don't get to do that ... I asked you to figure out why
> > we're missing an ahd_restore_modes(). Removing the
> > ahd_save_modes() is cosmetic: it gets rid of a warning but doesn't
> > fix the problem. I'd rather keep the warning until the problem is
> > fixed and the problem is we need a mode save/restore around the
> > ahd_set_modes() which is only partially implemented in this
> > function.
>
> I had a look. Traced it back to the dawn of time (time == Git), then
> delved even further back by downloading and trawling through ~10-15
> tarballs. It looks as though drivers/scsi/aic7xxx/aic79xx_osm.c was
> upstreamed in v2.5.60, nearly 20 years ago. 'saved_modes' has been
> unused since at least then. If no one has complained in 2 decades,
> I'd say it probably isn't an issue worth perusing.

Well, we have what looks like a fix now. The reason it matters is that
if the bus is not in AHD_MODE_SCSI when the routine is called, it ends
up being in a wrong state when the routine exits, so you abort one
command and screw up another. Ultimately I bet escalation to bus reset
fixes it, so everything appears to work, but it might have worked a lot
better if the original mode were restored.

This is error handling code, so most installations run just fine
without ever invoking it.

James

2020-07-15 06:24:16

by Hannes Reinecke

[permalink] [raw]
Subject: Re: [PATCH v2 24/24] scsi: aic7xxx: aic79xx_osm: Remove set but unused variabes 'saved_scsiid' and 'saved_modes'

On 7/14/20 11:39 PM, Lee Jones wrote:
> On Tue, 14 Jul 2020, James Bottomley wrote:
>
>> On Tue, 2020-07-14 at 09:46 +0200, Hannes Reinecke wrote:
>>> On 7/13/20 10:00 AM, Lee Jones wrote:
>>>> Haven't been used since 2006.
>>>>
>>>> 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:2155:17: warning: variable
>>>> ‘saved_modes’ set but not used [-Wunused-but-set-variable]
>>>> drivers/scsi/aic7xxx/aic79xx_osm.c:2148:9: warning: variable
>>>> ‘saved_scsiid’ set but not used [-Wunused-but-set-variable]
>>>>
>>>> Cc: Hannes Reinecke <[email protected]>
>>>> Signed-off-by: Lee Jones <[email protected]>
>>>> ---
>>>> drivers/scsi/aic7xxx/aic79xx_osm.c | 4 ----
>>>> 1 file changed, 4 deletions(-)
>>>>
>>>> diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c
>>>> b/drivers/scsi/aic7xxx/aic79xx_osm.c
>>>> index 3782a20d58885..140c4e74ddd7e 100644
>>>> --- a/drivers/scsi/aic7xxx/aic79xx_osm.c
>>>> +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
>>>> @@ -2141,14 +2141,12 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd
>>>> *cmd)
>>>> u_int saved_scbptr;
>>>> u_int active_scbptr;
>>>> u_int last_phase;
>>>> - u_int saved_scsiid;
>>>> u_int cdb_byte;
>>>> int retval;
>>>> int was_paused;
>>>> int paused;
>>>> int wait;
>>>> int disconnected;
>>>> - ahd_mode_state saved_modes;
>>>> unsigned long flags;
>>>>
>>>> pending_scb = NULL;
>>>> @@ -2239,7 +2237,6 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd
>>>> *cmd)
>>>> goto done;
>>>> }
>>>>
>>>> - saved_modes = ahd_save_modes(ahd);
>>>> ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
>>>> last_phase = ahd_inb(ahd, LASTPHASE);
>>>> saved_scbptr = ahd_get_scbptr(ahd);
>>>> @@ -2257,7 +2254,6 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd
>>>> *cmd)
>>>> * passed in command. That command is currently active on
>>>> the
>>>> * bus or is in the disconnected state.
>>>> */
>>>> - saved_scsiid = ahd_inb(ahd, SAVED_SCSIID);
>>>> if (last_phase != P_BUSFREE
>>>> && SCB_GET_TAG(pending_scb) == active_scbptr) {
>>>>
>>>>
>>>
>>> Reviewed-by: Hannes Reinecke <[email protected]>
>>
>> Hey, you don't get to do that ... I asked you to figure out why we're
>> missing an ahd_restore_modes(). Removing the ahd_save_modes() is
>> cosmetic: it gets rid of a warning but doesn't fix the problem. I'd
>> rather keep the warning until the problem is fixed and the problem is
>> we need a mode save/restore around the ahd_set_modes() which is only
>> partially implemented in this function.
>
> I had a look. Traced it back to the dawn of time (time == Git), then
> delved even further back by downloading and trawling through ~10-15
> tarballs. It looks as though drivers/scsi/aic7xxx/aic79xx_osm.c was
> upstreamed in v2.5.60, nearly 20 years ago. 'saved_modes' has been
> unused since at least then. If no one has complained in 2 decades,
> I'd say it probably isn't an issue worth perusing.
>
That's not really the point; this function is the first stage of error
recovery. And the only real way of exercising this is to inject a
command timeout, which is nearly impossible without dedicated hardware.
So this function will have a very limited exposure, but nevertheless a
quite crucial function.
Hence I'm not quite agree with your reasoning, and rather would have it
fixed.
But as we're having an alternative fix now, it might be best if you
could drop it from your patchset and we'll fix it separately.

Cheers,

Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
[email protected] +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer

2020-07-15 06:34:15

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 24/24] scsi: aic7xxx: aic79xx_osm: Remove set but unused variabes 'saved_scsiid' and 'saved_modes'

On Tue, 14 Jul 2020, James Bottomley wrote:

> On Tue, 2020-07-14 at 22:39 +0100, Lee Jones wrote:
> > On Tue, 14 Jul 2020, James Bottomley wrote:
> >
> > > On Tue, 2020-07-14 at 09:46 +0200, Hannes Reinecke wrote:
> > > > On 7/13/20 10:00 AM, Lee Jones wrote:
> > > > > Haven't been used since 2006.
> > > > >
> > > > > 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:2155:17: warning: variable
> > > > > ‘saved_modes’ set but not used [-Wunused-but-set-variable]
> > > > > drivers/scsi/aic7xxx/aic79xx_osm.c:2148:9: warning: variable
> > > > > ‘saved_scsiid’ set but not used [-Wunused-but-set-variable]
> > > > >
> > > > > Cc: Hannes Reinecke <[email protected]>
> > > > > Signed-off-by: Lee Jones <[email protected]>
> > > > > ---
> > > > > drivers/scsi/aic7xxx/aic79xx_osm.c | 4 ----
> > > > > 1 file changed, 4 deletions(-)
> > > > >
> > > > > diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c
> > > > > b/drivers/scsi/aic7xxx/aic79xx_osm.c
> > > > > index 3782a20d58885..140c4e74ddd7e 100644
> > > > > --- a/drivers/scsi/aic7xxx/aic79xx_osm.c
> > > > > +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
> > > > > @@ -2141,14 +2141,12 @@ ahd_linux_queue_abort_cmd(struct
> > > > > scsi_cmnd
> > > > > *cmd)
> > > > > u_int saved_scbptr;
> > > > > u_int active_scbptr;
> > > > > u_int last_phase;
> > > > > - u_int saved_scsiid;
> > > > > u_int cdb_byte;
> > > > > int retval;
> > > > > int was_paused;
> > > > > int paused;
> > > > > int wait;
> > > > > int disconnected;
> > > > > - ahd_mode_state saved_modes;
> > > > > unsigned long flags;
> > > > >
> > > > > pending_scb = NULL;
> > > > > @@ -2239,7 +2237,6 @@ ahd_linux_queue_abort_cmd(struct
> > > > > scsi_cmnd
> > > > > *cmd)
> > > > > goto done;
> > > > > }
> > > > >
> > > > > - saved_modes = ahd_save_modes(ahd);
> > > > > ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
> > > > > last_phase = ahd_inb(ahd, LASTPHASE);
> > > > > saved_scbptr = ahd_get_scbptr(ahd);
> > > > > @@ -2257,7 +2254,6 @@ ahd_linux_queue_abort_cmd(struct
> > > > > scsi_cmnd
> > > > > *cmd)
> > > > > * passed in command. That command is currently
> > > > > active on
> > > > > the
> > > > > * bus or is in the disconnected state.
> > > > > */
> > > > > - saved_scsiid = ahd_inb(ahd, SAVED_SCSIID);
> > > > > if (last_phase != P_BUSFREE
> > > > > && SCB_GET_TAG(pending_scb) == active_scbptr) {
> > > > >
> > > > >
> > > >
> > > > Reviewed-by: Hannes Reinecke <[email protected]>
> > >
> > > Hey, you don't get to do that ... I asked you to figure out why
> > > we're missing an ahd_restore_modes(). Removing the
> > > ahd_save_modes() is cosmetic: it gets rid of a warning but doesn't
> > > fix the problem. I'd rather keep the warning until the problem is
> > > fixed and the problem is we need a mode save/restore around the
> > > ahd_set_modes() which is only partially implemented in this
> > > function.
> >
> > I had a look. Traced it back to the dawn of time (time == Git), then
> > delved even further back by downloading and trawling through ~10-15
> > tarballs. It looks as though drivers/scsi/aic7xxx/aic79xx_osm.c was
> > upstreamed in v2.5.60, nearly 20 years ago. 'saved_modes' has been
> > unused since at least then. If no one has complained in 2 decades,
> > I'd say it probably isn't an issue worth perusing.
>
> Well, we have what looks like a fix now. The reason it matters is that
> if the bus is not in AHD_MODE_SCSI when the routine is called, it ends
> up being in a wrong state when the routine exits, so you abort one
> command and screw up another. Ultimately I bet escalation to bus reset
> fixes it, so everything appears to work, but it might have worked a lot
> better if the original mode were restored.
>
> This is error handling code, so most installations run just fine
> without ever invoking it.

Understood.

Obviously a *real* fix is better than this warning suppression one. I
was just explaining that, try as I might, I couldn't find any
non-broken code to use to use as a reference to author a proper fix
for this.

This being the first mail in my inbox, so I don't know if the proper
fix you reference above was a) sent as a patch and/or b) sent to me,
but it's great news that you have one either way.

Please drop this patch.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2020-07-15 06:35:12

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 24/24] scsi: aic7xxx: aic79xx_osm: Remove set but unused variabes 'saved_scsiid' and 'saved_modes'

On Wed, 15 Jul 2020, Hannes Reinecke wrote:

> On 7/14/20 11:39 PM, Lee Jones wrote:
> > On Tue, 14 Jul 2020, James Bottomley wrote:
> >
> > > On Tue, 2020-07-14 at 09:46 +0200, Hannes Reinecke wrote:
> > > > On 7/13/20 10:00 AM, Lee Jones wrote:
> > > > > Haven't been used since 2006.
> > > > >
> > > > > 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:2155:17: warning: variable
> > > > > ‘saved_modes’ set but not used [-Wunused-but-set-variable]
> > > > > drivers/scsi/aic7xxx/aic79xx_osm.c:2148:9: warning: variable
> > > > > ‘saved_scsiid’ set but not used [-Wunused-but-set-variable]
> > > > >
> > > > > Cc: Hannes Reinecke <[email protected]>
> > > > > Signed-off-by: Lee Jones <[email protected]>
> > > > > ---
> > > > > drivers/scsi/aic7xxx/aic79xx_osm.c | 4 ----
> > > > > 1 file changed, 4 deletions(-)
> > > > >
> > > > > diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c
> > > > > b/drivers/scsi/aic7xxx/aic79xx_osm.c
> > > > > index 3782a20d58885..140c4e74ddd7e 100644
> > > > > --- a/drivers/scsi/aic7xxx/aic79xx_osm.c
> > > > > +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
> > > > > @@ -2141,14 +2141,12 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd
> > > > > *cmd)
> > > > > u_int saved_scbptr;
> > > > > u_int active_scbptr;
> > > > > u_int last_phase;
> > > > > - u_int saved_scsiid;
> > > > > u_int cdb_byte;
> > > > > int retval;
> > > > > int was_paused;
> > > > > int paused;
> > > > > int wait;
> > > > > int disconnected;
> > > > > - ahd_mode_state saved_modes;
> > > > > unsigned long flags;
> > > > > pending_scb = NULL;
> > > > > @@ -2239,7 +2237,6 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd
> > > > > *cmd)
> > > > > goto done;
> > > > > }
> > > > > - saved_modes = ahd_save_modes(ahd);
> > > > > ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
> > > > > last_phase = ahd_inb(ahd, LASTPHASE);
> > > > > saved_scbptr = ahd_get_scbptr(ahd);
> > > > > @@ -2257,7 +2254,6 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd
> > > > > *cmd)
> > > > > * passed in command. That command is currently active on
> > > > > the
> > > > > * bus or is in the disconnected state.
> > > > > */
> > > > > - saved_scsiid = ahd_inb(ahd, SAVED_SCSIID);
> > > > > if (last_phase != P_BUSFREE
> > > > > && SCB_GET_TAG(pending_scb) == active_scbptr) {
> > > > >
> > > >
> > > > Reviewed-by: Hannes Reinecke <[email protected]>
> > >
> > > Hey, you don't get to do that ... I asked you to figure out why we're
> > > missing an ahd_restore_modes(). Removing the ahd_save_modes() is
> > > cosmetic: it gets rid of a warning but doesn't fix the problem. I'd
> > > rather keep the warning until the problem is fixed and the problem is
> > > we need a mode save/restore around the ahd_set_modes() which is only
> > > partially implemented in this function.
> >
> > I had a look. Traced it back to the dawn of time (time == Git), then
> > delved even further back by downloading and trawling through ~10-15
> > tarballs. It looks as though drivers/scsi/aic7xxx/aic79xx_osm.c was
> > upstreamed in v2.5.60, nearly 20 years ago. 'saved_modes' has been
> > unused since at least then. If no one has complained in 2 decades,
> > I'd say it probably isn't an issue worth perusing.
> >
> That's not really the point; this function is the first stage of error
> recovery. And the only real way of exercising this is to inject a command
> timeout, which is nearly impossible without dedicated hardware.
> So this function will have a very limited exposure, but nevertheless a quite
> crucial function.
> Hence I'm not quite agree with your reasoning, and rather would have it
> fixed.

100% agree.

> But as we're having an alternative fix now, it might be best if you could
> drop it from your patchset and we'll fix it separately.

Sounds good. Thanks.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2020-07-15 22:16:45

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH v2 00/24] Set 3: Fix another set of SCSI related W=1 warnings

On Mon, 13 Jul 2020 08:59:37 +0100, Lee Jones wrote:

> This set is part of a larger effort attempting to clean-up W=1
> kernel builds, which are currently overwhelmingly riddled with
> niggly little warnings.
>
> Slowly working through the SCSI related ones. There are many.
>
> This brings the total of W=1 SCSI wanings from 1690 in v5.8-rc1 to 1109.
>
> [...]

Applied to 5.9/scsi-queue. Thanks for cleaning things up!

I do think that in general it makes little sense for low-level drivers
to document internal functions using kerneldoc. As a general approach
I would prefer to just switch drivers to '/*' or to remove stale
comments instead of trying to keep up with the "docrot" warnings.

kerneldoc cleanups are great for functions that actually have more
than one user (core code, libraries, common code used by multiple
drivers, etc.). Whereas for driver internals I would much rather
emphasize function arguments with well-chosen, descriptive names
instead of a kerneldoc "@p: pointer to a foobar" comment that will
inevitably become stale next time an interface changes.

[01/24] scsi: aacraid: Repair two kerneldoc headers
https://git.kernel.org/mkp/scsi/c/b115958d91f5
[02/24] scsi: aacraid: Fix a few kerneldoc issues
https://git.kernel.org/mkp/scsi/c/cf93fffac261
[03/24] scsi: aacraid: Fix logical bug when !DBG
https://git.kernel.org/mkp/scsi/c/2fee77e5b820
[04/24] scsi: aacraid: Remove unused variable 'status'
https://git.kernel.org/mkp/scsi/c/0123c7c62d6c
[05/24] scsi: aacraid: Demote partially documented function header
https://git.kernel.org/mkp/scsi/c/71aa4d3e0e78
[06/24] scsi: aic94xx: Document 'lseq' and repair asd_update_port_links() header
https://git.kernel.org/mkp/scsi/c/966fdadf6fea
[07/24] scsi: aacraid: Fix a bunch of function header issues
https://git.kernel.org/mkp/scsi/c/f1134f0eb184
[08/24] scsi: aic94xx: Fix a couple of formatting and bitrot issues
https://git.kernel.org/mkp/scsi/c/d2e510505006
[09/24] scsi: aacraid: Fill in the very parameter descriptions for rx_sync_cmd()
https://git.kernel.org/mkp/scsi/c/ae272a95133a
[10/24] scsi: pm8001: Provide descriptions for the many undocumented 'attr's
https://git.kernel.org/mkp/scsi/c/e1c3e0f8a2ae
[11/24] scsi: ipr: Fix a mountain of kerneldoc misdemeanours
https://git.kernel.org/mkp/scsi/c/a96099e2c164
[12/24] scsi: virtio_scsi: Demote seemingly unintentional kerneldoc header
https://git.kernel.org/mkp/scsi/c/e31f2661ff41
[13/24] scsi: ipr: Remove a bunch of set but checked variables
https://git.kernel.org/mkp/scsi/c/4dc833999e37
[14/24] scsi: ipr: Fix struct packed-not-aligned issues
https://git.kernel.org/mkp/scsi/c/f3bdc59f9b11
[15/24] scsi: myrs: Demote obvious misuse of kerneldoc to standard comment blocks
https://git.kernel.org/mkp/scsi/c/8a692fdb1d04
[17/24] scsi: be2iscsi: Fix API/documentation slip
https://git.kernel.org/mkp/scsi/c/abad069ef0da
[18/24] scsi: be2iscsi: Fix misdocumentation of 'pcontext'
https://git.kernel.org/mkp/scsi/c/dbc019a48f97
[19/24] scsi: be2iscsi: Add missing function parameter description
https://git.kernel.org/mkp/scsi/c/7405edfdfb96
[20/24] scsi: lpfc: Correct some pretty obvious misdocumentation
https://git.kernel.org/mkp/scsi/c/09d99705b5d2
[21/24] scsi: aic7xxx: Remove unused variable 'ahd'
https://git.kernel.org/mkp/scsi/c/91b6e191c4dc
[22/24] scsi: aic7xxx: Remove unused variables 'wait' and 'paused'
https://git.kernel.org/mkp/scsi/c/532d56c631f1
[23/24] scsi: aic7xxx: Fix 'amount_xferred' set but not used issue
https://git.kernel.org/mkp/scsi/c/42b840bcfc16

--
Martin K. Petersen Oracle Linux Engineering

2020-07-16 07:15:47

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 00/24] Set 3: Fix another set of SCSI related W=1 warnings

On Wed, 15 Jul 2020, Martin K. Petersen wrote:

> On Mon, 13 Jul 2020 08:59:37 +0100, Lee Jones wrote:
>
> > This set is part of a larger effort attempting to clean-up W=1
> > kernel builds, which are currently overwhelmingly riddled with
> > niggly little warnings.
> >
> > Slowly working through the SCSI related ones. There are many.
> >
> > This brings the total of W=1 SCSI wanings from 1690 in v5.8-rc1 to 1109.
> >
> > [...]
>
> Applied to 5.9/scsi-queue. Thanks for cleaning things up!
>
> I do think that in general it makes little sense for low-level drivers
> to document internal functions using kerneldoc. As a general approach
> I would prefer to just switch drivers to '/*' or to remove stale
> comments instead of trying to keep up with the "docrot" warnings.
>
> kerneldoc cleanups are great for functions that actually have more
> than one user (core code, libraries, common code used by multiple
> drivers, etc.). Whereas for driver internals I would much rather
> emphasize function arguments with well-chosen, descriptive names
> instead of a kerneldoc "@p: pointer to a foobar" comment that will
> inevitably become stale next time an interface changes.

I'm inclined to agree.

There is even a script to list the 'offenders':

`scripts/find-unused-docs.sh`

An effort to demote all unused docs is likely to be somewhat more
controversial than one to re-sync the attribute/parameter
descriptions though. I choose the path of least resistance for my
clean-up effort. Nothing stopping us having another pass once they
are all re-synced.

> [01/24] scsi: aacraid: Repair two kerneldoc headers
> https://git.kernel.org/mkp/scsi/c/b115958d91f5
> [02/24] scsi: aacraid: Fix a few kerneldoc issues
> https://git.kernel.org/mkp/scsi/c/cf93fffac261
> [03/24] scsi: aacraid: Fix logical bug when !DBG
> https://git.kernel.org/mkp/scsi/c/2fee77e5b820
> [04/24] scsi: aacraid: Remove unused variable 'status'
> https://git.kernel.org/mkp/scsi/c/0123c7c62d6c
> [05/24] scsi: aacraid: Demote partially documented function header
> https://git.kernel.org/mkp/scsi/c/71aa4d3e0e78
> [06/24] scsi: aic94xx: Document 'lseq' and repair asd_update_port_links() header
> https://git.kernel.org/mkp/scsi/c/966fdadf6fea
> [07/24] scsi: aacraid: Fix a bunch of function header issues
> https://git.kernel.org/mkp/scsi/c/f1134f0eb184
> [08/24] scsi: aic94xx: Fix a couple of formatting and bitrot issues
> https://git.kernel.org/mkp/scsi/c/d2e510505006
> [09/24] scsi: aacraid: Fill in the very parameter descriptions for rx_sync_cmd()
> https://git.kernel.org/mkp/scsi/c/ae272a95133a
> [10/24] scsi: pm8001: Provide descriptions for the many undocumented 'attr's
> https://git.kernel.org/mkp/scsi/c/e1c3e0f8a2ae
> [11/24] scsi: ipr: Fix a mountain of kerneldoc misdemeanours
> https://git.kernel.org/mkp/scsi/c/a96099e2c164
> [12/24] scsi: virtio_scsi: Demote seemingly unintentional kerneldoc header
> https://git.kernel.org/mkp/scsi/c/e31f2661ff41
> [13/24] scsi: ipr: Remove a bunch of set but checked variables
> https://git.kernel.org/mkp/scsi/c/4dc833999e37
> [14/24] scsi: ipr: Fix struct packed-not-aligned issues
> https://git.kernel.org/mkp/scsi/c/f3bdc59f9b11
> [15/24] scsi: myrs: Demote obvious misuse of kerneldoc to standard comment blocks
> https://git.kernel.org/mkp/scsi/c/8a692fdb1d04
> [17/24] scsi: be2iscsi: Fix API/documentation slip
> https://git.kernel.org/mkp/scsi/c/abad069ef0da
> [18/24] scsi: be2iscsi: Fix misdocumentation of 'pcontext'
> https://git.kernel.org/mkp/scsi/c/dbc019a48f97
> [19/24] scsi: be2iscsi: Add missing function parameter description
> https://git.kernel.org/mkp/scsi/c/7405edfdfb96
> [20/24] scsi: lpfc: Correct some pretty obvious misdocumentation
> https://git.kernel.org/mkp/scsi/c/09d99705b5d2
> [21/24] scsi: aic7xxx: Remove unused variable 'ahd'
> https://git.kernel.org/mkp/scsi/c/91b6e191c4dc
> [22/24] scsi: aic7xxx: Remove unused variables 'wait' and 'paused'
> https://git.kernel.org/mkp/scsi/c/532d56c631f1
> [23/24] scsi: aic7xxx: Fix 'amount_xferred' set but not used issue
> https://git.kernel.org/mkp/scsi/c/42b840bcfc16
>

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2020-07-16 07:19:19

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 00/24] Set 3: Fix another set of SCSI related W=1 warnings

On Wed, 15 Jul 2020, Martin K. Petersen wrote:

> On Mon, 13 Jul 2020 08:59:37 +0100, Lee Jones wrote:
>
> > This set is part of a larger effort attempting to clean-up W=1
> > kernel builds, which are currently overwhelmingly riddled with
> > niggly little warnings.
> >
> > Slowly working through the SCSI related ones. There are many.
> >
> > This brings the total of W=1 SCSI wanings from 1690 in v5.8-rc1 to 1109.
> >
> > [...]
>
> [01/24] scsi: aacraid: Repair two kerneldoc headers
> https://git.kernel.org/mkp/scsi/c/b115958d91f5
> [02/24] scsi: aacraid: Fix a few kerneldoc issues
> https://git.kernel.org/mkp/scsi/c/cf93fffac261
> [03/24] scsi: aacraid: Fix logical bug when !DBG
> https://git.kernel.org/mkp/scsi/c/2fee77e5b820
> [04/24] scsi: aacraid: Remove unused variable 'status'
> https://git.kernel.org/mkp/scsi/c/0123c7c62d6c
> [05/24] scsi: aacraid: Demote partially documented function header
> https://git.kernel.org/mkp/scsi/c/71aa4d3e0e78
> [06/24] scsi: aic94xx: Document 'lseq' and repair asd_update_port_links() header
> https://git.kernel.org/mkp/scsi/c/966fdadf6fea
> [07/24] scsi: aacraid: Fix a bunch of function header issues
> https://git.kernel.org/mkp/scsi/c/f1134f0eb184
> [08/24] scsi: aic94xx: Fix a couple of formatting and bitrot issues
> https://git.kernel.org/mkp/scsi/c/d2e510505006
> [09/24] scsi: aacraid: Fill in the very parameter descriptions for rx_sync_cmd()
> https://git.kernel.org/mkp/scsi/c/ae272a95133a
> [10/24] scsi: pm8001: Provide descriptions for the many undocumented 'attr's
> https://git.kernel.org/mkp/scsi/c/e1c3e0f8a2ae
> [11/24] scsi: ipr: Fix a mountain of kerneldoc misdemeanours
> https://git.kernel.org/mkp/scsi/c/a96099e2c164
> [12/24] scsi: virtio_scsi: Demote seemingly unintentional kerneldoc header
> https://git.kernel.org/mkp/scsi/c/e31f2661ff41
> [13/24] scsi: ipr: Remove a bunch of set but checked variables
> https://git.kernel.org/mkp/scsi/c/4dc833999e37
> [14/24] scsi: ipr: Fix struct packed-not-aligned issues
> https://git.kernel.org/mkp/scsi/c/f3bdc59f9b11
> [15/24] scsi: myrs: Demote obvious misuse of kerneldoc to standard comment blocks
> https://git.kernel.org/mkp/scsi/c/8a692fdb1d04

Something wrong with [16/24]?

> [17/24] scsi: be2iscsi: Fix API/documentation slip
> https://git.kernel.org/mkp/scsi/c/abad069ef0da
> [18/24] scsi: be2iscsi: Fix misdocumentation of 'pcontext'
> https://git.kernel.org/mkp/scsi/c/dbc019a48f97
> [19/24] scsi: be2iscsi: Add missing function parameter description
> https://git.kernel.org/mkp/scsi/c/7405edfdfb96
> [20/24] scsi: lpfc: Correct some pretty obvious misdocumentation
> https://git.kernel.org/mkp/scsi/c/09d99705b5d2
> [21/24] scsi: aic7xxx: Remove unused variable 'ahd'
> https://git.kernel.org/mkp/scsi/c/91b6e191c4dc
> [22/24] scsi: aic7xxx: Remove unused variables 'wait' and 'paused'
> https://git.kernel.org/mkp/scsi/c/532d56c631f1
> [23/24] scsi: aic7xxx: Fix 'amount_xferred' set but not used issue
> https://git.kernel.org/mkp/scsi/c/42b840bcfc16
>

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2020-07-16 08:01:13

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 00/24] Set 3: Fix another set of SCSI related W=1 warnings

On Thu, 16 Jul 2020, Lee Jones wrote:

> On Wed, 15 Jul 2020, Martin K. Petersen wrote:
>
> > On Mon, 13 Jul 2020 08:59:37 +0100, Lee Jones wrote:
> >
> > > This set is part of a larger effort attempting to clean-up W=1
> > > kernel builds, which are currently overwhelmingly riddled with
> > > niggly little warnings.
> > >
> > > Slowly working through the SCSI related ones. There are many.
> > >
> > > This brings the total of W=1 SCSI wanings from 1690 in v5.8-rc1 to 1109.
> > >
> > > [...]
> >
> > [01/24] scsi: aacraid: Repair two kerneldoc headers
> > https://git.kernel.org/mkp/scsi/c/b115958d91f5
> > [02/24] scsi: aacraid: Fix a few kerneldoc issues
> > https://git.kernel.org/mkp/scsi/c/cf93fffac261
> > [03/24] scsi: aacraid: Fix logical bug when !DBG
> > https://git.kernel.org/mkp/scsi/c/2fee77e5b820
> > [04/24] scsi: aacraid: Remove unused variable 'status'
> > https://git.kernel.org/mkp/scsi/c/0123c7c62d6c
> > [05/24] scsi: aacraid: Demote partially documented function header
> > https://git.kernel.org/mkp/scsi/c/71aa4d3e0e78
> > [06/24] scsi: aic94xx: Document 'lseq' and repair asd_update_port_links() header
> > https://git.kernel.org/mkp/scsi/c/966fdadf6fea
> > [07/24] scsi: aacraid: Fix a bunch of function header issues
> > https://git.kernel.org/mkp/scsi/c/f1134f0eb184
> > [08/24] scsi: aic94xx: Fix a couple of formatting and bitrot issues
> > https://git.kernel.org/mkp/scsi/c/d2e510505006
> > [09/24] scsi: aacraid: Fill in the very parameter descriptions for rx_sync_cmd()
> > https://git.kernel.org/mkp/scsi/c/ae272a95133a
> > [10/24] scsi: pm8001: Provide descriptions for the many undocumented 'attr's
> > https://git.kernel.org/mkp/scsi/c/e1c3e0f8a2ae
> > [11/24] scsi: ipr: Fix a mountain of kerneldoc misdemeanours
> > https://git.kernel.org/mkp/scsi/c/a96099e2c164
> > [12/24] scsi: virtio_scsi: Demote seemingly unintentional kerneldoc header
> > https://git.kernel.org/mkp/scsi/c/e31f2661ff41
> > [13/24] scsi: ipr: Remove a bunch of set but checked variables
> > https://git.kernel.org/mkp/scsi/c/4dc833999e37
> > [14/24] scsi: ipr: Fix struct packed-not-aligned issues
> > https://git.kernel.org/mkp/scsi/c/f3bdc59f9b11
> > [15/24] scsi: myrs: Demote obvious misuse of kerneldoc to standard comment blocks
> > https://git.kernel.org/mkp/scsi/c/8a692fdb1d04
>
> Something wrong with [16/24]?

I see that you reviewed v1. No need to respond, thanks.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2020-07-21 06:39:41

by Hannes Reinecke

[permalink] [raw]
Subject: Re: [PATCH v2 24/24] scsi: aic7xxx: aic79xx_osm: Remove set but unused variabes 'saved_scsiid' and 'saved_modes'

On 7/15/20 1:03 AM, James Bottomley wrote:
> On Tue, 2020-07-14 at 22:39 +0100, Lee Jones wrote:
>> On Tue, 14 Jul 2020, James Bottomley wrote:
>>
>>> On Tue, 2020-07-14 at 09:46 +0200, Hannes Reinecke wrote:
>>>> On 7/13/20 10:00 AM, Lee Jones wrote:
>>>>> Haven't been used since 2006.
>>>>>
>>>>> 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:2155:17: warning: variable
>>>>> ‘saved_modes’ set but not used [-Wunused-but-set-variable]
>>>>> drivers/scsi/aic7xxx/aic79xx_osm.c:2148:9: warning: variable
>>>>> ‘saved_scsiid’ set but not used [-Wunused-but-set-variable]
>>>>>
>>>>> Cc: Hannes Reinecke <[email protected]>
>>>>> Signed-off-by: Lee Jones <[email protected]>
>>>>> ---
>>>>> drivers/scsi/aic7xxx/aic79xx_osm.c | 4 ----
>>>>> 1 file changed, 4 deletions(-)
>>>>>
>>>>> diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c
>>>>> b/drivers/scsi/aic7xxx/aic79xx_osm.c
>>>>> index 3782a20d58885..140c4e74ddd7e 100644
>>>>> --- a/drivers/scsi/aic7xxx/aic79xx_osm.c
>>>>> +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
>>>>> @@ -2141,14 +2141,12 @@ ahd_linux_queue_abort_cmd(struct
>>>>> scsi_cmnd
>>>>> *cmd)
>>>>> u_int saved_scbptr;
>>>>> u_int active_scbptr;
>>>>> u_int last_phase;
>>>>> - u_int saved_scsiid;
>>>>> u_int cdb_byte;
>>>>> int retval;
>>>>> int was_paused;
>>>>> int paused;
>>>>> int wait;
>>>>> int disconnected;
>>>>> - ahd_mode_state saved_modes;
>>>>> unsigned long flags;
>>>>>
>>>>> pending_scb = NULL;
>>>>> @@ -2239,7 +2237,6 @@ ahd_linux_queue_abort_cmd(struct
>>>>> scsi_cmnd
>>>>> *cmd)
>>>>> goto done;
>>>>> }
>>>>>
>>>>> - saved_modes = ahd_save_modes(ahd);
>>>>> ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
>>>>> last_phase = ahd_inb(ahd, LASTPHASE);
>>>>> saved_scbptr = ahd_get_scbptr(ahd);
>>>>> @@ -2257,7 +2254,6 @@ ahd_linux_queue_abort_cmd(struct
>>>>> scsi_cmnd
>>>>> *cmd)
>>>>> * passed in command. That command is currently
>>>>> active on
>>>>> the
>>>>> * bus or is in the disconnected state.
>>>>> */
>>>>> - saved_scsiid = ahd_inb(ahd, SAVED_SCSIID);
>>>>> if (last_phase != P_BUSFREE
>>>>> && SCB_GET_TAG(pending_scb) == active_scbptr) {
>>>>>
>>>>>
>>>>
>>>> Reviewed-by: Hannes Reinecke <[email protected]>
>>>
>>> Hey, you don't get to do that ... I asked you to figure out why
>>> we're missing an ahd_restore_modes(). Removing the
>>> ahd_save_modes() is cosmetic: it gets rid of a warning but doesn't
>>> fix the problem. I'd rather keep the warning until the problem is
>>> fixed and the problem is we need a mode save/restore around the
>>> ahd_set_modes() which is only partially implemented in this
>>> function.
>>
>> I had a look. Traced it back to the dawn of time (time == Git), then
>> delved even further back by downloading and trawling through ~10-15
>> tarballs. It looks as though drivers/scsi/aic7xxx/aic79xx_osm.c was
>> upstreamed in v2.5.60, nearly 20 years ago. 'saved_modes' has been
>> unused since at least then. If no one has complained in 2 decades,
>> I'd say it probably isn't an issue worth perusing.
>
> Well, we have what looks like a fix now. The reason it matters is that
> if the bus is not in AHD_MODE_SCSI when the routine is called, it ends
> up being in a wrong state when the routine exits, so you abort one
> command and screw up another. Ultimately I bet escalation to bus reset
> fixes it, so everything appears to work, but it might have worked a lot
> better if the original mode were restored.
>
> This is error handling code, so most installations run just fine
> without ever invoking it.
>
And since you mention it, it might also explain why every time this
routine got invoked it failed to fixup anything and got escalated to bus
reset.
(And yes, I _did_ have some customer issues with aic79xx EH escalations
over the years).

Testing will be tricky, though, as you'd have to inject timeouts onto
the parallel bus or device.

Cheers,

Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
[email protected] +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer