linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Thompson <danielt@kernel.org>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: foss@joelselvaraj.com, Lee Jones <lee@kernel.org>,
	Jingoo Han <jingoohan1@gmail.com>, Helge Deller <deller@gmx.de>,
	linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] backlight: qcom-wled: fix unbalanced ovp irq enable
Date: Tue, 28 Oct 2025 12:40:30 +0000	[thread overview]
Message-ID: <aQC5vsJzeA-cPdKd@aspen.lan> (raw)
In-Reply-To: <280f1e92-36a1-450b-b6df-b36c3aed3c1c@oss.qualcomm.com>

On Wed, Oct 22, 2025 at 07:14:32PM +0200, Konrad Dybcio wrote:
> On 10/21/25 8:53 PM, Joel Selvaraj via B4 Relay wrote:
> > From: Joel Selvaraj <foss@joelselvaraj.com>
> >
> > In Xiaomi Poco F1 and at least few other devices, the qcom wled driver
> > triggers unbalanced ovp irq enable warning like the following during
> > boot up.
> >
> > [    1.151677] ------------[ cut here ]------------
> > [    1.151680] Unbalanced enable for IRQ 176
> > [    1.151693] WARNING: CPU: 0 PID: 160 at kernel/irq/manage.c:774 __enable_irq+0x50/0x80
> > [    1.151710] Modules linked in:
> > [    1.151717] CPU: 0 PID: 160 Comm: kworker/0:11 Not tainted 5.17.0-sdm845 #4
> > [    1.151724] Hardware name: Xiaomi Pocophone F1 (DT)
> > [    1.151728] Workqueue: events wled_ovp_work
> > ...<snip>...
> > [    1.151833] Call trace:
> > [    1.151836]  __enable_irq+0x50/0x80
> > [    1.151841]  enable_irq+0x48/0xa0
> > [    1.151846]  wled_ovp_work+0x18/0x24
> > [    1.151850]  process_one_work+0x1d0/0x350
> > [    1.151858]  worker_thread+0x13c/0x460
> > [    1.151862]  kthread+0x110/0x114
> > [    1.151868]  ret_from_fork+0x10/0x20
> > [    1.151876] ---[ end trace 0000000000000000 ]---
> >
> > Fix it by storing and checking the state of ovp irq before enabling and
> > disabling it.
> >
> > Signed-off-by: Joel Selvaraj <foss@joelselvaraj.com>
> > ---
> > I was able to debug the issue a little further. This happens mainly because
> > devm_request_threaded_irq already enables the ovp irq during probe. Then ovp
> > work gets scheduled when update_status happens and in turn enables the irq again.
> > Tracking the status makes it easy to avoid the double irq enable. But I am
> > open to try a different approach if there is any suggestion.
>
> Would reverting this change and adding (| IRQF_NO_AUTOEN) to that call
> fix it?

I'd definitely favour trying an alternative approach.

wled_[disable|enable]_ovp_irq() do hide "unbalanced enable/disable"
warnings but they will not nest correctly. That put things are high risk
of bugs (even if there are no bugs now it makes maintaining this driver
"high risk" in the future).


Daniel.

      reply	other threads:[~2025-10-28 12:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-21 18:53 [PATCH v2] backlight: qcom-wled: fix unbalanced ovp irq enable Joel Selvaraj via B4 Relay
2025-10-22 17:14 ` Konrad Dybcio
2025-10-28 12:40   ` Daniel Thompson [this message]

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=aQC5vsJzeA-cPdKd@aspen.lan \
    --to=danielt@kernel.org \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=foss@joelselvaraj.com \
    --cc=jingoohan1@gmail.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=lee@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).