[PATCH] media: v4l2-core: v4l2-subdev: Removed duplicate lockdep assertion

Sunny Patel posted 1 patch 2 months, 1 week ago
There is a newer version of this series
drivers/media/v4l2-core/v4l2-subdev.c | 2 --
1 file changed, 2 deletions(-)
[PATCH] media: v4l2-core: v4l2-subdev: Removed duplicate lockdep assertion
Posted by Sunny Patel 2 months, 1 week ago
The __v4l2_subdev_state_get_interval() function has a duplicate
lockdep_assert_held() call. Removed the redundant assertion.

Signed-off-by: Sunny Patel <nueralspacetech@gmail.com>
---
 drivers/media/v4l2-core/v4l2-subdev.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 32e6f60e26c7..4616e9280a28 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -1843,8 +1843,6 @@ __v4l2_subdev_state_get_interval(struct v4l2_subdev_state *state,
 	if (WARN_ON(!state))
 		return NULL;
 
-	lockdep_assert_held(state->lock);
-
 	if (state->pads) {
 		if (stream)
 			return NULL;
-- 
2.43.0
Re: [PATCH] media: v4l2-core: v4l2-subdev: Removed duplicate lockdep assertion
Posted by Laurent Pinchart 2 months, 1 week ago
When submitting new versions of a patch (or patch series), please
remember to indicate the version in the subject line. The -v option to
git-format-patch helps.

On Mon, Apr 06, 2026 at 03:28:50PM +0530, Sunny Patel wrote:
> The __v4l2_subdev_state_get_interval() function has a duplicate
> lockdep_assert_held() call. Removed the redundant assertion.
> 
> Signed-off-by: Sunny Patel <nueralspacetech@gmail.com>
> ---
>  drivers/media/v4l2-core/v4l2-subdev.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
> index 32e6f60e26c7..4616e9280a28 100644
> --- a/drivers/media/v4l2-core/v4l2-subdev.c
> +++ b/drivers/media/v4l2-core/v4l2-subdev.c
> @@ -1843,8 +1843,6 @@ __v4l2_subdev_state_get_interval(struct v4l2_subdev_state *state,
>  	if (WARN_ON(!state))
>  		return NULL;
>  
> -	lockdep_assert_held(state->lock);
> -

Why do you remove this assertion and not the next one ?

>  	if (state->pads) {
>  		if (stream)
>  			return NULL;

-- 
Regards,

Laurent Pinchart
[PATCH] media: v4l2-core: v4l2-subdev: Removed duplicate lockdep assertion
Posted by Sunny Patel 2 months ago
Removal is only required afte state->pads for stream_configs since
state->pads only represents the static array so not required locking for
it.


The __v4l2_subdev_state_get_interval() function has a duplicate
lockdep_assert_held() call. Removed the redundant assertion.

Signed-off-by: Sunny Patel <nueralspacetech@gmail.com>
---
 drivers/media/v4l2-core/v4l2-subdev.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 32e6f60e26c7..4616e9280a28 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -1843,8 +1843,6 @@ __v4l2_subdev_state_get_interval(struct v4l2_subdev_state *state,
 	if (WARN_ON(!state))
 		return NULL;
 
-	lockdep_assert_held(state->lock);
-
 	if (state->pads) {
 		if (stream)
 			return NULL;
-- 
2.43.0
Re: [PATCH] media: v4l2-core: v4l2-subdev: Removed duplicate lockdep assertion
Posted by Sakari Ailus 1 month, 3 weeks ago
Hi Sunny,

Thanks for the update.

Please always set the version of the patch if not the first.

On Thu, Apr 09, 2026 at 10:45:23PM +0530, Sunny Patel wrote:
> Removal is only required afte state->pads for stream_configs since
> state->pads only represents the static array so not required locking for
> it.
> 
> 

Extra newline.

> The __v4l2_subdev_state_get_interval() function has a duplicate
> lockdep_assert_held() call. Removed the redundant assertion.

Please use imperative when describing what the patch does.

> 
> Signed-off-by: Sunny Patel <nueralspacetech@gmail.com>
> ---

Please describe changes across versions, at least from the previous one.

>  drivers/media/v4l2-core/v4l2-subdev.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
> index 32e6f60e26c7..4616e9280a28 100644
> --- a/drivers/media/v4l2-core/v4l2-subdev.c
> +++ b/drivers/media/v4l2-core/v4l2-subdev.c
> @@ -1843,8 +1843,6 @@ __v4l2_subdev_state_get_interval(struct v4l2_subdev_state *state,
>  	if (WARN_ON(!state))
>  		return NULL;
>  
> -	lockdep_assert_held(state->lock);
> -
>  	if (state->pads) {
>  		if (stream)
>  			return NULL;

-- 
Kind regards,

Sakari Ailus
[PATCH v2] media: v4l2-core: Removed duplicate lockdep assertion
Posted by Sunny Patel 2 months, 1 week ago
The __v4l2_subdev_state_get_interval() function has a duplicate
lockdep_assert_held() call. Removed the redundant assertion.

Signed-off-by: Sunny Patel <nueralspacetech@gmail.com>
---
 drivers/media/v4l2-core/v4l2-subdev.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 32e6f60e26c7..4616e9280a28 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -1843,8 +1843,6 @@ __v4l2_subdev_state_get_interval(struct v4l2_subdev_state *state,
 	if (WARN_ON(!state))
 		return NULL;
 
-	lockdep_assert_held(state->lock);
-
 	if (state->pads) {
 		if (stream)
 			return NULL;
-- 
2.43.0
Re: [PATCH v2] media: v4l2-core: Removed duplicate lockdep assertion
Posted by Laurent Pinchart 2 months, 1 week ago
There was a review comment in the previous version of this patch and you
didn't take it into account. Please reply to it and explain why.

On Tue, Apr 07, 2026 at 11:09:46AM +0530, Sunny Patel wrote:
> The __v4l2_subdev_state_get_interval() function has a duplicate
> lockdep_assert_held() call. Removed the redundant assertion.
> 
> Signed-off-by: Sunny Patel <nueralspacetech@gmail.com>
> ---
>  drivers/media/v4l2-core/v4l2-subdev.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
> index 32e6f60e26c7..4616e9280a28 100644
> --- a/drivers/media/v4l2-core/v4l2-subdev.c
> +++ b/drivers/media/v4l2-core/v4l2-subdev.c
> @@ -1843,8 +1843,6 @@ __v4l2_subdev_state_get_interval(struct v4l2_subdev_state *state,
>  	if (WARN_ON(!state))
>  		return NULL;
>  
> -	lockdep_assert_held(state->lock);
> -
>  	if (state->pads) {
>  		if (stream)
>  			return NULL;

-- 
Regards,

Laurent Pinchart