<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/mmc/host, branch v3.2.73</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>mmc: sdhci: fix lockdep error in tuning routine</title>
<updated>2014-04-01T23:58:44+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.toradex.cn/cgit/linux-toradex.git/commit/?id=4fab53434e082b3835f5a89d5af15983c2be664d'/>
<id>4fab53434e082b3835f5a89d5af15983c2be664d</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;
[bwh: Backported to 3.2:
 - Adjust context
 - There's no platform_execute_tuning hook]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&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;
[bwh: Backported to 3.2:
 - Adjust context
 - There's no platform_execute_tuning hook]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: atmel-mci: fix timeout errors in SDIO mode when using DMA</title>
<updated>2014-04-01T23:58:42+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.toradex.cn/cgit/linux-toradex.git/commit/?id=c98df443b8a9bd7573cf7c556bdf4aa7a192188b'/>
<id>c98df443b8a9bd7573cf7c556bdf4aa7a192188b</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: Ben Hutchings &lt;ben@decadent.org.uk&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: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: tmio_mmc_dma: fix PIO fallback on SDHI</title>
<updated>2013-10-26T20:05:59+00:00</updated>
<author>
<name>Sergei Shtylyov</name>
<email>sergei.shtylyov@cogentembedded.com</email>
</author>
<published>2013-08-25T03:38:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0140c2fcecbdc5fdf70a10060147df9d8201d79e'/>
<id>0140c2fcecbdc5fdf70a10060147df9d8201d79e</id>
<content type='text'>
commit f936f9b67b7f8c2eae01dd303a0e90bd777c4679 upstream.

I'm testing SH-Mobile SDHI driver in DMA mode with  a new DMA controller  using
'bonnie++' and getting DMA error after which the tmio_mmc_dma.c code falls back
to PIO but all commands time out after that.  It turned out that the fallback
code calls tmio_mmc_enable_dma() with RX/TX channels already freed and pointers
to them cleared, so that the function bails out early instead  of clearing the
DMA bit in the CTL_DMA_ENABLE register. The regression was introduced by commit
162f43e31c5a376ec16336e5d0ac973373d54c89 (mmc: tmio: fix a deadlock).
Moving tmio_mmc_enable_dma() calls to the top of the PIO fallback code in
tmio_mmc_start_dma_{rx|tx}() helps.

Signed-off-by: Sergei Shtylyov &lt;sergei.shtylyov@cogentembedded.com&gt;
Acked-by: Guennadi Liakhovetski &lt;g.liakhovetski@gmx.de&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit f936f9b67b7f8c2eae01dd303a0e90bd777c4679 upstream.

I'm testing SH-Mobile SDHI driver in DMA mode with  a new DMA controller  using
'bonnie++' and getting DMA error after which the tmio_mmc_dma.c code falls back
to PIO but all commands time out after that.  It turned out that the fallback
code calls tmio_mmc_enable_dma() with RX/TX channels already freed and pointers
to them cleared, so that the function bails out early instead  of clearing the
DMA bit in the CTL_DMA_ENABLE register. The regression was introduced by commit
162f43e31c5a376ec16336e5d0ac973373d54c89 (mmc: tmio: fix a deadlock).
Moving tmio_mmc_enable_dma() calls to the top of the PIO fallback code in
tmio_mmc_start_dma_{rx|tx}() helps.

Signed-off-by: Sergei Shtylyov &lt;sergei.shtylyov@cogentembedded.com&gt;
Acked-by: Guennadi Liakhovetski &lt;g.liakhovetski@gmx.de&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: atmel-mci: pio hang on block errors</title>
<updated>2013-05-30T13:34:49+00:00</updated>
<author>
<name>Terry Barnaby</name>
<email>terry@beam.ltd.uk</email>
</author>
<published>2013-04-08T16:05:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3c6fc3ed92a2614f0027a778a3598764ace0bb11'/>
<id>3c6fc3ed92a2614f0027a778a3598764ace0bb11</id>
<content type='text'>
commit bdbc5d0c60f3e9de3eeccf1c1a18bdc11dca62cc upstream.

The driver is doing, by default, multi-block reads. When a block error
occurs, card/block.c instigates a single block read: "mmcblk0: retrying
using single block read".  It leaves the sg chain intact and just changes
the length attribute for the first sg entry and the overall sg_len
parameter.  When atmci_read_data_pio is called to read the single block
of data it ignores the sg_len and expects to read more than 512 bytes as
it sees there are multiple items in the sg list. No more data comes as
the controller has only been commanded to get one block.

Signed-off-by: Terry Barnaby &lt;terry@beam.ltd.uk&gt;
Acked-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit bdbc5d0c60f3e9de3eeccf1c1a18bdc11dca62cc upstream.

The driver is doing, by default, multi-block reads. When a block error
occurs, card/block.c instigates a single block read: "mmcblk0: retrying
using single block read".  It leaves the sg chain intact and just changes
the length attribute for the first sg entry and the overall sg_len
parameter.  When atmci_read_data_pio is called to read the single block
of data it ignores the sg_len and expects to read more than 512 bytes as
it sees there are multiple items in the sg list. No more data comes as
the controller has only been commanded to get one block.

Signed-off-by: Terry Barnaby &lt;terry@beam.ltd.uk&gt;
Acked-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: at91/avr32/atmel-mci: fix DMA-channel leak on module unload</title>
<updated>2013-05-30T13:34:48+00:00</updated>
<author>
<name>Johan Hovold</name>
<email>jhovold@gmail.com</email>
</author>
<published>2013-03-13T16:11:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=29878cdb099a4703b884aa1e0354fedff9766133'/>
<id>29878cdb099a4703b884aa1e0354fedff9766133</id>
<content type='text'>
commit 91cf54feecf815bec0b6a8d6d9dbd0e219f2f2cc upstream.

Fix regression introduced by commit 796211b7953 ("mmc: atmel-mci: add
pdc support and runtime capabilities detection") which removed the need
for CONFIG_MMC_ATMELMCI_DMA but kept the Kconfig-entry as well as the
compile guards around dma_release_channel() in remove(). Consequently,
DMA is always enabled (if supported), but the DMA-channel is not
released on module unload unless the DMA-config option is selected.

Remove the no longer used CONFIG_MMC_ATMELMCI_DMA option completely.

Signed-off-by: Johan Hovold &lt;jhovold@gmail.com&gt;
Acked-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 91cf54feecf815bec0b6a8d6d9dbd0e219f2f2cc upstream.

Fix regression introduced by commit 796211b7953 ("mmc: atmel-mci: add
pdc support and runtime capabilities detection") which removed the need
for CONFIG_MMC_ATMELMCI_DMA but kept the Kconfig-entry as well as the
compile guards around dma_release_channel() in remove(). Consequently,
DMA is always enabled (if supported), but the DMA-channel is not
released on module unload unless the DMA-config option is selected.

Remove the no longer used CONFIG_MMC_ATMELMCI_DMA option completely.

Signed-off-by: Johan Hovold &lt;jhovold@gmail.com&gt;
Acked-by: Ludovic Desroches &lt;ludovic.desroches@atmel.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sdhci-esdhc-imx: fix host version read</title>
<updated>2013-03-06T03:24:13+00:00</updated>
<author>
<name>Shawn Guo</name>
<email>shawn.guo@linaro.org</email>
</author>
<published>2013-01-15T15:30:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e3efb0af9406a25d27c03407c288b187c95e8244'/>
<id>e3efb0af9406a25d27c03407c288b187c95e8244</id>
<content type='text'>
commit ef4d0888bb7e1b963880f086575081c3d39cad2d upstream.

When commit 95a2482 (mmc: sdhci-esdhc-imx: add basic imx6q usdhc
support) works around host version issue on imx6q, it gets the
register address fixup "reg ^= 2" lost for imx25/35/51/53 esdhc.
Thus, the controller version on these SoCs is wrongly identified
as v1 while it's actually v2.

Add the address fixup back and take a different approach to correct
imx6q host version, so that the host version read gets back to work
for all SoCs.

Signed-off-by: Shawn Guo &lt;shawn.guo@linaro.org&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit ef4d0888bb7e1b963880f086575081c3d39cad2d upstream.

When commit 95a2482 (mmc: sdhci-esdhc-imx: add basic imx6q usdhc
support) works around host version issue on imx6q, it gets the
register address fixup "reg ^= 2" lost for imx25/35/51/53 esdhc.
Thus, the controller version on these SoCs is wrongly identified
as v1 while it's actually v2.

Add the address fixup back and take a different approach to correct
imx6q host version, so that the host version read gets back to work
for all SoCs.

Signed-off-by: Shawn Guo &lt;shawn.guo@linaro.org&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert misapplied "mmc: sh-mmcif: avoid oops on spurious interrupts"</title>
<updated>2013-01-03T03:32:54+00:00</updated>
<author>
<name>Chris Ball</name>
<email>cjb@laptop.org</email>
</author>
<published>2012-12-03T14:17:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d8c2239fcc2c65572d199b010f7903d05a839502'/>
<id>d8c2239fcc2c65572d199b010f7903d05a839502</id>
<content type='text'>
commit 6984f3c31bb57cb7491dbec1be44b74bd00f4648 upstream.

This reverts commit 8464dd52d3198dd05, which was a misapplied debugging
version of the patch, not the final patch itself.

Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 6984f3c31bb57cb7491dbec1be44b74bd00f4648 upstream.

This reverts commit 8464dd52d3198dd05, which was a misapplied debugging
version of the patch, not the final patch itself.

Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sdhci-s3c: fix the wrong number of max bus clocks</title>
<updated>2012-10-17T02:49:43+00:00</updated>
<author>
<name>Jaehoon Chung</name>
<email>jh80.chung@samsung.com</email>
</author>
<published>2012-09-19T06:43:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=664f857bc07bf8e327b0f1271d3490c7af4a5195'/>
<id>664f857bc07bf8e327b0f1271d3490c7af4a5195</id>
<content type='text'>
commit 5feb54a1ab91a237e247c013b8c4fb100ea347b1 upstream.

We can use up to four bus-clocks; but on module remove, we didn't
disable the fourth bus clock.

Signed-off-by: Jaehoon Chung &lt;jh80.chung@samsung.com&gt;
Signed-off-by: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 5feb54a1ab91a237e247c013b8c4fb100ea347b1 upstream.

We can use up to four bus-clocks; but on module remove, we didn't
disable the fourth bus clock.

Signed-off-by: Jaehoon Chung &lt;jh80.chung@samsung.com&gt;
Signed-off-by: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sh-mmcif: avoid oops on spurious interrupts</title>
<updated>2012-10-17T02:49:28+00:00</updated>
<author>
<name>Guennadi Liakhovetski</name>
<email>g.liakhovetski@gmx.de</email>
</author>
<published>2012-09-18T06:42:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cf06b5a1c78a13ff25d8b2d367770b2936316006'/>
<id>cf06b5a1c78a13ff25d8b2d367770b2936316006</id>
<content type='text'>
commit 8464dd52d3198dd05cafb005371d76e5339eb842 upstream.

On some systems, e.g., kzm9g, MMCIF interfaces can produce spurious
interrupts without any active request. To prevent the Oops, that results
in such cases, don't dereference the mmc request pointer until we make
sure, that we are indeed processing such a request.

Reported-by: Tetsuyuki Kobayashi &lt;koba@kmckk.co.jp&gt;
Signed-off-by: Guennadi Liakhovetski &lt;g.liakhovetski@gmx.de&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 8464dd52d3198dd05cafb005371d76e5339eb842 upstream.

On some systems, e.g., kzm9g, MMCIF interfaces can produce spurious
interrupts without any active request. To prevent the Oops, that results
in such cases, don't dereference the mmc request pointer until we make
sure, that we are indeed processing such a request.

Reported-by: Tetsuyuki Kobayashi &lt;koba@kmckk.co.jp&gt;
Signed-off-by: Guennadi Liakhovetski &lt;g.liakhovetski@gmx.de&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: omap_hsmmc: Pass on the suspend failure to the PM core</title>
<updated>2012-10-17T02:49:27+00:00</updated>
<author>
<name>Vaibhav Bedia</name>
<email>vaibhav.bedia@ti.com</email>
</author>
<published>2012-09-13T06:31:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b1f9cafbf2313768160d3d2587deba1f099fc5f5'/>
<id>b1f9cafbf2313768160d3d2587deba1f099fc5f5</id>
<content type='text'>
commit c4c8eeb4df00aabb641553d6fbcd46f458e56cd9 upstream.

In some cases mmc_suspend_host() is not able to claim the
host and proceed with the suspend process. The core returns
-EBUSY to the host controller driver. Unfortunately, the
host controller driver does not pass on this information
to the PM core and hence the system suspend process continues.

	ret = mmc_suspend_host(host-&gt;mmc);
	if (ret) {
		host-&gt;suspended = 0;
		if (host-&gt;pdata-&gt;resume) {
			ret = host-&gt;pdata-&gt;resume(dev, host-&gt;slot_id);

The return status from mmc_suspend_host() is overwritten by return
status from host-&gt;pdata-&gt;resume. So the original return status is lost.

In these cases the MMC core gets to an unexpected state
during resume and multiple issues related to MMC crop up.
1. Host controller driver starts accessing the device registers
before the clocks are enabled which leads to a prefetch abort.
2. A file copy thread which was launched before suspend gets
stuck due to the host not being reclaimed during resume.

To avoid such problems pass on the -EBUSY status to the PM core
from the host controller driver. With this change, MMC core
suspend might still fail but it does not end up making the
system unusable. Suspend gets aborted and the user can try
suspending the system again.

Signed-off-by: Vaibhav Bedia &lt;vaibhav.bedia@ti.com&gt;
Signed-off-by: Hebbar, Gururaja &lt;gururaja.hebbar@ti.com&gt;
Acked-by: Venkatraman S &lt;svenkatr@ti.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
[bwh: Backported to 3.2:
 - Adjust context, indentation
 - s/dev/\&amp;pdev-&gt;dev/]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit c4c8eeb4df00aabb641553d6fbcd46f458e56cd9 upstream.

In some cases mmc_suspend_host() is not able to claim the
host and proceed with the suspend process. The core returns
-EBUSY to the host controller driver. Unfortunately, the
host controller driver does not pass on this information
to the PM core and hence the system suspend process continues.

	ret = mmc_suspend_host(host-&gt;mmc);
	if (ret) {
		host-&gt;suspended = 0;
		if (host-&gt;pdata-&gt;resume) {
			ret = host-&gt;pdata-&gt;resume(dev, host-&gt;slot_id);

The return status from mmc_suspend_host() is overwritten by return
status from host-&gt;pdata-&gt;resume. So the original return status is lost.

In these cases the MMC core gets to an unexpected state
during resume and multiple issues related to MMC crop up.
1. Host controller driver starts accessing the device registers
before the clocks are enabled which leads to a prefetch abort.
2. A file copy thread which was launched before suspend gets
stuck due to the host not being reclaimed during resume.

To avoid such problems pass on the -EBUSY status to the PM core
from the host controller driver. With this change, MMC core
suspend might still fail but it does not end up making the
system unusable. Suspend gets aborted and the user can try
suspending the system again.

Signed-off-by: Vaibhav Bedia &lt;vaibhav.bedia@ti.com&gt;
Signed-off-by: Hebbar, Gururaja &lt;gururaja.hebbar@ti.com&gt;
Acked-by: Venkatraman S &lt;svenkatr@ti.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
[bwh: Backported to 3.2:
 - Adjust context, indentation
 - s/dev/\&amp;pdev-&gt;dev/]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
</feed>
