<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/mmc/core/sd.c, branch linux-4.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-05-22T08:38:17Z</updated>
<entry>
<title>mmc: core: Set read only for SD cards with permanent write protect bit</title>
<updated>2021-05-22T08:38:17Z</updated>
<author>
<name>Seunghui Lee</name>
</author>
<published>2021-02-22T08:31:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=458319b47133af9aaf86da0bb1a366846e61d913'/>
<id>urn:sha1:458319b47133af9aaf86da0bb1a366846e61d913</id>
<content type='text'>
commit 917a5336f2c27928be270226ab374ed0cbf3805d upstream.

Some of SD cards sets permanent write protection bit in their CSD register,
due to lifespan or internal problem. To avoid unnecessary I/O write
operations, let's parse the bits in the CSD during initialization and mark
the card as read only for this case.

Signed-off-by: Seunghui Lee &lt;sh043.lee@samsung.com&gt;
Link: https://lore.kernel.org/r/20210222083156.19158-1-sh043.lee@samsung.com
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mmc: sd: limit SD card power limit according to cards capabilities</title>
<updated>2020-05-10T08:26:06Z</updated>
<author>
<name>Russell King</name>
</author>
<published>2016-01-02T10:06:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=674c32a1c73905444fd0449a7b6f9aef451927e1'/>
<id>urn:sha1:674c32a1c73905444fd0449a7b6f9aef451927e1</id>
<content type='text'>
commit d9812780a020bcec44565b5950b2a8b31afb5545 upstream.

The SD card specification allows cards to error out a SWITCH command
where the requested function in a group is not supported.  The spec
provides for a set of capabilities which indicate which functions are
supported.

In the case of the power limit, requesting an unsupported power level
via the SWITCH command fails, resulting in the power level remaining at
the power-on default of 0.72W, even though the host and card may support
higher powers levels.

This has been seen with SanDisk 8GB cards, which support the default
0.72W and 1.44W (200mA and 400mA) in combination with an iMX6 host,
supporting up to 2.88W (800mA).  This currently causes us to try to set
a power limit function value of '3' (2.88W) which the card errors out
on, and thereby causes the power level to remain at 0.72W rather than
the desired 1.44W.

Arrange to limit the selected current limit by the capabilities reported
by the card to avoid the SWITCH command failing.  Select the highest
current limit that the host and card combination support.

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Fixes: a39ca6ae0a08 ("mmc: core: Simplify and fix for SD switch processing")
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>mmc: core: Fix init of SD cards reporting an invalid VDD range</title>
<updated>2019-09-06T08:18:17Z</updated>
<author>
<name>Ulf Hansson</name>
</author>
<published>2019-08-27T08:10:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e2f1509fca476d763d94eb0026b28c22ab110688'/>
<id>urn:sha1:e2f1509fca476d763d94eb0026b28c22ab110688</id>
<content type='text'>
commit 72741084d903e65e121c27bd29494d941729d4a1 upstream.

The OCR register defines the supported range of VDD voltages for SD cards.
However, it has turned out that some SD cards reports an invalid voltage
range, for example having bit7 set.

When a host supports MMC_CAP2_FULL_PWR_CYCLE and some of the voltages from
the invalid VDD range, this triggers the core to run a power cycle of the
card to try to initialize it at the lowest common supported voltage.
Obviously this fails, since the card can't support it.

Let's fix this problem, by clearing invalid bits from the read OCR register
for SD cards, before proceeding with the VDD voltage negotiation.

Cc: stable@vger.kernel.org
Reported-by: Philip Langdale &lt;philipl@overt.org&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Reviewed-by: Philip Langdale &lt;philipl@overt.org&gt;
Tested-by: Philip Langdale &lt;philipl@overt.org&gt;
Tested-by: Manuel Presnitz &lt;mail@mpy.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>mmc: core: Verify SD bus width</title>
<updated>2019-06-11T10:23:54Z</updated>
<author>
<name>Raul E Rangel</name>
</author>
<published>2019-04-29T17:32:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dba032038c959b0321fd5d06c7e51f69a46e2db8'/>
<id>urn:sha1:dba032038c959b0321fd5d06c7e51f69a46e2db8</id>
<content type='text'>
[ Upstream commit 9e4be8d03f50d1b25c38e2b59e73b194c130df7d ]

The SD Physical Layer Spec says the following: Since the SD Memory Card
shall support at least the two bus modes 1-bit or 4-bit width, then any SD
Card shall set at least bits 0 and 2 (SD_BUS_WIDTH="0101").

This change verifies the card has specified a bus width.

AMD SDHC Device 7806 can get into a bad state after a card disconnect
where anything transferred via the DATA lines will always result in a
zero filled buffer. Currently the driver will continue without error if
the HC is in this condition. A block device will be created, but reading
from it will result in a zero buffer. This makes it seem like the SD
device has been erased, when in actuality the data is never getting
copied from the DATA lines to the data buffer.

SCR is the first command in the SD initialization sequence that uses the
DATA lines. By checking that the response was invalid, we can abort
mounting the card.

Reviewed-by: Avri Altman &lt;avri.altman@wdc.com&gt;
Signed-off-by: Raul E Rangel &lt;rrangel@chromium.org&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>mmc: core: Enable tuning according to the actual timing</title>
<updated>2016-03-03T23:07:15Z</updated>
<author>
<name>Carlo Caione</name>
</author>
<published>2016-01-13T08:36:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3cafb70cabf27616ac3da795a92a9b651fb28733'/>
<id>urn:sha1:3cafb70cabf27616ac3da795a92a9b651fb28733</id>
<content type='text'>
commit e10c321977091f163eceedec0650e0ef4b3cf4bb upstream.

While in sdhci_execute_tuning() the choice whether or not to enable the
tuning is done on the actual timing, in the mmc_sdio_init_uhs_card() the
check is done on the capability of the card.

This difference is causing some issues with some SDIO cards in DDR50
mode where the CDM19 is wrongly issued.

With this patch we modify the check in both
mmc_(sd|sdio)_init_uhs_card() functions to take the proper decision
only according to the actual timing specification.

Signed-off-by: Carlo Caione &lt;carlo@endlessm.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>mmc: skip reclaiming host on mmc_add_card() error</title>
<updated>2015-10-26T15:00:14Z</updated>
<author>
<name>Sergei Shtylyov</name>
</author>
<published>2015-10-14T20:53:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2860d060ac902df0164cc9580f843b101e27a2c6'/>
<id>urn:sha1:2860d060ac902df0164cc9580f843b101e27a2c6</id>
<content type='text'>
There's little sense in releasing the host on mmc_add_card() error
immediately after reclaiming  it, so reclaim the host  only in case
of success.

Signed-off-by: Sergei Shtylyov &lt;sergei.shtylyov@cogentembedded.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: core: Remove MMC_CLKGATE</title>
<updated>2015-10-26T15:00:09Z</updated>
<author>
<name>Ulf Hansson</name>
</author>
<published>2015-10-02T08:56:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9eadcc0581a8ccaf4c2378aa1c193fb164304f1d'/>
<id>urn:sha1:9eadcc0581a8ccaf4c2378aa1c193fb164304f1d</id>
<content type='text'>
MMC_CLKGATE was once invented to save power by gating the bus clock at
request inactivity. At that time it served its purpose. The modern way to
deal with power saving for these scenarios, is by using runtime PM.

Nowadays, several host drivers have deployed runtime PM, but for those
that haven't and which still cares power saving at request inactivity,
it's certainly time to deploy runtime PM as it has been around for several
years now.

To simplify code to mmc core and thus decrease maintenance efforts, this
patch removes all code related to MMC_CLKGATE.

Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: core: enable CMD19 tuning for DDR50 mode</title>
<updated>2015-10-26T15:00:03Z</updated>
<author>
<name>Weijun Yang</name>
</author>
<published>2015-10-04T12:04:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4324f6de6d2eb9b232410eb0d67bfafdde8ba711'/>
<id>urn:sha1:4324f6de6d2eb9b232410eb0d67bfafdde8ba711</id>
<content type='text'>
As SD Specifications Part1 Physical Layer Specification Version
3.01 says, CMD19 tuning is available for unlocked cards in transfer
state of 1.8V signaling mode. The small difference between v3.00
and 3.01 spec means that CMD19 tuning is also available for DDR50
mode.

Signed-off-by: Weijun Yang &lt;york.yang@csr.com&gt;
Signed-off-by: Barry Song &lt;Baohua.Song@csr.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: sd: Remove superfluous error code assignment</title>
<updated>2015-10-26T14:59:53Z</updated>
<author>
<name>Yousong Zhou</name>
</author>
<published>2015-09-09T16:33:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bf8b8511af7721e6f81848a1fd1359716602f3b7'/>
<id>urn:sha1:bf8b8511af7721e6f81848a1fd1359716602f3b7</id>
<content type='text'>
Signed-off-by: Yousong Zhou &lt;yszhou4tech@gmail.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: core: Remove redundant -&gt;power_restore() callback for SD</title>
<updated>2015-06-04T08:03:51Z</updated>
<author>
<name>Ulf Hansson</name>
</author>
<published>2015-06-01T09:14:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3056c49c35c1e8cc303e79c7085579ff0729a83b'/>
<id>urn:sha1:3056c49c35c1e8cc303e79c7085579ff0729a83b</id>
<content type='text'>
Since the -&gt;reset() callback is implemented for SD, the -&gt;power_restore()
callback has become redundant, let's remove it.

Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
</feed>
