* [PATCH] media: sti: hva: Remove bogus mutex_unlock() in hva_hw_get_ip_version()
@ 2026-11-03 1:34 Xiangwu Lai
2026-11-17 1:13 ` Xiangwu Lai
0 siblings, 1 reply; 3+ messages in thread
From: Xiangwu Lai @ 2026-11-03 1:34 UTC (permalink / raw)
To: Jean-Christophe Trotin, Mauro Carvalho Chehab
Cc: linux-media, linux-kernel, Xiangwu Lai
When runtime resume fails, hva_hw_get_ip_version() calls
mutex_unlock() on hva->protect_mutex before returning. The only
caller of this function is hva_hw_probe(), which does not hold
protect_mutex at that point, so the error path unlocks a mutex that
was never locked.
The line appears to be copied from the encode path in
hva_hw_execute_cmds(), which does run under protect_mutex. Remove
it so that a failed runtime resume returns without corrupting the
mutex state.
Fixes: 57b2c0628b60 ("[media] st-hva: multi-format video encoder V4L2 driver")
Signed-off-by: Xiangwu Lai <laixiangwu@cmss.chinamobile.com>
---
drivers/media/platform/st/sti/hva/hva-hw.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/media/platform/st/sti/hva/hva-hw.c b/drivers/media/platform/st/sti/hva/hva-hw.c
index fcb18fb52..bd33d8dab 100644
--- a/drivers/media/platform/st/sti/hva/hva-hw.c
+++ b/drivers/media/platform/st/sti/hva/hva-hw.c
@@ -271,7 +271,6 @@ static unsigned long int hva_hw_get_ip_version(struct hva_dev *hva)
if (pm_runtime_resume_and_get(dev) < 0) {
dev_err(dev, "%s failed to get pm_runtime\n", HVA_PREFIX);
- mutex_unlock(&hva->protect_mutex);
return -EFAULT;
}
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] media: sti: hva: Remove bogus mutex_unlock() in hva_hw_get_ip_version()
2026-11-03 1:34 [PATCH] media: sti: hva: Remove bogus mutex_unlock() in hva_hw_get_ip_version() Xiangwu Lai
@ 2026-11-17 1:13 ` Xiangwu Lai
2026-11-26 22:11 ` Nicolas Dufresne
0 siblings, 1 reply; 3+ messages in thread
From: Xiangwu Lai @ 2026-11-17 1:13 UTC (permalink / raw)
To: Jean-Christophe Trotin, Mauro Carvalho Chehab
Cc: Xiangwu Lai, linux-media, linux-kernel
Hi,
gentle ping for:
media: sti: hva: Remove bogus mutex_unlock() in hva_hw_get_ip_version()
https://lore.kernel.org/all/20261103013440.1138-1-laixiangwu@cmss.chinamobile.com/
When runtime resume fails, hva_hw_get_ip_version() unlocks
protect_mutex, but the only caller (hva_hw_probe()) never took that
lock; the line was copied from the encode path which does run under
the lock. The patch removes the bogus unlock.
Is there anything blocking this patch, or does it just need more
time?
Best regards,
Xiangwu Lai
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] media: sti: hva: Remove bogus mutex_unlock() in hva_hw_get_ip_version()
2026-11-17 1:13 ` Xiangwu Lai
@ 2026-11-26 22:11 ` Nicolas Dufresne
0 siblings, 0 replies; 3+ messages in thread
From: Nicolas Dufresne @ 2026-11-26 22:11 UTC (permalink / raw)
To: Xiangwu Lai, Jean-Christophe Trotin, Mauro Carvalho Chehab
Cc: linux-media, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 849 bytes --]
Le mardi 17 novembre 2026 à 09:13 +0800, Xiangwu Lai a écrit :
> Hi,
>
> gentle ping for:
>
> media: sti: hva: Remove bogus mutex_unlock() in hva_hw_get_ip_version()
> https://lore.kernel.org/all/20261103013440.1138-1-laixiangwu@cmss.chinamobile.com/
>
> When runtime resume fails, hva_hw_get_ip_version() unlocks
> protect_mutex, but the only caller (hva_hw_probe()) never took that
> lock; the line was copied from the encode path which does run under
> the lock. The patch removes the bogus unlock.
>
> Is there anything blocking this patch, or does it just need more
> time?
I'm trying to figure-out if its even worth the time to keep applying patches, if
there is no ST reply next week, I'll send a patch to remove it, and that should
also fix the issue.
Nicolas
>
> Best regards,
> Xiangwu Lai
>
>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-26 22:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03 1:34 [PATCH] media: sti: hva: Remove bogus mutex_unlock() in hva_hw_get_ip_version() Xiangwu Lai
2026-11-17 1:13 ` Xiangwu Lai
2026-11-26 22:11 ` Nicolas Dufresne
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®