lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAOTY_9K5wb_d-DbFnDKDUPdSkt9Tt8ObbVc6eErehpO1SNbvw@mail.gmail.com>
Date: Thu, 29 Aug 2024 22:57:52 +0800
From: Chun-Kuang Hu <chunkuang.hu@...nel.org>
To: Fei Shao <fshao@...omium.org>
Cc: Chun-Kuang Hu <chunkuang.hu@...nel.org>, 
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>, 
	Bibby Hsieh <bibby.hsieh@...iatek.com>, CK Hu <ck.hu@...iatek.com>, 
	Daniel Vetter <daniel@...ll.ch>, David Airlie <airlied@...il.com>, 
	Matthias Brugger <matthias.bgg@...il.com>, Philipp Zabel <p.zabel@...gutronix.de>, 
	dri-devel@...ts.freedesktop.org, linux-arm-kernel@...ts.infradead.org, 
	linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH] drm/mediatek: Use spin_lock_irqsave() for CRTC event lock

Hi, Fei:

Fei Shao <fshao@...omium.org> 於 2024年8月28日 週三 下午6:16寫道:
>
> Use the state-aware spin_lock_irqsave() and spin_unlock_irqrestore()
> to avoid unconditionally re-enabling the local interrupts.

Applied to mediatek-drm-next [1], thanks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next

Regards,
Chun-Kuang.

>
> Fixes: 411f5c1eacfe ("drm/mediatek: handle events when enabling/disabling crtc")
> Signed-off-by: Fei Shao <fshao@...omium.org>
> ---
>
>  drivers/gpu/drm/mediatek/mtk_crtc.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_crtc.c b/drivers/gpu/drm/mediatek/mtk_crtc.c
> index 6f34f573e127..42f47086f414 100644
> --- a/drivers/gpu/drm/mediatek/mtk_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_crtc.c
> @@ -449,6 +449,7 @@ static void mtk_crtc_ddp_hw_fini(struct mtk_crtc *mtk_crtc)
>  {
>         struct drm_device *drm = mtk_crtc->base.dev;
>         struct drm_crtc *crtc = &mtk_crtc->base;
> +       unsigned long flags;
>         int i;
>
>         for (i = 0; i < mtk_crtc->ddp_comp_nr; i++) {
> @@ -480,10 +481,10 @@ static void mtk_crtc_ddp_hw_fini(struct mtk_crtc *mtk_crtc)
>         pm_runtime_put(drm->dev);
>
>         if (crtc->state->event && !crtc->state->active) {
> -               spin_lock_irq(&crtc->dev->event_lock);
> +               spin_lock_irqsave(&crtc->dev->event_lock, flags);
>                 drm_crtc_send_vblank_event(crtc, crtc->state->event);
>                 crtc->state->event = NULL;
> -               spin_unlock_irq(&crtc->dev->event_lock);
> +               spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
>         }
>  }
>
> --
> 2.46.0.295.g3b9ea8a38a-goog
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ