Linux Samsung SOC development
 help / color / mirror / Atom feed
* [PATCH 2/2] media: camif-core: Add check for clk_enable()
@ 2024-11-21 21:05 Jiasheng Jiang
  0 siblings, 0 replies; 11+ messages in thread
From: Jiasheng Jiang @ 2024-11-21 21:05 UTC (permalink / raw)
  To: sylvester.nawrocki, mchehab, dron0gus, tomasz.figa, krzk,
	alim.akhtar, kyungmin.park, laurent.pinchart
  Cc: linux-media, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	Jiasheng Jiang

Add check for the return value of clk_enable() to gurantee the success.

Fixes: babde1c243b2 ("[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
---
 .../media/platform/samsung/s3c-camif/camif-core.c   | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/samsung/s3c-camif/camif-core.c b/drivers/media/platform/samsung/s3c-camif/camif-core.c
index de6e8f151849..221e3c447f36 100644
--- a/drivers/media/platform/samsung/s3c-camif/camif-core.c
+++ b/drivers/media/platform/samsung/s3c-camif/camif-core.c
@@ -527,10 +527,19 @@ static void s3c_camif_remove(struct platform_device *pdev)
 static int s3c_camif_runtime_resume(struct device *dev)
 {
 	struct camif_dev *camif = dev_get_drvdata(dev);
+	int ret;
+
+	ret = clk_enable(camif->clock[CLK_GATE]);
+	if (ret)
+		return ret;
 
-	clk_enable(camif->clock[CLK_GATE]);
 	/* null op on s3c244x */
-	clk_enable(camif->clock[CLK_CAM]);
+	ret = clk_enable(camif->clock[CLK_CAM]);
+	if (ret) {
+		clk_disable(camif->clock[CLK_GATE]);
+		return ret;
+	}
+
 	return 0;
 }
 
-- 
2.25.1


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

* [PATCH 2/2] media: camif-core: Add check for clk_enable()
@ 2024-11-22 19:53 Jiasheng Jiang
  0 siblings, 0 replies; 11+ messages in thread
From: Jiasheng Jiang @ 2024-11-22 19:53 UTC (permalink / raw)
  To: krzk
  Cc: sylvester.nawrocki, mchehab, dron0gus, tomasz.figa, alim.akhtar,
	kyungmin.park, laurent.pinchart, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, Jiasheng Jiang

Add check for the return value of clk_enable() to gurantee the success.

Fixes: babde1c243b2 ("[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
---
 .../media/platform/samsung/s3c-camif/camif-core.c   | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/samsung/s3c-camif/camif-core.c b/drivers/media/platform/samsung/s3c-camif/camif-core.c
index de6e8f151849..221e3c447f36 100644
--- a/drivers/media/platform/samsung/s3c-camif/camif-core.c
+++ b/drivers/media/platform/samsung/s3c-camif/camif-core.c
@@ -527,10 +527,19 @@ static void s3c_camif_remove(struct platform_device *pdev)
 static int s3c_camif_runtime_resume(struct device *dev)
 {
 	struct camif_dev *camif = dev_get_drvdata(dev);
+	int ret;
+
+	ret = clk_enable(camif->clock[CLK_GATE]);
+	if (ret)
+		return ret;
 
-	clk_enable(camif->clock[CLK_GATE]);
 	/* null op on s3c244x */
-	clk_enable(camif->clock[CLK_CAM]);
+	ret = clk_enable(camif->clock[CLK_CAM]);
+	if (ret) {
+		clk_disable(camif->clock[CLK_GATE]);
+		return ret;
+	}
+
 	return 0;
 }
 
-- 
2.25.1


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

* [PATCH 2/2] media: camif-core: Add check for clk_enable()
@ 2024-11-22 22:13 Jiasheng Jiang
  2024-11-23 16:00 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 11+ messages in thread
From: Jiasheng Jiang @ 2024-11-22 22:13 UTC (permalink / raw)
  To: krzk
  Cc: sylvester.nawrocki, mchehab, dron0gus, tomasz.figa, alim.akhtar,
	kyungmin.park, laurent.pinchart, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, Jiasheng Jiang

Add check for the return value of clk_enable() to gurantee the success.

Fixes: babde1c243b2 ("[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
---
 .../media/platform/samsung/s3c-camif/camif-core.c   | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/samsung/s3c-camif/camif-core.c b/drivers/media/platform/samsung/s3c-camif/camif-core.c
index de6e8f151849..221e3c447f36 100644
--- a/drivers/media/platform/samsung/s3c-camif/camif-core.c
+++ b/drivers/media/platform/samsung/s3c-camif/camif-core.c
@@ -527,10 +527,19 @@ static void s3c_camif_remove(struct platform_device *pdev)
 static int s3c_camif_runtime_resume(struct device *dev)
 {
 	struct camif_dev *camif = dev_get_drvdata(dev);
+	int ret;
+
+	ret = clk_enable(camif->clock[CLK_GATE]);
+	if (ret)
+		return ret;
 
-	clk_enable(camif->clock[CLK_GATE]);
 	/* null op on s3c244x */
-	clk_enable(camif->clock[CLK_CAM]);
+	ret = clk_enable(camif->clock[CLK_CAM]);
+	if (ret) {
+		clk_disable(camif->clock[CLK_GATE]);
+		return ret;
+	}
+
 	return 0;
 }
 
-- 
2.25.1


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

* Re: [PATCH 2/2] media: camif-core: Add check for clk_enable()
  2024-11-22 22:13 Jiasheng Jiang
@ 2024-11-23 16:00 ` Krzysztof Kozlowski
  2024-11-23 21:29   ` Jiasheng Jiang
  0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2024-11-23 16:00 UTC (permalink / raw)
  To: Jiasheng Jiang
  Cc: sylvester.nawrocki, mchehab, dron0gus, tomasz.figa, alim.akhtar,
	kyungmin.park, laurent.pinchart, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

On 22/11/2024 23:13, Jiasheng Jiang wrote:
> Add check for the return value of clk_enable() to gurantee the success.
> 
> Fixes: babde1c243b2 ("[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface")
> Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Please version your patches correctly, e.g. use b4 or git format-patch
-vX, and add changelog in cover letter or under '---' of individual
patches describing changes from previous version.

Best regards,
Krzysztof

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

* [PATCH 2/2] media: camif-core: Add check for clk_enable()
@ 2024-11-23 21:26 Jiasheng Jiang
  2024-11-23 21:26 ` [PATCH RESEND v3 1/2] media: mipi-csis: " Jiasheng Jiang
  2024-11-24 10:50 ` [PATCH 2/2] media: camif-core: " Krzysztof Kozlowski
  0 siblings, 2 replies; 11+ messages in thread
From: Jiasheng Jiang @ 2024-11-23 21:26 UTC (permalink / raw)
  To: krzk
  Cc: sylvester.nawrocki, mchehab, dron0gus, tomasz.figa, alim.akhtar,
	kyungmin.park, laurent.pinchart, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, Jiasheng Jiang

Add check for the return value of clk_enable() to gurantee the success.

Fixes: babde1c243b2 ("[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
---
 .../media/platform/samsung/s3c-camif/camif-core.c   | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/samsung/s3c-camif/camif-core.c b/drivers/media/platform/samsung/s3c-camif/camif-core.c
index de6e8f151849..221e3c447f36 100644
--- a/drivers/media/platform/samsung/s3c-camif/camif-core.c
+++ b/drivers/media/platform/samsung/s3c-camif/camif-core.c
@@ -527,10 +527,19 @@ static void s3c_camif_remove(struct platform_device *pdev)
 static int s3c_camif_runtime_resume(struct device *dev)
 {
 	struct camif_dev *camif = dev_get_drvdata(dev);
+	int ret;
+
+	ret = clk_enable(camif->clock[CLK_GATE]);
+	if (ret)
+		return ret;
 
-	clk_enable(camif->clock[CLK_GATE]);
 	/* null op on s3c244x */
-	clk_enable(camif->clock[CLK_CAM]);
+	ret = clk_enable(camif->clock[CLK_CAM]);
+	if (ret) {
+		clk_disable(camif->clock[CLK_GATE]);
+		return ret;
+	}
+
 	return 0;
 }
 
-- 
2.25.1


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

* [PATCH RESEND v3 1/2] media: mipi-csis: Add check for clk_enable()
  2024-11-23 21:26 [PATCH 2/2] media: camif-core: Add check for clk_enable() Jiasheng Jiang
@ 2024-11-23 21:26 ` Jiasheng Jiang
  2024-11-24 10:50 ` [PATCH 2/2] media: camif-core: " Krzysztof Kozlowski
  1 sibling, 0 replies; 11+ messages in thread
From: Jiasheng Jiang @ 2024-11-23 21:26 UTC (permalink / raw)
  To: krzk
  Cc: sylvester.nawrocki, mchehab, dron0gus, tomasz.figa, alim.akhtar,
	kyungmin.park, laurent.pinchart, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, Jiasheng Jiang

Add check for the return value of clk_enable() to gurantee the success.

Fixes: b5f1220d587d ("[media] v4l: Add v4l2 subdev driver for S5P/EXYNOS4 MIPI-CSI receivers")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
---
Changelog:

v2 -> v3:

1. Correct alignment to match open parenthesis

v1 -> v2:

1. Power off the phy and disble regulators when clk_enable() fails.
2. Remove a redundant space before the label "unlock".
---
 drivers/media/platform/samsung/exynos4-is/mipi-csis.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
index 63f3eecdd7e6..452880b5350c 100644
--- a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
+++ b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
@@ -940,13 +940,19 @@ static int s5pcsis_pm_resume(struct device *dev, bool runtime)
 					       state->supplies);
 			goto unlock;
 		}
-		clk_enable(state->clock[CSIS_CLK_GATE]);
+		ret = clk_enable(state->clock[CSIS_CLK_GATE]);
+		if (ret) {
+			phy_power_off(state->phy);
+			regulator_bulk_disable(CSIS_NUM_SUPPLIES,
+					       state->supplies);
+			goto unlock;
+		}
 	}
 	if (state->flags & ST_STREAMING)
 		s5pcsis_start_stream(state);
 
 	state->flags &= ~ST_SUSPENDED;
- unlock:
+unlock:
 	mutex_unlock(&state->lock);
 	return ret ? -EAGAIN : 0;
 }
-- 
2.25.1


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

* Re: [PATCH 2/2] media: camif-core: Add check for clk_enable()
  2024-11-23 16:00 ` Krzysztof Kozlowski
@ 2024-11-23 21:29   ` Jiasheng Jiang
  0 siblings, 0 replies; 11+ messages in thread
From: Jiasheng Jiang @ 2024-11-23 21:29 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: sylvester.nawrocki, mchehab, dron0gus, tomasz.figa, alim.akhtar,
	kyungmin.park, laurent.pinchart, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

Hi Krzysztof,

On Sat, Nov 23, 2024 at 11:00 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 22/11/2024 23:13, Jiasheng Jiang wrote:
> > Add check for the return value of clk_enable() to gurantee the success.
> >
> > Fixes: babde1c243b2 ("[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface")
> > Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
> Please version your patches correctly, e.g. use b4 or git format-patch
> -vX, and add changelog in cover letter or under '---' of individual
> patches describing changes from previous version.

Thanks for your correction.
I have corrected the errors in the Changelog and resent the patch.

-Jiasheng

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

* Re: [PATCH 2/2] media: camif-core: Add check for clk_enable()
  2024-11-23 21:26 [PATCH 2/2] media: camif-core: Add check for clk_enable() Jiasheng Jiang
  2024-11-23 21:26 ` [PATCH RESEND v3 1/2] media: mipi-csis: " Jiasheng Jiang
@ 2024-11-24 10:50 ` Krzysztof Kozlowski
  2024-11-24 21:10   ` Jiasheng Jiang
  1 sibling, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2024-11-24 10:50 UTC (permalink / raw)
  To: Jiasheng Jiang
  Cc: sylvester.nawrocki, mchehab, dron0gus, tomasz.figa, alim.akhtar,
	kyungmin.park, laurent.pinchart, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

On 23/11/2024 22:26, Jiasheng Jiang wrote:
> Add check for the return value of clk_enable() to gurantee the success.
> 
> Fixes: babde1c243b2 ("[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface")
> Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
> ---
>  .../media/platform/samsung/s3c-camif/camif-core.c   | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)

Nothing improved...

Best regards,
Krzysztof

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

* Re: [PATCH 2/2] media: camif-core: Add check for clk_enable()
  2024-11-24 10:50 ` [PATCH 2/2] media: camif-core: " Krzysztof Kozlowski
@ 2024-11-24 21:10   ` Jiasheng Jiang
  2024-11-25  7:27     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 11+ messages in thread
From: Jiasheng Jiang @ 2024-11-24 21:10 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: sylvester.nawrocki, mchehab, dron0gus, tomasz.figa, alim.akhtar,
	kyungmin.park, laurent.pinchart, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

Hi Krzysztof,

On Sun, Nov 24, 2024 at 5:50 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 23/11/2024 22:26, Jiasheng Jiang wrote:
> > Add check for the return value of clk_enable() to gurantee the success.
> >
> > Fixes: babde1c243b2 ("[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface")
> > Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
> > ---
> >  .../media/platform/samsung/s3c-camif/camif-core.c   | 13 +++++++++++--
> >  1 file changed, 11 insertions(+), 2 deletions(-)
>
> Nothing improved...

Sorry for the confusion. This series consists of two patches.
Only "PATCH 1/2" has been modified, while "PATCH 2/2" remains unchanged.
As a result, there is no changelog for "PATCH 2/2".

-Jiasheng

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

* Re: [PATCH 2/2] media: camif-core: Add check for clk_enable()
  2024-11-24 21:10   ` Jiasheng Jiang
@ 2024-11-25  7:27     ` Krzysztof Kozlowski
  2024-11-25 19:19       ` Jiasheng Jiang
  0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2024-11-25  7:27 UTC (permalink / raw)
  To: Jiasheng Jiang
  Cc: sylvester.nawrocki, mchehab, dron0gus, tomasz.figa, alim.akhtar,
	kyungmin.park, laurent.pinchart, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

On 24/11/2024 22:10, Jiasheng Jiang wrote:
> Hi Krzysztof,
> 
> On Sun, Nov 24, 2024 at 5:50 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>
>> On 23/11/2024 22:26, Jiasheng Jiang wrote:
>>> Add check for the return value of clk_enable() to gurantee the success.
>>>
>>> Fixes: babde1c243b2 ("[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface")
>>> Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
>>> ---
>>>  .../media/platform/samsung/s3c-camif/camif-core.c   | 13 +++++++++++--
>>>  1 file changed, 11 insertions(+), 2 deletions(-)
>>
>> Nothing improved...
> 
> Sorry for the confusion. This series consists of two patches.
> Only "PATCH 1/2" has been modified, while "PATCH 2/2" remains unchanged.
> As a result, there is no changelog for "PATCH 2/2".
It is not correctly versioned. Version is per entire patchset, simply
use b4 (or look how any other patchset is done via lore.kernel.org).

Best regards,
Krzysztof

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

* Re: [PATCH 2/2] media: camif-core: Add check for clk_enable()
  2024-11-25  7:27     ` Krzysztof Kozlowski
@ 2024-11-25 19:19       ` Jiasheng Jiang
  0 siblings, 0 replies; 11+ messages in thread
From: Jiasheng Jiang @ 2024-11-25 19:19 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: sylvester.nawrocki, mchehab, dron0gus, tomasz.figa, alim.akhtar,
	kyungmin.park, laurent.pinchart, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

Hi Krzysztof,

On Mon, Nov 25, 2024 at 2:27 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 24/11/2024 22:10, Jiasheng Jiang wrote:
> > Hi Krzysztof,
> >
> > On Sun, Nov 24, 2024 at 5:50 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> >>
> >> On 23/11/2024 22:26, Jiasheng Jiang wrote:
> >>> Add check for the return value of clk_enable() to gurantee the success.
> >>>
> >>> Fixes: babde1c243b2 ("[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface")
> >>> Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
> >>> ---
> >>>  .../media/platform/samsung/s3c-camif/camif-core.c   | 13 +++++++++++--
> >>>  1 file changed, 11 insertions(+), 2 deletions(-)
> >>
> >> Nothing improved...
> >
> > Sorry for the confusion. This series consists of two patches.
> > Only "PATCH 1/2" has been modified, while "PATCH 2/2" remains unchanged.
> > As a result, there is no changelog for "PATCH 2/2".
> It is not correctly versioned. Version is per entire patchset, simply
> use b4 (or look how any other patchset is done via lore.kernel.org).

Thank you very much.
I have correctly versioned and resend the v3 patches.

-Jiasheng

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

end of thread, other threads:[~2024-11-25 19:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-23 21:26 [PATCH 2/2] media: camif-core: Add check for clk_enable() Jiasheng Jiang
2024-11-23 21:26 ` [PATCH RESEND v3 1/2] media: mipi-csis: " Jiasheng Jiang
2024-11-24 10:50 ` [PATCH 2/2] media: camif-core: " Krzysztof Kozlowski
2024-11-24 21:10   ` Jiasheng Jiang
2024-11-25  7:27     ` Krzysztof Kozlowski
2024-11-25 19:19       ` Jiasheng Jiang
  -- strict thread matches above, loose matches on Subject: below --
2024-11-22 22:13 Jiasheng Jiang
2024-11-23 16:00 ` Krzysztof Kozlowski
2024-11-23 21:29   ` Jiasheng Jiang
2024-11-22 19:53 Jiasheng Jiang
2024-11-21 21:05 Jiasheng Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox