All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yongbang Shi" <shiyongbang@huawei.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH for drm-misc-fixes v5 2/2] drm/hisilicon/hibmc: Add a flag to indicate whether the OS-side driver has been loaded
Date: Tue, 17 Nov 2026 13:56:50 +0000	[thread overview]
Message-ID: <sashiko-outbox-218910@kernel.org> (raw)
In-Reply-To: <20261117130056.272609-3-shiyongbang@huawei.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/hisilicon/hibmc: missing DP IRQ in hibmc_msi_init() on
  single-MSI fallback
--

commit c5b72c7e5869fdeb7952573f12ec81ff829734f9
Author: Lin He <helin52@huawei.com>

drm/hisilicon/hibmc: Add a flag to indicate whether the OS-side driver has been loaded

This commit adds a hardware enable flag to notify the BMC when the OS
driver and DP block are initialized, and serializes RMW access to the
shared GPIO/flag register with a spinlock.

> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> index a110b5e15e596..9b9077b69cdc5 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c

[ ... ]

> @@ -347,12 +349,17 @@ static void hibmc_unload(struct drm_device *dev)
>  static int hibmc_msi_init(struct drm_device *dev)
>  {
>  	struct pci_dev *pdev = to_pci_dev(dev->dev);
> +	struct hibmc_drm_private *priv = to_hibmc_drm_private(dev);
> +	int max_vectors = HIBMC_MIN_VECTORS;
>  	int valid_irq_num;
>  	int irq;
>  	int ret;
>  
> -	ret = pci_alloc_irq_vectors(pdev, HIBMC_MIN_VECTORS,
> -				    HIBMC_MAX_VECTORS, PCI_IRQ_MSI);
> +	if (priv->dp.initialized)
> +		max_vectors = HIBMC_MAX_VECTORS;
> +
> +	ret = pci_alloc_irq_vectors(pdev, HIBMC_MIN_VECTORS, max_vectors,
> +				    PCI_IRQ_MSI);
>  	if (ret < 0) {
>  		drm_err(dev, "enabling MSI failed: %d\n", ret);
>  		return ret;

[Severity: Medium]
What happens when priv->dp.initialized is true, but
pci_alloc_irq_vectors() only allocates 1 vector instead of 2 (for
example, when multi-MSI is unavailable)?

Because HIBMC_MIN_VECTORS (1) is still passed as min_vecs,
hibmc_msi_init() succeeds while only requesting vector 0
(hibmc_interrupt()) and skipping hibmc_dp_interrupt().  However,
hibmc_set_enable_flag() still sets HIBMC_ENABLE_STATE because
priv->dp.initialized is true, and hibmc_dp_late_register() unmasks DP
interrupts via hibmc_dp_enable_int().  With single-message MSI fallback,
DP interrupts are routed to vector 0 where hibmc_interrupt() does not
clear them and returns IRQ_NONE, triggering an unhandled interrupt storm
that disables vector 0 and leaves DP HPD broken.

Should min_vecs also be HIBMC_MAX_VECTORS when priv->dp.initialized is
true, or should DP be disabled if the second vector cannot be allocated?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261117130056.272609-1-shiyongbang@huawei.com?part=2

  reply	other threads:[~2026-11-17 13:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 13:00 [PATCH for drm-misc-fixes v5 0/2] Fix some bugs in the hibmc DP Yongbang Shi
2026-11-17 13:00 ` [PATCH for drm-misc-fixes v5 1/2] drm/hisilicon/hibmc: Modify the method of obtaining the hpd_status Yongbang Shi
2026-11-17 13:36   ` sashiko-bot
2026-11-17 14:12   ` Thomas Zimmermann
2026-11-17 13:00 ` [PATCH for drm-misc-fixes v5 2/2] drm/hisilicon/hibmc: Add a flag to indicate whether the OS-side driver has been loaded Yongbang Shi
2026-11-17 13:56   ` sashiko-bot [this message]
2026-11-17 14:15   ` Thomas Zimmermann
2026-11-17 14:16 ` [PATCH for drm-misc-fixes v5 0/2] Fix some bugs in the hibmc DP Thomas Zimmermann

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=sashiko-outbox-218910@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=shiyongbang@huawei.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.