1. 17 3月, 2014 1 次提交
  2. 23 2月, 2014 3 次提交
  3. 20 1月, 2014 1 次提交
  4. 18 1月, 2014 1 次提交
    • A
      mmc: sdhci: fix lockdep error in tuning routine · 2b35bd83
      Aisheng Dong 提交于
      The sdhci_execute_tuning routine gets lock separately by
      disable_irq(host->irq);
      spin_lock(&host->lock);
      It will cause the following lockdep error message since the &host->lock
      could also be got in irq context.
      Use spin_lock_irqsave/spin_unlock_restore instead to get rid of
      this error message.
      
      [ INFO: inconsistent lock state ]
      3.13.0-rc1+ #287 Not tainted
      ---------------------------------
      inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
      kworker/u2:1/33 [HC0[0]:SC0[0]:HE1:SE1] takes:
       (&(&host->lock)->rlock){?.-...}, at: [<8045f7f4>] sdhci_execute_tuning+0x4c/0x710
      {IN-HARDIRQ-W} state was registered at:
        [<8005f030>] mark_lock+0x140/0x6ac
        [<80060760>] __lock_acquire+0xb30/0x1cbc
        [<800620d0>] lock_acquire+0x70/0x84
        [<8061d1c8>] _raw_spin_lock+0x30/0x40
        [<804605cc>] sdhci_irq+0x24/0xa68
        [<8006b1d4>] handle_irq_event_percpu+0x54/0x18c
        [<8006b350>] handle_irq_event+0x44/0x64
        [<8006e50c>] handle_fasteoi_irq+0xa0/0x170
        [<8006a8f0>] generic_handle_irq+0x30/0x44
        [<8000f238>] handle_IRQ+0x54/0xbc
        [<8000864c>] gic_handle_irq+0x30/0x64
        [<80013024>] __irq_svc+0x44/0x5c
        [<80329bf4>] dev_vprintk_emit+0x50/0x58
        [<80329c24>] dev_printk_emit+0x28/0x30
        [<80329fec>] __dev_printk+0x4c/0x90
        [<8032a180>] dev_err+0x3c/0x48
        [<802dd4f0>] _regulator_get+0x158/0x1cc
        [<802dd5b4>] regulator_get_optional+0x18/0x1c
        [<80461df4>] sdhci_add_host+0x42c/0xbd8
        [<80464820>] sdhci_esdhc_imx_probe+0x378/0x67c
        [<8032ee88>] platform_drv_probe+0x20/0x50
        [<8032d48c>] driver_probe_device+0x118/0x234
        [<8032d690>] __driver_attach+0x9c/0xa0
        [<8032b89c>] bus_for_each_dev+0x68/0x9c
        [<8032cf44>] driver_attach+0x20/0x28
        [<8032cbc8>] bus_add_driver+0x148/0x1f4
        [<8032dce0>] driver_register+0x80/0x100
        [<8032ee54>] __platform_driver_register+0x50/0x64
        [<8084b094>] sdhci_esdhc_imx_driver_init+0x18/0x20
        [<80008980>] do_one_initcall+0x108/0x16c
        [<8081cca4>] kernel_init_freeable+0x10c/0x1d0
        [<80611b28>] kernel_init+0x10/0x120
        [<8000e9c8>] ret_from_fork+0x14/0x2c
      irq event stamp: 805
      hardirqs last  enabled at (805): [<8061d43c>] _raw_spin_unlock_irqrestore+0x38/0x4c
      hardirqs last disabled at (804): [<8061d2c8>] _raw_spin_lock_irqsave+0x24/0x54
      softirqs last  enabled at (570): [<8002b824>] __do_softirq+0x1c4/0x290
      softirqs last disabled at (561): [<8002bcf4>] irq_exit+0xb4/0x10c
      
      other info that might help us debug this:
       Possible unsafe locking scenario:
      
             CPU0
             ----
        lock(&(&host->lock)->rlock);
        <Interrupt>
          lock(&(&host->lock)->rlock);
      
       *** DEADLOCK ***
      
      2 locks held by kworker/u2:1/33:
       #0:  (kmmcd){.+.+..}, at: [<8003db18>] process_one_work+0x128/0x468
       #1:  ((&(&host->detect)->work)){+.+...}, at: [<8003db18>] process_one_work+0x128/0x468
      
      stack backtrace:
      CPU: 0 PID: 33 Comm: kworker/u2:1 Not tainted 3.13.0-rc1+ #287
      Workqueue: kmmcd mmc_rescan
      Backtrace:
      [<80012160>] (dump_backtrace+0x0/0x10c) from [<80012438>] (show_stack+0x18/0x1c)
       r6:bfad0900 r5:00000000 r4:8088ecc8 r3:bfad0900
      [<80012420>] (show_stack+0x0/0x1c) from [<806169ec>] (dump_stack+0x84/0x9c)
      [<80616968>] (dump_stack+0x0/0x9c) from [<806147b4>] (print_usage_bug+0x260/0x2d0)
       r5:8076ba88 r4:80977410
      [<80614554>] (print_usage_bug+0x0/0x2d0) from [<8005f0d0>] (mark_lock+0x1e0/0x6ac)
       r9:8005e678 r8:00000000 r7:bfad0900 r6:00001015 r5:bfad0cd0
      r4:00000002
      [<8005eef0>] (mark_lock+0x0/0x6ac) from [<80060234>] (__lock_acquire+0x604/0x1cbc)
      [<8005fc30>] (__lock_acquire+0x0/0x1cbc) from [<800620d0>] (lock_acquire+0x70/0x84)
      [<80062060>] (lock_acquire+0x0/0x84) from [<8061d1c8>] (_raw_spin_lock+0x30/0x40)
       r7:00000000 r6:bfb63000 r5:00000000 r4:bfb60568
      [<8061d198>] (_raw_spin_lock+0x0/0x40) from [<8045f7f4>] (sdhci_execute_tuning+0x4c/0x710)
       r4:bfb60000
      [<8045f7a8>] (sdhci_execute_tuning+0x0/0x710) from [<80453454>] (mmc_sd_init_card+0x5f8/0x660)
      [<80452e5c>] (mmc_sd_init_card+0x0/0x660) from [<80453748>] (mmc_attach_sd+0xb4/0x180)
       r9:bf92d400 r8:8065f364 r7:00061a80 r6:bfb60000 r5:8065f358
      r4:bfb60000
      [<80453694>] (mmc_attach_sd+0x0/0x180) from [<8044d9f8>] (mmc_rescan+0x284/0x2f0)
       r5:8065f358 r4:bfb602f8
      [<8044d774>] (mmc_rescan+0x0/0x2f0) from [<8003db94>] (process_one_work+0x1a4/0x468)
       r8:00000000 r7:bfb55eb0 r6:bf80dc00 r5:bfb602f8 r4:bfb35980
      r3:8044d774
      [<8003d9f0>] (process_one_work+0x0/0x468) from [<8003e850>] (worker_thread+0x118/0x3e0)
      [<8003e738>] (worker_thread+0x0/0x3e0) from [<80044de0>] (kthread+0xd4/0xf0)
      [<80044d0c>] (kthread+0x0/0xf0) from [<8000e9c8>] (ret_from_fork+0x14/0x2c)
       r7:00000000 r6:00000000 r5:80044d0c r4:bfb37b40
      Signed-off-by: NDong Aisheng <b29396@freescale.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NChris Ball <chris@printf.net>
      2b35bd83
  5. 14 1月, 2014 2 次提交
  6. 27 11月, 2013 1 次提交
    • D
      mmc: sdhci: clear auto cmd setting bits for no data cmds · 2b558c13
      Dong Aisheng 提交于
      The auto cmd settings bits should be cleared before sending new commands
      or we may receive command timeout error for normal commands due to wrongly
      pre-sent auto cmd.
      
      e.g. we receive CMD13 timeout error due to ACMD23 is wrongly enabled
      by former data commands.
      
      mmc2: new high speed DDR MMC card at address 0001
      mmcblk1: mmc2:0001 SEM08G 7.39 GiB
      mmcblk1boot0: mmc2:0001 SEM08G partition 1 2.00 MiB
      mmcblk1boot1: mmc2:0001 SEM08G partition 2 2.00 MiB
      mmcblk1rpmb: mmc2:0001 SEM08G partition 3 128 KiB
       mmcblk1: p1 p2 p3 p4 < p5 p6 p7 >
      mmc2: Timeout waiting for hardware interrupt.
       mmcblk1boot1: unknown partition table
      mmc2: Timeout waiting for hardware interrupt.
       mmcblk1boot0: unknown partition table
      Signed-off-by: NDong Aisheng <b29396@freescale.com>
      Acked-by: NShawn Guo <shawn.guo@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      2b558c13
  7. 09 11月, 2013 1 次提交
  8. 31 10月, 2013 1 次提交
  9. 22 10月, 2013 2 次提交
  10. 26 9月, 2013 2 次提交
  11. 26 8月, 2013 1 次提交
  12. 25 8月, 2013 1 次提交
    • S
      mmc: sdhci: request irq after sdhci_init() is called · 2af502ca
      Shawn Guo 提交于
      Generally request_irq() should be called after hardware has been
      initialized into a sane state.  However, sdhci driver currently calls
      request_irq() before sdhci_init().  At least, the following kernel panic
      seen on i.MX6 is caused by that.  The sdhci controller on i.MX6 may have
      noisy glitch on DAT1 line, which will trigger SDIO interrupt handling
      once request_irq() is called.  But at this point, the SDIO interrupt
      handler host->sdio_irq_thread has not been registered yet.  Thus, we
      see the NULL pointer access with wake_up_process(host->sdio_irq_thread)
      in mmc_signal_sdio_irq().
      
      Fix the panic by simply reverse the calling sequence between
      request_irq() and sdhci_init().
      
      sdhci-pltfm: SDHCI platform and OF driver helper
      mmc0: no vqmmc regulator found
      mmc0: no vmmc regulator found
      Unable to handle kernel NULL pointer dereference at virtual address 00000000
      pgd = 80004000
      [00000000] *pgd=00000000
      Internal error: Oops: 5 [#1] SMP ARM
      Modules linked in:
      CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.0+ #3
      task: 9f860000 ti: 9f862000 task.ti: 9f862000
      PC is at wake_up_process+0xc/0x44
      LR is at sdhci_irq+0x378/0x93c
      pc : [<8004f768>]    lr : [<803fb698>]    psr: 40000193
      sp : 9f863ba0  ip : 9f863bb8  fp : 9f863bb4
      r10: 9f807900  r9 : 80761fbc  r8 : 00000000
      r7 : 00000000  r6 : 00000000  r5 : 00000001  r4 : 9fa68000
      r3 : 00000001  r2 : 00000002  r1 : 20000193  r0 : 00000000
      Flags: nZcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      Control: 10c53c7d  Table: 8000404a  DAC: 00000017
      Process swapper/0 (pid: 1, stack limit = 0x9f862238)
      Stack: (0x9f863ba0 to 0x9f864000)
      3ba0: 00000001 9fa68000 9f863c04 9f863bb8 803fb698 8004f768 8011af00 80265aac
      3bc0: 00000000 000003d9 00000000 9fa51880 00000001 00000000 9f863c14 9fa53640
      3be0: 00000001 00000000 00000000 00000036 80761fbc 9f807900 9f863c3c 9f863c08
      3c00: 80075154 803fb32c 802c2b38 802c63d8 802c63cc 9f807900 00000001 9f862000
      3c20: 00000036 00000000 9f807930 60000113 9f863c54 9f863c40 800752ec 8007510c
      3c40: 9f807900 00000001 9f863c6c 9f863c58 80078324 800752a8 00000036 8071fd64
      3c60: 9f863c84 9f863c70 80074ac0 80078294 00000140 8072ab78 9f863cac 9f863c88
      3c80: 8000ee34 80074aa4 00000000 a080e10c 8072acbc 9f863cd0 a080e100 00000036
      3ca0: 9f863ccc 9f863cb0 80008600 8000edec 805386a8 60000113 ffffffff 9f863d04
      3cc0: 9f863d24 9f863cd0 8000e0c0 800085dc 9f807950 60000113 00000007 00000000
      3ce0: 9f807900 9fa53640 9f807950 9fa68240 00000036 9f807930 60000113 9f863d24
      3d00: 9f863d28 9f863d18 80076834 805386a8 60000113 ffffffff 9f863d64 9f863d28
      3d20: 80076834 80538688 00000000 800bfe4c 00002fac 00000001 9f863d54 9fa53640
      3d40: 9f807900 803fb320 9fa68240 00000080 00000000 00000036 9f863d94 9f863d68
      3d60: 80076b38 80076674 00000080 9fa68240 9fa68000 04000000 9fa6836c 9fa68380
      3d80: 806d620c 80700350 9f863dc4 9f863d98 803fce8c 80076a88 9fa532c0 9fa68240
      3da0: 9fa51490 9fa51490 9fa68240 00000000 9f8ae600 9f81d080 9f863df4 9f863dc8
      3dc0: 803fea0c 803fc808 9f863de4 9f863dd8 80125850 807b1ed8 807576b8 9f8ae610
      3de0: 00000000 807576b8 9f863e04 9f863df8 802ee0d4 803fe798 9f863e2c 9f863e08
      3e00: 802ecd1c 802ee0c0 00000000 9f8ae610 807576b8 9f8ae644 00000000 000000a9
      3e20: 9f863e4c 9f863e30 802ecec0 802ecc30 9f83355c 807576b8 802ece2c 00000000
      3e40: 9f863e74 9f863e50 802eb3d8 802ece38 9f83355c 9f8ac3b4 9f833570 807576b8
      3e60: 80746e70 9fa51400 9f863e84 9f863e78 802ec838 802eb388 9f863eb4 9f863e88
      3e80: 802ec3d0 802ec824 80692748 807620c0 9f863eb4 807576b8 00000006 807620c0
      3ea0: 00000000 000000a9 9f863edc 9f863eb8 802ed3e8 802ec2fc 9f862000 00000006
      3ec0: 807620c0 00000000 000000a9 80700350 9f863eec 9f863ee0 802ee2f8 802ed374
      3ee0: 9f863efc 9f863ef0 80700364 802ee2b8 9f863f54 9f863f00 8000870c 8070035c
      3f00: 9f863f54 9f863f10 9f862000 00000000 00000000 00000006 00000006 806d3aa4
      3f20: 00000000 80688b18 9f863f54 80713560 00000006 80713540 807620c0 000000a9
      3f40: 806d620c 8071ec24 9f863f94 9f863f58 806d6994 800086dc 00000006 00000006
      3f60: 806d620c f6bfffff fb7f5df7 00000000 8052da28 00000000 00000000 00000000
      3f80: 00000000 00000000 9f863fac 9f863f98 8052da38 806d689c ffffffff 00000000
      3fa0: 00000000 9f863fb0 8000e5d8 8052da34 00000000 00000000 00000000 00000000
      3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      3fe0: 00000000 00000000 00000000 00000000 00000013 00000000 d9cdf5ff 1fff5ffe
      Backtrace:
      [<8004f75c>] (wake_up_process+0x0/0x44) from [<803fb698>] (sdhci_irq+0x378/0x93c)
       r4:9fa68000 r3:00000001
      [<803fb320>] (sdhci_irq+0x0/0x93c) from [<80075154>] (handle_irq_event_percpu+0x54/0x19c)
      [<80075100>] (handle_irq_event_percpu+0x0/0x19c) from [<800752ec>] (handle_irq_event+0x50/0x70)
      [<8007529c>] (handle_irq_event+0x0/0x70) from [<80078324>] (handle_fasteoi_irq+0x9c/0x170)
       r5:00000001 r4:9f807900
      [<80078288>] (handle_fasteoi_irq+0x0/0x170) from [<80074ac0>] (generic_handle_irq+0x28/0x38)
       r5:8071fd64 r4:00000036
      [<80074a98>] (generic_handle_irq+0x0/0x38) from [<8000ee34>] (handle_IRQ+0x54/0xb4)
       r4:8072ab78 r3:00000140
      [<8000ede0>] (handle_IRQ+0x0/0xb4) from [<80008600>] (gic_handle_irq+0x30/0x64)
       r8:00000036 r7:a080e100 r6:9f863cd0 r5:8072acbc r4:a080e10c
      r3:00000000
      [<800085d0>] (gic_handle_irq+0x0/0x64) from [<8000e0c0>] (__irq_svc+0x40/0x54)
      Exception stack(0x9f863cd0 to 0x9f863d18)
      3cc0:                                     9f807950 60000113 00000007 00000000
      3ce0: 9f807900 9fa53640 9f807950 9fa68240 00000036 9f807930 60000113 9f863d24
      3d00: 9f863d28 9f863d18 80076834 805386a8 60000113 ffffffff
       r7:9f863d04 r6:ffffffff r5:60000113 r4:805386a8
      [<8053867c>] (_raw_spin_unlock_irqrestore+0x0/0x30) from [<80076834>] (__setup_irq+0x1cc/0x414)
      [<80076668>] (__setup_irq+0x0/0x414) from [<80076b38>] (request_threaded_irq+0xbc/0x140)
      [<80076a7c>] (request_threaded_irq+0x0/0x140) from [<803fce8c>] (sdhci_add_host+0x690/0xb88)
      [<803fc7fc>] (sdhci_add_host+0x0/0xb88) from [<803fea0c>] (sdhci_esdhc_imx_probe+0x280/0x4d4)
       r8:9f81d080 r7:9f8ae600 r6:00000000 r5:9fa68240 r4:9fa51490
      [<803fe78c>] (sdhci_esdhc_imx_probe+0x0/0x4d4) from [<802ee0d4>] (platform_drv_probe+0x20/0x24)
       r8:807576b8 r7:00000000 r6:9f8ae610 r5:807576b8 r4:807b1ed8
      [<802ee0b4>] (platform_drv_probe+0x0/0x24) from [<802ecd1c>] (driver_probe_device+0xf8/0x208)
      [<802ecc24>] (driver_probe_device+0x0/0x208) from [<802ecec0>] (__driver_attach+0x94/0x98)
       r8:000000a9 r7:00000000 r6:9f8ae644 r5:807576b8 r4:9f8ae610
      r3:00000000
      [<802ece2c>] (__driver_attach+0x0/0x98) from [<802eb3d8>] (bus_for_each_dev+0x5c/0x90)
       r6:00000000 r5:802ece2c r4:807576b8 r3:9f83355c
      [<802eb37c>] (bus_for_each_dev+0x0/0x90) from [<802ec838>] (driver_attach+0x20/0x28)
       r6:9fa51400 r5:80746e70 r4:807576b8
      [<802ec818>] (driver_attach+0x0/0x28) from [<802ec3d0>] (bus_add_driver+0xe0/0x234)
      [<802ec2f0>] (bus_add_driver+0x0/0x234) from [<802ed3e8>] (driver_register+0x80/0x14c)
       r8:000000a9 r7:00000000 r6:807620c0 r5:00000006 r4:807576b8
      [<802ed368>] (driver_register+0x0/0x14c) from [<802ee2f8>] (platform_driver_register+0x4c/0x60)
      [<802ee2ac>] (platform_driver_register+0x0/0x60) from [<80700364>] (sdhci_esdhc_imx_driver_init+0x14/0x1c)
      [<80700350>] (sdhci_esdhc_imx_driver_init+0x0/0x1c) from [<8000870c>] (do_one_initcall+0x3c/0x164)
      [<800086d0>] (do_one_initcall+0x0/0x164) from [<806d6994>] (kernel_init_freeable+0x104/0x1d0)
      [<806d6890>] (kernel_init_freeable+0x0/0x1d0) from [<8052da38>] (kernel_init+0x10/0xec)
      [<8052da28>] (kernel_init+0x0/0xec) from [<8000e5d8>] (ret_from_fork+0x14/0x3c)
       r4:00000000 r3:ffffffff
      Code: e89da800 e1a0c00d e92dd818 e24cb004 (e5903000)
      ---[ end trace e9af3588936b63f0 ]---
      Kernel panic - not syncing: Fatal exception in interrupt
      Signed-off-by: NShawn Guo <shawn.guo@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      2af502ca
  13. 31 7月, 2013 1 次提交
  14. 06 7月, 2013 2 次提交
  15. 28 6月, 2013 2 次提交
    • G
      mmc: sdhci: fix caps2 for HS200 · 156e14b1
      Giuseppe CAVALLARO 提交于
      Although the HC supports HS200 (eMMC) the caps2 are always zero; this
      means there's no way to use the super speed mode (when init the card).
      
      If the HC support SDR104, for SD3.0, so it also supports HS200 for eMMC
      and this patch just sets the MMC_CAP2_HS200 in the host caps2 field.
      Reported-by: NYoussef Triki <youssef.triki@st.com>
      Signed-off-by: NGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Reviewed-by: NPhilip Rakity <prakity@nvidia.com>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      156e14b1
    • S
      mmc: sdhci: improve card removal check in sdhci_card_event() · 9668d765
      Shawn Guo 提交于
      The following error randomly appears on an imx6q board where gpio is
      used to implement card-detection when mounting EXT4 rootfs during boot.
      
      mmc1: Card removed during transfer!
      mmc1: Resetting controller.
      mmcblk0: unknown error -123 sending read/write command, card status 0x900
      end_request: I/O error, dev mmcblk0, sector 106744
      EXT4-fs error (device mmcblk0p2): ext4_find_entry:1312: inode #5011: comm swapper/0: reading directory lblock 0
      
      It turns out that the error message comes from the card removal check
      in function sdhci_card_event().  While we have a well implemented
      function sdhci_do_get_cd() handling all the possible cases of
      CD, the current code only checks controller internal CD case.  That
      causes problem for other CD cases like gpio on above imx6q board.
      
      Improve the check by using sdhci_do_get_cd() to cover all possible CD
      cases, so that above error on the imx6q board gets fixed.
      Signed-off-by: NShawn Guo <shawn.guo@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      9668d765
  16. 27 5月, 2013 1 次提交
  17. 23 3月, 2013 2 次提交
  18. 25 2月, 2013 5 次提交
  19. 12 2月, 2013 4 次提交
  20. 28 1月, 2013 4 次提交
  21. 08 12月, 2012 1 次提交
  22. 07 12月, 2012 1 次提交