All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Peter Wang <peter.wang@mediatek.com>
Cc: linux-scsi@vger.kernel.org, linux-mediatek@lists.infradead.org
Subject: [bug report] scsi: ufs: host: mediatek: Set IRQ affinity policy for MCQ mode
Date: Fri, 1 Aug 2025 16:18:47 +0300	[thread overview]
Message-ID: <aIy-t8rS0b8vhfmL@stanley.mountain> (raw)

Hello Peter Wang,

Commit 66e26a4b8a77 ("scsi: ufs: host: mediatek: Set IRQ affinity
policy for MCQ mode") from Jul 22, 2025 (linux-next), leads to the
following *UNPUBLISHED* Smatch static checker warning:

	drivers/ufs/host/ufs-mediatek.c:827 ufs_mtk_mcq_get_irq()
	warn: array off by one? 'host->mcq_intr_info[q_index]'

drivers/ufs/host/ufs-mediatek.c
    812 static u32 ufs_mtk_mcq_get_irq(struct ufs_hba *hba, unsigned int cpu)
    813 {
    814         struct ufs_mtk_host *host = ufshcd_get_variant(hba);
    815         struct blk_mq_tag_set *tag_set = &hba->host->tag_set;
    816         struct blk_mq_queue_map        *map = &tag_set->map[HCTX_TYPE_DEFAULT];
    817         unsigned int nr = map->nr_queues;
    818         unsigned int q_index;
    819 
    820         q_index = map->mq_map[cpu];
    821         if (q_index > nr) {

This really looks like it should be ">= nr" instead of "> nr" but I'm not
certain enough to send a patch for it.  Could you take a look?

    822                 dev_err(hba->dev, "hwq index %d exceed %d\n",
    823                         q_index, nr);
    824                 return MTK_MCQ_INVALID_IRQ;
    825         }
    826 
--> 827         return host->mcq_intr_info[q_index].irq;
    828 }

regards,
dan carpenter


             reply	other threads:[~2025-08-01 13:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-01 13:18 Dan Carpenter [this message]
2025-08-04  5:59 ` [bug report] scsi: ufs: host: mediatek: Set IRQ affinity policy for MCQ mode Peter Wang (王信友)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aIy-t8rS0b8vhfmL@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=peter.wang@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.