From: Jani Nikula <jani.nikula@intel.com>
To: Suraj Kandpal <suraj.kandpal@intel.com>,
intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Cc: jouni.hogander@intel.com, Suraj Kandpal <suraj.kandpal@intel.com>
Subject: Re: [PATCH v2] drm/i915/backlight: Fix divide by 0 error in i9xx_set_backlight
Date: Wed, 20 Aug 2025 10:18:15 +0300 [thread overview]
Message-ID: <aa314e44e68404093a1956dfd8af54bc1031d3b7@intel.com> (raw)
In-Reply-To: <20250819160438.145734-1-suraj.kandpal@intel.com>
On Tue, 19 Aug 2025, Suraj Kandpal <suraj.kandpal@intel.com> wrote:
> pwm_level_max maybe 0 we do throw a warning but move ahead with
> execution which may later cause a /0 error.
>
> --v2
> -return if the warn_on gets hit [Jani]
>
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_backlight.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_backlight.c b/drivers/gpu/drm/i915/display/intel_backlight.c
> index e007380e9a63..3b14f929825a 100644
> --- a/drivers/gpu/drm/i915/display/intel_backlight.c
> +++ b/drivers/gpu/drm/i915/display/intel_backlight.c
> @@ -236,7 +236,8 @@ static void i9xx_set_backlight(const struct drm_connector_state *conn_state, u32
> struct intel_panel *panel = &connector->panel;
> u32 tmp, mask;
>
> - drm_WARN_ON(display->drm, panel->backlight.pwm_level_max == 0);
> + if (drm_WARN_ON(display->drm, panel->backlight.pwm_level_max == 0))
> + return;
>
> if (panel->backlight.combination_mode) {
> struct pci_dev *pdev = to_pci_dev(display->drm->dev);
--
Jani Nikula, Intel
next prev parent reply other threads:[~2025-08-20 7:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-19 16:04 [PATCH v2] drm/i915/backlight: Fix divide by 0 error in i9xx_set_backlight Suraj Kandpal
2025-08-20 1:17 ` ✓ CI.KUnit: success for drm/i915/backlight: Fix divide by 0 error in i9xx_set_backlight (rev2) Patchwork
2025-08-20 2:40 ` ✓ Xe.CI.BAT: " Patchwork
2025-08-20 7:18 ` Jani Nikula [this message]
2025-08-20 23:05 ` ✗ Xe.CI.Full: failure " Patchwork
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=aa314e44e68404093a1956dfd8af54bc1031d3b7@intel.com \
--to=jani.nikula@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jouni.hogander@intel.com \
--cc=suraj.kandpal@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).