dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Daniel Golle" <daniel@makrotopia.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v9 02/14] drm/bridge: it6505: quiesce work items before powering off
Date: Fri, 20 Nov 2026 00:19:09 +0000	[thread overview]
Message-ID: <sashiko-outbox-224263@kernel.org> (raw)
In-Reply-To: <4578349476dde314604b9b65670d7545a01ab3c9.1795132452.git.daniel@makrotopia.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/bridge: it6505: missing IRQ sync in it6505_poweroff()
  allows work requeue
--

commit 047992d501bf36c86f72d05d9e0cb5d26d252fa0
Author: Daniel Golle <daniel@makrotopia.org>

drm/bridge: it6505: quiesce work items before powering off

This commit cancels link_works, hdcp_wait_ksv_list, and hdcp_work in
it6505_poweroff() before asserting reset and disabling the power rails.

> diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c
> index e980cc6d5760c..52d7d818a5ea3 100644
> --- a/drivers/gpu/drm/bridge/ite-it6505.c
> +++ b/drivers/gpu/drm/bridge/ite-it6505.c
> @@ -2804,6 +2804,9 @@ static int it6505_poweroff(struct it6505 *it6505)
>  	}
>  
>  	disable_irq_nosync(it6505->irq);
> +	cancel_work_sync(&it6505->link_works);
> +	cancel_work_sync(&it6505->hdcp_wait_ksv_list);
> +	cancel_delayed_work_sync(&it6505->hdcp_work);
>  
>  	if (pdata->gpiod_reset)
>  		gpiod_set_value_cansleep(pdata->gpiod_reset, 1);

[Severity: Medium]
Can an in-flight it6505_int_threaded_handler() requeue these work items
right after cancel_work_sync() and cancel_delayed_work_sync() return?

During system suspend, pm_runtime_force_suspend() disables runtime PM
and calls it6505_bridge_suspend() -> it6505_poweroff() without waiting
for a running threaded IRQ handler. Because it6505_poweroff() uses
disable_irq_nosync(), an already-running handler can schedule work
after the synchronous cancels finish:

CPU0                                  CPU1 (irq/it6505-int)
it6505_int_threaded_handler()
  regmap_bulk_read(INT_STATUS_01..03)
  it6505_irq_scdt()
    it6505_calc_video_info()
pm_runtime_force_suspend()
  it6505_poweroff()
    disable_irq_nosync(it6505->irq)
    cancel_work_sync(&link_works)
    ...
    gpiod_set_value_cansleep(reset, 1)
                                      schedule_work(&link_works)
                                        <-- runs against powered-off chip
    regulator_disable(...)
    it6505->powered = false;

Since it6505->powered is cleared last, the requeued work can issue I2C
and DP AUX transactions while the chip is held in reset or powering
down, or leave hdcp_work pending across poweroff. Using disable_irq()
(or synchronize_irq() when called from outside the IRQ thread) before
canceling the work items would ensure the handler has finished.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1795132452.git.daniel@makrotopia.org?part=2

  reply	other threads:[~2026-11-20  0:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 23:58 [PATCH v9 00/14] drm/bridge: it6505: DP audio support + shared-DAI hw_params fix Daniel Golle
2026-11-19 23:58 ` [PATCH v9 01/14] drm/bridge: it6505: quiesce event sources and work on remove() Daniel Golle
2026-11-19 23:59 ` [PATCH v9 02/14] drm/bridge: it6505: quiesce work items before powering off Daniel Golle
2026-11-20  0:19   ` sashiko-bot [this message]
2026-11-19 23:59 ` [PATCH v9 03/14] drm/bridge: it6505: balance and disable runtime PM on remove Daniel Golle
2026-11-19 23:59 ` [PATCH v9 04/14] drm/bridge: it6505: unregister DP AUX adapter on bridge detach Daniel Golle
2026-11-19 23:59 ` [PATCH v9 05/14] drm/bridge: it6505: complete poweroff even if disabling regulators fails Daniel Golle
2026-11-20  0:02 ` [PATCH v9 06/14] drm/bridge: it6505: bail out of the IRQ handler when status reads fail Daniel Golle
2026-11-20  0:03 ` [PATCH v9 07/14] drm/bridge: it6505: avoid division by zero in pixel clock calculation Daniel Golle
2026-11-20  0:03 ` [PATCH v9 08/14] drm/bridge: it6505: drop the audio input FS debug print Daniel Golle
2026-11-20  0:04 ` [PATCH v9 09/14] drm/bridge: it6505: guard against zero channel count in audio infoframe Daniel Golle
2026-11-20  0:04 ` [PATCH v9 10/14] drm/bridge: it6505: hold endpoint OF node reference while parsing it Daniel Golle
2026-11-20  0:05 ` [PATCH v9 11/14] drm/bridge: it6505: reject a too short link-frequencies property Daniel Golle
2026-11-20  0:05 ` [PATCH v9 12/14] drm/bridge: it6505: don't write an error code back to the reset register Daniel Golle
2026-11-20  0:06 ` [PATCH v9 13/14] drm/bridge: it6505: Add audio support Daniel Golle
2026-11-20  0:23   ` sashiko-bot
2026-11-20  0:06 ` [PATCH v9 14/14] drm/bridge: it6505: Don't reject audio hw_params without an encoder Daniel Golle
2026-11-20  0:12 ` [PATCH v9 00/14] drm/bridge: it6505: DP audio support + shared-DAI hw_params fix Daniel Golle

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-224263@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=daniel@makrotopia.org \
    --cc=dri-devel@lists.freedesktop.org \
    --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