<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/mmc/host, branch linux-3.13.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>mmc: sdhci-pci: Fix possibility of chip-&gt;fixes being null</title>
<updated>2014-02-13T21:55:46+00:00</updated>
<author>
<name>Adrian Hunter</name>
<email>adrian.hunter@intel.com</email>
</author>
<published>2014-01-21T07:52:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c28a553bd62e80b4ef51592e2b787ceb71754fec'/>
<id>c28a553bd62e80b4ef51592e2b787ceb71754fec</id>
<content type='text'>
commit 945be38caa287b177b8c17ffaae7754cab6a658f upstream.

It is possible for chip-&gt;fixes to be null.  Check before dereferencing it.

Signed-off-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Signed-off-by: Chris Ball &lt;chris@printf.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 945be38caa287b177b8c17ffaae7754cab6a658f upstream.

It is possible for chip-&gt;fixes to be null.  Check before dereferencing it.

Signed-off-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Signed-off-by: Chris Ball &lt;chris@printf.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sdhci-pci: Fix BYT sd card getting stuck in runtime suspend</title>
<updated>2014-02-13T21:55:46+00:00</updated>
<author>
<name>Adrian Hunter</name>
<email>adrian.hunter@intel.com</email>
</author>
<published>2014-01-13T07:49:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0a3ce0fcb82f60a7682c2130dc9f15fb25f2d306'/>
<id>0a3ce0fcb82f60a7682c2130dc9f15fb25f2d306</id>
<content type='text'>
commit 77a0122e0838663795651aa0beb2325156f98c09 upstream.

A host controller for a SD card may need a GPIO for card detect in order
to wake up from runtime suspend when a card is inserted.  If that GPIO is
not configured, then the host controller will not wake up.  Fix that for
the affected devices by not enabling runtime PM unless the GPIO is
successfully set up.

This affects BYT sd card host controller which had runtime PM enabled from
v3.11.  For completeness, the MFD sd card host controller is flagged also.

The original patch before rebasing (see link below) was tested on v3.11.10
and v3.12.4 although the patch applied with some offsets and fuzz.  The
original patch is here:

    http://marc.info/?l=linux-mmc&amp;m=138676702327057

Signed-off-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Signed-off-by: Chris Ball &lt;chris@printf.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 77a0122e0838663795651aa0beb2325156f98c09 upstream.

A host controller for a SD card may need a GPIO for card detect in order
to wake up from runtime suspend when a card is inserted.  If that GPIO is
not configured, then the host controller will not wake up.  Fix that for
the affected devices by not enabling runtime PM unless the GPIO is
successfully set up.

This affects BYT sd card host controller which had runtime PM enabled from
v3.11.  For completeness, the MFD sd card host controller is flagged also.

The original patch before rebasing (see link below) was tested on v3.11.10
and v3.12.4 although the patch applied with some offsets and fuzz.  The
original patch is here:

    http://marc.info/?l=linux-mmc&amp;m=138676702327057

Signed-off-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Signed-off-by: Chris Ball &lt;chris@printf.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: atmel-mci: fix timeout errors in SDIO mode when using DMA</title>
<updated>2014-02-13T21:55:30+00:00</updated>
<author>
<name>Ludovic Desroches</name>
<email>ludovic.desroches@atmel.com</email>
</author>
<published>2013-11-20T15:01:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5370524d4a16b67480641fb1a01ec9ddcf3d8eac'/>
<id>5370524d4a16b67480641fb1a01ec9ddcf3d8eac</id>
<content type='text'>
commit 66b512eda74d59b17eac04c4da1b38d82059e6c9 upstream.

With some SDIO devices, timeout errors can happen when reading data.
To solve this issue, the DMA transfer has to be activated before sending
the command to the device. This order is incorrect in PDC mode. So we
have to take care if we are using DMA or PDC to know when to send the
MMC command.

Signed-off-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Acked-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 66b512eda74d59b17eac04c4da1b38d82059e6c9 upstream.

With some SDIO devices, timeout errors can happen when reading data.
To solve this issue, the DMA transfer has to be activated before sending
the command to the device. This order is incorrect in PDC mode. So we
have to take care if we are using DMA or PDC to know when to send the
MMC command.

Signed-off-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Acked-by: Nicolas Ferre &lt;nicolas.ferre@atmel.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sdhci-esdhc-imx: fix access hardirq-unsafe lock in atomic context</title>
<updated>2014-02-06T19:34:09+00:00</updated>
<author>
<name>Dong Aisheng</name>
<email>b29396@freescale.com</email>
</author>
<published>2013-12-26T07:23:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8fabad704e223548edb974819d2bd5d942d049b6'/>
<id>8fabad704e223548edb974819d2bd5d942d049b6</id>
<content type='text'>
commit a974862faee199cba3ff36b5a148df5fd34bd1e7 upstream.

Sometimes we may meet the following lockdep issue.
The root cause is .set_clock callback is executed with spin_lock_irqsave
in sdhci_do_set_ios. However, the IMX set_clock callback will try to access
clk_get_rate which is using a mutex lock.

The fix avoids access mutex in .set_clock callback by initializing the
pltfm_host-&gt;clock at probe time and use it later instead of calling
clk_get_rate again in atomic context.

[ INFO: HARDIRQ-safe -&gt; HARDIRQ-unsafe lock order detected ]
3.13.0-rc1+ #285 Not tainted
------------------------------------------------------
kworker/u8:1/29 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
 (prepare_lock){+.+...}, at: [&lt;80480b08&gt;] clk_prepare_lock+0x44/0xe4

and this task is already holding:
 (&amp;(&amp;host-&gt;lock)-&gt;rlock#2){-.-...}, at: [&lt;804611f4&gt;] sdhci_do_set_ios+0x20/0x720
which would create a new lock dependency:
 (&amp;(&amp;host-&gt;lock)-&gt;rlock#2){-.-...} -&gt; (prepare_lock){+.+...}

but this new dependency connects a HARDIRQ-irq-safe lock:
 (&amp;(&amp;host-&gt;lock)-&gt;rlock#2){-.-...}
... which became HARDIRQ-irq-safe at:
  [&lt;8005f030&gt;] mark_lock+0x140/0x6ac
  [&lt;80060760&gt;] __lock_acquire+0xb30/0x1cbc
  [&lt;800620d0&gt;] lock_acquire+0x70/0x84
  [&lt;8061d2f0&gt;] _raw_spin_lock+0x30/0x40
  [&lt;80460668&gt;] sdhci_irq+0x24/0xa68
  [&lt;8006b1d4&gt;] handle_irq_event_percpu+0x54/0x18c
  [&lt;8006b350&gt;] handle_irq_event+0x44/0x64
  [&lt;8006e50c&gt;] handle_fasteoi_irq+0xa0/0x170
  [&lt;8006a8f0&gt;] generic_handle_irq+0x30/0x44
  [&lt;8000f238&gt;] handle_IRQ+0x54/0xbc
  [&lt;8000864c&gt;] gic_handle_irq+0x30/0x64
  [&lt;80013024&gt;] __irq_svc+0x44/0x5c
  [&lt;80614c58&gt;] printk+0x38/0x40
  [&lt;804622a8&gt;] sdhci_add_host+0x844/0xbcc
  [&lt;80464948&gt;] sdhci_esdhc_imx_probe+0x378/0x67c
  [&lt;8032ee88&gt;] platform_drv_probe+0x20/0x50
  [&lt;8032d48c&gt;] driver_probe_device+0x118/0x234
  [&lt;8032d690&gt;] __driver_attach+0x9c/0xa0
  [&lt;8032b89c&gt;] bus_for_each_dev+0x68/0x9c
  [&lt;8032cf44&gt;] driver_attach+0x20/0x28
  [&lt;8032cbc8&gt;] bus_add_driver+0x148/0x1f4
  [&lt;8032dce0&gt;] driver_register+0x80/0x100
  [&lt;8032ee54&gt;] __platform_driver_register+0x50/0x64
  [&lt;8084b094&gt;] sdhci_esdhc_imx_driver_init+0x18/0x20
  [&lt;80008980&gt;] do_one_initcall+0x108/0x16c
  [&lt;8081cca4&gt;] kernel_init_freeable+0x10c/0x1d0
  [&lt;80611c50&gt;] kernel_init+0x10/0x120
  [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c

to a HARDIRQ-irq-unsafe lock:
 (prepare_lock){+.+...}
... which became HARDIRQ-irq-unsafe at:
...  [&lt;8005f030&gt;] mark_lock+0x140/0x6ac
  [&lt;8005f604&gt;] mark_held_locks+0x68/0x12c
  [&lt;8005f780&gt;] trace_hardirqs_on_caller+0xb8/0x1d8
  [&lt;8005f8b4&gt;] trace_hardirqs_on+0x14/0x18
  [&lt;8061a130&gt;] mutex_trylock+0x180/0x20c
  [&lt;80480ad8&gt;] clk_prepare_lock+0x14/0xe4
  [&lt;804816a4&gt;] clk_notifier_register+0x28/0xf0
  [&lt;80015120&gt;] twd_clk_init+0x50/0x68
  [&lt;80008980&gt;] do_one_initcall+0x108/0x16c
  [&lt;8081cca4&gt;] kernel_init_freeable+0x10c/0x1d0
  [&lt;80611c50&gt;] kernel_init+0x10/0x120
  [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c

other info that might help us debug this:

 Possible interrupt unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(prepare_lock);
                               local_irq_disable();
                               lock(&amp;(&amp;host-&gt;lock)-&gt;rlock#2);
                               lock(prepare_lock);
  &lt;Interrupt&gt;
    lock(&amp;(&amp;host-&gt;lock)-&gt;rlock#2);

 *** DEADLOCK ***

3 locks held by kworker/u8:1/29:
 #0:  (kmmcd){.+.+.+}, at: [&lt;8003db18&gt;] process_one_work+0x128/0x468
 #1:  ((&amp;(&amp;host-&gt;detect)-&gt;work)){+.+.+.}, at: [&lt;8003db18&gt;] process_one_work+0x128/0x468
 #2:  (&amp;(&amp;host-&gt;lock)-&gt;rlock#2){-.-...}, at: [&lt;804611f4&gt;] sdhci_do_set_ios+0x20/0x720

the dependencies between HARDIRQ-irq-safe lock and the holding lock:
-&gt; (&amp;(&amp;host-&gt;lock)-&gt;rlock#2){-.-...} ops: 330 {
   IN-HARDIRQ-W at:
                    [&lt;8005f030&gt;] mark_lock+0x140/0x6ac
                    [&lt;80060760&gt;] __lock_acquire+0xb30/0x1cbc
                    [&lt;800620d0&gt;] lock_acquire+0x70/0x84
                    [&lt;8061d2f0&gt;] _raw_spin_lock+0x30/0x40
                    [&lt;80460668&gt;] sdhci_irq+0x24/0xa68
                    [&lt;8006b1d4&gt;] handle_irq_event_percpu+0x54/0x18c
                    [&lt;8006b350&gt;] handle_irq_event+0x44/0x64
                    [&lt;8006e50c&gt;] handle_fasteoi_irq+0xa0/0x170
                    [&lt;8006a8f0&gt;] generic_handle_irq+0x30/0x44
                    [&lt;8000f238&gt;] handle_IRQ+0x54/0xbc
                    [&lt;8000864c&gt;] gic_handle_irq+0x30/0x64
                    [&lt;80013024&gt;] __irq_svc+0x44/0x5c
                    [&lt;80614c58&gt;] printk+0x38/0x40
                    [&lt;804622a8&gt;] sdhci_add_host+0x844/0xbcc
                    [&lt;80464948&gt;] sdhci_esdhc_imx_probe+0x378/0x67c
                    [&lt;8032ee88&gt;] platform_drv_probe+0x20/0x50
                    [&lt;8032d48c&gt;] driver_probe_device+0x118/0x234
                    [&lt;8032d690&gt;] __driver_attach+0x9c/0xa0
                    [&lt;8032b89c&gt;] bus_for_each_dev+0x68/0x9c
                    [&lt;8032cf44&gt;] driver_attach+0x20/0x28
                    [&lt;8032cbc8&gt;] bus_add_driver+0x148/0x1f4
                    [&lt;8032dce0&gt;] driver_register+0x80/0x100
                    [&lt;8032ee54&gt;] __platform_driver_register+0x50/0x64
                    [&lt;8084b094&gt;] sdhci_esdhc_imx_driver_init+0x18/0x20
                    [&lt;80008980&gt;] do_one_initcall+0x108/0x16c
                    [&lt;8081cca4&gt;] kernel_init_freeable+0x10c/0x1d0
                    [&lt;80611c50&gt;] kernel_init+0x10/0x120
                    [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c
   IN-SOFTIRQ-W at:
                    [&lt;8005f030&gt;] mark_lock+0x140/0x6ac
                    [&lt;80060204&gt;] __lock_acquire+0x5d4/0x1cbc
                    [&lt;800620d0&gt;] lock_acquire+0x70/0x84
                    [&lt;8061d40c&gt;] _raw_spin_lock_irqsave+0x40/0x54
                    [&lt;8045e4a4&gt;] sdhci_tasklet_finish+0x1c/0x120
                    [&lt;8002b538&gt;] tasklet_action+0xa0/0x15c
                    [&lt;8002b778&gt;] __do_softirq+0x118/0x290
                    [&lt;8002bcf4&gt;] irq_exit+0xb4/0x10c
                    [&lt;8000f240&gt;] handle_IRQ+0x5c/0xbc
                    [&lt;8000864c&gt;] gic_handle_irq+0x30/0x64
                    [&lt;80013024&gt;] __irq_svc+0x44/0x5c
                    [&lt;80614c58&gt;] printk+0x38/0x40
                    [&lt;804622a8&gt;] sdhci_add_host+0x844/0xbcc
                    [&lt;80464948&gt;] sdhci_esdhc_imx_probe+0x378/0x67c
                    [&lt;8032ee88&gt;] platform_drv_probe+0x20/0x50
                    [&lt;8032d48c&gt;] driver_probe_device+0x118/0x234
                    [&lt;8032d690&gt;] __driver_attach+0x9c/0xa0
                    [&lt;8032b89c&gt;] bus_for_each_dev+0x68/0x9c
                    [&lt;8032cf44&gt;] driver_attach+0x20/0x28
                    [&lt;8032cbc8&gt;] bus_add_driver+0x148/0x1f4
                    [&lt;8032dce0&gt;] driver_register+0x80/0x100
                    [&lt;8032ee54&gt;] __platform_driver_register+0x50/0x64
                    [&lt;8084b094&gt;] sdhci_esdhc_imx_driver_init+0x18/0x20
                    [&lt;80008980&gt;] do_one_initcall+0x108/0x16c
                    [&lt;8081cca4&gt;] kernel_init_freeable+0x10c/0x1d0
                    [&lt;80611c50&gt;] kernel_init+0x10/0x120
                    [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c
   INITIAL USE at:
                   [&lt;8005f030&gt;] mark_lock+0x140/0x6ac
                   [&lt;8005ff0c&gt;] __lock_acquire+0x2dc/0x1cbc
                   [&lt;800620d0&gt;] lock_acquire+0x70/0x84
                   [&lt;8061d40c&gt;] _raw_spin_lock_irqsave+0x40/0x54
                   [&lt;804611f4&gt;] sdhci_do_set_ios+0x20/0x720
                   [&lt;80461924&gt;] sdhci_set_ios+0x30/0x3c
                   [&lt;8044cea0&gt;] mmc_power_up+0x6c/0xd0
                   [&lt;8044dac4&gt;] mmc_start_host+0x60/0x70
                   [&lt;8044eb3c&gt;] mmc_add_host+0x60/0x88
                   [&lt;8046225c&gt;] sdhci_add_host+0x7f8/0xbcc
                   [&lt;80464948&gt;] sdhci_esdhc_imx_probe+0x378/0x67c
                   [&lt;8032ee88&gt;] platform_drv_probe+0x20/0x50
                   [&lt;8032d48c&gt;] driver_probe_device+0x118/0x234
                   [&lt;8032d690&gt;] __driver_attach+0x9c/0xa0
                   [&lt;8032b89c&gt;] bus_for_each_dev+0x68/0x9c
                   [&lt;8032cf44&gt;] driver_attach+0x20/0x28
                   [&lt;8032cbc8&gt;] bus_add_driver+0x148/0x1f4
                   [&lt;8032dce0&gt;] driver_register+0x80/0x100
                   [&lt;8032ee54&gt;] __platform_driver_register+0x50/0x64
                   [&lt;8084b094&gt;] sdhci_esdhc_imx_driver_init+0x18/0x20
                   [&lt;80008980&gt;] do_one_initcall+0x108/0x16c
                   [&lt;8081cca4&gt;] kernel_init_freeable+0x10c/0x1d0
                   [&lt;80611c50&gt;] kernel_init+0x10/0x120
                   [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c
 }
 ... key      at: [&lt;80e040e8&gt;] __key.26952+0x0/0x8
 ... acquired at:
   [&lt;8005eb60&gt;] check_usage+0x3d0/0x5c0
   [&lt;8005edac&gt;] check_irq_usage+0x5c/0xb8
   [&lt;80060d38&gt;] __lock_acquire+0x1108/0x1cbc
   [&lt;800620d0&gt;] lock_acquire+0x70/0x84
   [&lt;8061a210&gt;] mutex_lock_nested+0x54/0x3c0
   [&lt;80480b08&gt;] clk_prepare_lock+0x44/0xe4
   [&lt;8048188c&gt;] clk_get_rate+0x14/0x64
   [&lt;8046374c&gt;] esdhc_pltfm_set_clock+0x20/0x2a4
   [&lt;8045d70c&gt;] sdhci_set_clock+0x4c/0x498
   [&lt;80461518&gt;] sdhci_do_set_ios+0x344/0x720
   [&lt;80461924&gt;] sdhci_set_ios+0x30/0x3c
   [&lt;8044c390&gt;] __mmc_set_clock+0x44/0x60
   [&lt;8044cd4c&gt;] mmc_set_clock+0x10/0x14
   [&lt;8044f8f4&gt;] mmc_init_card+0x1b4/0x1520
   [&lt;80450f00&gt;] mmc_attach_mmc+0xb4/0x194
   [&lt;8044da08&gt;] mmc_rescan+0x294/0x2f0
   [&lt;8003db94&gt;] process_one_work+0x1a4/0x468
   [&lt;8003e850&gt;] worker_thread+0x118/0x3e0
   [&lt;80044de0&gt;] kthread+0xd4/0xf0
   [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c

the dependencies between the lock to be acquired and HARDIRQ-irq-unsafe lock:
-&gt; (prepare_lock){+.+...} ops: 395 {
   HARDIRQ-ON-W at:
                    [&lt;8005f030&gt;] mark_lock+0x140/0x6ac
                    [&lt;8005f604&gt;] mark_held_locks+0x68/0x12c
                    [&lt;8005f780&gt;] trace_hardirqs_on_caller+0xb8/0x1d8
                    [&lt;8005f8b4&gt;] trace_hardirqs_on+0x14/0x18
                    [&lt;8061a130&gt;] mutex_trylock+0x180/0x20c
                    [&lt;80480ad8&gt;] clk_prepare_lock+0x14/0xe4
                    [&lt;804816a4&gt;] clk_notifier_register+0x28/0xf0
                    [&lt;80015120&gt;] twd_clk_init+0x50/0x68
                    [&lt;80008980&gt;] do_one_initcall+0x108/0x16c
                    [&lt;8081cca4&gt;] kernel_init_freeable+0x10c/0x1d0
                    [&lt;80611c50&gt;] kernel_init+0x10/0x120
                    [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c
   SOFTIRQ-ON-W at:
                    [&lt;8005f030&gt;] mark_lock+0x140/0x6ac
                    [&lt;8005f604&gt;] mark_held_locks+0x68/0x12c
                    [&lt;8005f7c8&gt;] trace_hardirqs_on_caller+0x100/0x1d8
                    [&lt;8005f8b4&gt;] trace_hardirqs_on+0x14/0x18
                    [&lt;8061a130&gt;] mutex_trylock+0x180/0x20c
                    [&lt;80480ad8&gt;] clk_prepare_lock+0x14/0xe4
                    [&lt;804816a4&gt;] clk_notifier_register+0x28/0xf0
                    [&lt;80015120&gt;] twd_clk_init+0x50/0x68
                    [&lt;80008980&gt;] do_one_initcall+0x108/0x16c
                    [&lt;8081cca4&gt;] kernel_init_freeable+0x10c/0x1d0
                    [&lt;80611c50&gt;] kernel_init+0x10/0x120
                    [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c
   INITIAL USE at:
                   [&lt;8005f030&gt;] mark_lock+0x140/0x6ac
                   [&lt;8005ff0c&gt;] __lock_acquire+0x2dc/0x1cbc
                   [&lt;800620d0&gt;] lock_acquire+0x70/0x84
                   [&lt;8061a0c8&gt;] mutex_trylock+0x118/0x20c
                   [&lt;80480ad8&gt;] clk_prepare_lock+0x14/0xe4
                   [&lt;80482af8&gt;] __clk_init+0x1c/0x45c
                   [&lt;8048306c&gt;] _clk_register+0xd0/0x170
                   [&lt;80483148&gt;] clk_register+0x3c/0x7c
                   [&lt;80483b4c&gt;] clk_register_fixed_rate+0x88/0xd8
                   [&lt;80483c04&gt;] of_fixed_clk_setup+0x68/0x94
                   [&lt;8084c6fc&gt;] of_clk_init+0x44/0x68
                   [&lt;808202b0&gt;] time_init+0x2c/0x38
                   [&lt;8081ca14&gt;] start_kernel+0x1e4/0x368
                   [&lt;10008074&gt;] 0x10008074
 }
 ... key      at: [&lt;808afebc&gt;] prepare_lock+0x38/0x48
 ... acquired at:
   [&lt;8005eb94&gt;] check_usage+0x404/0x5c0
   [&lt;8005edac&gt;] check_irq_usage+0x5c/0xb8
   [&lt;80060d38&gt;] __lock_acquire+0x1108/0x1cbc
   [&lt;800620d0&gt;] lock_acquire+0x70/0x84
   [&lt;8061a210&gt;] mutex_lock_nested+0x54/0x3c0
   [&lt;80480b08&gt;] clk_prepare_lock+0x44/0xe4
   [&lt;8048188c&gt;] clk_get_rate+0x14/0x64
   [&lt;8046374c&gt;] esdhc_pltfm_set_clock+0x20/0x2a4
   [&lt;8045d70c&gt;] sdhci_set_clock+0x4c/0x498
   [&lt;80461518&gt;] sdhci_do_set_ios+0x344/0x720
   [&lt;80461924&gt;] sdhci_set_ios+0x30/0x3c
   [&lt;8044c390&gt;] __mmc_set_clock+0x44/0x60
   [&lt;8044cd4c&gt;] mmc_set_clock+0x10/0x14
   [&lt;8044f8f4&gt;] mmc_init_card+0x1b4/0x1520
   [&lt;80450f00&gt;] mmc_attach_mmc+0xb4/0x194
   [&lt;8044da08&gt;] mmc_rescan+0x294/0x2f0
   [&lt;8003db94&gt;] process_one_work+0x1a4/0x468
   [&lt;8003e850&gt;] worker_thread+0x118/0x3e0
   [&lt;80044de0&gt;] kthread+0xd4/0xf0
   [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c

stack backtrace:
CPU: 2 PID: 29 Comm: kworker/u8:1 Not tainted 3.13.0-rc1+ #285
Workqueue: kmmcd mmc_rescan
Backtrace:
[&lt;80012160&gt;] (dump_backtrace+0x0/0x10c) from [&lt;80012438&gt;] (show_stack+0x18/0x1c)
 r6:00000000 r5:00000000 r4:8088ecc8 r3:bfa11200
[&lt;80012420&gt;] (show_stack+0x0/0x1c) from [&lt;80616b14&gt;] (dump_stack+0x84/0x9c)
[&lt;80616a90&gt;] (dump_stack+0x0/0x9c) from [&lt;8005ebb4&gt;] (check_usage+0x424/0x5c0)
 r5:80979940 r4:bfa29b44
[&lt;8005e790&gt;] (check_usage+0x0/0x5c0) from [&lt;8005edac&gt;] (check_irq_usage+0x5c/0xb8)
[&lt;8005ed50&gt;] (check_irq_usage+0x0/0xb8) from [&lt;80060d38&gt;] (__lock_acquire+0x1108/0x1cbc)
 r8:bfa115e8 r7:80df9884 r6:80dafa9c r5:00000003 r4:bfa115d0
[&lt;8005fc30&gt;] (__lock_acquire+0x0/0x1cbc) from [&lt;800620d0&gt;] (lock_acquire+0x70/0x84)
[&lt;80062060&gt;] (lock_acquire+0x0/0x84) from [&lt;8061a210&gt;] (mutex_lock_nested+0x54/0x3c0)
 r7:bfa11200 r6:80dafa9c r5:00000000 r4:80480b08
[&lt;8061a1bc&gt;] (mutex_lock_nested+0x0/0x3c0) from [&lt;80480b08&gt;] (clk_prepare_lock+0x44/0xe4)
[&lt;80480ac4&gt;] (clk_prepare_lock+0x0/0xe4) from [&lt;8048188c&gt;] (clk_get_rate+0x14/0x64)
 r6:03197500 r5:bf0e9aa8 r4:bf827400 r3:808ae128
[&lt;80481878&gt;] (clk_get_rate+0x0/0x64) from [&lt;8046374c&gt;] (esdhc_pltfm_set_clock+0x20/0x2a4)
 r5:bf0e9aa8 r4:bf0e9c40
[&lt;8046372c&gt;] (esdhc_pltfm_set_clock+0x0/0x2a4) from [&lt;8045d70c&gt;] (sdhci_set_clock+0x4c/0x498)
[&lt;8045d6c0&gt;] (sdhci_set_clock+0x0/0x498) from [&lt;80461518&gt;] (sdhci_do_set_ios+0x344/0x720)
 r8:0000003b r7:20000113 r6:bf0e9d68 r5:bf0e9aa8 r4:bf0e9c40
r3:00000000
[&lt;804611d4&gt;] (sdhci_do_set_ios+0x0/0x720) from [&lt;80461924&gt;] (sdhci_set_ios+0x30/0x3c)
 r9:00000004 r8:bf131000 r7:bf131048 r6:00000000 r5:bf0e9aa8
r4:bf0e9800
[&lt;804618f4&gt;] (sdhci_set_ios+0x0/0x3c) from [&lt;8044c390&gt;] (__mmc_set_clock+0x44/0x60)
 r5:03197500 r4:bf0e9800
[&lt;8044c34c&gt;] (__mmc_set_clock+0x0/0x60) from [&lt;8044cd4c&gt;] (mmc_set_clock+0x10/0x14)
 r5:00000000 r4:bf0e9800
[&lt;8044cd3c&gt;] (mmc_set_clock+0x0/0x14) from [&lt;8044f8f4&gt;] (mmc_init_card+0x1b4/0x1520)
[&lt;8044f740&gt;] (mmc_init_card+0x0/0x1520) from [&lt;80450f00&gt;] (mmc_attach_mmc+0xb4/0x194)
[&lt;80450e4c&gt;] (mmc_attach_mmc+0x0/0x194) from [&lt;8044da08&gt;] (mmc_rescan+0x294/0x2f0)
 r5:8065f358 r4:bf0e9af8
[&lt;8044d774&gt;] (mmc_rescan+0x0/0x2f0) from [&lt;8003db94&gt;] (process_one_work+0x1a4/0x468)
 r8:00000000 r7:bfa29eb0 r6:bf80dc00 r5:bf0e9af8 r4:bf9e3f00
r3:8044d774
[&lt;8003d9f0&gt;] (process_one_work+0x0/0x468) from [&lt;8003e850&gt;] (worker_thread+0x118/0x3e0)
[&lt;8003e738&gt;] (worker_thread+0x0/0x3e0) from [&lt;80044de0&gt;] (kthread+0xd4/0xf0)
[&lt;80044d0c&gt;] (kthread+0x0/0xf0) from [&lt;8000e9c8&gt;] (ret_from_fork+0x14/0x2c)
 r7:00000000 r6:00000000 r5:80044d0c r4:bf9e7f00

Fixes: 0ddf03c mmc: esdhc-imx: parse max-frequency from devicetree
Signed-off-by: Dong Aisheng &lt;b29396@freescale.com&gt;
Acked-by: Shawn Guo &lt;shawn.guo@linaro.org&gt;
Tested-by: Philippe De Muyter &lt;phdm@macqel.be&gt;
Signed-off-by: Chris Ball &lt;chris@printf.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit a974862faee199cba3ff36b5a148df5fd34bd1e7 upstream.

Sometimes we may meet the following lockdep issue.
The root cause is .set_clock callback is executed with spin_lock_irqsave
in sdhci_do_set_ios. However, the IMX set_clock callback will try to access
clk_get_rate which is using a mutex lock.

The fix avoids access mutex in .set_clock callback by initializing the
pltfm_host-&gt;clock at probe time and use it later instead of calling
clk_get_rate again in atomic context.

[ INFO: HARDIRQ-safe -&gt; HARDIRQ-unsafe lock order detected ]
3.13.0-rc1+ #285 Not tainted
------------------------------------------------------
kworker/u8:1/29 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
 (prepare_lock){+.+...}, at: [&lt;80480b08&gt;] clk_prepare_lock+0x44/0xe4

and this task is already holding:
 (&amp;(&amp;host-&gt;lock)-&gt;rlock#2){-.-...}, at: [&lt;804611f4&gt;] sdhci_do_set_ios+0x20/0x720
which would create a new lock dependency:
 (&amp;(&amp;host-&gt;lock)-&gt;rlock#2){-.-...} -&gt; (prepare_lock){+.+...}

but this new dependency connects a HARDIRQ-irq-safe lock:
 (&amp;(&amp;host-&gt;lock)-&gt;rlock#2){-.-...}
... which became HARDIRQ-irq-safe at:
  [&lt;8005f030&gt;] mark_lock+0x140/0x6ac
  [&lt;80060760&gt;] __lock_acquire+0xb30/0x1cbc
  [&lt;800620d0&gt;] lock_acquire+0x70/0x84
  [&lt;8061d2f0&gt;] _raw_spin_lock+0x30/0x40
  [&lt;80460668&gt;] sdhci_irq+0x24/0xa68
  [&lt;8006b1d4&gt;] handle_irq_event_percpu+0x54/0x18c
  [&lt;8006b350&gt;] handle_irq_event+0x44/0x64
  [&lt;8006e50c&gt;] handle_fasteoi_irq+0xa0/0x170
  [&lt;8006a8f0&gt;] generic_handle_irq+0x30/0x44
  [&lt;8000f238&gt;] handle_IRQ+0x54/0xbc
  [&lt;8000864c&gt;] gic_handle_irq+0x30/0x64
  [&lt;80013024&gt;] __irq_svc+0x44/0x5c
  [&lt;80614c58&gt;] printk+0x38/0x40
  [&lt;804622a8&gt;] sdhci_add_host+0x844/0xbcc
  [&lt;80464948&gt;] sdhci_esdhc_imx_probe+0x378/0x67c
  [&lt;8032ee88&gt;] platform_drv_probe+0x20/0x50
  [&lt;8032d48c&gt;] driver_probe_device+0x118/0x234
  [&lt;8032d690&gt;] __driver_attach+0x9c/0xa0
  [&lt;8032b89c&gt;] bus_for_each_dev+0x68/0x9c
  [&lt;8032cf44&gt;] driver_attach+0x20/0x28
  [&lt;8032cbc8&gt;] bus_add_driver+0x148/0x1f4
  [&lt;8032dce0&gt;] driver_register+0x80/0x100
  [&lt;8032ee54&gt;] __platform_driver_register+0x50/0x64
  [&lt;8084b094&gt;] sdhci_esdhc_imx_driver_init+0x18/0x20
  [&lt;80008980&gt;] do_one_initcall+0x108/0x16c
  [&lt;8081cca4&gt;] kernel_init_freeable+0x10c/0x1d0
  [&lt;80611c50&gt;] kernel_init+0x10/0x120
  [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c

to a HARDIRQ-irq-unsafe lock:
 (prepare_lock){+.+...}
... which became HARDIRQ-irq-unsafe at:
...  [&lt;8005f030&gt;] mark_lock+0x140/0x6ac
  [&lt;8005f604&gt;] mark_held_locks+0x68/0x12c
  [&lt;8005f780&gt;] trace_hardirqs_on_caller+0xb8/0x1d8
  [&lt;8005f8b4&gt;] trace_hardirqs_on+0x14/0x18
  [&lt;8061a130&gt;] mutex_trylock+0x180/0x20c
  [&lt;80480ad8&gt;] clk_prepare_lock+0x14/0xe4
  [&lt;804816a4&gt;] clk_notifier_register+0x28/0xf0
  [&lt;80015120&gt;] twd_clk_init+0x50/0x68
  [&lt;80008980&gt;] do_one_initcall+0x108/0x16c
  [&lt;8081cca4&gt;] kernel_init_freeable+0x10c/0x1d0
  [&lt;80611c50&gt;] kernel_init+0x10/0x120
  [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c

other info that might help us debug this:

 Possible interrupt unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(prepare_lock);
                               local_irq_disable();
                               lock(&amp;(&amp;host-&gt;lock)-&gt;rlock#2);
                               lock(prepare_lock);
  &lt;Interrupt&gt;
    lock(&amp;(&amp;host-&gt;lock)-&gt;rlock#2);

 *** DEADLOCK ***

3 locks held by kworker/u8:1/29:
 #0:  (kmmcd){.+.+.+}, at: [&lt;8003db18&gt;] process_one_work+0x128/0x468
 #1:  ((&amp;(&amp;host-&gt;detect)-&gt;work)){+.+.+.}, at: [&lt;8003db18&gt;] process_one_work+0x128/0x468
 #2:  (&amp;(&amp;host-&gt;lock)-&gt;rlock#2){-.-...}, at: [&lt;804611f4&gt;] sdhci_do_set_ios+0x20/0x720

the dependencies between HARDIRQ-irq-safe lock and the holding lock:
-&gt; (&amp;(&amp;host-&gt;lock)-&gt;rlock#2){-.-...} ops: 330 {
   IN-HARDIRQ-W at:
                    [&lt;8005f030&gt;] mark_lock+0x140/0x6ac
                    [&lt;80060760&gt;] __lock_acquire+0xb30/0x1cbc
                    [&lt;800620d0&gt;] lock_acquire+0x70/0x84
                    [&lt;8061d2f0&gt;] _raw_spin_lock+0x30/0x40
                    [&lt;80460668&gt;] sdhci_irq+0x24/0xa68
                    [&lt;8006b1d4&gt;] handle_irq_event_percpu+0x54/0x18c
                    [&lt;8006b350&gt;] handle_irq_event+0x44/0x64
                    [&lt;8006e50c&gt;] handle_fasteoi_irq+0xa0/0x170
                    [&lt;8006a8f0&gt;] generic_handle_irq+0x30/0x44
                    [&lt;8000f238&gt;] handle_IRQ+0x54/0xbc
                    [&lt;8000864c&gt;] gic_handle_irq+0x30/0x64
                    [&lt;80013024&gt;] __irq_svc+0x44/0x5c
                    [&lt;80614c58&gt;] printk+0x38/0x40
                    [&lt;804622a8&gt;] sdhci_add_host+0x844/0xbcc
                    [&lt;80464948&gt;] sdhci_esdhc_imx_probe+0x378/0x67c
                    [&lt;8032ee88&gt;] platform_drv_probe+0x20/0x50
                    [&lt;8032d48c&gt;] driver_probe_device+0x118/0x234
                    [&lt;8032d690&gt;] __driver_attach+0x9c/0xa0
                    [&lt;8032b89c&gt;] bus_for_each_dev+0x68/0x9c
                    [&lt;8032cf44&gt;] driver_attach+0x20/0x28
                    [&lt;8032cbc8&gt;] bus_add_driver+0x148/0x1f4
                    [&lt;8032dce0&gt;] driver_register+0x80/0x100
                    [&lt;8032ee54&gt;] __platform_driver_register+0x50/0x64
                    [&lt;8084b094&gt;] sdhci_esdhc_imx_driver_init+0x18/0x20
                    [&lt;80008980&gt;] do_one_initcall+0x108/0x16c
                    [&lt;8081cca4&gt;] kernel_init_freeable+0x10c/0x1d0
                    [&lt;80611c50&gt;] kernel_init+0x10/0x120
                    [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c
   IN-SOFTIRQ-W at:
                    [&lt;8005f030&gt;] mark_lock+0x140/0x6ac
                    [&lt;80060204&gt;] __lock_acquire+0x5d4/0x1cbc
                    [&lt;800620d0&gt;] lock_acquire+0x70/0x84
                    [&lt;8061d40c&gt;] _raw_spin_lock_irqsave+0x40/0x54
                    [&lt;8045e4a4&gt;] sdhci_tasklet_finish+0x1c/0x120
                    [&lt;8002b538&gt;] tasklet_action+0xa0/0x15c
                    [&lt;8002b778&gt;] __do_softirq+0x118/0x290
                    [&lt;8002bcf4&gt;] irq_exit+0xb4/0x10c
                    [&lt;8000f240&gt;] handle_IRQ+0x5c/0xbc
                    [&lt;8000864c&gt;] gic_handle_irq+0x30/0x64
                    [&lt;80013024&gt;] __irq_svc+0x44/0x5c
                    [&lt;80614c58&gt;] printk+0x38/0x40
                    [&lt;804622a8&gt;] sdhci_add_host+0x844/0xbcc
                    [&lt;80464948&gt;] sdhci_esdhc_imx_probe+0x378/0x67c
                    [&lt;8032ee88&gt;] platform_drv_probe+0x20/0x50
                    [&lt;8032d48c&gt;] driver_probe_device+0x118/0x234
                    [&lt;8032d690&gt;] __driver_attach+0x9c/0xa0
                    [&lt;8032b89c&gt;] bus_for_each_dev+0x68/0x9c
                    [&lt;8032cf44&gt;] driver_attach+0x20/0x28
                    [&lt;8032cbc8&gt;] bus_add_driver+0x148/0x1f4
                    [&lt;8032dce0&gt;] driver_register+0x80/0x100
                    [&lt;8032ee54&gt;] __platform_driver_register+0x50/0x64
                    [&lt;8084b094&gt;] sdhci_esdhc_imx_driver_init+0x18/0x20
                    [&lt;80008980&gt;] do_one_initcall+0x108/0x16c
                    [&lt;8081cca4&gt;] kernel_init_freeable+0x10c/0x1d0
                    [&lt;80611c50&gt;] kernel_init+0x10/0x120
                    [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c
   INITIAL USE at:
                   [&lt;8005f030&gt;] mark_lock+0x140/0x6ac
                   [&lt;8005ff0c&gt;] __lock_acquire+0x2dc/0x1cbc
                   [&lt;800620d0&gt;] lock_acquire+0x70/0x84
                   [&lt;8061d40c&gt;] _raw_spin_lock_irqsave+0x40/0x54
                   [&lt;804611f4&gt;] sdhci_do_set_ios+0x20/0x720
                   [&lt;80461924&gt;] sdhci_set_ios+0x30/0x3c
                   [&lt;8044cea0&gt;] mmc_power_up+0x6c/0xd0
                   [&lt;8044dac4&gt;] mmc_start_host+0x60/0x70
                   [&lt;8044eb3c&gt;] mmc_add_host+0x60/0x88
                   [&lt;8046225c&gt;] sdhci_add_host+0x7f8/0xbcc
                   [&lt;80464948&gt;] sdhci_esdhc_imx_probe+0x378/0x67c
                   [&lt;8032ee88&gt;] platform_drv_probe+0x20/0x50
                   [&lt;8032d48c&gt;] driver_probe_device+0x118/0x234
                   [&lt;8032d690&gt;] __driver_attach+0x9c/0xa0
                   [&lt;8032b89c&gt;] bus_for_each_dev+0x68/0x9c
                   [&lt;8032cf44&gt;] driver_attach+0x20/0x28
                   [&lt;8032cbc8&gt;] bus_add_driver+0x148/0x1f4
                   [&lt;8032dce0&gt;] driver_register+0x80/0x100
                   [&lt;8032ee54&gt;] __platform_driver_register+0x50/0x64
                   [&lt;8084b094&gt;] sdhci_esdhc_imx_driver_init+0x18/0x20
                   [&lt;80008980&gt;] do_one_initcall+0x108/0x16c
                   [&lt;8081cca4&gt;] kernel_init_freeable+0x10c/0x1d0
                   [&lt;80611c50&gt;] kernel_init+0x10/0x120
                   [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c
 }
 ... key      at: [&lt;80e040e8&gt;] __key.26952+0x0/0x8
 ... acquired at:
   [&lt;8005eb60&gt;] check_usage+0x3d0/0x5c0
   [&lt;8005edac&gt;] check_irq_usage+0x5c/0xb8
   [&lt;80060d38&gt;] __lock_acquire+0x1108/0x1cbc
   [&lt;800620d0&gt;] lock_acquire+0x70/0x84
   [&lt;8061a210&gt;] mutex_lock_nested+0x54/0x3c0
   [&lt;80480b08&gt;] clk_prepare_lock+0x44/0xe4
   [&lt;8048188c&gt;] clk_get_rate+0x14/0x64
   [&lt;8046374c&gt;] esdhc_pltfm_set_clock+0x20/0x2a4
   [&lt;8045d70c&gt;] sdhci_set_clock+0x4c/0x498
   [&lt;80461518&gt;] sdhci_do_set_ios+0x344/0x720
   [&lt;80461924&gt;] sdhci_set_ios+0x30/0x3c
   [&lt;8044c390&gt;] __mmc_set_clock+0x44/0x60
   [&lt;8044cd4c&gt;] mmc_set_clock+0x10/0x14
   [&lt;8044f8f4&gt;] mmc_init_card+0x1b4/0x1520
   [&lt;80450f00&gt;] mmc_attach_mmc+0xb4/0x194
   [&lt;8044da08&gt;] mmc_rescan+0x294/0x2f0
   [&lt;8003db94&gt;] process_one_work+0x1a4/0x468
   [&lt;8003e850&gt;] worker_thread+0x118/0x3e0
   [&lt;80044de0&gt;] kthread+0xd4/0xf0
   [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c

the dependencies between the lock to be acquired and HARDIRQ-irq-unsafe lock:
-&gt; (prepare_lock){+.+...} ops: 395 {
   HARDIRQ-ON-W at:
                    [&lt;8005f030&gt;] mark_lock+0x140/0x6ac
                    [&lt;8005f604&gt;] mark_held_locks+0x68/0x12c
                    [&lt;8005f780&gt;] trace_hardirqs_on_caller+0xb8/0x1d8
                    [&lt;8005f8b4&gt;] trace_hardirqs_on+0x14/0x18
                    [&lt;8061a130&gt;] mutex_trylock+0x180/0x20c
                    [&lt;80480ad8&gt;] clk_prepare_lock+0x14/0xe4
                    [&lt;804816a4&gt;] clk_notifier_register+0x28/0xf0
                    [&lt;80015120&gt;] twd_clk_init+0x50/0x68
                    [&lt;80008980&gt;] do_one_initcall+0x108/0x16c
                    [&lt;8081cca4&gt;] kernel_init_freeable+0x10c/0x1d0
                    [&lt;80611c50&gt;] kernel_init+0x10/0x120
                    [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c
   SOFTIRQ-ON-W at:
                    [&lt;8005f030&gt;] mark_lock+0x140/0x6ac
                    [&lt;8005f604&gt;] mark_held_locks+0x68/0x12c
                    [&lt;8005f7c8&gt;] trace_hardirqs_on_caller+0x100/0x1d8
                    [&lt;8005f8b4&gt;] trace_hardirqs_on+0x14/0x18
                    [&lt;8061a130&gt;] mutex_trylock+0x180/0x20c
                    [&lt;80480ad8&gt;] clk_prepare_lock+0x14/0xe4
                    [&lt;804816a4&gt;] clk_notifier_register+0x28/0xf0
                    [&lt;80015120&gt;] twd_clk_init+0x50/0x68
                    [&lt;80008980&gt;] do_one_initcall+0x108/0x16c
                    [&lt;8081cca4&gt;] kernel_init_freeable+0x10c/0x1d0
                    [&lt;80611c50&gt;] kernel_init+0x10/0x120
                    [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c
   INITIAL USE at:
                   [&lt;8005f030&gt;] mark_lock+0x140/0x6ac
                   [&lt;8005ff0c&gt;] __lock_acquire+0x2dc/0x1cbc
                   [&lt;800620d0&gt;] lock_acquire+0x70/0x84
                   [&lt;8061a0c8&gt;] mutex_trylock+0x118/0x20c
                   [&lt;80480ad8&gt;] clk_prepare_lock+0x14/0xe4
                   [&lt;80482af8&gt;] __clk_init+0x1c/0x45c
                   [&lt;8048306c&gt;] _clk_register+0xd0/0x170
                   [&lt;80483148&gt;] clk_register+0x3c/0x7c
                   [&lt;80483b4c&gt;] clk_register_fixed_rate+0x88/0xd8
                   [&lt;80483c04&gt;] of_fixed_clk_setup+0x68/0x94
                   [&lt;8084c6fc&gt;] of_clk_init+0x44/0x68
                   [&lt;808202b0&gt;] time_init+0x2c/0x38
                   [&lt;8081ca14&gt;] start_kernel+0x1e4/0x368
                   [&lt;10008074&gt;] 0x10008074
 }
 ... key      at: [&lt;808afebc&gt;] prepare_lock+0x38/0x48
 ... acquired at:
   [&lt;8005eb94&gt;] check_usage+0x404/0x5c0
   [&lt;8005edac&gt;] check_irq_usage+0x5c/0xb8
   [&lt;80060d38&gt;] __lock_acquire+0x1108/0x1cbc
   [&lt;800620d0&gt;] lock_acquire+0x70/0x84
   [&lt;8061a210&gt;] mutex_lock_nested+0x54/0x3c0
   [&lt;80480b08&gt;] clk_prepare_lock+0x44/0xe4
   [&lt;8048188c&gt;] clk_get_rate+0x14/0x64
   [&lt;8046374c&gt;] esdhc_pltfm_set_clock+0x20/0x2a4
   [&lt;8045d70c&gt;] sdhci_set_clock+0x4c/0x498
   [&lt;80461518&gt;] sdhci_do_set_ios+0x344/0x720
   [&lt;80461924&gt;] sdhci_set_ios+0x30/0x3c
   [&lt;8044c390&gt;] __mmc_set_clock+0x44/0x60
   [&lt;8044cd4c&gt;] mmc_set_clock+0x10/0x14
   [&lt;8044f8f4&gt;] mmc_init_card+0x1b4/0x1520
   [&lt;80450f00&gt;] mmc_attach_mmc+0xb4/0x194
   [&lt;8044da08&gt;] mmc_rescan+0x294/0x2f0
   [&lt;8003db94&gt;] process_one_work+0x1a4/0x468
   [&lt;8003e850&gt;] worker_thread+0x118/0x3e0
   [&lt;80044de0&gt;] kthread+0xd4/0xf0
   [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c

stack backtrace:
CPU: 2 PID: 29 Comm: kworker/u8:1 Not tainted 3.13.0-rc1+ #285
Workqueue: kmmcd mmc_rescan
Backtrace:
[&lt;80012160&gt;] (dump_backtrace+0x0/0x10c) from [&lt;80012438&gt;] (show_stack+0x18/0x1c)
 r6:00000000 r5:00000000 r4:8088ecc8 r3:bfa11200
[&lt;80012420&gt;] (show_stack+0x0/0x1c) from [&lt;80616b14&gt;] (dump_stack+0x84/0x9c)
[&lt;80616a90&gt;] (dump_stack+0x0/0x9c) from [&lt;8005ebb4&gt;] (check_usage+0x424/0x5c0)
 r5:80979940 r4:bfa29b44
[&lt;8005e790&gt;] (check_usage+0x0/0x5c0) from [&lt;8005edac&gt;] (check_irq_usage+0x5c/0xb8)
[&lt;8005ed50&gt;] (check_irq_usage+0x0/0xb8) from [&lt;80060d38&gt;] (__lock_acquire+0x1108/0x1cbc)
 r8:bfa115e8 r7:80df9884 r6:80dafa9c r5:00000003 r4:bfa115d0
[&lt;8005fc30&gt;] (__lock_acquire+0x0/0x1cbc) from [&lt;800620d0&gt;] (lock_acquire+0x70/0x84)
[&lt;80062060&gt;] (lock_acquire+0x0/0x84) from [&lt;8061a210&gt;] (mutex_lock_nested+0x54/0x3c0)
 r7:bfa11200 r6:80dafa9c r5:00000000 r4:80480b08
[&lt;8061a1bc&gt;] (mutex_lock_nested+0x0/0x3c0) from [&lt;80480b08&gt;] (clk_prepare_lock+0x44/0xe4)
[&lt;80480ac4&gt;] (clk_prepare_lock+0x0/0xe4) from [&lt;8048188c&gt;] (clk_get_rate+0x14/0x64)
 r6:03197500 r5:bf0e9aa8 r4:bf827400 r3:808ae128
[&lt;80481878&gt;] (clk_get_rate+0x0/0x64) from [&lt;8046374c&gt;] (esdhc_pltfm_set_clock+0x20/0x2a4)
 r5:bf0e9aa8 r4:bf0e9c40
[&lt;8046372c&gt;] (esdhc_pltfm_set_clock+0x0/0x2a4) from [&lt;8045d70c&gt;] (sdhci_set_clock+0x4c/0x498)
[&lt;8045d6c0&gt;] (sdhci_set_clock+0x0/0x498) from [&lt;80461518&gt;] (sdhci_do_set_ios+0x344/0x720)
 r8:0000003b r7:20000113 r6:bf0e9d68 r5:bf0e9aa8 r4:bf0e9c40
r3:00000000
[&lt;804611d4&gt;] (sdhci_do_set_ios+0x0/0x720) from [&lt;80461924&gt;] (sdhci_set_ios+0x30/0x3c)
 r9:00000004 r8:bf131000 r7:bf131048 r6:00000000 r5:bf0e9aa8
r4:bf0e9800
[&lt;804618f4&gt;] (sdhci_set_ios+0x0/0x3c) from [&lt;8044c390&gt;] (__mmc_set_clock+0x44/0x60)
 r5:03197500 r4:bf0e9800
[&lt;8044c34c&gt;] (__mmc_set_clock+0x0/0x60) from [&lt;8044cd4c&gt;] (mmc_set_clock+0x10/0x14)
 r5:00000000 r4:bf0e9800
[&lt;8044cd3c&gt;] (mmc_set_clock+0x0/0x14) from [&lt;8044f8f4&gt;] (mmc_init_card+0x1b4/0x1520)
[&lt;8044f740&gt;] (mmc_init_card+0x0/0x1520) from [&lt;80450f00&gt;] (mmc_attach_mmc+0xb4/0x194)
[&lt;80450e4c&gt;] (mmc_attach_mmc+0x0/0x194) from [&lt;8044da08&gt;] (mmc_rescan+0x294/0x2f0)
 r5:8065f358 r4:bf0e9af8
[&lt;8044d774&gt;] (mmc_rescan+0x0/0x2f0) from [&lt;8003db94&gt;] (process_one_work+0x1a4/0x468)
 r8:00000000 r7:bfa29eb0 r6:bf80dc00 r5:bf0e9af8 r4:bf9e3f00
r3:8044d774
[&lt;8003d9f0&gt;] (process_one_work+0x0/0x468) from [&lt;8003e850&gt;] (worker_thread+0x118/0x3e0)
[&lt;8003e738&gt;] (worker_thread+0x0/0x3e0) from [&lt;80044de0&gt;] (kthread+0xd4/0xf0)
[&lt;80044d0c&gt;] (kthread+0x0/0xf0) from [&lt;8000e9c8&gt;] (ret_from_fork+0x14/0x2c)
 r7:00000000 r6:00000000 r5:80044d0c r4:bf9e7f00

Fixes: 0ddf03c mmc: esdhc-imx: parse max-frequency from devicetree
Signed-off-by: Dong Aisheng &lt;b29396@freescale.com&gt;
Acked-by: Shawn Guo &lt;shawn.guo@linaro.org&gt;
Tested-by: Philippe De Muyter &lt;phdm@macqel.be&gt;
Signed-off-by: Chris Ball &lt;chris@printf.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sdhci: fix lockdep error in tuning routine</title>
<updated>2014-02-06T19:34:09+00:00</updated>
<author>
<name>Aisheng Dong</name>
<email>b29396@freescale.com</email>
</author>
<published>2013-12-23T11:13:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ee02211febfb1dc0ee77e2b641d48910422ed872'/>
<id>ee02211febfb1dc0ee77e2b641d48910422ed872</id>
<content type='text'>
commit 2b35bd83467df6f8284b9148d6f768148c3a5e5f upstream.

The sdhci_execute_tuning routine gets lock separately by
disable_irq(host-&gt;irq);
spin_lock(&amp;host-&gt;lock);
It will cause the following lockdep error message since the &amp;host-&gt;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} -&gt; {HARDIRQ-ON-W} usage.
kworker/u2:1/33 [HC0[0]:SC0[0]:HE1:SE1] takes:
 (&amp;(&amp;host-&gt;lock)-&gt;rlock){?.-...}, at: [&lt;8045f7f4&gt;] sdhci_execute_tuning+0x4c/0x710
{IN-HARDIRQ-W} state was registered at:
  [&lt;8005f030&gt;] mark_lock+0x140/0x6ac
  [&lt;80060760&gt;] __lock_acquire+0xb30/0x1cbc
  [&lt;800620d0&gt;] lock_acquire+0x70/0x84
  [&lt;8061d1c8&gt;] _raw_spin_lock+0x30/0x40
  [&lt;804605cc&gt;] sdhci_irq+0x24/0xa68
  [&lt;8006b1d4&gt;] handle_irq_event_percpu+0x54/0x18c
  [&lt;8006b350&gt;] handle_irq_event+0x44/0x64
  [&lt;8006e50c&gt;] handle_fasteoi_irq+0xa0/0x170
  [&lt;8006a8f0&gt;] generic_handle_irq+0x30/0x44
  [&lt;8000f238&gt;] handle_IRQ+0x54/0xbc
  [&lt;8000864c&gt;] gic_handle_irq+0x30/0x64
  [&lt;80013024&gt;] __irq_svc+0x44/0x5c
  [&lt;80329bf4&gt;] dev_vprintk_emit+0x50/0x58
  [&lt;80329c24&gt;] dev_printk_emit+0x28/0x30
  [&lt;80329fec&gt;] __dev_printk+0x4c/0x90
  [&lt;8032a180&gt;] dev_err+0x3c/0x48
  [&lt;802dd4f0&gt;] _regulator_get+0x158/0x1cc
  [&lt;802dd5b4&gt;] regulator_get_optional+0x18/0x1c
  [&lt;80461df4&gt;] sdhci_add_host+0x42c/0xbd8
  [&lt;80464820&gt;] sdhci_esdhc_imx_probe+0x378/0x67c
  [&lt;8032ee88&gt;] platform_drv_probe+0x20/0x50
  [&lt;8032d48c&gt;] driver_probe_device+0x118/0x234
  [&lt;8032d690&gt;] __driver_attach+0x9c/0xa0
  [&lt;8032b89c&gt;] bus_for_each_dev+0x68/0x9c
  [&lt;8032cf44&gt;] driver_attach+0x20/0x28
  [&lt;8032cbc8&gt;] bus_add_driver+0x148/0x1f4
  [&lt;8032dce0&gt;] driver_register+0x80/0x100
  [&lt;8032ee54&gt;] __platform_driver_register+0x50/0x64
  [&lt;8084b094&gt;] sdhci_esdhc_imx_driver_init+0x18/0x20
  [&lt;80008980&gt;] do_one_initcall+0x108/0x16c
  [&lt;8081cca4&gt;] kernel_init_freeable+0x10c/0x1d0
  [&lt;80611b28&gt;] kernel_init+0x10/0x120
  [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c
irq event stamp: 805
hardirqs last  enabled at (805): [&lt;8061d43c&gt;] _raw_spin_unlock_irqrestore+0x38/0x4c
hardirqs last disabled at (804): [&lt;8061d2c8&gt;] _raw_spin_lock_irqsave+0x24/0x54
softirqs last  enabled at (570): [&lt;8002b824&gt;] __do_softirq+0x1c4/0x290
softirqs last disabled at (561): [&lt;8002bcf4&gt;] irq_exit+0xb4/0x10c

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&amp;(&amp;host-&gt;lock)-&gt;rlock);
  &lt;Interrupt&gt;
    lock(&amp;(&amp;host-&gt;lock)-&gt;rlock);

 *** DEADLOCK ***

2 locks held by kworker/u2:1/33:
 #0:  (kmmcd){.+.+..}, at: [&lt;8003db18&gt;] process_one_work+0x128/0x468
 #1:  ((&amp;(&amp;host-&gt;detect)-&gt;work)){+.+...}, at: [&lt;8003db18&gt;] 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:
[&lt;80012160&gt;] (dump_backtrace+0x0/0x10c) from [&lt;80012438&gt;] (show_stack+0x18/0x1c)
 r6:bfad0900 r5:00000000 r4:8088ecc8 r3:bfad0900
[&lt;80012420&gt;] (show_stack+0x0/0x1c) from [&lt;806169ec&gt;] (dump_stack+0x84/0x9c)
[&lt;80616968&gt;] (dump_stack+0x0/0x9c) from [&lt;806147b4&gt;] (print_usage_bug+0x260/0x2d0)
 r5:8076ba88 r4:80977410
[&lt;80614554&gt;] (print_usage_bug+0x0/0x2d0) from [&lt;8005f0d0&gt;] (mark_lock+0x1e0/0x6ac)
 r9:8005e678 r8:00000000 r7:bfad0900 r6:00001015 r5:bfad0cd0
r4:00000002
[&lt;8005eef0&gt;] (mark_lock+0x0/0x6ac) from [&lt;80060234&gt;] (__lock_acquire+0x604/0x1cbc)
[&lt;8005fc30&gt;] (__lock_acquire+0x0/0x1cbc) from [&lt;800620d0&gt;] (lock_acquire+0x70/0x84)
[&lt;80062060&gt;] (lock_acquire+0x0/0x84) from [&lt;8061d1c8&gt;] (_raw_spin_lock+0x30/0x40)
 r7:00000000 r6:bfb63000 r5:00000000 r4:bfb60568
[&lt;8061d198&gt;] (_raw_spin_lock+0x0/0x40) from [&lt;8045f7f4&gt;] (sdhci_execute_tuning+0x4c/0x710)
 r4:bfb60000
[&lt;8045f7a8&gt;] (sdhci_execute_tuning+0x0/0x710) from [&lt;80453454&gt;] (mmc_sd_init_card+0x5f8/0x660)
[&lt;80452e5c&gt;] (mmc_sd_init_card+0x0/0x660) from [&lt;80453748&gt;] (mmc_attach_sd+0xb4/0x180)
 r9:bf92d400 r8:8065f364 r7:00061a80 r6:bfb60000 r5:8065f358
r4:bfb60000
[&lt;80453694&gt;] (mmc_attach_sd+0x0/0x180) from [&lt;8044d9f8&gt;] (mmc_rescan+0x284/0x2f0)
 r5:8065f358 r4:bfb602f8
[&lt;8044d774&gt;] (mmc_rescan+0x0/0x2f0) from [&lt;8003db94&gt;] (process_one_work+0x1a4/0x468)
 r8:00000000 r7:bfb55eb0 r6:bf80dc00 r5:bfb602f8 r4:bfb35980
r3:8044d774
[&lt;8003d9f0&gt;] (process_one_work+0x0/0x468) from [&lt;8003e850&gt;] (worker_thread+0x118/0x3e0)
[&lt;8003e738&gt;] (worker_thread+0x0/0x3e0) from [&lt;80044de0&gt;] (kthread+0xd4/0xf0)
[&lt;80044d0c&gt;] (kthread+0x0/0xf0) from [&lt;8000e9c8&gt;] (ret_from_fork+0x14/0x2c)
 r7:00000000 r6:00000000 r5:80044d0c r4:bfb37b40

Signed-off-by: Dong Aisheng &lt;b29396@freescale.com&gt;
Signed-off-by: Chris Ball &lt;chris@printf.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 2b35bd83467df6f8284b9148d6f768148c3a5e5f upstream.

The sdhci_execute_tuning routine gets lock separately by
disable_irq(host-&gt;irq);
spin_lock(&amp;host-&gt;lock);
It will cause the following lockdep error message since the &amp;host-&gt;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} -&gt; {HARDIRQ-ON-W} usage.
kworker/u2:1/33 [HC0[0]:SC0[0]:HE1:SE1] takes:
 (&amp;(&amp;host-&gt;lock)-&gt;rlock){?.-...}, at: [&lt;8045f7f4&gt;] sdhci_execute_tuning+0x4c/0x710
{IN-HARDIRQ-W} state was registered at:
  [&lt;8005f030&gt;] mark_lock+0x140/0x6ac
  [&lt;80060760&gt;] __lock_acquire+0xb30/0x1cbc
  [&lt;800620d0&gt;] lock_acquire+0x70/0x84
  [&lt;8061d1c8&gt;] _raw_spin_lock+0x30/0x40
  [&lt;804605cc&gt;] sdhci_irq+0x24/0xa68
  [&lt;8006b1d4&gt;] handle_irq_event_percpu+0x54/0x18c
  [&lt;8006b350&gt;] handle_irq_event+0x44/0x64
  [&lt;8006e50c&gt;] handle_fasteoi_irq+0xa0/0x170
  [&lt;8006a8f0&gt;] generic_handle_irq+0x30/0x44
  [&lt;8000f238&gt;] handle_IRQ+0x54/0xbc
  [&lt;8000864c&gt;] gic_handle_irq+0x30/0x64
  [&lt;80013024&gt;] __irq_svc+0x44/0x5c
  [&lt;80329bf4&gt;] dev_vprintk_emit+0x50/0x58
  [&lt;80329c24&gt;] dev_printk_emit+0x28/0x30
  [&lt;80329fec&gt;] __dev_printk+0x4c/0x90
  [&lt;8032a180&gt;] dev_err+0x3c/0x48
  [&lt;802dd4f0&gt;] _regulator_get+0x158/0x1cc
  [&lt;802dd5b4&gt;] regulator_get_optional+0x18/0x1c
  [&lt;80461df4&gt;] sdhci_add_host+0x42c/0xbd8
  [&lt;80464820&gt;] sdhci_esdhc_imx_probe+0x378/0x67c
  [&lt;8032ee88&gt;] platform_drv_probe+0x20/0x50
  [&lt;8032d48c&gt;] driver_probe_device+0x118/0x234
  [&lt;8032d690&gt;] __driver_attach+0x9c/0xa0
  [&lt;8032b89c&gt;] bus_for_each_dev+0x68/0x9c
  [&lt;8032cf44&gt;] driver_attach+0x20/0x28
  [&lt;8032cbc8&gt;] bus_add_driver+0x148/0x1f4
  [&lt;8032dce0&gt;] driver_register+0x80/0x100
  [&lt;8032ee54&gt;] __platform_driver_register+0x50/0x64
  [&lt;8084b094&gt;] sdhci_esdhc_imx_driver_init+0x18/0x20
  [&lt;80008980&gt;] do_one_initcall+0x108/0x16c
  [&lt;8081cca4&gt;] kernel_init_freeable+0x10c/0x1d0
  [&lt;80611b28&gt;] kernel_init+0x10/0x120
  [&lt;8000e9c8&gt;] ret_from_fork+0x14/0x2c
irq event stamp: 805
hardirqs last  enabled at (805): [&lt;8061d43c&gt;] _raw_spin_unlock_irqrestore+0x38/0x4c
hardirqs last disabled at (804): [&lt;8061d2c8&gt;] _raw_spin_lock_irqsave+0x24/0x54
softirqs last  enabled at (570): [&lt;8002b824&gt;] __do_softirq+0x1c4/0x290
softirqs last disabled at (561): [&lt;8002bcf4&gt;] irq_exit+0xb4/0x10c

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&amp;(&amp;host-&gt;lock)-&gt;rlock);
  &lt;Interrupt&gt;
    lock(&amp;(&amp;host-&gt;lock)-&gt;rlock);

 *** DEADLOCK ***

2 locks held by kworker/u2:1/33:
 #0:  (kmmcd){.+.+..}, at: [&lt;8003db18&gt;] process_one_work+0x128/0x468
 #1:  ((&amp;(&amp;host-&gt;detect)-&gt;work)){+.+...}, at: [&lt;8003db18&gt;] 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:
[&lt;80012160&gt;] (dump_backtrace+0x0/0x10c) from [&lt;80012438&gt;] (show_stack+0x18/0x1c)
 r6:bfad0900 r5:00000000 r4:8088ecc8 r3:bfad0900
[&lt;80012420&gt;] (show_stack+0x0/0x1c) from [&lt;806169ec&gt;] (dump_stack+0x84/0x9c)
[&lt;80616968&gt;] (dump_stack+0x0/0x9c) from [&lt;806147b4&gt;] (print_usage_bug+0x260/0x2d0)
 r5:8076ba88 r4:80977410
[&lt;80614554&gt;] (print_usage_bug+0x0/0x2d0) from [&lt;8005f0d0&gt;] (mark_lock+0x1e0/0x6ac)
 r9:8005e678 r8:00000000 r7:bfad0900 r6:00001015 r5:bfad0cd0
r4:00000002
[&lt;8005eef0&gt;] (mark_lock+0x0/0x6ac) from [&lt;80060234&gt;] (__lock_acquire+0x604/0x1cbc)
[&lt;8005fc30&gt;] (__lock_acquire+0x0/0x1cbc) from [&lt;800620d0&gt;] (lock_acquire+0x70/0x84)
[&lt;80062060&gt;] (lock_acquire+0x0/0x84) from [&lt;8061d1c8&gt;] (_raw_spin_lock+0x30/0x40)
 r7:00000000 r6:bfb63000 r5:00000000 r4:bfb60568
[&lt;8061d198&gt;] (_raw_spin_lock+0x0/0x40) from [&lt;8045f7f4&gt;] (sdhci_execute_tuning+0x4c/0x710)
 r4:bfb60000
[&lt;8045f7a8&gt;] (sdhci_execute_tuning+0x0/0x710) from [&lt;80453454&gt;] (mmc_sd_init_card+0x5f8/0x660)
[&lt;80452e5c&gt;] (mmc_sd_init_card+0x0/0x660) from [&lt;80453748&gt;] (mmc_attach_sd+0xb4/0x180)
 r9:bf92d400 r8:8065f364 r7:00061a80 r6:bfb60000 r5:8065f358
r4:bfb60000
[&lt;80453694&gt;] (mmc_attach_sd+0x0/0x180) from [&lt;8044d9f8&gt;] (mmc_rescan+0x284/0x2f0)
 r5:8065f358 r4:bfb602f8
[&lt;8044d774&gt;] (mmc_rescan+0x0/0x2f0) from [&lt;8003db94&gt;] (process_one_work+0x1a4/0x468)
 r8:00000000 r7:bfb55eb0 r6:bf80dc00 r5:bfb602f8 r4:bfb35980
r3:8044d774
[&lt;8003d9f0&gt;] (process_one_work+0x0/0x468) from [&lt;8003e850&gt;] (worker_thread+0x118/0x3e0)
[&lt;8003e738&gt;] (worker_thread+0x0/0x3e0) from [&lt;80044de0&gt;] (kthread+0xd4/0xf0)
[&lt;80044d0c&gt;] (kthread+0x0/0xf0) from [&lt;8000e9c8&gt;] (ret_from_fork+0x14/0x2c)
 r7:00000000 r6:00000000 r5:80044d0c r4:bfb37b40

Signed-off-by: Dong Aisheng &lt;b29396@freescale.com&gt;
Signed-off-by: Chris Ball &lt;chris@printf.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sdhci-pci: add broken HS200 quirk for Intel Merrifield</title>
<updated>2014-02-06T19:34:08+00:00</updated>
<author>
<name>David Cohen</name>
<email>david.a.cohen@linux.intel.com</email>
</author>
<published>2013-10-29T17:58:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8a6551ad7cd0751319efbc75e0b5ad884cb06fdb'/>
<id>8a6551ad7cd0751319efbc75e0b5ad884cb06fdb</id>
<content type='text'>
commit 390145f9adcf2730fcee81c8a51fd7c6c08f705f upstream.

Due to unknown hw issue so far, Merrifield is unable to enable HS200
support. This patch adds quirk to avoid SDHCI to initialize with error
below:

[   53.850132] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W
3.12.0-rc6-00037-g3d7c8d9-dirty #36
[   53.850150] Hardware name: Intel Corporation Merrifield/SALT BAY,
BIOS 397 2013.09.12:11.51.40
[   53.850167]  00000000 00000000 ee409e48 c18816d2 00000000 ee409e78
c123e254 c1acc9b0
[   53.850227]  00000000 00000000 c1b14148 000003de c16c03bf c16c03bf
ee75b480 ed97c54c
[   53.850282]  ee75b480 ee409e88 c123e292 00000009 00000000 ee409ef8
c16c03bf c1207fac
[   53.850339] Call Trace:
[   53.850376]  [&lt;c18816d2&gt;] dump_stack+0x4b/0x79
[   53.850408]  [&lt;c123e254&gt;] warn_slowpath_common+0x84/0xa0
[   53.850436]  [&lt;c16c03bf&gt;] ? sdhci_send_command+0xb4f/0xc50
[   53.850462]  [&lt;c16c03bf&gt;] ? sdhci_send_command+0xb4f/0xc50
[   53.850490]  [&lt;c123e292&gt;] warn_slowpath_null+0x22/0x30
[   53.850516]  [&lt;c16c03bf&gt;] sdhci_send_command+0xb4f/0xc50
[   53.850545]  [&lt;c1207fac&gt;] ? native_sched_clock+0x2c/0xb0
[   53.850575]  [&lt;c14c1f93&gt;] ? delay_tsc+0x73/0xb0
[   53.850601]  [&lt;c14c1ebe&gt;] ? __const_udelay+0x1e/0x20
[   53.850626]  [&lt;c16bdeb3&gt;] ? sdhci_reset+0x93/0x190
[   53.850654]  [&lt;c16c05b0&gt;] sdhci_finish_data+0xf0/0x2e0
[   53.850683]  [&lt;c16c130f&gt;] sdhci_irq+0x31f/0x930
[   53.850713]  [&lt;c12cb080&gt;] ? __buffer_unlock_commit+0x10/0x20
[   53.850740]  [&lt;c12cbcd7&gt;] ? trace_buffer_unlock_commit+0x37/0x50
[   53.850773]  [&lt;c1288f3c&gt;] handle_irq_event_percpu+0x5c/0x220
[   53.850800]  [&lt;c128bc96&gt;] ? handle_fasteoi_irq+0x16/0xd0
[   53.850827]  [&lt;c128913a&gt;] handle_irq_event+0x3a/0x60
[   53.850852]  [&lt;c128bc80&gt;] ? unmask_irq+0x30/0x30
[   53.850878]  [&lt;c128bcce&gt;] handle_fasteoi_irq+0x4e/0xd0
[   53.850895]  &lt;IRQ&gt;  [&lt;c1890b52&gt;] ? do_IRQ+0x42/0xb0
[   53.850943]  [&lt;c1890a31&gt;] ? common_interrupt+0x31/0x38
[   53.850973]  [&lt;c12b00d8&gt;] ? cgroup_mkdir+0x4e8/0x580
[   53.851001]  [&lt;c1208d32&gt;] ? default_idle+0x22/0xf0
[   53.851029]  [&lt;c1209576&gt;] ? arch_cpu_idle+0x26/0x30
[   53.851054]  [&lt;c1288505&gt;] ? cpu_startup_entry+0x65/0x240
[   53.851082]  [&lt;c18793d5&gt;] ? rest_init+0xb5/0xc0
[   53.851108]  [&lt;c1879320&gt;] ? __read_lock_failed+0x18/0x18
[   53.851138]  [&lt;c1bf6a15&gt;] ? start_kernel+0x31b/0x321
[   53.851164]  [&lt;c1bf652f&gt;] ? repair_env_string+0x51/0x51
[   53.851190]  [&lt;c1bf6363&gt;] ? i386_start_kernel+0x139/0x13c
[   53.851209] ---[ end trace 92777f5fe48d33f2 ]---
[   53.853449] mmcblk0: error -84 transferring data, sector 11142162, nr
304, cmd response 0x0, card status 0x0
[   53.853476] mmcblk0: retrying using single block read
[   55.937863] sdhci: Timeout waiting for Buffer Read Ready interrupt
during tuning procedure, falling back to fixed sampling clock
[   56.207951] sdhci: Timeout waiting for Buffer Read Ready interrupt
during tuning procedure, falling back to fixed sampling clock
[   66.228785] mmc0: Timeout waiting for hardware interrupt.
[   66.230855] ------------[ cut here ]------------

Signed-off-by: David Cohen &lt;david.a.cohen@linux.intel.com&gt;
Reviewed-by: Chuanxiao Dong &lt;chuanxiao.dong@intel.com&gt;
Acked-by: Dong Aisheng &lt;b29396@freescale.com&gt;
Signed-off-by: Chris Ball &lt;chris@printf.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 390145f9adcf2730fcee81c8a51fd7c6c08f705f upstream.

Due to unknown hw issue so far, Merrifield is unable to enable HS200
support. This patch adds quirk to avoid SDHCI to initialize with error
below:

[   53.850132] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W
3.12.0-rc6-00037-g3d7c8d9-dirty #36
[   53.850150] Hardware name: Intel Corporation Merrifield/SALT BAY,
BIOS 397 2013.09.12:11.51.40
[   53.850167]  00000000 00000000 ee409e48 c18816d2 00000000 ee409e78
c123e254 c1acc9b0
[   53.850227]  00000000 00000000 c1b14148 000003de c16c03bf c16c03bf
ee75b480 ed97c54c
[   53.850282]  ee75b480 ee409e88 c123e292 00000009 00000000 ee409ef8
c16c03bf c1207fac
[   53.850339] Call Trace:
[   53.850376]  [&lt;c18816d2&gt;] dump_stack+0x4b/0x79
[   53.850408]  [&lt;c123e254&gt;] warn_slowpath_common+0x84/0xa0
[   53.850436]  [&lt;c16c03bf&gt;] ? sdhci_send_command+0xb4f/0xc50
[   53.850462]  [&lt;c16c03bf&gt;] ? sdhci_send_command+0xb4f/0xc50
[   53.850490]  [&lt;c123e292&gt;] warn_slowpath_null+0x22/0x30
[   53.850516]  [&lt;c16c03bf&gt;] sdhci_send_command+0xb4f/0xc50
[   53.850545]  [&lt;c1207fac&gt;] ? native_sched_clock+0x2c/0xb0
[   53.850575]  [&lt;c14c1f93&gt;] ? delay_tsc+0x73/0xb0
[   53.850601]  [&lt;c14c1ebe&gt;] ? __const_udelay+0x1e/0x20
[   53.850626]  [&lt;c16bdeb3&gt;] ? sdhci_reset+0x93/0x190
[   53.850654]  [&lt;c16c05b0&gt;] sdhci_finish_data+0xf0/0x2e0
[   53.850683]  [&lt;c16c130f&gt;] sdhci_irq+0x31f/0x930
[   53.850713]  [&lt;c12cb080&gt;] ? __buffer_unlock_commit+0x10/0x20
[   53.850740]  [&lt;c12cbcd7&gt;] ? trace_buffer_unlock_commit+0x37/0x50
[   53.850773]  [&lt;c1288f3c&gt;] handle_irq_event_percpu+0x5c/0x220
[   53.850800]  [&lt;c128bc96&gt;] ? handle_fasteoi_irq+0x16/0xd0
[   53.850827]  [&lt;c128913a&gt;] handle_irq_event+0x3a/0x60
[   53.850852]  [&lt;c128bc80&gt;] ? unmask_irq+0x30/0x30
[   53.850878]  [&lt;c128bcce&gt;] handle_fasteoi_irq+0x4e/0xd0
[   53.850895]  &lt;IRQ&gt;  [&lt;c1890b52&gt;] ? do_IRQ+0x42/0xb0
[   53.850943]  [&lt;c1890a31&gt;] ? common_interrupt+0x31/0x38
[   53.850973]  [&lt;c12b00d8&gt;] ? cgroup_mkdir+0x4e8/0x580
[   53.851001]  [&lt;c1208d32&gt;] ? default_idle+0x22/0xf0
[   53.851029]  [&lt;c1209576&gt;] ? arch_cpu_idle+0x26/0x30
[   53.851054]  [&lt;c1288505&gt;] ? cpu_startup_entry+0x65/0x240
[   53.851082]  [&lt;c18793d5&gt;] ? rest_init+0xb5/0xc0
[   53.851108]  [&lt;c1879320&gt;] ? __read_lock_failed+0x18/0x18
[   53.851138]  [&lt;c1bf6a15&gt;] ? start_kernel+0x31b/0x321
[   53.851164]  [&lt;c1bf652f&gt;] ? repair_env_string+0x51/0x51
[   53.851190]  [&lt;c1bf6363&gt;] ? i386_start_kernel+0x139/0x13c
[   53.851209] ---[ end trace 92777f5fe48d33f2 ]---
[   53.853449] mmcblk0: error -84 transferring data, sector 11142162, nr
304, cmd response 0x0, card status 0x0
[   53.853476] mmcblk0: retrying using single block read
[   55.937863] sdhci: Timeout waiting for Buffer Read Ready interrupt
during tuning procedure, falling back to fixed sampling clock
[   56.207951] sdhci: Timeout waiting for Buffer Read Ready interrupt
during tuning procedure, falling back to fixed sampling clock
[   66.228785] mmc0: Timeout waiting for hardware interrupt.
[   66.230855] ------------[ cut here ]------------

Signed-off-by: David Cohen &lt;david.a.cohen@linux.intel.com&gt;
Reviewed-by: Chuanxiao Dong &lt;chuanxiao.dong@intel.com&gt;
Acked-by: Dong Aisheng &lt;b29396@freescale.com&gt;
Signed-off-by: Chris Ball &lt;chris@printf.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sdhci: add quirk for broken HS200 support</title>
<updated>2014-02-06T19:34:08+00:00</updated>
<author>
<name>David Cohen</name>
<email>david.a.cohen@linux.intel.com</email>
</author>
<published>2013-10-29T17:58:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a5891096c1e99013f0fab10eb353d855988392d1'/>
<id>a5891096c1e99013f0fab10eb353d855988392d1</id>
<content type='text'>
commit 13868bf20f2f2c305f96e23620b024e167d6f9cb upstream.

This patch defines a quirk for platforms unable to enable HS200 support.

Signed-off-by: David Cohen &lt;david.a.cohen@linux.intel.com&gt;
Reviewed-by: Chuanxiao Dong &lt;chuanxiao.dong@intel.com&gt;
Acked-by: Dong Aisheng &lt;b29396@freescale.com&gt;
Signed-off-by: Chris Ball &lt;chris@printf.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 13868bf20f2f2c305f96e23620b024e167d6f9cb upstream.

This patch defines a quirk for platforms unable to enable HS200 support.

Signed-off-by: David Cohen &lt;david.a.cohen@linux.intel.com&gt;
Reviewed-by: Chuanxiao Dong &lt;chuanxiao.dong@intel.com&gt;
Acked-by: Dong Aisheng &lt;b29396@freescale.com&gt;
Signed-off-by: Chris Ball &lt;chris@printf.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: omap: Fix I2C dependency and make driver usable with device tree</title>
<updated>2013-11-26T23:51:16+00:00</updated>
<author>
<name>Tony Lindgren</name>
<email>tony@atomide.com</email>
</author>
<published>2013-11-26T23:50:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9cb238c00ba5c1ddfff2c2ed6aa66c15b962e4c3'/>
<id>9cb238c00ba5c1ddfff2c2ed6aa66c15b962e4c3</id>
<content type='text'>
Some features can be configured by the companion I2C chips,
which may not be available at the probe time. Fix the issue
by returning -EPROBE_DEFER when the MMC controller slots
are not configured.

While at it, let's also add minimal device tree support so
omap24xx platforms can use this driver without legacy mode
since we claim to support device tree for mach-omap2 based
systems.

Although adding the minimal device tree support is not strictly
a fix, it does remove one of the last blockers for dropping a
bunch of legacy platform data for mach-omap2.

Cc: linux-mmc@vger.kernel.org
Acked-by: Chris Ball &lt;cjb@laptop.org&gt;
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some features can be configured by the companion I2C chips,
which may not be available at the probe time. Fix the issue
by returning -EPROBE_DEFER when the MMC controller slots
are not configured.

While at it, let's also add minimal device tree support so
omap24xx platforms can use this driver without legacy mode
since we claim to support device tree for mach-omap2 based
systems.

Although adding the minimal device tree support is not strictly
a fix, it does remove one of the last blockers for dropping a
bunch of legacy platform data for mach-omap2.

Cc: linux-mmc@vger.kernel.org
Acked-by: Chris Ball &lt;cjb@laptop.org&gt;
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: omap: Fix DMA configuration to not rely on device id</title>
<updated>2013-11-26T23:50:33+00:00</updated>
<author>
<name>Tony Lindgren</name>
<email>tony@atomide.com</email>
</author>
<published>2013-11-26T23:50:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=31ee9181eb92cc727876ec5a2144a1b3cbdf5bb1'/>
<id>31ee9181eb92cc727876ec5a2144a1b3cbdf5bb1</id>
<content type='text'>
We are wrongly relying on device id for the DMA configuration
which can lead to wrong DMA channel being selected.

Fix the issue by using the standard resources like we should.

Cc: linux-mmc@vger.kernel.org
Acked-by: Chris Ball &lt;cjb@laptop.org&gt;
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We are wrongly relying on device id for the DMA configuration
which can lead to wrong DMA channel being selected.

Fix the issue by using the standard resources like we should.

Cc: linux-mmc@vger.kernel.org
Acked-by: Chris Ball &lt;cjb@laptop.org&gt;
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'mmc-updates-for-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc</title>
<updated>2013-11-18T22:47:30+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-11-18T22:47:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c2ac2ae44d4c32382d001672021116e771bef4c9'/>
<id>c2ac2ae44d4c32382d001672021116e771bef4c9</id>
<content type='text'>
Pull MMC updates from Chris Ball:
 "MMC highlights for 3.13:

  Core:
   - Improve runtime PM support, remove mmc_{suspend,resume}_host().
   - Add MMC_CAP_RUNTIME_RESUME, for delaying MMC resume until we're
     outside of the resume sequence (in runtime_resume) to decrease
     system resume time.

  Drivers:
   - dw_mmc: Support HS200 mode.
   - sdhci-eshdc-imx: Support SD3.0 SDR clock tuning, DDR on IMX6.
   - sdhci-pci: Add support for Intel Clovertrail and Merrifield"

* tag 'mmc-updates-for-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (108 commits)
  mmc: wbsd: Silence compiler warning
  mmc: core: Silence compiler warning in __mmc_switch
  mmc: sh_mmcif: Convert to clk_prepare|unprepare
  mmc: sh_mmcif: Convert to PM macros when defining dev_pm_ops
  mmc: dw_mmc: exynos: Revert the sdr_timing assignment
  mmc: sdhci: Avoid needless loop while handling SDIO interrupts in sdhci_irq
  mmc: core: Add MMC_CAP_RUNTIME_RESUME to resume at runtime_resume
  mmc: core: Improve runtime PM support during suspend/resume for sd/mmc
  mmc: core: Remove redundant mmc_power_up|off at runtime callbacks
  mmc: Don't force card to active state when entering suspend/shutdown
  MIPS: db1235: Don't use MMC_CLKGATE
  mmc: core: Remove deprecated mmc_suspend|resume_host APIs
  mmc: mmci: Move away from using deprecated APIs
  mmc: via-sdmmc: Move away from using deprecated APIs
  mmc: tmio: Move away from using deprecated APIs
  mmc: sh_mmcif: Move away from using deprecated APIs
  mmc: sdricoh_cs: Move away from using deprecated APIs
  mmc: rtsx: Remove redundant suspend and resume callbacks
  mmc: wbsd: Move away from using deprecated APIs
  mmc: pxamci: Remove redundant suspend and resume callbacks
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull MMC updates from Chris Ball:
 "MMC highlights for 3.13:

  Core:
   - Improve runtime PM support, remove mmc_{suspend,resume}_host().
   - Add MMC_CAP_RUNTIME_RESUME, for delaying MMC resume until we're
     outside of the resume sequence (in runtime_resume) to decrease
     system resume time.

  Drivers:
   - dw_mmc: Support HS200 mode.
   - sdhci-eshdc-imx: Support SD3.0 SDR clock tuning, DDR on IMX6.
   - sdhci-pci: Add support for Intel Clovertrail and Merrifield"

* tag 'mmc-updates-for-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (108 commits)
  mmc: wbsd: Silence compiler warning
  mmc: core: Silence compiler warning in __mmc_switch
  mmc: sh_mmcif: Convert to clk_prepare|unprepare
  mmc: sh_mmcif: Convert to PM macros when defining dev_pm_ops
  mmc: dw_mmc: exynos: Revert the sdr_timing assignment
  mmc: sdhci: Avoid needless loop while handling SDIO interrupts in sdhci_irq
  mmc: core: Add MMC_CAP_RUNTIME_RESUME to resume at runtime_resume
  mmc: core: Improve runtime PM support during suspend/resume for sd/mmc
  mmc: core: Remove redundant mmc_power_up|off at runtime callbacks
  mmc: Don't force card to active state when entering suspend/shutdown
  MIPS: db1235: Don't use MMC_CLKGATE
  mmc: core: Remove deprecated mmc_suspend|resume_host APIs
  mmc: mmci: Move away from using deprecated APIs
  mmc: via-sdmmc: Move away from using deprecated APIs
  mmc: tmio: Move away from using deprecated APIs
  mmc: sh_mmcif: Move away from using deprecated APIs
  mmc: sdricoh_cs: Move away from using deprecated APIs
  mmc: rtsx: Remove redundant suspend and resume callbacks
  mmc: wbsd: Move away from using deprecated APIs
  mmc: pxamci: Remove redundant suspend and resume callbacks
  ...
</pre>
</div>
</content>
</entry>
</feed>
