Re: [PATCH v2] scsi: pm8001: Offset hardware queue index for MSI-X pre-vector

From: Bart Van Assche

Date: Tue Nov 17 2026 - 14:27:48 EST


On 11/17/26 9:55 AM, TJ Adams wrote:
> diff --git a/drivers/scsi/pm8001/pm8001_defs.h b/drivers/scsi/pm8001/pm8001_defs.h
> index a9605ca317f3..ef7b6257cc8b 100644
> --- a/drivers/scsi/pm8001/pm8001_defs.h
> +++ b/drivers/scsi/pm8001/pm8001_defs.h
> @@ -178,6 +178,7 @@ enum port_type {
> #define PM8001_MAX_INB_NUM 64
> #define PM8001_MAX_OUTB_NUM 64
> #define PM8001_CAN_QUEUE 508 /* SCSI Queue depth */
> +#define PM8001_PRE_VECTORS 1 /* non-affinitized housekeeping vector */

The surrounding definitions have a tab between "#define" and the
macro name, while this one has a space. Is this intentional?

> -static u32 pm80xx_chip_get_q_index(struct sas_task *task)
> +static u32 pm80xx_chip_get_q_index(struct pm8001_hba_info *pm8001_ha,
> + struct sas_task *task)
> {
> struct request *rq = sas_task_find_rq(task);
>
> if (!rq)
> return 0;
>
> - return blk_mq_unique_tag_to_hwq(blk_mq_unique_tag(rq));
> + if (pm8001_ha->number_of_intr > PM8001_PRE_VECTORS)
> + return blk_mq_unique_tag_to_hwq(blk_mq_unique_tag(rq)) +
> + PM8001_PRE_VECTORS;
> +
> + return 0;
> }

A side effect of this change: completions for the highest hardware
queue now go to outbound queue max_q_num - 1. pm80xx_chip_init()
programs that vector as the fatal error interrupt. process_oq() reads
MSGU_SCRATCH_PAD_1 for every interrupt on that vector, and also
MSGU_SCRATCH_PAD_RSVD_0 if no fatal error is reported. Without this
patch, no I/O completions go to that queue, so those MMIO reads only
happen for fatal error interrupts. The code is still correct, and the
driver used that queue for I/O before commit 42f22fe36d51 too, but it
might be worth mentioning in the patch description. Alternatively, a
follow-up patch could move the fatal error interrupt to the
housekeeping vector.

Anyway:

Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx>