<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/mmc, branch v5.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.3</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2019-09-13T11:49:09Z</updated>
<entry>
<title>mmc: tmio: Fixup runtime PM management during remove</title>
<updated>2019-09-13T11:49:09Z</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2019-09-13T09:20:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=87b5d602a1cc76169b8d81ec2c74c8d95d9350dc'/>
<id>urn:sha1:87b5d602a1cc76169b8d81ec2c74c8d95d9350dc</id>
<content type='text'>
Accessing the device when it may be runtime suspended is a bug, which is
the case in tmio_mmc_host_remove(). Let's fix the behaviour.

Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Tested-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
</content>
</entry>
<entry>
<title>mmc: tmio: Fixup runtime PM management during probe</title>
<updated>2019-09-13T11:49:04Z</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2019-09-13T09:19:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aa86f1a3887523d78bfadd1c4e4df8f919336511'/>
<id>urn:sha1:aa86f1a3887523d78bfadd1c4e4df8f919336511</id>
<content type='text'>
The tmio_mmc_host_probe() calls pm_runtime_set_active() to update the
runtime PM status of the device, as to make it reflect the current status
of the HW. This works fine for most cases, but unfortunate not for all.
Especially, there is a generic problem when the device has a genpd attached
and that genpd have the -&gt;start|stop() callbacks assigned.

More precisely, if the driver calls pm_runtime_set_active() during
-&gt;probe(), genpd does not get to invoke the -&gt;start() callback for it,
which means the HW isn't really fully powered on. Furthermore, in the next
phase, when the device becomes runtime suspended, genpd will invoke the
-&gt;stop() callback for it, potentially leading to usage count imbalance
problems, depending on what's implemented behind the callbacks of course.

To fix this problem, convert to call pm_runtime_get_sync() from
tmio_mmc_host_probe() rather than pm_runtime_set_active(). Additionally, to
avoid bumping usage counters and unnecessary re-initializing the HW the
first time the tmio driver's -&gt;runtime_resume() callback is called,
introduce a state flag to keeping track of this.

Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Tested-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
</content>
</entry>
<entry>
<title>Revert "mmc: tmio: move runtime PM enablement to the driver implementations"</title>
<updated>2019-09-13T11:48:35Z</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2019-09-13T08:03:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8861474a105c91e812d38cd65d3be795c7f32c4f'/>
<id>urn:sha1:8861474a105c91e812d38cd65d3be795c7f32c4f</id>
<content type='text'>
This reverts commit 7ff213193310ef8d0ee5f04f79d791210787ac2c.

It turns out that the above commit introduces other problems. For example,
calling pm_runtime_set_active() must not be done prior calling
pm_runtime_enable() as that makes it fail. This leads to additional
problems, such as clock enables being wrongly balanced.

Rather than fixing the problem on top, let's start over by doing a revert.

Fixes: 7ff213193310 ("mmc: tmio: move runtime PM enablement to the driver implementations")
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Tested-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
</content>
</entry>
<entry>
<title>Revert "mmc: sdhci: Remove unneeded quirk2 flag of O2 SD host controller"</title>
<updated>2019-09-11T13:57:21Z</updated>
<author>
<name>Daniel Drake</name>
<email>drake@endlessm.com</email>
</author>
<published>2019-09-05T04:55:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=49baa01c8b99ef92958e18fb58ebeb5dfdcde8af'/>
<id>urn:sha1:49baa01c8b99ef92958e18fb58ebeb5dfdcde8af</id>
<content type='text'>
This reverts commit 414126f9e5abf1973c661d24229543a9458fa8ce.

This commit broke eMMC storage access on a new consumer MiniPC based on
AMD SoC, which has eMMC connected to:

02:00.0 SD Host controller: O2 Micro, Inc. Device 8620 (rev 01) (prog-if 01)
	Subsystem: O2 Micro, Inc. Device 0002

During probe, several errors are seen including:

  mmc1: Got data interrupt 0x02000000 even though no data operation was in progress.
  mmc1: Timeout waiting for hardware interrupt.
  mmc1: error -110 whilst initialising MMC card

Reverting this commit allows the eMMC storage to be detected &amp; usable
again.

Signed-off-by: Daniel Drake &lt;drake@endlessm.com&gt;
Fixes: 414126f9e5ab ("mmc: sdhci: Remove unneeded quirk2 flag of O2 SD host
controller")
Cc: stable@vger.kernel.org # v5.1+
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>Revert "mmc: bcm2835: Terminate timeout work synchronously"</title>
<updated>2019-09-11T13:57:21Z</updated>
<author>
<name>Stefan Wahren</name>
<email>wahrenst@gmx.net</email>
</author>
<published>2019-09-08T07:45:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aea64b583601aa5e0d6ea51a0420e46e43710bd4'/>
<id>urn:sha1:aea64b583601aa5e0d6ea51a0420e46e43710bd4</id>
<content type='text'>
The commit 37fefadee8bb ("mmc: bcm2835: Terminate timeout work
synchronously") causes lockups in case of hardware timeouts due the
timeout work also calling cancel_delayed_work_sync() on its own.
So revert it.

Fixes: 37fefadee8bb ("mmc: bcm2835: Terminate timeout work synchronously")
Cc: stable@vger.kernel.org
Signed-off-by: Stefan Wahren &lt;wahrenst@gmx.net&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>Revert "mmc: core: do not retry CMD6 in __mmc_switch()"</title>
<updated>2019-09-03T14:53:28Z</updated>
<author>
<name>Jan Kaisrlik</name>
<email>ja.kaisrlik@gmail.com</email>
</author>
<published>2019-08-20T11:42:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8ad8e02c2fa70cfddc1ded53ba9001c9d444075d'/>
<id>urn:sha1:8ad8e02c2fa70cfddc1ded53ba9001c9d444075d</id>
<content type='text'>
Turns out the commit 3a0681c7448b ("mmc: core: do not retry CMD6 in
__mmc_switch()") breaks initialization of a Toshiba THGBMNG5 eMMC card,
when using the meson-gx-mmc.c driver on a custom board based on Amlogic
A113D.

The CMD6 that switches the card into HS200 mode is then one that fails and
according to the below printed messages from the log:

[    1.648951] mmc0: mmc_select_hs200 failed, error -84
[    1.648988] mmc0: error -84 whilst initialising MMC card

After some analyze, it turns out that adding a delay of ~5ms inside
mmc_select_bus_width() but after mmc_compare_ext_csds() has been executed,
also fixes the problem. Adding yet some more debug code, trying to figure
out if potentially the card could be in a busy state, both by using CMD13
and -&gt;card_busy() ops concluded that this was not the case.

Therefore, let's simply revert the commit that dropped support for retrying
of CMD6, as this also fixes the problem.

Fixes: 3a0681c7448b ("mmc: core: do not retry CMD6 in __mmc_switch()")
Cc: stable@vger.kernel.org
Signed-off-by: Jan Kaisrlik &lt;ja.kaisrlik@gmail.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: sdhci-cadence: enable v4_mode to fix ADMA 64-bit addressing</title>
<updated>2019-08-30T07:17:53Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>yamada.masahiro@socionext.com</email>
</author>
<published>2019-08-29T10:49:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e73a3896eaca95ea5fc895720502a3f040eb4b39'/>
<id>urn:sha1:e73a3896eaca95ea5fc895720502a3f040eb4b39</id>
<content type='text'>
The IP datasheet says this controller is compatible with SD Host
Specification Version v4.00.

As it turned out, the ADMA of this IP does not work with 64-bit mode
when it is in the Version 3.00 compatible mode; it understands the
old 64-bit descriptor table (as defined in SDHCI v2), but the ADMA
System Address Register (SDHCI_ADMA_ADDRESS) cannot point to the
64-bit address.

I noticed this issue only after commit bd2e75633c80 ("dma-contiguous:
use fallback alloc_pages for single pages"). Prior to that commit,
dma_set_mask_and_coherent() returned the dma address that fits in
32-bit range, at least for the default arm64 configuration
(arch/arm64/configs/defconfig). Now the host-&gt;adma_addr exceeds the
32-bit limit, causing the real problem for the Socionext SoCs.
(As a side-note, I was also able to reproduce the issue for older
kernels by turning off CONFIG_DMA_CMA.)

Call sdhci_enable_v4_mode() to fix this.

Cc: &lt;stable@vger.kernel.org&gt; # v4.20+
Signed-off-by: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: sdhci-sprd: clear the UHS-I modes read from registers</title>
<updated>2019-08-30T07:17:53Z</updated>
<author>
<name>Chunyan Zhang</name>
<email>chunyan.zhang@unisoc.com</email>
</author>
<published>2019-08-28T02:17:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2f765c175e1d1acae911f889e71e5933c6488929'/>
<id>urn:sha1:2f765c175e1d1acae911f889e71e5933c6488929</id>
<content type='text'>
sprd's sd host controller supports SDR50/SDR104/DDR50 though, the UHS-I
mode used by the specific card can be selected via devicetree only.

Fixes: fb8bd90f83c4 ("mmc: sdhci-sprd: Add Spreadtrum's initial host controller")
Signed-off-by: Chunyan Zhang &lt;chunyan.zhang@unisoc.com&gt;
Signed-off-by: Chunyan Zhang &lt;zhang.lyra@gmail.com&gt;
Reviewed-by: Baolin Wang &lt;baolin.wang@linaro.org&gt;
Tested-by: Baolin Wang &lt;baolin.wang@linaro.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mms: sdhci-sprd: add SDHCI_QUIRK_BROKEN_CARD_DETECTION</title>
<updated>2019-08-30T07:17:53Z</updated>
<author>
<name>Chunyan Zhang</name>
<email>chunyan.zhang@unisoc.com</email>
</author>
<published>2019-08-28T02:17:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4324e54bbea0107b054336f20075a26939b2bd51'/>
<id>urn:sha1:4324e54bbea0107b054336f20075a26939b2bd51</id>
<content type='text'>
sprd's sd host controller doesn't support detection to
card insert or remove.

Fixes: fb8bd90f83c4 ("mmc: sdhci-sprd: Add Spreadtrum's initial host controller")
Signed-off-by: Chunyan Zhang &lt;chunyan.zhang@unisoc.com&gt;
Signed-off-by: Chunyan Zhang &lt;zhang.lyra@gmail.com&gt;
Reviewed-by: Baolin Wang &lt;baolin.wang@linaro.org&gt;
Tested-by: Baolin Wang &lt;baolin.wang@linaro.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: sdhci-sprd: add SDHCI_QUIRK2_PRESET_VALUE_BROKEN</title>
<updated>2019-08-30T07:17:53Z</updated>
<author>
<name>Chunyan Zhang</name>
<email>chunyan.zhang@unisoc.com</email>
</author>
<published>2019-08-28T02:17:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6a526f66ab1494b63c71cd6639d9d96fd7216add'/>
<id>urn:sha1:6a526f66ab1494b63c71cd6639d9d96fd7216add</id>
<content type='text'>
The bit of PRESET_VAL_ENABLE in HOST_CONTROL2 register is reserved on
sprd's sd host controller, set quirk2 to disable configuring this.

Fixes: fb8bd90f83c4 ("mmc: sdhci-sprd: Add Spreadtrum's initial host controller")
Signed-off-by: Chunyan Zhang &lt;chunyan.zhang@unisoc.com&gt;
Signed-off-by: Chunyan Zhang &lt;zhang.lyra@gmail.com&gt;
Reviewed-by: Baolin Wang &lt;baolin.wang@linaro.org&gt;
Tested-by: Baolin Wang &lt;baolin.wang@linaro.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
</feed>
