Re: [PATCH v2] i2c: rcar: make sure clocks are on when doing hw init

2015-10-30 Thread Wolfram Sang

> First of all, I got one kernel panic.

:( I am starting to think i should revert my last i2c-rcar series until
these issues are gone...

> I have also seen different errors:
> 
> [1.177690] i2c-rcar e653.i2c: error -16 : 0
> [1.182534] adv7511: probe of 2-0039 failed with error -16
> [1.188293] i2c-rcar e653.i2c: probed
> 
> -110 occurred as well.

I'd think you always get a -110 somewhere and all later accesses to
the bus will return -16. The bus is stalled.

> This occurred when rebooting the board by pressing the reset button, and if I 

I use the reset button quite frequently, too.

> remember correctly moving from renesas-devel-20151013v2-v4.3-rc5 to renesas-
> devel-20151026-v4.3-rc7. Even though it occurred several times in a row I 
> can't seem to reproduce this issue now I'm afraid.

Darn...



signature.asc
Description: Digital signature


Re: [PATCH v2] i2c: rcar: make sure clocks are on when doing hw init

2015-10-30 Thread Geert Uytterhoeven
Hi Laurent,

On Fri, Oct 30, 2015 at 5:35 AM, Laurent Pinchart
 wrote:
> [9.641533] Unable to handle kernel paging request at virtual address
> 
> [9.648927] pgd = eb2adf40
> [9.651695] [] *pgd=8040007003, *pmd=6bfde003, *pte=
> [9.658579] Internal error: Oops: a07 [#1] SMP ARM
> [9.663475] Modules linked in: rcar_thermal adv7180(+) phy_rcar_gen2
> soundcore udc_core
> [9.671719] CPU: 0 PID: 552 Comm: udevd Not tainted 4.3.0-rc7-07332-
> gfb990fd3ff96 #114
> [9.679811] Hardware name: Generic R8A7791 (Flattened Device Tree)
> [9.686125] task: eb11f400 ti: ea92e000 task.ti: ea92e000
> [9.691653] PC is at rcar_i2c_irq+0xd4/0x3e4
> [9.696018] LR is at rcar_i2c_write+0x28/0x38
> [9.700471] pc : []lr : []psr: 8193

> This only occurred once, I don't know how to reproduce it.

Do you still have the kernel binary, so you can see where exactly the crash
happened?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] i2c: rcar: make sure clocks are on when doing hw init

2015-10-30 Thread Laurent Pinchart
Hi Geert,

On Friday 30 October 2015 09:16:40 Geert Uytterhoeven wrote:
> On Fri, Oct 30, 2015 at 5:35 AM, Laurent Pinchart wrote:
> > [9.641533] Unable to handle kernel paging request at virtual address
> > 
> > [9.648927] pgd = eb2adf40
> > [9.651695] [] *pgd=8040007003, *pmd=6bfde003,
> > *pte=
> > [9.658579] Internal error: Oops: a07 [#1] SMP ARM
> > [9.663475] Modules linked in: rcar_thermal adv7180(+) phy_rcar_gen2
> > soundcore udc_core
> > [9.671719] CPU: 0 PID: 552 Comm: udevd Not tainted 4.3.0-rc7-07332-
> > gfb990fd3ff96 #114
> > [9.679811] Hardware name: Generic R8A7791 (Flattened Device Tree)
> > [9.686125] task: eb11f400 ti: ea92e000 task.ti: ea92e000
> > [9.691653] PC is at rcar_i2c_irq+0xd4/0x3e4
> > [9.696018] LR is at rcar_i2c_write+0x28/0x38
> > [9.700471] pc : []lr : []psr: 8193
> > 
> > This only occurred once, I don't know how to reproduce it.
> 
> Do you still have the kernel binary, so you can see where exactly the crash
> happened?

I haven't kept it, but I'm pretty sure I was using renesas-devel-20151026-
v4.3-rc7 without any additional patch applied.

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] i2c: rcar: make sure clocks are on when doing hw init

2015-10-29 Thread Wolfram Sang
From: Wolfram Sang 

Reported-by: Kuninori Morimoto 
Signed-off-by: Wolfram Sang 
---
 drivers/i2c/busses/i2c-rcar.c | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index 616433d387cdb2..58dbd30c24d1cc 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -612,7 +612,10 @@ static int rcar_i2c_probe(struct platform_device *pdev)
if (IS_ERR(priv->io))
return PTR_ERR(priv->io);
 
+   pm_runtime_enable(dev);
+   pm_runtime_get_sync(dev);
rcar_i2c_init(priv);
+   pm_runtime_put(dev);
 
irq = platform_get_irq(pdev, 0);
init_waitqueue_head(>wait);
@@ -631,22 +634,24 @@ static int rcar_i2c_probe(struct platform_device *pdev)
   dev_name(dev), priv);
if (ret < 0) {
dev_err(dev, "cannot get irq %d\n", irq);
-   return ret;
+   goto out_pm_disable;
}
 
-   pm_runtime_enable(dev);
platform_set_drvdata(pdev, priv);
 
ret = i2c_add_numbered_adapter(adap);
if (ret < 0) {
dev_err(dev, "reg adap failed: %d\n", ret);
-   pm_runtime_disable(dev);
-   return ret;
+   goto out_pm_disable;
}
 
dev_info(dev, "probed\n");
 
return 0;
+
+ out_pm_disable:
+   pm_runtime_disable(dev);
+   return ret;
 }
 
 static int rcar_i2c_remove(struct platform_device *pdev)
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] i2c: rcar: make sure clocks are on when doing hw init

2015-10-29 Thread Kuninori Morimoto

Hi Wolfram Sang wrote:
> 
> From: Wolfram Sang 
> 
> Reported-by: Kuninori Morimoto 
> Signed-off-by: Wolfram Sang 
> ---

Please add explain why this patch is needed, and what happen
without this patch.
And my previous patch didn't explain this, but please add
93c659d820ef291f6ca5e628f44b26cfb2226aba
was cause of this issue.

>  drivers/i2c/busses/i2c-rcar.c | 13 +
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
> index 616433d387cdb2..58dbd30c24d1cc 100644
> --- a/drivers/i2c/busses/i2c-rcar.c
> +++ b/drivers/i2c/busses/i2c-rcar.c
> @@ -612,7 +612,10 @@ static int rcar_i2c_probe(struct platform_device *pdev)
>   if (IS_ERR(priv->io))
>   return PTR_ERR(priv->io);
>  
> + pm_runtime_enable(dev);
> + pm_runtime_get_sync(dev);
>   rcar_i2c_init(priv);
> + pm_runtime_put(dev);
>  
>   irq = platform_get_irq(pdev, 0);
>   init_waitqueue_head(>wait);
> @@ -631,22 +634,24 @@ static int rcar_i2c_probe(struct platform_device *pdev)
>  dev_name(dev), priv);
>   if (ret < 0) {
>   dev_err(dev, "cannot get irq %d\n", irq);
> - return ret;
> + goto out_pm_disable;
>   }
>  
> - pm_runtime_enable(dev);
>   platform_set_drvdata(pdev, priv);
>  
>   ret = i2c_add_numbered_adapter(adap);
>   if (ret < 0) {
>   dev_err(dev, "reg adap failed: %d\n", ret);
> - pm_runtime_disable(dev);
> - return ret;
> + goto out_pm_disable;
>   }
>  
>   dev_info(dev, "probed\n");
>  
>   return 0;
> +
> + out_pm_disable:
> + pm_runtime_disable(dev);
> + return ret;
>  }
>  
>  static int rcar_i2c_remove(struct platform_device *pdev)
> -- 
> 2.1.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] i2c: rcar: make sure clocks are on when doing hw init

2015-10-29 Thread Laurent Pinchart
Hi Wolfram,

Thank you for the patch.

I'm afraid this doesn't make any noticeable difference. With or without the 
patch applied the adv7511 can't be detected using the latest driver tag 
(renesas-devel-20151026-v4.3-rc7).

However, I have a bit more information to report.

First of all, I got one kernel panic.

[9.596439] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[9.603252] [drm] No driver support for vblank timestamp query.
[9.609724] rcar-du feb0.display: failed to initialize DRM/KMS (-517)
[9.616106] adv7180 2-0020: chip found @ 0x20 (e653.i2c)
[9.632980] rcar_thermal e61f.thermal: 1 sensor probed
[9.641533] Unable to handle kernel paging request at virtual address 

[9.648927] pgd = eb2adf40
[9.651695] [] *pgd=8040007003, *pmd=6bfde003, *pte=
[9.658579] Internal error: Oops: a07 [#1] SMP ARM
[9.663475] Modules linked in: rcar_thermal adv7180(+) phy_rcar_gen2 
soundcore udc_core
[9.671719] CPU: 0 PID: 552 Comm: udevd Not tainted 4.3.0-rc7-07332-
gfb990fd3ff96 #114
[9.679811] Hardware name: Generic R8A7791 (Flattened Device Tree)
[9.686125] task: eb11f400 ti: ea92e000 task.ti: ea92e000
[9.691653] PC is at rcar_i2c_irq+0xd4/0x3e4
[9.696018] LR is at rcar_i2c_write+0x28/0x38
[9.700471] pc : []lr : []psr: 8193
[9.700471] sp : ea92fea8  ip : ea92fe88  fp : ea92fecc
[9.712200] r10:   r9 : c067f37c  r8 : 
[9.717538] r7 :   r6 : ea92db38  r5 :   r4 : eb223c10
[9.724206] r3 :   r2 :   r1 :   r0 : eb223c10
[9.730877] Flags: Nzcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment 
user
[9.738260] Control: 30c5387d  Table: 6b2adf40  DAC: fffd
[9.744131] Process udevd (pid: 552, stack limit = 0xea92e210)
[9.750090] Stack: (0xea92fea8 to 0xea93)
[9.754543] fea0:   c0121368 c011cdfc eb1f9b90 eb21cc40 
eb1d4220 0068
[9.762903] fec0: ea92ff0c ea92fed0 c00727bc c03244c0 ea886198 0101 
eada6e90 eb1d41c0
[9.771263] fee0:  eb1d41c0 eb1d4220   eb00a800 
0003 f0803000
[9.779622] ff00: ea92ff2c ea92ff10 c0072a24 c0072760  eb1d41c0 
c0656484 
[9.787981] ff20: ea92ff4c ea92ff30 c0075e40 c00729c0 c0075d80 0068 
c06361f0 
[9.796339] ff40: ea92ff5c ea92ff50 c0071fd0 c0075d8c ea92ff84 ea92ff60 
c007211c c0071fb4
[9.804697] ff60: ea92ffb0 f0802000 f080200c c063cd10 c0656480 ea92ffb0 
ea92ffac ea92ff88
[9.813055] ff80: c000a4a0 c00720c4 f948 8010  30c5387d 
30c5387d 0004
[9.821414] ffa0:  ea92ffb0 c0015dc8 c000a45c 0004 0001fabc 
0004 0002d00c
[9.829773] ffc0: 03ef 000419be bec86de8 00041168 00032060 0003 
0004 000419bf
[9.838132] ffe0: 0018 bec86dc0 f97c f948 8010  
ea92fff4 
[9.846488] Backtrace: 
[9.849010] [] (rcar_i2c_irq) from [] 
(handle_irq_event_percpu+0x68/0x260)
[9.857810]  r6:0068 r5:eb1d4220 r4:eb21cc40
[9.862560] [] (handle_irq_event_percpu) from [] 
(handle_irq_event+0x70/0x94)
[9.871626]  r10:f0803000 r9:0003 r8:eb00a800 r7: r6: 
r5:eb1d4220
[9.879675]  r4:eb1d41c0
[9.882278] [] (handle_irq_event) from [] 
(handle_fasteoi_irq+0xc0/0x1c0)
[9.890990]  r6: r5:c0656484 r4:eb1d41c0 r3:
[9.896812] [] (handle_fasteoi_irq) from [] 
(generic_handle_irq+0x28/0x38)
[9.905612]  r6: r5:c06361f0 r4:0068 r3:c0075d80
[9.911433] [] (generic_handle_irq) from [] 
(__handle_domain_irq+0x64/0xc4)
[9.920327] [] (__handle_domain_irq) from [] 
(gic_handle_irq+0x50/0x98)
[9.928860]  r8:ea92ffb0 r7:c0656480 r6:c063cd10 r5:f080200c r4:f0802000 
r3:ea92ffb0
[9.936824] [] (gic_handle_irq) from [] 
(__irq_usr+0x48/0x60)
[9.944471] Exception stack(0xea92ffb0 to 0xea92fff8)
[9.949632] ffa0: 0004 0001fabc 
0004 0002d00c
[9.957991] ffc0: 03ef 000419be bec86de8 00041168 00032060 0003 
0004 000419bf
[9.966349] ffe0: 0018 bec86dc0 f97c f948 8010 
[9.973105]  r10:0004 r8:30c5387d r7:30c5387d r6: r5:8010 
r4:f948
[9.981158] Code: e5962008 e5941000 e5911024 f57ff04f (e7c21003) 
[9.987389] ---[ end trace 4f04837ce7816c01 ]---
[9.992107] Kernel panic - not syncing: Fatal exception in interrupt
[9.998603] CPU1: stopping
[   10.001380] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G  D 4.3.0-
rc7-07332-gfb990fd3ff96 #114
[   10.010893] Hardware name: Generic R8A7791 (Flattened Device Tree)
[   10.017207] Backtrace: 
[   10.019729] [] (dump_backtrace) from [] 
(show_stack+0x20/0x24)
[   10.027466]  r6:c067f2c8 r5:0001 r4: r3:
[   10.033297] [] (show_stack) from [] 
(dump_stack+0x8c/0xc0)
[   10.040686] [] (dump_stack) from [] 
(handle_IPI+0x1b8/0x2dc)
[   10.048245]