Skip to contentSkip to conversation

i.MX27: Fix emma-prp clocks in mx2_camera.c

PATCH Superseded Javier Martin 4 participants 12 messages Jul 6, 2012 – Jul 23, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 i.MX27: Fix emma-prp clocks in mx2_camera.c

This driver wasn't converted to the new clock changes (clk_prepare_enable/clk_disable_unprepare). Also naming of emma-prp related clocks for the i.MX27 was not correct.
---
Enable clocks only for i.MX27.

---
 arch/arm/mach-imx/clk-imx27.c    |    8 +++--
 drivers/media/video/mx2_camera.c |   67 ++++++++++++++++++++++----------------
 2 files changed, 44 insertions(+), 31 deletions(-)
arch/arm/mach-imx/clk-imx27.c +5 -3
index 295cbd7..373c8fd 100644
@@ -223,7 +223,7 @@ int __init mx27_clocks_init(unsigned long fref)
 	clk_register_clkdev(clk[per3_gate], "per", "imx-fb.0");
 	clk_register_clkdev(clk[lcdc_ipg_gate], "ipg", "imx-fb.0");
 	clk_register_clkdev(clk[lcdc_ahb_gate], "ahb", "imx-fb.0");
-	clk_register_clkdev(clk[csi_ahb_gate], NULL, "mx2-camera.0");
+	clk_register_clkdev(clk[csi_ahb_gate], "ahb", "mx2-camera.0");
 	clk_register_clkdev(clk[usb_div], "per", "fsl-usb2-udc");
 	clk_register_clkdev(clk[usb_ipg_gate], "ipg", "fsl-usb2-udc");
 	clk_register_clkdev(clk[usb_ahb_gate], "ahb", "fsl-usb2-udc");
@@ -250,8 +250,10 @@ int __init mx27_clocks_init(unsigned long fref)
 	clk_register_clkdev(clk[i2c2_ipg_gate], NULL, "imx-i2c.1");
 	clk_register_clkdev(clk[owire_ipg_gate], NULL, "mxc_w1.0");
 	clk_register_clkdev(clk[kpp_ipg_gate], NULL, "imx-keypad");
-	clk_register_clkdev(clk[emma_ahb_gate], "ahb", "imx-emma");
-	clk_register_clkdev(clk[emma_ipg_gate], "ipg", "imx-emma");
+	clk_register_clkdev(clk[emma_ahb_gate], "emma-ahb", "mx2-camera.0");
+	clk_register_clkdev(clk[emma_ipg_gate], "emma-ipg", "mx2-camera.0");
+	clk_register_clkdev(clk[emma_ahb_gate], "ahb", "m2m-emmaprp.0");
+	clk_register_clkdev(clk[emma_ipg_gate], "ipg", "m2m-emmaprp.0");
 	clk_register_clkdev(clk[iim_ipg_gate], "iim", NULL);
 	clk_register_clkdev(clk[gpio_ipg_gate], "gpio", NULL);
 	clk_register_clkdev(clk[brom_ahb_gate], "brom", NULL);
drivers/media/video/mx2_camera.c +39 -28

132 lines not on this page · raw message

Signature · 1 line
1.7.9.5
maintainer
#1 lore raw

PATCH v3 1/1 i.MX27: Fix emma-prp clocks in mx2_camera.c

Quoted 6 lines · Javier Martin

This driver wasn't converted to the new clock changes (clk_prepare_enable/clk_disable_unprepare). Also naming of emma-prp related clocks for the i.MX27 was not correct.
---
Enable clocks only for i.MX27.

Indeed,

drivers/media/video/mx2_camera.c static int __devinit mx2_camera_probe(struct platform_device *pdev) · line 1670

Quoted 13 lines
drivers/media/video/mx2_camera.c +7 -5
-	pcdev->clk_csi = clk_get(&pdev->dev, NULL);
-	if (IS_ERR(pcdev->clk_csi)) {
-		dev_err(&pdev->dev, "Could not get csi clock\n");
-		err = PTR_ERR(pcdev->clk_csi);
-		goto exit_kfree;
+	if (cpu_is_mx27()) {
+		pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
+		if (IS_ERR(pcdev->clk_csi)) {
+			dev_err(&pdev->dev, "Could not get csi clock\n");
+			err = PTR_ERR(pcdev->clk_csi);
+			goto exit_kfree;
+		}

but why? Now the i.MX25 won't get a clock anymore.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#2 lore raw

PATCH v3 1/1 i.MX27: Fix emma-prp clocks in mx2_camera.c

Quoted 24 lines · Sascha Hauer
Quoted 6 lines · Javier Martin

This driver wasn't converted to the new clock changes (clk_prepare_enable/clk_disable_unprepare). Also naming of emma-prp related clocks for the i.MX27 was not correct.
---
Enable clocks only for i.MX27.

Indeed,

drivers/media/video/mx2_camera.c static int __devinit mx2_camera_probe(struct platform_device *pdev) · line 1670

Quoted 13 lines
drivers/media/video/mx2_camera.c +7 -5
-     pcdev->clk_csi = clk_get(&pdev->dev, NULL);
-     if (IS_ERR(pcdev->clk_csi)) {
-             dev_err(&pdev->dev, "Could not get csi clock\n");
-             err = PTR_ERR(pcdev->clk_csi);
-             goto exit_kfree;
+     if (cpu_is_mx27()) {
+             pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
+             if (IS_ERR(pcdev->clk_csi)) {
+                     dev_err(&pdev->dev, "Could not get csi clock\n");
+                     err = PTR_ERR(pcdev->clk_csi);
+                     goto exit_kfree;
+             }
Quoted 1 line

but why? Now the i.MX25 won't get a clock anymore.

What are the clocks needed by i.MX25? csi only?

By the way, is anybody using this driver with i.MX25?

Signature · 7 lines
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
maintainer
#3 lore raw

PATCH v3 1/1 i.MX27: Fix emma-prp clocks in mx2_camera.c

Quoted 25 lines · javier Martin
Quoted 24 lines · Sascha Hauer
Quoted 6 lines · Javier Martin

This driver wasn't converted to the new clock changes (clk_prepare_enable/clk_disable_unprepare). Also naming of emma-prp related clocks for the i.MX27 was not correct.
---
Enable clocks only for i.MX27.

Indeed,

Quoted 13 lines
drivers/media/video/mx2_camera.c +7 -5
-     pcdev->clk_csi = clk_get(&pdev->dev, NULL);
-     if (IS_ERR(pcdev->clk_csi)) {
-             dev_err(&pdev->dev, "Could not get csi clock\n");
-             err = PTR_ERR(pcdev->clk_csi);
-             goto exit_kfree;
+     if (cpu_is_mx27()) {
+             pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
+             if (IS_ERR(pcdev->clk_csi)) {
+                     dev_err(&pdev->dev, "Could not get csi clock\n");
+                     err = PTR_ERR(pcdev->clk_csi);
+                     goto exit_kfree;
+             }
Quoted 5 lines
Quoted 1 line

but why? Now the i.MX25 won't get a clock anymore.

What are the clocks needed by i.MX25? csi only?

By the way, is anybody using this driver with i.MX25?

It seems Baruch (added to Cc) has used it on an i.MX25.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#4 lore raw

PATCH v3 1/1 i.MX27: Fix emma-prp clocks in mx2_camera.c

Quoted 26 lines · Sascha Hauer
Quoted 25 lines · javier Martin
Quoted 24 lines · Sascha Hauer
Quoted 6 lines · Javier Martin

This driver wasn't converted to the new clock changes (clk_prepare_enable/clk_disable_unprepare). Also naming of emma-prp related clocks for the i.MX27 was not correct.
---
Enable clocks only for i.MX27.

Indeed,

Quoted 13 lines
drivers/media/video/mx2_camera.c +7 -5
-     pcdev->clk_csi = clk_get(&pdev->dev, NULL);
-     if (IS_ERR(pcdev->clk_csi)) {
-             dev_err(&pdev->dev, "Could not get csi clock\n");
-             err = PTR_ERR(pcdev->clk_csi);
-             goto exit_kfree;
+     if (cpu_is_mx27()) {
+             pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
+             if (IS_ERR(pcdev->clk_csi)) {
+                     dev_err(&pdev->dev, "Could not get csi clock\n");
+                     err = PTR_ERR(pcdev->clk_csi);
+                     goto exit_kfree;
+             }
Quoted 7 lines
Quoted 5 lines
Quoted 1 line

but why? Now the i.MX25 won't get a clock anymore.

What are the clocks needed by i.MX25? csi only?

By the way, is anybody using this driver with i.MX25?

It seems Baruch (added to Cc) has used it on an i.MX25.

Baruch,
could you tell us what are the clocks needed by i.MX25?

Regards.

Signature · 7 lines
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
#5 lore raw

PATCH v3 1/1 i.MX27: Fix emma-prp clocks in mx2_camera.c

Hi Javier,

Quoted 25 lines · javier Martin
Quoted 24 lines · Sascha Hauer
Quoted 23 lines · javier Martin
Quoted 22 lines · Sascha Hauer
Quoted 5 lines · Javier Martin

This driver wasn't converted to the new clock changes (clk_prepare_enable/clk_disable_unprepare). Also naming of emma-prp related clocks for the i.MX27 was not correct.
---
Enable clocks only for i.MX27.

Indeed,

Quoted 12 lines
drivers/media/video/mx2_camera.c +7 -5
-     pcdev->clk_csi = clk_get(&pdev->dev, NULL);
-     if (IS_ERR(pcdev->clk_csi)) {
-             dev_err(&pdev->dev, "Could not get csi clock\n");
-             err = PTR_ERR(pcdev->clk_csi);
-             goto exit_kfree;
+     if (cpu_is_mx27()) {
+             pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
+             if (IS_ERR(pcdev->clk_csi)) {
+                     dev_err(&pdev->dev, "Could not get csi clock\n");
+                     err = PTR_ERR(pcdev->clk_csi);
+                     goto exit_kfree;
+             }
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
Quoted 1 line

but why? Now the i.MX25 won't get a clock anymore.

What are the clocks needed by i.MX25? csi only?

By the way, is anybody using this driver with i.MX25?

It seems Baruch (added to Cc) has used it on an i.MX25.

could you tell us what are the clocks needed by i.MX25?

According to the code the csi clock is sufficient for i.MX25. Unfortunately I don't have access to a running system anymore, so I can't test current code.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
maintainer
#6 lore raw

PATCH v3 1/1 i.MX27: Fix emma-prp clocks in mx2_camera.c

In reply to javier Martin
Quoted 29 lines · javier Martin
Quoted 28 lines · Sascha Hauer
Quoted 27 lines · javier Martin
Quoted 25 lines · Sascha Hauer
Quoted 6 lines · Javier Martin

This driver wasn't converted to the new clock changes (clk_prepare_enable/clk_disable_unprepare). Also naming of emma-prp related clocks for the i.MX27 was not correct.
---
Enable clocks only for i.MX27.

Indeed,

drivers/media/video/mx2_camera.c static int __devinit mx2_camera_probe(struct platform_device *pdev) · line 1670

Quoted 13 lines
drivers/media/video/mx2_camera.c +7 -5
-     pcdev->clk_csi = clk_get(&pdev->dev, NULL);
-     if (IS_ERR(pcdev->clk_csi)) {
-             dev_err(&pdev->dev, "Could not get csi clock\n");
-             err = PTR_ERR(pcdev->clk_csi);
-             goto exit_kfree;
+     if (cpu_is_mx27()) {
+             pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
+             if (IS_ERR(pcdev->clk_csi)) {
+                     dev_err(&pdev->dev, "Could not get csi clock\n");
+                     err = PTR_ERR(pcdev->clk_csi);
+                     goto exit_kfree;
+             }

but why? Now the i.MX25 won't get a clock anymore.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

What are the clocks needed by i.MX25? csi only?

By the way, is anybody using this driver with i.MX25?

It seems Baruch (added to Cc) has used it on an i.MX25.

Baruch,
could you tell us what are the clocks needed by i.MX25?

I just had a look and the i.MX25 it needs three clocks: ipg, ahb and peripheral clock. So this is broken anyway and should probably be fixed seperately, that is:

- provide dummy clocks for the csi clocks on i.MX27
- clk_get ipg, ahb and peripheral clocks on all SoCs
- clk_get emma clocks on i.MX27 only

As said, this is a separate topic, so your original patch should be fine for now.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#7 lore raw

PATCH v3 1/1 i.MX27: Fix emma-prp clocks in mx2_camera.c

Quoted 43 lines · Sascha Hauer
Quoted 29 lines · javier Martin
Quoted 28 lines · Sascha Hauer
Quoted 27 lines · javier Martin
Quoted 25 lines · Sascha Hauer
Quoted 6 lines · Javier Martin

This driver wasn't converted to the new clock changes (clk_prepare_enable/clk_disable_unprepare). Also naming of emma-prp related clocks for the i.MX27 was not correct.
---
Enable clocks only for i.MX27.

Indeed,

drivers/media/video/mx2_camera.c static int __devinit mx2_camera_probe(struct platform_device *pdev) · line 1670

Quoted 13 lines
drivers/media/video/mx2_camera.c +7 -5
-     pcdev->clk_csi = clk_get(&pdev->dev, NULL);
-     if (IS_ERR(pcdev->clk_csi)) {
-             dev_err(&pdev->dev, "Could not get csi clock\n");
-             err = PTR_ERR(pcdev->clk_csi);
-             goto exit_kfree;
+     if (cpu_is_mx27()) {
+             pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
+             if (IS_ERR(pcdev->clk_csi)) {
+                     dev_err(&pdev->dev, "Could not get csi clock\n");
+                     err = PTR_ERR(pcdev->clk_csi);
+                     goto exit_kfree;
+             }

but why? Now the i.MX25 won't get a clock anymore.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

What are the clocks needed by i.MX25? csi only?

By the way, is anybody using this driver with i.MX25?

It seems Baruch (added to Cc) has used it on an i.MX25.

Baruch,
could you tell us what are the clocks needed by i.MX25?

I just had a look and the i.MX25 it needs three clocks: ipg, ahb and peripheral clock. So this is broken anyway and should probably be fixed seperately, that is:

Quoted 6 lines

- provide dummy clocks for the csi clocks on i.MX27
- clk_get ipg, ahb and peripheral clocks on all SoCs
- clk_get emma clocks on i.MX27 only

As said, this is a separate topic, so your original patch should be fine for now.

OK, thanks for your interest.

Regards.

Signature · 7 lines
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
#8 lore raw

PATCH v3 1/1 i.MX27: Fix emma-prp clocks in mx2_camera.c

Hi Javier

Thanks for the patch

Quoted 44 lines · javier Martin
Quoted 43 lines · Sascha Hauer
Quoted 29 lines · javier Martin
Quoted 28 lines · Sascha Hauer
Quoted 27 lines · javier Martin
Quoted 25 lines · Sascha Hauer
Quoted 6 lines · Javier Martin

This driver wasn't converted to the new clock changes (clk_prepare_enable/clk_disable_unprepare). Also naming of emma-prp related clocks for the i.MX27 was not correct.
---
Enable clocks only for i.MX27.

Indeed,

Review

Quoted 13 lines
(quoted diff) +7 -5
-     pcdev->clk_csi = clk_get(&pdev->dev, NULL);
-     if (IS_ERR(pcdev->clk_csi)) {
-             dev_err(&pdev->dev, "Could not get csi clock\n");
-             err = PTR_ERR(pcdev->clk_csi);
-             goto exit_kfree;
+     if (cpu_is_mx27()) {
+             pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
+             if (IS_ERR(pcdev->clk_csi)) {
+                     dev_err(&pdev->dev, "Could not get csi clock\n");
+                     err = PTR_ERR(pcdev->clk_csi);
+                     goto exit_kfree;
+             }

but why? Now the i.MX25 won't get a clock anymore.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

What are the clocks needed by i.MX25? csi only?

By the way, is anybody using this driver with i.MX25?

It seems Baruch (added to Cc) has used it on an i.MX25.

Baruch,
could you tell us what are the clocks needed by i.MX25?

I just had a look and the i.MX25 it needs three clocks: ipg, ahb and peripheral clock. So this is broken anyway and should probably be fixed seperately, that is:

Quoted 6 lines
Quoted 6 lines

- provide dummy clocks for the csi clocks on i.MX27
- clk_get ipg, ahb and peripheral clocks on all SoCs
- clk_get emma clocks on i.MX27 only

As said, this is a separate topic, so your original patch should be fine for now.

Well, sorry, but I don't think I can share this.

1. it touches two areas - arch/ and drivers/ which isn?t a good thing and should be avoided wherever possible
2. it addresses several problems: (a) missing name for "ahb" camera clock,
(b) wrong device and connection names for emma clocks, (c) missing _(un)prepare suffixes in clock API
3. it makes a possibly broken i.MX25 even more broken

IIUC, mx2-camera is broken on i.MX27 in current next because of wrong clock entries, right? So, we don't have to be bothered not to break bisection - it is already broken. Then we can clean up the problems separately under arch/ and drivers/.

So, would it be possible to split this into 3 parts:

(a) arch - fix clocks
(b) media - fix clocks on i.MX27 _without_ breaking it even further on i.MX25. If we think i.MX25 support is already broken, let's schedule its removal and remove properly, or add BROKEN to Kconfig, when built on i.MX25. In your patch this would mean just adding an "else" to your "if (cpu_is_mx27())" statement and moving the current clk_get() there
(c) add _(un)prepare.

Since these are fixes, I won't wait too long for these. If you don't resubmit them today, they'll go in after 3.6-rc1.

Thanks
Guennadi

Quoted 12 lines

OK, thanks for your interest.

Regards.

Signature · 7 lines
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

#9 lore raw

PATCH v3 1/1 i.MX27: Fix emma-prp clocks in mx2_camera.c

Quoted 81 lines · Guennadi Liakhovetski

Hi Javier

Thanks for the patch

Quoted 44 lines · javier Martin
Quoted 43 lines · Sascha Hauer
Quoted 29 lines · javier Martin
Quoted 28 lines · Sascha Hauer
Quoted 27 lines · javier Martin
Quoted 25 lines · Sascha Hauer
Quoted 6 lines · Javier Martin

This driver wasn't converted to the new clock changes (clk_prepare_enable/clk_disable_unprepare). Also naming of emma-prp related clocks for the i.MX27 was not correct.
---
Enable clocks only for i.MX27.

Indeed,

Review

Quoted 13 lines
(quoted diff) +7 -5
-     pcdev->clk_csi = clk_get(&pdev->dev, NULL);
-     if (IS_ERR(pcdev->clk_csi)) {
-             dev_err(&pdev->dev, "Could not get csi clock\n");
-             err = PTR_ERR(pcdev->clk_csi);
-             goto exit_kfree;
+     if (cpu_is_mx27()) {
+             pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
+             if (IS_ERR(pcdev->clk_csi)) {
+                     dev_err(&pdev->dev, "Could not get csi clock\n");
+                     err = PTR_ERR(pcdev->clk_csi);
+                     goto exit_kfree;
+             }

but why? Now the i.MX25 won't get a clock anymore.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

What are the clocks needed by i.MX25? csi only?

By the way, is anybody using this driver with i.MX25?

It seems Baruch (added to Cc) has used it on an i.MX25.

Baruch,
could you tell us what are the clocks needed by i.MX25?

I just had a look and the i.MX25 it needs three clocks: ipg, ahb and peripheral clock. So this is broken anyway and should probably be fixed seperately, that is:

Quoted 6 lines
Quoted 6 lines

- provide dummy clocks for the csi clocks on i.MX27
- clk_get ipg, ahb and peripheral clocks on all SoCs
- clk_get emma clocks on i.MX27 only

As said, this is a separate topic, so your original patch should be fine for now.

Well, sorry, but I don't think I can share this.

1. it touches two areas - arch/ and drivers/ which isn?t a good thing and should be avoided wherever possible
2. it addresses several problems: (a) missing name for "ahb" camera clock,
(b) wrong device and connection names for emma clocks, (c) missing _(un)prepare suffixes in clock API
3. it makes a possibly broken i.MX25 even more broken

IIUC, mx2-camera is broken on i.MX27 in current next because of wrong clock entries, right? So, we don't have to be bothered not to break bisection - it is already broken. Then we can clean up the problems separately under arch/ and drivers/.

So, would it be possible to split this into 3 parts:

(a) arch - fix clocks
(b) media - fix clocks on i.MX27 _without_ breaking it even further on i.MX25. If we think i.MX25 support is already broken, let's schedule its removal and remove properly, or add BROKEN to Kconfig, when built on i.MX25. In your patch this would mean just adding an "else" to your "if (cpu_is_mx27())" statement and moving the current clk_get() there
(c) add _(un)prepare.

Quoted 19 lines

Since these are fixes, I won't wait too long for these. If you don't resubmit them today, they'll go in after 3.6-rc1.

Thanks
Guennadi

Quoted 12 lines

OK, thanks for your interest.

Regards.
--
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com

Hi Guennadi,
thanks for your review.

I could agree with some of your reasons for not accepting this patch. Specially (1) and (2).
As regards of reason (3), i.MX25 has been broken for months and I refuse that a broken chip that no known board in the mainline uses is constantly slowing the development process.

Furthermore, I sent v3 of this patch 11 days ago. I know you are a busy developer but, honestly, it doesn't seem fair that, having sent the patch with plenty of time I am now given only this little time to fix it. I'm out of the office right now and I won't come back until monday. Couldn't you either make an exception and accept the path or give me until monday in the morning to send the new version?

Alternatively, Sascha, Fabio or any other i.MX27 user could send it too if they have the time.

Otherwise, as you stated it'll have to wait to 3.6-rc1. So 3.5 will be broken for i.MX27.

Regards.

Signature · 7 lines
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
#10 lore raw

PATCH v3 1/1 i.MX27: Fix emma-prp clocks in mx2_camera.c

Quoted 118 lines · javier Martin
Quoted 81 lines · Guennadi Liakhovetski

Hi Javier

Thanks for the patch

Quoted 44 lines · javier Martin
Quoted 43 lines · Sascha Hauer
Quoted 29 lines · javier Martin
Quoted 28 lines · Sascha Hauer
Quoted 27 lines · javier Martin
Quoted 25 lines · Sascha Hauer
Quoted 6 lines · Javier Martin

This driver wasn't converted to the new clock changes (clk_prepare_enable/clk_disable_unprepare). Also naming of emma-prp related clocks for the i.MX27 was not correct.
---
Enable clocks only for i.MX27.

Indeed,

Review

Quoted 13 lines
(quoted diff) +7 -5
-     pcdev->clk_csi = clk_get(&pdev->dev, NULL);
-     if (IS_ERR(pcdev->clk_csi)) {
-             dev_err(&pdev->dev, "Could not get csi clock\n");
-             err = PTR_ERR(pcdev->clk_csi);
-             goto exit_kfree;
+     if (cpu_is_mx27()) {
+             pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
+             if (IS_ERR(pcdev->clk_csi)) {
+                     dev_err(&pdev->dev, "Could not get csi clock\n");
+                     err = PTR_ERR(pcdev->clk_csi);
+                     goto exit_kfree;
+             }

but why? Now the i.MX25 won't get a clock anymore.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

What are the clocks needed by i.MX25? csi only?

By the way, is anybody using this driver with i.MX25?

It seems Baruch (added to Cc) has used it on an i.MX25.

Baruch,
could you tell us what are the clocks needed by i.MX25?

I just had a look and the i.MX25 it needs three clocks: ipg, ahb and peripheral clock. So this is broken anyway and should probably be fixed seperately, that is:

Quoted 6 lines
Quoted 6 lines

- provide dummy clocks for the csi clocks on i.MX27
- clk_get ipg, ahb and peripheral clocks on all SoCs
- clk_get emma clocks on i.MX27 only

As said, this is a separate topic, so your original patch should be fine for now.

Well, sorry, but I don't think I can share this.

1. it touches two areas - arch/ and drivers/ which isn?t a good thing and should be avoided wherever possible
2. it addresses several problems: (a) missing name for "ahb" camera clock,
(b) wrong device and connection names for emma clocks, (c) missing _(un)prepare suffixes in clock API
3. it makes a possibly broken i.MX25 even more broken

IIUC, mx2-camera is broken on i.MX27 in current next because of wrong clock entries, right? So, we don't have to be bothered not to break bisection - it is already broken. Then we can clean up the problems separately under arch/ and drivers/.

So, would it be possible to split this into 3 parts:

(a) arch - fix clocks
(b) media - fix clocks on i.MX27 _without_ breaking it even further on i.MX25. If we think i.MX25 support is already broken, let's schedule its removal and remove properly, or add BROKEN to Kconfig, when built on i.MX25. In your patch this would mean just adding an "else" to your "if (cpu_is_mx27())" statement and moving the current clk_get() there
(c) add _(un)prepare.

Quoted 19 lines

Since these are fixes, I won't wait too long for these. If you don't resubmit them today, they'll go in after 3.6-rc1.

Thanks
Guennadi

Quoted 12 lines

OK, thanks for your interest.

Regards.
--
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com

Hi Guennadi,
thanks for your review.

I could agree with some of your reasons for not accepting this patch. Specially (1) and (2).
As regards of reason (3), i.MX25 has been broken for months and I refuse that a broken chip that no known board in the mainline uses is constantly slowing the development process.

Furthermore, I sent v3 of this patch 11 days ago. I know you are a busy developer but, honestly, it doesn't seem fair that, having sent the patch with plenty of time I am now given only this little time to fix it. I'm out of the office right now and I won't come back until monday. Couldn't you either make an exception and accept the path or give me until monday in the morning to send the new version?

Quoted 5 lines

Alternatively, Sascha, Fabio or any other i.MX27 user could send it too if they have the time.

Otherwise, as you stated it'll have to wait to 3.6-rc1. So 3.5 will be broken for i.MX27.

Sorry, now I'm totally lost. Are you saying, that this fix is needed for 3.5??? Huh, nice...

commit e038ed50a4a767add205094c035b6943e7b30140

Author: Sascha Hauer <[email protected]>
Date:   Fri Mar 9 09:11:46 2012 +0100

ARM i.MX27: implement clocks using common clock framework

appeared in 3.5-rc4 and broke stuff... Cool. I don't think it was mentioned in this patch, that it is for 3.5, was it? So, I naturally assumed it was for 3.6. Nice.

So, if I am right, and it'd that patch that broke mx2-camera, my _firm_ conviction is, that now days before 3.5 is released, the only right way to fix it is to fix _that_ regression and that regression only. I.e., we need a patch _only_ to fix clk-imx27.c. For which I anyway cannot help you.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

#11 lore raw

PATCH v3 1/1 i.MX27: Fix emma-prp clocks in mx2_camera.c

Quoted 130 lines · Guennadi Liakhovetski
Quoted 118 lines · javier Martin
Quoted 81 lines · Guennadi Liakhovetski

Hi Javier

Thanks for the patch

Quoted 44 lines · javier Martin
Quoted 43 lines · Sascha Hauer
Quoted 29 lines · javier Martin
Quoted 28 lines · Sascha Hauer
Quoted 27 lines · javier Martin
Quoted 25 lines · Sascha Hauer
Quoted 6 lines · Javier Martin

This driver wasn't converted to the new clock changes (clk_prepare_enable/clk_disable_unprepare). Also naming of emma-prp related clocks for the i.MX27 was not correct.
---
Enable clocks only for i.MX27.

Indeed,

Review

Quoted 13 lines
(quoted diff) +7 -5
-     pcdev->clk_csi = clk_get(&pdev->dev, NULL);
-     if (IS_ERR(pcdev->clk_csi)) {
-             dev_err(&pdev->dev, "Could not get csi clock\n");
-             err = PTR_ERR(pcdev->clk_csi);
-             goto exit_kfree;
+     if (cpu_is_mx27()) {
+             pcdev->clk_csi = devm_clk_get(&pdev->dev, "ahb");
+             if (IS_ERR(pcdev->clk_csi)) {
+                     dev_err(&pdev->dev, "Could not get csi clock\n");
+                     err = PTR_ERR(pcdev->clk_csi);
+                     goto exit_kfree;
+             }

but why? Now the i.MX25 won't get a clock anymore.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

What are the clocks needed by i.MX25? csi only?

By the way, is anybody using this driver with i.MX25?

It seems Baruch (added to Cc) has used it on an i.MX25.

Baruch,
could you tell us what are the clocks needed by i.MX25?

I just had a look and the i.MX25 it needs three clocks: ipg, ahb and peripheral clock. So this is broken anyway and should probably be fixed seperately, that is:

Quoted 6 lines
Quoted 6 lines

- provide dummy clocks for the csi clocks on i.MX27
- clk_get ipg, ahb and peripheral clocks on all SoCs
- clk_get emma clocks on i.MX27 only

As said, this is a separate topic, so your original patch should be fine for now.

Well, sorry, but I don't think I can share this.

1. it touches two areas - arch/ and drivers/ which isn?t a good thing and should be avoided wherever possible
2. it addresses several problems: (a) missing name for "ahb" camera clock,
(b) wrong device and connection names for emma clocks, (c) missing _(un)prepare suffixes in clock API
3. it makes a possibly broken i.MX25 even more broken

IIUC, mx2-camera is broken on i.MX27 in current next because of wrong clock entries, right? So, we don't have to be bothered not to break bisection - it is already broken. Then we can clean up the problems separately under arch/ and drivers/.

So, would it be possible to split this into 3 parts:

(a) arch - fix clocks
(b) media - fix clocks on i.MX27 _without_ breaking it even further on i.MX25. If we think i.MX25 support is already broken, let's schedule its removal and remove properly, or add BROKEN to Kconfig, when built on i.MX25. In your patch this would mean just adding an "else" to your "if (cpu_is_mx27())" statement and moving the current clk_get() there
(c) add _(un)prepare.

Quoted 19 lines

Since these are fixes, I won't wait too long for these. If you don't resubmit them today, they'll go in after 3.6-rc1.

Thanks
Guennadi

Quoted 12 lines

OK, thanks for your interest.

Regards.
--
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com

Hi Guennadi,
thanks for your review.

I could agree with some of your reasons for not accepting this patch. Specially (1) and (2).
As regards of reason (3), i.MX25 has been broken for months and I refuse that a broken chip that no known board in the mainline uses is constantly slowing the development process.

Furthermore, I sent v3 of this patch 11 days ago. I know you are a busy developer but, honestly, it doesn't seem fair that, having sent the patch with plenty of time I am now given only this little time to fix it. I'm out of the office right now and I won't come back until monday. Couldn't you either make an exception and accept the path or give me until monday in the morning to send the new version?

Quoted 5 lines

Alternatively, Sascha, Fabio or any other i.MX27 user could send it too if they have the time.

Otherwise, as you stated it'll have to wait to 3.6-rc1. So 3.5 will be broken for i.MX27.

Sorry, now I'm totally lost. Are you saying, that this fix is needed for 3.5??? Huh, nice...

commit e038ed50a4a767add205094c035b6943e7b30140

Quoted 8 lines
Author: Sascha Hauer <[email protected]>
Date:   Fri Mar 9 09:11:46 2012 +0100

ARM i.MX27: implement clocks using common clock framework

appeared in 3.5-rc4 and broke stuff... Cool. I don't think it was mentioned in this patch, that it is for 3.5, was it? So, I naturally assumed it was for 3.6. Nice.

Sorry, I thought that being named as a fix it was clear that this patch was meant for 3.5. This is my fault.

Quoted 4 lines

So, if I am right, and it'd that patch that broke mx2-camera, my _firm_ conviction is, that now days before 3.5 is released, the only right way to fix it is to fix _that_ regression and that regression only. I.e., we need a patch _only_ to fix clk-imx27.c. For which I anyway cannot help you.

Ok. Now the fact is that 3.5 is out and it's broken for i.MX27. Now, what is the way to proceed?

Should Sascha revert his patch or should I split mine as Guennadi requested?

Regards.

Signature · 7 lines
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com