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-next>] [day] [month] [year] [list]
Message-ID: <20250829091727.3745415-1-jason-jh.lin@mediatek.com>
Date: Fri, 29 Aug 2025 17:15:57 +0800
From: Jason-JH Lin <jason-jh.lin@...iatek.com>
To: Chun-Kuang Hu <chunkuang.hu@...nel.org>, AngeloGioacchino Del Regno
	<angelogioacchino.delregno@...labora.com>, Jassi Brar
	<jassisinghbrar@...il.com>, Mauro Carvalho Chehab <mchehab@...nel.org>
CC: Philipp Zabel <p.zabel@...gutronix.de>, David Airlie <airlied@...il.com>,
	Simona Vetter <simona@...ll.ch>, Jason-JH Lin <jason-jh.lin@...iatek.com>,
	Nancy Lin <nancy.lin@...iatek.com>, Singo Chang <singo.chang@...iatek.com>,
	Paul-PL Chen <paul-pl.chen@...iatek.com>, Yongqiang Niu
	<yongqiang.niu@...iatek.com>, Zhenxing Qin <zhenxing.qin@...iatek.com>,
	Xiandong Wang <xiandong.wang@...iatek.com>, Sirius Wang
	<sirius.wang@...iatek.com>, Xavier Chang <xavier.chang@...iatek.com>, Jarried
 Lin <jarried.lin@...iatek.com>, Fei Shao <fshao@...omium.org>, Chen-yu Tsai
	<wenst@...omium.org>, <Project_Global_Chrome_Upstream_Group@...iatek.com>,
	<dri-devel@...ts.freedesktop.org>, <linux-mediatek@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
	<linux-media@...r.kernel.org>
Subject: [PATCH v2 0/3] Fix sleeping function called from invalid context

We found that there is a spin_lock_irqsave protection in msg_submit()
of mailbox.c and it is in the atomic context.
So when the mailbox controller driver calls pm_runtime_get_sync() in
mbox_chan_ops->send_data(), it will get this BUG report.
"BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:1164"

Additionally, pm_runtime_put_autosuspend() should be invoked from the
GCE IRQ handler to ensure the hardware has actually completed its work.

To resolve these issues, remove the pm_runtime calls from
cmdq_mbox_send_data() and delegate power management responsibilities
to the client driver.
---
Changes in v2:
- Move pm_runtmie APIs from cmdq driver to client drivers.
- Move pm_runtime_put_autosuspend to GCE irq callback function.
- Link to v1: https://lore.kernel.org/r/20240614040133.24967-1-jason-jh.lin@mediatek.com
---
Jason-JH Lin (3):
  mailbox: mtk-cmdq: Remove pm_runtime APIs from cmdq_mbox_send_data()
  drm/mediatek: Add pm_runtime support for GCE power control
  media: platform: mtk-mdp3: Add pm_runtime support for GCE power
    control

 drivers/gpu/drm/mediatek/mtk_crtc.c                  |  7 +++++++
 drivers/mailbox/mtk-cmdq-mailbox.c                   | 12 +-----------
 drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 11 +++++++++++
 3 files changed, 19 insertions(+), 11 deletions(-)

-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ