<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/mmc, branch v3.2.73</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.2.73</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.2.73'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2015-08-12T14:33:16Z</updated>
<entry>
<title>mmc: card: Fixup request missing in mmc_blk_issue_rw_rq</title>
<updated>2015-08-12T14:33:16Z</updated>
<author>
<name>Ding Wang</name>
<email>justin.wang@spreadtrum.com</email>
</author>
<published>2015-05-18T12:14:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f0f69fa1f5681291070806ffeefa1ed357696af8'/>
<id>urn:sha1:f0f69fa1f5681291070806ffeefa1ed357696af8</id>
<content type='text'>
commit 29535f7b797df35cc9b6b3bca635591cdd3dd2a8 upstream.

The current handler of MMC_BLK_CMD_ERR in mmc_blk_issue_rw_rq function
may cause new coming request permanent missing when the ongoing
request (previoulsy started) complete end.

The problem scenario is as follows:
(1) Request A is ongoing;
(2) Request B arrived, and finally mmc_blk_issue_rw_rq() is called;
(3) Request A encounters the MMC_BLK_CMD_ERR error;
(4) In the error handling of MMC_BLK_CMD_ERR, suppose mmc_blk_cmd_err()
    end request A completed and return zero. Continue the error handling,
    suppose mmc_blk_reset() reset device success;
(5) Continue the execution, while loop completed because variable ret
    is zero now;
(6) Finally, mmc_blk_issue_rw_rq() return without processing request B.

The process related to the missing request may wait that IO request
complete forever, possibly crashing the application or hanging the system.

Fix this issue by starting new request when reset success.

Signed-off-by: Ding Wang &lt;justin.wang@spreadtrum.com&gt;
Fixes: 67716327eec7 ("mmc: block: add eMMC hardware reset support")
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>mmc: core: add missing pm event in mmc_pm_notify to fix hib restore</title>
<updated>2015-08-06T23:32:09Z</updated>
<author>
<name>Grygorii Strashko</name>
<email>Grygorii.Strashko@linaro.org</email>
</author>
<published>2015-04-23T10:43:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b221184ff664276d80833a1205411b5dc39672a6'/>
<id>urn:sha1:b221184ff664276d80833a1205411b5dc39672a6</id>
<content type='text'>
commit 184af16b09360d6273fd6160e6ff7f8e2482ef23 upstream.

The PM_RESTORE_PREPARE is not handled now in mmc_pm_notify(),
as result mmc_rescan() could be scheduled and executed at
late hibernation restore stages when MMC device is suspended
already - which, in turn, will lead to system crash on TI dra7-evm board:

WARNING: CPU: 0 PID: 3188 at drivers/bus/omap_l3_noc.c:148 l3_interrupt_handler+0x258/0x374()
44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4_PER1_P3 (Idle): Data Access in User mode during Functional access

Hence, add missed PM_RESTORE_PREPARE PM event in mmc_pm_notify().

Fixes: 4c2ef25fe0b8 (mmc: fix all hangs related to mmc/sd card...)
Signed-off-by: Grygorii Strashko &lt;Grygorii.Strashko@linaro.org&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>mmc: sdhci: fix lockdep error in tuning routine</title>
<updated>2014-04-01T23:58:44Z</updated>
<author>
<name>Aisheng Dong</name>
<email>b29396@freescale.com</email>
</author>
<published>2013-12-23T11:13:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4fab53434e082b3835f5a89d5af15983c2be664d'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>mmc: atmel-mci: fix timeout errors in SDIO mode when using DMA</title>
<updated>2014-04-01T23:58:42Z</updated>
<author>
<name>Ludovic Desroches</name>
<email>ludovic.desroches@atmel.com</email>
</author>
<published>2013-11-20T15:01:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c98df443b8a9bd7573cf7c556bdf4aa7a192188b'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>mmc: block: fix a bug of error handling in MMC driver</title>
<updated>2014-01-03T04:33:36Z</updated>
<author>
<name>KOBAYASHI Yoshitake</name>
<email>yoshitake.kobayashi@toshiba.co.jp</email>
</author>
<published>2013-07-06T22:35:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=295efae476b7941e55a0d46ad4f1044d7f7ecbe0'/>
<id>urn:sha1:295efae476b7941e55a0d46ad4f1044d7f7ecbe0</id>
<content type='text'>
commit c8760069627ad3b0dbbea170f0c4c58b16e18d3d upstream.

Current MMC driver doesn't handle generic error (bit19 of device
status) in write sequence. As a result, write data gets lost when
generic error occurs. For example, a generic error when updating a
filesystem management information causes a loss of write data and
corrupts the filesystem. In the worst case, the system will never
boot.

This patch includes the following functionality:
  1. To enable error checking for the response of CMD12 and CMD13
     in write command sequence
  2. To retry write sequence when a generic error occurs

Messages are added for v2 to show what occurs.

[Backported to 3.4-stable]

Signed-off-by: KOBAYASHI Yoshitake &lt;yoshitake.kobayashi@toshiba.co.jp&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>mmc: tmio_mmc_dma: fix PIO fallback on SDHI</title>
<updated>2013-10-26T20:05:59Z</updated>
<author>
<name>Sergei Shtylyov</name>
<email>sergei.shtylyov@cogentembedded.com</email>
</author>
<published>2013-08-25T03:38:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0140c2fcecbdc5fdf70a10060147df9d8201d79e'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>mmc: atmel-mci: pio hang on block errors</title>
<updated>2013-05-30T13:34:49Z</updated>
<author>
<name>Terry Barnaby</name>
<email>terry@beam.ltd.uk</email>
</author>
<published>2013-04-08T16:05:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3c6fc3ed92a2614f0027a778a3598764ace0bb11'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>mmc: core: Fix bit width test failing on old eMMC cards</title>
<updated>2013-05-30T13:34:49Z</updated>
<author>
<name>Philip Rakity</name>
<email>prakity@yahoo.com</email>
</author>
<published>2013-04-04T19:18:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9126ab0cea7cde9180ed18c72997cadff18f6213'/>
<id>urn:sha1:9126ab0cea7cde9180ed18c72997cadff18f6213</id>
<content type='text'>
commit 836dc2fe89c968c10cada87e0dfae6626f8f9da3 upstream.

PARTITION_SUPPORT needs to be set before doing the compare on version
number so the bit width test does not get invalid data.  Before this
patch, a Sandisk iNAND eMMC card would detect 1-bit width although
the hardware supports 4-bit.

Only affects old emmc devices - pre 4.4 devices.

Reported-by: Elad Yi &lt;elad.yi@gmail.com&gt;
Signed-off-by: Philip Rakity &lt;prakity@yahoo.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>mmc: at91/avr32/atmel-mci: fix DMA-channel leak on module unload</title>
<updated>2013-05-30T13:34:48Z</updated>
<author>
<name>Johan Hovold</name>
<email>jhovold@gmail.com</email>
</author>
<published>2013-03-13T16:11:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=29878cdb099a4703b884aa1e0354fedff9766133'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>mmc: sdhci-esdhc-imx: fix host version read</title>
<updated>2013-03-06T03:24:13Z</updated>
<author>
<name>Shawn Guo</name>
<email>shawn.guo@linaro.org</email>
</author>
<published>2013-01-15T15:30:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e3efb0af9406a25d27c03407c288b187c95e8244'/>
<id>urn:sha1: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>
</entry>
</feed>
