* [PATCH 1/2] media: mc: Fix MUST_CONNECT handling for pads with no links
[not found] <20250820140021.8026-1-laurent.pinchart@ideasonboard.com>
@ 2025-08-20 14:00 ` Laurent Pinchart
2025-08-20 14:48 ` Martin Kepplinger-Novakovic
2025-08-21 7:12 ` Maud Spierings
0 siblings, 2 replies; 4+ messages in thread
From: Laurent Pinchart @ 2025-08-20 14:00 UTC (permalink / raw)
To: linux-media
Cc: Sakari Ailus, Hans Verkuil, Maud Spierings,
Martin Kepplinger-Novaković, stable
Commit b3decc5ce7d7 ("media: mc: Expand MUST_CONNECT flag to always
require an enabled link") expanded the meaning of the MUST_CONNECT flag
to require an enabled link in all cases. To do so, the link exploration
code was expanded to cover unconnected pads, in order to reject those
that have the MUST_CONNECT flag set. The implementation was however
incorrect, ignoring unconnected pads instead of ignoring connected pads.
Fix it.
Reported-by: Martin Kepplinger-Novaković <martink@posteo.de>
Closes: https://lore.kernel.org/linux-media/20250205172957.182362-1-martink@posteo.de
Reported-by: Maud Spierings <maudspierings@gocontroll.com>
Closes: https://lore.kernel.org/linux-media/20250818-imx8_isi-v1-1-e9cfe994c435@gocontroll.com
Fixes: b3decc5ce7d7 ("media: mc: Expand MUST_CONNECT flag to always require an enabled link")
Cc: stable@vger.kernel.org # 6.1
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/media/mc/mc-entity.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c
index 04d69f042a0e..928613d60e8f 100644
--- a/drivers/media/mc/mc-entity.c
+++ b/drivers/media/mc/mc-entity.c
@@ -696,7 +696,7 @@ static int media_pipeline_explore_next_link(struct media_pipeline *pipe,
* (already discovered through iterating over links) and pads
* not internally connected.
*/
- if (origin == local || !local->num_links ||
+ if (origin == local || local->num_links ||
!media_entity_has_pad_interdep(origin->entity, origin->index,
local->index))
continue;
--
Regards,
Laurent Pinchart
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] media: mc: Fix MUST_CONNECT handling for pads with no links
2025-08-20 14:00 ` [PATCH 1/2] media: mc: Fix MUST_CONNECT handling for pads with no links Laurent Pinchart
@ 2025-08-20 14:48 ` Martin Kepplinger-Novakovic
2025-08-21 16:51 ` Sakari Ailus
2025-08-21 7:12 ` Maud Spierings
1 sibling, 1 reply; 4+ messages in thread
From: Martin Kepplinger-Novakovic @ 2025-08-20 14:48 UTC (permalink / raw)
To: Laurent Pinchart, linux-media
Cc: Sakari Ailus, Hans Verkuil, Maud Spierings, stable
Am Mittwoch, dem 20.08.2025 um 17:00 +0300 schrieb Laurent Pinchart:
> Commit b3decc5ce7d7 ("media: mc: Expand MUST_CONNECT flag to always
> require an enabled link") expanded the meaning of the MUST_CONNECT
> flag
> to require an enabled link in all cases. To do so, the link
> exploration
> code was expanded to cover unconnected pads, in order to reject those
> that have the MUST_CONNECT flag set. The implementation was however
> incorrect, ignoring unconnected pads instead of ignoring connected
> pads.
> Fix it.
>
> Reported-by: Martin Kepplinger-Novaković <martink@posteo.de>
> Closes:
> https://lore.kernel.org/linux-media/20250205172957.182362-1-martink@posteo.de
> Reported-by: Maud Spierings <maudspierings@gocontroll.com>
> Closes:
> https://lore.kernel.org/linux-media/20250818-imx8_isi-v1-1-e9cfe994c435@gocontroll.com
> Fixes: b3decc5ce7d7 ("media: mc: Expand MUST_CONNECT flag to always
> require an enabled link")
> Cc: stable@vger.kernel.org # 6.1
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/mc/mc-entity.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-
> entity.c
> index 04d69f042a0e..928613d60e8f 100644
> --- a/drivers/media/mc/mc-entity.c
> +++ b/drivers/media/mc/mc-entity.c
> @@ -696,7 +696,7 @@ static int
> media_pipeline_explore_next_link(struct media_pipeline *pipe,
> * (already discovered through iterating over links)
> and pads
> * not internally connected.
> */
> - if (origin == local || !local->num_links ||
> + if (origin == local || local->num_links ||
> !media_entity_has_pad_interdep(origin->entity,
> origin->index,
> local->index))
> continue;
hi Laurent,
Indeed this fixes the crash I see without checking
media_pad_remote_pad_first()'s return value.
Reported-and-tested-by: Martin Kepplinger-Novaković <martink@posteo.de>
Thank you very much!
martin
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] media: mc: Fix MUST_CONNECT handling for pads with no links
2025-08-20 14:00 ` [PATCH 1/2] media: mc: Fix MUST_CONNECT handling for pads with no links Laurent Pinchart
2025-08-20 14:48 ` Martin Kepplinger-Novakovic
@ 2025-08-21 7:12 ` Maud Spierings
1 sibling, 0 replies; 4+ messages in thread
From: Maud Spierings @ 2025-08-21 7:12 UTC (permalink / raw)
To: Laurent Pinchart, linux-media
Cc: Sakari Ailus, Hans Verkuil, Martin Kepplinger-Novaković,
stable
On 8/20/25 16:00, Laurent Pinchart wrote:
> Commit b3decc5ce7d7 ("media: mc: Expand MUST_CONNECT flag to always
> require an enabled link") expanded the meaning of the MUST_CONNECT flag
> to require an enabled link in all cases. To do so, the link exploration
> code was expanded to cover unconnected pads, in order to reject those
> that have the MUST_CONNECT flag set. The implementation was however
> incorrect, ignoring unconnected pads instead of ignoring connected pads.
> Fix it.
>
> Reported-by: Martin Kepplinger-Novaković <martink@posteo.de>
> Closes: https://lore.kernel.org/linux-media/20250205172957.182362-1-martink@posteo.de
> Reported-by: Maud Spierings <maudspierings@gocontroll.com>
> Closes: https://lore.kernel.org/linux-media/20250818-imx8_isi-v1-1-e9cfe994c435@gocontroll.com
> Fixes: b3decc5ce7d7 ("media: mc: Expand MUST_CONNECT flag to always require an enabled link")
> Cc: stable@vger.kernel.org # 6.1
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/mc/mc-entity.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c
> index 04d69f042a0e..928613d60e8f 100644
> --- a/drivers/media/mc/mc-entity.c
> +++ b/drivers/media/mc/mc-entity.c
> @@ -696,7 +696,7 @@ static int media_pipeline_explore_next_link(struct media_pipeline *pipe,
> * (already discovered through iterating over links) and pads
> * not internally connected.
> */
> - if (origin == local || !local->num_links ||
> + if (origin == local || local->num_links ||
> !media_entity_has_pad_interdep(origin->entity, origin->index,
> local->index))
> continue;
The panic is now replaced with an error in userspace as it should be.
[video4linux2,v4l2 @ 0xaaaaceb8bc60] ioctl(VIDIOC_STREAMON): Link has
been severed
[in#0 @ 0xaaaaceb36510] Error opening input: Link has been severed
Error opening input file /dev/video2.
Error opening input files: Link has been severed
Reported-and-tested-by: Maud Spierings <maudspierings@gocontroll.com>
Thanks!
Kind regards,
Maud
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] media: mc: Fix MUST_CONNECT handling for pads with no links
2025-08-20 14:48 ` Martin Kepplinger-Novakovic
@ 2025-08-21 16:51 ` Sakari Ailus
0 siblings, 0 replies; 4+ messages in thread
From: Sakari Ailus @ 2025-08-21 16:51 UTC (permalink / raw)
To: Martin Kepplinger-Novakovic
Cc: Laurent Pinchart, linux-media, Hans Verkuil, Maud Spierings,
stable
Hi Martin,
On Wed, Aug 20, 2025 at 02:48:39PM +0000, Martin Kepplinger-Novakovic wrote:
> Am Mittwoch, dem 20.08.2025 um 17:00 +0300 schrieb Laurent Pinchart:
> > Commit b3decc5ce7d7 ("media: mc: Expand MUST_CONNECT flag to always
> > require an enabled link") expanded the meaning of the MUST_CONNECT
> > flag
> > to require an enabled link in all cases. To do so, the link
> > exploration
> > code was expanded to cover unconnected pads, in order to reject those
> > that have the MUST_CONNECT flag set. The implementation was however
> > incorrect, ignoring unconnected pads instead of ignoring connected
> > pads.
> > Fix it.
> >
> > Reported-by: Martin Kepplinger-Novaković <martink@posteo.de>
> > Closes:
> > https://lore.kernel.org/linux-media/20250205172957.182362-1-martink@posteo.de
> > Reported-by: Maud Spierings <maudspierings@gocontroll.com>
> > Closes:
> > https://lore.kernel.org/linux-media/20250818-imx8_isi-v1-1-e9cfe994c435@gocontroll.com
> > Fixes: b3decc5ce7d7 ("media: mc: Expand MUST_CONNECT flag to always
> > require an enabled link")
> > Cc: stable@vger.kernel.org # 6.1
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> > drivers/media/mc/mc-entity.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-
> > entity.c
> > index 04d69f042a0e..928613d60e8f 100644
> > --- a/drivers/media/mc/mc-entity.c
> > +++ b/drivers/media/mc/mc-entity.c
> > @@ -696,7 +696,7 @@ static int
> > media_pipeline_explore_next_link(struct media_pipeline *pipe,
> > * (already discovered through iterating over links)
> > and pads
> > * not internally connected.
> > */
> > - if (origin == local || !local->num_links ||
> > + if (origin == local || local->num_links ||
> > !media_entity_has_pad_interdep(origin->entity,
> > origin->index,
> > local->index))
> > continue;
>
> hi Laurent,
>
> Indeed this fixes the crash I see without checking
> media_pad_remote_pad_first()'s return value.
>
> Reported-and-tested-by: Martin Kepplinger-Novaković <martink@posteo.de>
There's already your Reported-by:; I'll replace this by Tested-by: which is
preferred in any case. Same for the Maud's tag.
--
Regards,
Sakari Ailus
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-08-21 16:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250820140021.8026-1-laurent.pinchart@ideasonboard.com>
2025-08-20 14:00 ` [PATCH 1/2] media: mc: Fix MUST_CONNECT handling for pads with no links Laurent Pinchart
2025-08-20 14:48 ` Martin Kepplinger-Novakovic
2025-08-21 16:51 ` Sakari Ailus
2025-08-21 7:12 ` Maud Spierings
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).