dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Esben Haabendal" <esben@geanix.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 4/4] drm/bridge: nwl-dsi: Add error handling of nwl_dsi_mode_set()
Date: Mon, 03 Aug 2026 15:28:26 +0000	[thread overview]
Message-ID: <20260803152827.37C061F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260803-nwl-dsi-fixes-v2-4-1809a0ac453f@geanix.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Handling `nwl_dsi_mode_set()` error by jumping to `runtime_put` causes a `pm_runtime` usage counter underflow.
--

--- Patch [4]: [PATCH v2 4/4] drm/bridge: nwl-dsi: Add error handling of nwl_dsi_mode_set() ---
commit 7d9af739876057a4f21f4e98151a3fe153456a02
Author: Esben Haabendal <esben@geanix.com>

drm/bridge: nwl-dsi: Add error handling of nwl_dsi_mode_set()

This commit introduces error handling for nwl_dsi_mode_set() in
nwl_dsi_bridge_mode_set(). If the function fails, it jumps to the
runtime_put label to release the PM runtime reference.

> diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
> index 226036d22e3f8..08e87d166b17a 100644
> --- a/drivers/gpu/drm/bridge/nwl-dsi.c
> +++ b/drivers/gpu/drm/bridge/nwl-dsi.c
> @@ -942,7 +942,9 @@ nwl_dsi_bridge_mode_set(struct drm_bridge *bridge,
>  	}
>  
>  	/* Step 2 from DSI reset-out instructions */
> -	nwl_dsi_mode_set(dsi);
> +	ret = nwl_dsi_mode_set(dsi);
> +	if (ret < 0)
> +		goto runtime_put;

[Severity: Medium]
Since nwl_dsi_bridge_mode_set() returns void, does the DRM core know that this
setup failed?

If the DRM core continues treating the bridge as active, it will unconditionally
call nwl_dsi_bridge_atomic_disable() during teardown, which also drops the
reference:

drivers/gpu/drm/bridge/nwl-dsi.c:nwl_dsi_bridge_atomic_disable() {
	...
	pm_runtime_put(dsi->dev);
	...
}

Could this double-put cause a pm_runtime usage counter underflow, since we 
already dropped the reference in this new error path?

>  
>  	/* Step 3 from DSI reset-out instructions */
>  	ret = reset_control_deassert(dsi->rst_esc);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260803-nwl-dsi-fixes-v2-0-1809a0ac453f@geanix.com?part=4

  reply	other threads:[~2026-08-03 15:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03 14:56 [PATCH v2 0/4] drm/bridge: nwl-dsi: Various fixes Esben Haabendal
2026-08-03 14:56 ` [PATCH v2 1/4] drm/bridge: nwl-dsi: Limit LCDIF specific sync override Esben Haabendal
2026-08-05  8:36   ` Luca Ceresoli
2026-08-05 12:56     ` Esben Haabendal
2026-08-03 14:56 ` [PATCH v2 2/4] drm/bridge: nwl-dsi: Correct auto-insert EOTP behavior Esben Haabendal
2026-08-03 14:56 ` [PATCH v2 3/4] drm/bridge: nwl-dsi: Correct MIPI DSI horizontal sync timing Esben Haabendal
2026-08-03 15:18   ` sashiko-bot
2026-08-03 14:56 ` [PATCH v2 4/4] drm/bridge: nwl-dsi: Add error handling of nwl_dsi_mode_set() Esben Haabendal
2026-08-03 15:28   ` sashiko-bot [this message]
2026-08-05  8:36   ` Luca Ceresoli
2026-08-05 12:58     ` Esben Haabendal

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=20260803152827.37C061F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=esben@geanix.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox