Linux-Media Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] media: staging: rkisp1: don't lock media's graph_mutex when calling rkisp1_create_links
@ 2020-02-04 21:44 Dafna Hirschfeld
  2020-02-04 21:44 ` [PATCH] media: staging: rkisp1: fix test of return value of media_entity_get_fwnode_pad Dafna Hirschfeld
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Dafna Hirschfeld @ 2020-02-04 21:44 UTC (permalink / raw)
  To: linux-media
  Cc: dafna.hirschfeld, helen.koike, ezequiel, hverkuil, kernel,
	dafna3, sakari.ailus, linux-rockchip, mchehab

The function rkisp1_create_links calls media_entity_get_fwnode_pad
and media_create_pad_link in the mc api. Those calls don't require
locking the graph_mutex so remove the locking.

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
---
 drivers/staging/media/rkisp1/rkisp1-dev.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/media/rkisp1/rkisp1-dev.c b/drivers/staging/media/rkisp1/rkisp1-dev.c
index 9d866396a5de..64e61ab29143 100644
--- a/drivers/staging/media/rkisp1/rkisp1-dev.c
+++ b/drivers/staging/media/rkisp1/rkisp1-dev.c
@@ -219,19 +219,17 @@ static int rkisp1_subdev_notifier_complete(struct v4l2_async_notifier *notifier)
 		container_of(notifier, struct rkisp1_device, notifier);
 	int ret;
 
-	mutex_lock(&rkisp1->media_dev.graph_mutex);
 	ret = rkisp1_create_links(rkisp1);
 	if (ret)
-		goto unlock;
+		return ret;
+
 	ret = v4l2_device_register_subdev_nodes(&rkisp1->v4l2_dev);
 	if (ret)
-		goto unlock;
+		return ret;
 
 	dev_dbg(rkisp1->dev, "Async subdev notifier completed\n");
 
-unlock:
-	mutex_unlock(&rkisp1->media_dev.graph_mutex);
-	return ret;
+	return 0;
 }
 
 static int rkisp1_fwnode_parse(struct device *dev,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] media: staging: rkisp1: fix test of return value of media_entity_get_fwnode_pad
  2020-02-04 21:44 [PATCH] media: staging: rkisp1: don't lock media's graph_mutex when calling rkisp1_create_links Dafna Hirschfeld
@ 2020-02-04 21:44 ` Dafna Hirschfeld
  2020-02-05 13:45   ` Helen Koike
  2020-02-04 21:44 ` [PATCH] media: staging: rkisp1: improve inner documentation in rkisp1-isp.c Dafna Hirschfeld
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Dafna Hirschfeld @ 2020-02-04 21:44 UTC (permalink / raw)
  To: linux-media
  Cc: dafna.hirschfeld, helen.koike, ezequiel, hverkuil, kernel,
	dafna3, sakari.ailus, linux-rockchip, mchehab

media_entity_get_fwnode_pad returns negative value on error
and the pad numeber on success. Therefore change the error test
from 'if (ret)' to 'if (ret < 0)' .

Fixes: d65dd85281fb ("media: staging: rkisp1: add Rockchip ISP1 base driver")
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
---
 drivers/staging/media/rkisp1/rkisp1-dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/rkisp1/rkisp1-dev.c b/drivers/staging/media/rkisp1/rkisp1-dev.c
index 21837d4dc9e1..9d866396a5de 100644
--- a/drivers/staging/media/rkisp1/rkisp1-dev.c
+++ b/drivers/staging/media/rkisp1/rkisp1-dev.c
@@ -128,7 +128,7 @@ static int rkisp1_create_links(struct rkisp1_device *rkisp1)
 
 		ret = media_entity_get_fwnode_pad(&sd->entity, sd->fwnode,
 						  MEDIA_PAD_FL_SOURCE);
-		if (ret) {
+		if (ret < 0) {
 			dev_err(sd->dev, "failed to find src pad for %s\n",
 				sd->name);
 			return ret;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] media: staging: rkisp1: improve inner documentation in rkisp1-isp.c
  2020-02-04 21:44 [PATCH] media: staging: rkisp1: don't lock media's graph_mutex when calling rkisp1_create_links Dafna Hirschfeld
  2020-02-04 21:44 ` [PATCH] media: staging: rkisp1: fix test of return value of media_entity_get_fwnode_pad Dafna Hirschfeld
@ 2020-02-04 21:44 ` Dafna Hirschfeld
  2020-02-05 13:48   ` Helen Koike
  2020-02-05 13:45 ` [PATCH] media: staging: rkisp1: don't lock media's graph_mutex when calling rkisp1_create_links Helen Koike
  2020-02-14  9:47 ` Sakari Ailus
  3 siblings, 1 reply; 7+ messages in thread
From: Dafna Hirschfeld @ 2020-02-04 21:44 UTC (permalink / raw)
  To: linux-media
  Cc: dafna.hirschfeld, helen.koike, ezequiel, hverkuil, kernel,
	dafna3, sakari.ailus, linux-rockchip, mchehab

Improve the documentation in the beginning of the file
rkisp1-isp1.c

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
---
 drivers/staging/media/rkisp1/rkisp1-isp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/rkisp1/rkisp1-isp.c b/drivers/staging/media/rkisp1/rkisp1-isp.c
index 2b0513e826fe..844556389b0b 100644
--- a/drivers/staging/media/rkisp1/rkisp1-isp.c
+++ b/drivers/staging/media/rkisp1/rkisp1-isp.c
@@ -28,9 +28,9 @@
 #define RKISP1_DIR_SINK_SRC (RKISP1_DIR_SINK | RKISP1_DIR_SRC)
 
 /*
- * NOTE: MIPI controller and input MUX are also configured in this file,
- * because ISP Subdev is not only describe ISP submodule(input size,format,
- * output size, format), but also a virtual route device.
+ * NOTE: MIPI controller and input MUX are also configured in this file.
+ * This is because ISP Subdev describes not only ISP submodule (input size,
+ * format, output size, format), but also a virtual route device.
  */
 
 /*
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] media: staging: rkisp1: don't lock media's graph_mutex when calling rkisp1_create_links
  2020-02-04 21:44 [PATCH] media: staging: rkisp1: don't lock media's graph_mutex when calling rkisp1_create_links Dafna Hirschfeld
  2020-02-04 21:44 ` [PATCH] media: staging: rkisp1: fix test of return value of media_entity_get_fwnode_pad Dafna Hirschfeld
  2020-02-04 21:44 ` [PATCH] media: staging: rkisp1: improve inner documentation in rkisp1-isp.c Dafna Hirschfeld
@ 2020-02-05 13:45 ` Helen Koike
  2020-02-14  9:47 ` Sakari Ailus
  3 siblings, 0 replies; 7+ messages in thread
From: Helen Koike @ 2020-02-05 13:45 UTC (permalink / raw)
  To: Dafna Hirschfeld, linux-media
  Cc: ezequiel, hverkuil, kernel, dafna3, sakari.ailus, linux-rockchip,
	mchehab



On 2/4/20 7:44 PM, Dafna Hirschfeld wrote:
> The function rkisp1_create_links calls media_entity_get_fwnode_pad
> and media_create_pad_link in the mc api. Those calls don't require
> locking the graph_mutex so remove the locking.
> 
> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>

Acked-by: Helen Koike <helen.koike@collabora.com>

Thanks
Helen

> ---
>  drivers/staging/media/rkisp1/rkisp1-dev.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/media/rkisp1/rkisp1-dev.c b/drivers/staging/media/rkisp1/rkisp1-dev.c
> index 9d866396a5de..64e61ab29143 100644
> --- a/drivers/staging/media/rkisp1/rkisp1-dev.c
> +++ b/drivers/staging/media/rkisp1/rkisp1-dev.c
> @@ -219,19 +219,17 @@ static int rkisp1_subdev_notifier_complete(struct v4l2_async_notifier *notifier)
>  		container_of(notifier, struct rkisp1_device, notifier);
>  	int ret;
>  
> -	mutex_lock(&rkisp1->media_dev.graph_mutex);
>  	ret = rkisp1_create_links(rkisp1);
>  	if (ret)
> -		goto unlock;
> +		return ret;
> +
>  	ret = v4l2_device_register_subdev_nodes(&rkisp1->v4l2_dev);
>  	if (ret)
> -		goto unlock;
> +		return ret;
>  
>  	dev_dbg(rkisp1->dev, "Async subdev notifier completed\n");
>  
> -unlock:
> -	mutex_unlock(&rkisp1->media_dev.graph_mutex);
> -	return ret;
> +	return 0;
>  }
>  
>  static int rkisp1_fwnode_parse(struct device *dev,
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] media: staging: rkisp1: fix test of return value of media_entity_get_fwnode_pad
  2020-02-04 21:44 ` [PATCH] media: staging: rkisp1: fix test of return value of media_entity_get_fwnode_pad Dafna Hirschfeld
@ 2020-02-05 13:45   ` Helen Koike
  0 siblings, 0 replies; 7+ messages in thread
From: Helen Koike @ 2020-02-05 13:45 UTC (permalink / raw)
  To: Dafna Hirschfeld, linux-media
  Cc: ezequiel, hverkuil, kernel, dafna3, sakari.ailus, linux-rockchip,
	mchehab



On 2/4/20 7:44 PM, Dafna Hirschfeld wrote:
> media_entity_get_fwnode_pad returns negative value on error
> and the pad numeber on success. Therefore change the error test
> from 'if (ret)' to 'if (ret < 0)' .
> 
> Fixes: d65dd85281fb ("media: staging: rkisp1: add Rockchip ISP1 base driver")
> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>

Acked-by: Helen Koike <helen.koike@collabora.com>

Thanks
Helen

> ---
>  drivers/staging/media/rkisp1/rkisp1-dev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/rkisp1/rkisp1-dev.c b/drivers/staging/media/rkisp1/rkisp1-dev.c
> index 21837d4dc9e1..9d866396a5de 100644
> --- a/drivers/staging/media/rkisp1/rkisp1-dev.c
> +++ b/drivers/staging/media/rkisp1/rkisp1-dev.c
> @@ -128,7 +128,7 @@ static int rkisp1_create_links(struct rkisp1_device *rkisp1)
>  
>  		ret = media_entity_get_fwnode_pad(&sd->entity, sd->fwnode,
>  						  MEDIA_PAD_FL_SOURCE);
> -		if (ret) {
> +		if (ret < 0) {
>  			dev_err(sd->dev, "failed to find src pad for %s\n",
>  				sd->name);
>  			return ret;
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] media: staging: rkisp1: improve inner documentation in rkisp1-isp.c
  2020-02-04 21:44 ` [PATCH] media: staging: rkisp1: improve inner documentation in rkisp1-isp.c Dafna Hirschfeld
@ 2020-02-05 13:48   ` Helen Koike
  0 siblings, 0 replies; 7+ messages in thread
From: Helen Koike @ 2020-02-05 13:48 UTC (permalink / raw)
  To: Dafna Hirschfeld, linux-media
  Cc: ezequiel, hverkuil, kernel, dafna3, sakari.ailus, linux-rockchip,
	mchehab



On 2/4/20 7:44 PM, Dafna Hirschfeld wrote:
> Improve the documentation in the beginning of the file
> rkisp1-isp1.c
> 
> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>

Acked-by: Helen Koike <helen.koike@collabora.com>

Thanks
Helen

> ---
>  drivers/staging/media/rkisp1/rkisp1-isp.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/media/rkisp1/rkisp1-isp.c b/drivers/staging/media/rkisp1/rkisp1-isp.c
> index 2b0513e826fe..844556389b0b 100644
> --- a/drivers/staging/media/rkisp1/rkisp1-isp.c
> +++ b/drivers/staging/media/rkisp1/rkisp1-isp.c
> @@ -28,9 +28,9 @@
>  #define RKISP1_DIR_SINK_SRC (RKISP1_DIR_SINK | RKISP1_DIR_SRC)
>  
>  /*
> - * NOTE: MIPI controller and input MUX are also configured in this file,
> - * because ISP Subdev is not only describe ISP submodule(input size,format,
> - * output size, format), but also a virtual route device.
> + * NOTE: MIPI controller and input MUX are also configured in this file.
> + * This is because ISP Subdev describes not only ISP submodule (input size,
> + * format, output size, format), but also a virtual route device.
>   */
>  
>  /*
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] media: staging: rkisp1: don't lock media's graph_mutex when calling rkisp1_create_links
  2020-02-04 21:44 [PATCH] media: staging: rkisp1: don't lock media's graph_mutex when calling rkisp1_create_links Dafna Hirschfeld
                   ` (2 preceding siblings ...)
  2020-02-05 13:45 ` [PATCH] media: staging: rkisp1: don't lock media's graph_mutex when calling rkisp1_create_links Helen Koike
@ 2020-02-14  9:47 ` Sakari Ailus
  3 siblings, 0 replies; 7+ messages in thread
From: Sakari Ailus @ 2020-02-14  9:47 UTC (permalink / raw)
  To: Dafna Hirschfeld
  Cc: linux-media, helen.koike, ezequiel, hverkuil, kernel, dafna3,
	linux-rockchip, mchehab

On Tue, Feb 04, 2020 at 10:44:44PM +0100, Dafna Hirschfeld wrote:
> The function rkisp1_create_links calls media_entity_get_fwnode_pad
> and media_create_pad_link in the mc api. Those calls don't require
> locking the graph_mutex so remove the locking.
> 
> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>

For the three patches:

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>

-- 
Sakari Ailus

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 21:44 [PATCH] media: staging: rkisp1: don't lock media's graph_mutex when calling rkisp1_create_links Dafna Hirschfeld
2020-02-04 21:44 ` [PATCH] media: staging: rkisp1: fix test of return value of media_entity_get_fwnode_pad Dafna Hirschfeld
2020-02-05 13:45   ` Helen Koike
2020-02-04 21:44 ` [PATCH] media: staging: rkisp1: improve inner documentation in rkisp1-isp.c Dafna Hirschfeld
2020-02-05 13:48   ` Helen Koike
2020-02-05 13:45 ` [PATCH] media: staging: rkisp1: don't lock media's graph_mutex when calling rkisp1_create_links Helen Koike
2020-02-14  9:47 ` Sakari Ailus

Linux-Media Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-media/0 linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ https://lore.kernel.org/linux-media \
		linux-media@vger.kernel.org
	public-inbox-index linux-media

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-media


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git