Re: All OMAP platforms: MMC is broken

2015-09-24 Thread Grygorii Strashko
Hi Russell,

+Cc: Lokesh

On 09/24/2015 02:00 AM, Russell King - ARM Linux wrote:
> Nightly testing has revealed that both the OMAP3430 LDP and the OMAP4430
> SDP fail to boot due to lack of working MMC.  Both platforms fail to
> find their rootfs, which is on a SD card.
> 
> The breakage occurred somewhere between trees of September 9th (commit
> 4e4adb2f4628) and September 12th (commit b0a1ea51bda4), so during the
> merge window.
> 
> Diffing those two trees show no changes to OMAP platform code, but
> substantial changes in the MMC code:
> 

[...]

> 
> So this probably results from the MMC update during the merge window:
> 
> 85579ad7f1df Merge tag 'mmc-v4.3' of 
> git://git.linaro.org/people/ulf.hansson/mmc
> 
> The OMAP4430 reports this during it's boot log:
> 
> mmc0: new high speed MMC card at address 0001
> mmcblk0: mmc0:0001 SEM08G 7.39 GiB
> mmcblk0boot0: mmc0:0001 SEM08G partition 1 1.00 MiB
> mmcblk0boot1: mmc0:0001 SEM08G partition 2 1.00 MiB
> ...
> VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2): error -6
> b300 7757824 mmcblk0  driver: mmcblk
> b3101024 mmcblk0boot1  (driver?)
> b3081024 mmcblk0boot0  (driver?)
> Kernel panic - not syncing: VFS: Unable to mount root fs on 
> unknown-block(179,2)
> 
> whereas previous kernels reported:
> 
> mmc0: host does not support reading read-only switch, assuming write-enable
> mmc0: new high speed SD card at address 0002
> mmcblk0: mmc0:0002 0 971 MiB
>   mmcblk0: p1 p2
> Waiting 2 sec before mounting root device...
> mmc1: new high speed MMC card at address 0001
> mmcblk1: mmc1:0001 SEM08G 7.39 GiB
> mmcblk1boot0: mmc1:0001 SEM08G partition 1 1.00 MiB
> mmcblk1boot1: mmc1:0001 SEM08G partition 2 1.00 MiB
> ...
> VFS: Mounted root (ext3 filesystem) on device 179:2.
> 
> OMAP3430 only reports:
> 
> VFS: Cannot open root device "mmcblk0p2" or unknown-block(0,0): error -6
> 
> where previous kernels reported:
> 
> mmc0: host does not support reading read-only switch, assuming write-enable
> mmc0: new high speed SD card at address 0002
> mmcblk0: mmc0:0002 0 971 MiB
>   mmcblk0: p1 p2
> ...
> VFS: Mounted root (ext2 filesystem) on device 179:2.
> 

It looks like mmcX enumeration problem, which is not new, I think :(
Most probably with the last DT+code changes probing of MMC which handles SD
is deferred and as result it will get different ID.

I think Lokesh can comment more on this as he fixed it by switching uboot to 
UUIDs instead of partition names.

http://git.ti.com/ti-u-boot/ti-u-boot/commit/5e31eb59f03a424371c605448b6bbc2f93da787b
   

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


Re: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors from omap_hsmmc_reg_get

2015-09-01 Thread Grygorii Strashko
On 09/01/2015 12:14 AM, Tony Lindgren wrote:
> * Tony Lindgren  [150831 14:02]:
>>
>> And I must have tested next-20150827 instead of next-20150828. Or
>> else it does not happen on every boot. In any case, I'm now getting
>> the following on next-20150831 most of the time:
>>
>> [9.493133] omap_hsmmc 4809c000.mmc: using lookup tables for GPIO lookup
>> [9.500274] omap_hsmmc 4809c000.mmc: lookup for GPIO wp failed
>> [9.506378] [ cut here ]
>> [9.508941] WARNING: CPU: 0 PID: 6 at drivers/bus/omap_l3_noc.c:147 
>> l3_interrupt_handler+0x224/0x350()
>> [9.520568] 4400.ocp:L3 Custom Error: MASTER MPU TARGET L4PER2 
>> (Read): Data Access in User mode during Functional access
>> [9.524810] Modules linked in: rtc_twl twl4030_wdt
>> [9.534820] CPU: 0 PID: 6 Comm: kworker/u4:0 Not tainted 
>> 4.2.0-next-20150831-2-gf55bad8 #1113
>> [9.544830] Hardware name: Generic OMAP4 (Flattened Device Tree)
>> [9.544830] Workqueue: deferwq deferred_probe_work_func
>> [9.554809] [] (unwind_backtrace) from [] 
>> (show_stack+0x10/0x14)
>> [9.564819] [] (show_stack) from [] 
>> (dump_stack+0x84/0x9c)
>> [9.574829] [] (dump_stack) from [] 
>> (warn_slowpath_common+0x78/0xb4)
>> [9.574951] [] (warn_slowpath_common) from [] 
>> (warn_slowpath_fmt+0x30/0x40)
>> [9.584686] [] (warn_slowpath_fmt) from [] 
>> (l3_interrupt_handler+0x224/0x350)
>> [9.594818] [] (l3_interrupt_handler) from [] 
>> (handle_irq_event_percpu+0x44/0x1f0)
>> [9.604827] [] (handle_irq_event_percpu) from [] 
>> (handle_irq_event+0x40/0x64)
>> [9.614807] [] (handle_irq_event) from [] 
>> (handle_fasteoi_irq+0xcc/0x1c4)
>> [9.625396] [] (handle_fasteoi_irq) from [] 
>> (generic_handle_irq+0x28/0x3c)
>> [9.638732] [] (generic_handle_irq) from [] 
>> (__handle_domain_irq+0x64/0xe0)
>> [9.647827] [] (__handle_domain_irq) from [] 
>> (gic_handle_irq+0x40/0x8c)
>> [9.654693] [] (gic_handle_irq) from [] 
>> (__irq_svc+0x58/0x78)
>> [9.664367] Exception stack(0xee0cfd80 to 0xee0cfdc8)
>> [9.665130] fd80: ee1ec010 c082f174 00d0  ee6b0800 ee6ae850 
>> ee1ec000 ee1ec010
>> [9.674835] fda0:  ee6b0cc0 00ee fa09c000 0003 ee0cfdd0 
>> c04cd748 c04df4e0
>> [9.684814] fdc0: 2113 
>> [9.684814] [] (__irq_svc) from [] 
>> (devm_clk_get+0x8/0x70)
>> [9.694824] [] (devm_clk_get) from [] 
>> (omap_hsmmc_probe+0x2e8/0x9f0)
>> [9.704833] [] (omap_hsmmc_probe) from [] 
>> (platform_drv_probe+0x44/0xac)
>> [9.714691] [] (platform_drv_probe) from [] 
>> (driver_probe_device+0x1f4/0x2f0)
>> [9.724548] [] (driver_probe_device) from [] 
>> (bus_for_each_drv+0x64/0x98)
>> [9.733459] [] (bus_for_each_drv) from [] 
>> (__device_attach+0xb0/0x118)
>> [9.734832] [] (__device_attach) from [] 
>> (bus_probe_device+0x88/0x90)
>> [9.744812] [] (bus_probe_device) from [] 
>> (deferred_probe_work_func+0x60/0x90)
>> [9.760040] [] (deferred_probe_work_func) from [] 
>> (process_one_work+0x1a4/0x558)
>> [9.769470] [] (process_one_work) from [] 
>> (worker_thread+0x3c/0x514)
>> [9.774688] [] (worker_thread) from [] 
>> (kthread+0xd4/0xf0)
>> [9.785614] [] (kthread) from [] 
>> (ret_from_fork+0x14/0x24)
>> [9.785614] ---[ end trace 402743bd8cfdde2f ]---
> 
> And with the (currently almost useless) l3 interrupt stuff taken out by
> removing the ti,omap4-l3-noc compatible from omap4.dtsi, we get a real
> trace that might be of some help to you:
> 
> [8.440917] omap_hsmmc 4809c000.mmc: lookup for GPIO wp failed
> [8.447418] Unhandled fault: imprecise external abort (0x1406) at 
> 0xbeafaa10
> [8.454925] pgd = c0004000
> [8.454986] [beafaa10] *pgd=/root/init: line 14: 
> /sys/devices/6800.ocp/4
> 8098000.spi/spi_master/spi1/spi1[8.461334] Internal error: : 1406 [#1] 
> SMP ARM
> .2/backlight/acx565akm/brightness: No such file [8.473175] Modules linked 
> in:or directory
>   rtc_twl twl4030_wdt
> [8.483520] CPU: 1 PID: 66 Comm: kworker/u4:1 Not tainted 
> 4.2.0-next-20150831-2-gf55bad8-dirty #1115
> [8.493652] Hardware name: Generic OMAP4 (Flattened Device Tree)
> [8.498352] Workqueue: deferwq deferred_probe_work_func
> [8.505493] task: ee5f4f40 ti: ee5f6000 task.ti: ee5f6000
> [8.510803] PC is at devm_clk_get+0x8/0x70
> [8.514801] LR is at omap_hsmmc_probe+0x2e8/0x9f0
> [8.520385] pc : []lr : []psr: 20010013
> [8.520385] sp : ee5f7dd0  ip : 0003  fp : fa09c000
> [8.532470] r10: 00ee  r9 : ee6904c0  r8 : 
> [8.537963] r7 : ee1ec010  r6 : ee1ec000  r5 : ee6e7dd0  r4 : ee69
> [8.544769] r3 :   r2 : 00d0  r1 : c082f184  r0 : ee1ec010
> [8.551666] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment 
> none
> [8.559143] Control: 10c5387d  Table: ae73804a  DAC: 0051
> [8.564727] Process kworker/u4:1 (pid: 66, stack limit = 0xee5f6218)

Re: [PATCH v3 02/15] mmc: host: omap_hsmmc: return on fatal errors from omap_hsmmc_reg_get

2015-09-01 Thread Grygorii Strashko

On 09/01/2015 05:50 PM, Tony Lindgren wrote:

* Grygorii Strashko <grygorii.stras...@ti.com> [150901 07:36]:

On 09/01/2015 12:14 AM, Tony Lindgren wrote:

* Tony Lindgren <t...@atomide.com> [150831 14:02]:


And I must have tested next-20150827 instead of next-20150828. Or
else it does not happen on every boot. In any case, I'm now getting
the following on next-20150831 most of the time:

[9.493133] omap_hsmmc 4809c000.mmc: using lookup tables for GPIO lookup
[9.500274] omap_hsmmc 4809c000.mmc: lookup for GPIO wp failed
[9.506378] [ cut here ]
[9.508941] WARNING: CPU: 0 PID: 6 at drivers/bus/omap_l3_noc.c:147 
l3_interrupt_handler+0x224/0x350()
[9.520568] 4400.ocp:L3 Custom Error: MASTER MPU TARGET L4PER2 (Read): 
Data Access in User mode during Functional access
[9.524810] Modules linked in: rtc_twl twl4030_wdt
[9.534820] CPU: 0 PID: 6 Comm: kworker/u4:0 Not tainted 
4.2.0-next-20150831-2-gf55bad8 #1113
[9.544830] Hardware name: Generic OMAP4 (Flattened Device Tree)
[9.544830] Workqueue: deferwq deferred_probe_work_func
[9.554809] [] (unwind_backtrace) from [] 
(show_stack+0x10/0x14)
[9.564819] [] (show_stack) from [] 
(dump_stack+0x84/0x9c)
[9.574829] [] (dump_stack) from [] 
(warn_slowpath_common+0x78/0xb4)
[9.574951] [] (warn_slowpath_common) from [] 
(warn_slowpath_fmt+0x30/0x40)
[9.584686] [] (warn_slowpath_fmt) from [] 
(l3_interrupt_handler+0x224/0x350)
[9.594818] [] (l3_interrupt_handler) from [] 
(handle_irq_event_percpu+0x44/0x1f0)
[9.604827] [] (handle_irq_event_percpu) from [] 
(handle_irq_event+0x40/0x64)
[9.614807] [] (handle_irq_event) from [] 
(handle_fasteoi_irq+0xcc/0x1c4)
[9.625396] [] (handle_fasteoi_irq) from [] 
(generic_handle_irq+0x28/0x3c)
[9.638732] [] (generic_handle_irq) from [] 
(__handle_domain_irq+0x64/0xe0)
[9.647827] [] (__handle_domain_irq) from [] 
(gic_handle_irq+0x40/0x8c)
[9.654693] [] (gic_handle_irq) from [] 
(__irq_svc+0x58/0x78)
[9.664367] Exception stack(0xee0cfd80 to 0xee0cfdc8)
[9.665130] fd80: ee1ec010 c082f174 00d0  ee6b0800 ee6ae850 
ee1ec000 ee1ec010
[9.674835] fda0:  ee6b0cc0 00ee fa09c000 0003 ee0cfdd0 
c04cd748 c04df4e0
[9.684814] fdc0: 2113 
[9.684814] [] (__irq_svc) from [] 
(devm_clk_get+0x8/0x70)
[9.694824] [] (devm_clk_get) from [] 
(omap_hsmmc_probe+0x2e8/0x9f0)
[9.704833] [] (omap_hsmmc_probe) from [] 
(platform_drv_probe+0x44/0xac)
[9.714691] [] (platform_drv_probe) from [] 
(driver_probe_device+0x1f4/0x2f0)
[9.724548] [] (driver_probe_device) from [] 
(bus_for_each_drv+0x64/0x98)
[9.733459] [] (bus_for_each_drv) from [] 
(__device_attach+0xb0/0x118)
[9.734832] [] (__device_attach) from [] 
(bus_probe_device+0x88/0x90)
[9.744812] [] (bus_probe_device) from [] 
(deferred_probe_work_func+0x60/0x90)
[9.760040] [] (deferred_probe_work_func) from [] 
(process_one_work+0x1a4/0x558)
[9.769470] [] (process_one_work) from [] 
(worker_thread+0x3c/0x514)
[9.774688] [] (worker_thread) from [] 
(kthread+0xd4/0xf0)
[9.785614] [] (kthread) from [] 
(ret_from_fork+0x14/0x24)
[9.785614] ---[ end trace 402743bd8cfdde2f ]---


And with the (currently almost useless) l3 interrupt stuff taken out by
removing the ti,omap4-l3-noc compatible from omap4.dtsi, we get a real
trace that might be of some help to you:

[8.440917] omap_hsmmc 4809c000.mmc: lookup for GPIO wp failed
[8.447418] Unhandled fault: imprecise external abort (0x1406) at 0xbeafaa10
[8.454925] pgd = c0004000
[8.454986] [beafaa10] *pgd=/root/init: line 14: 
/sys/devices/6800.ocp/4
8098000.spi/spi_master/spi1/spi1[8.461334] Internal error: : 1406 [#1] SMP 
ARM
.2/backlight/acx565akm/brightness: No such file [8.473175] Modules linked 
in:or directory
   rtc_twl twl4030_wdt
[8.483520] CPU: 1 PID: 66 Comm: kworker/u4:1 Not tainted 
4.2.0-next-20150831-2-gf55bad8-dirty #1115
[8.493652] Hardware name: Generic OMAP4 (Flattened Device Tree)
[8.498352] Workqueue: deferwq deferred_probe_work_func
[8.505493] task: ee5f4f40 ti: ee5f6000 task.ti: ee5f6000
[8.510803] PC is at devm_clk_get+0x8/0x70
[8.514801] LR is at omap_hsmmc_probe+0x2e8/0x9f0
[8.520385] pc : []lr : []psr: 20010013
[8.520385] sp : ee5f7dd0  ip : 0003  fp : fa09c000
[8.532470] r10: 00ee  r9 : ee6904c0  r8 : 
[8.537963] r7 : ee1ec010  r6 : ee1ec000  r5 : ee6e7dd0  r4 : ee69
[8.544769] r3 :   r2 : 00d0  r1 : c082f184  r0 : ee1ec010
[8.551666] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[8.559143] Control: 10c5387d  Table: ae73804a  DAC: 0051
[8.564727] Process kworker/u4:1 (pid: 66, stack limit = 0xee5f6218)
[8.571441] Stack: (0xee5f7dd0 to 0xee5f8000)
[8.576263] 7dc0: ee69 ee6e7dd0 
ee1ec000 c04cd748
[8.

Re: [PATCH 01/17] mmc: host: omap_hsmmc: use devm_regulator_get_optional() for vmmc

2015-07-29 Thread Grygorii Strashko
On 07/29/2015 02:09 PM, Kishon Vijay Abraham I wrote:
 Since vmmc can be optional for some platforms, use
 devm_regulator_get_optional() for vmmc. Now return error only
 in the case of -EPROBE_DEFER and for all other cases set
 host-vcc to NULL.
 
 Signed-off-by: Kishon Vijay Abraham I kis...@ti.com
 ---
   drivers/mmc/host/omap_hsmmc.c |8 +---
   1 file changed, 5 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
 index 4d12032..b673e59 100644
 --- a/drivers/mmc/host/omap_hsmmc.c
 +++ b/drivers/mmc/host/omap_hsmmc.c
 @@ -344,11 +344,13 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host 
 *host)
   struct regulator *reg;
   int ocr_value = 0;
   
 - reg = devm_regulator_get(host-dev, vmmc);
 + reg = devm_regulator_get_optional(host-dev, vmmc);
   if (IS_ERR(reg)) {
 - dev_err(host-dev, unable to get vmmc regulator %ld\n,
 + if (PTR_ERR(reg) == -EPROBE_DEFER)
 + return -EPROBE_DEFER;
 + host-vcc = NULL;
 + dev_dbg(host-dev, unable to get vmmc regulator %ld\n,
   PTR_ERR(reg));
 - return PTR_ERR(reg);

I think, It could be unsafe to just drop this return.
regulator_get_optional may return:
1 valid pointer on regulator : success;
2 ERR_PTR(-ENODEV)   : regulator is not assigned, can proceed.
3 ERR_PTR(-EPROBE_DEFER) : regulator is assigned, but not ready yet, retry.
4 ERR_PTR(other error codes: regulator is assigned, but can't be retrieved, 
failure, can't proceed

So, It's allowed to continue with host-vcc = NULL; only in case [2], while
in case [4] probe should fail.

   } else {
   host-vcc = reg;
   ocr_value = mmc_regulator_get_ocrmask(reg);
 


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