<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/mmc/core/sd.c, branch linux-4.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-10-26T11:19:17Z</updated>
<entry>
<title>mmc: core: Terminate infinite loop in SD-UHS voltage switch</title>
<updated>2022-10-26T11:19:17Z</updated>
<author>
<name>Brian Norris</name>
</author>
<published>2022-09-14T01:40:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=871d9a6a42a399e75846d82e1ec232a7b49df0dc'/>
<id>urn:sha1:871d9a6a42a399e75846d82e1ec232a7b49df0dc</id>
<content type='text'>
commit e9233917a7e53980664efbc565888163c0a33c3f upstream.

This loop intends to retry a max of 10 times, with some implicit
termination based on the SD_{R,}OCR_S18A bit. Unfortunately, the
termination condition depends on the value reported by the SD card
(*rocr), which may or may not correctly reflect what we asked it to do.

Needless to say, it's not wise to rely on the card doing what we expect;
we should at least terminate the loop regardless. So, check both the
input and output values, so we ensure we will terminate regardless of
the SD card behavior.

Note that SDIO learned a similar retry loop in commit 0797e5f1453b
("mmc: core: Fixup signal voltage switch"), but that used the 'ocr'
result, and so the current pre-terminating condition looks like:

    rocr &amp; ocr &amp; R4_18V_PRESENT

(i.e., it doesn't have the same bug.)

This addresses a number of crash reports seen on ChromeOS that look
like the following:

    ... // lots of repeated: ...
    &lt;4&gt;[13142.846061] mmc1: Skipping voltage switch
    &lt;4&gt;[13143.406087] mmc1: Skipping voltage switch
    &lt;4&gt;[13143.964724] mmc1: Skipping voltage switch
    &lt;4&gt;[13144.526089] mmc1: Skipping voltage switch
    &lt;4&gt;[13145.086088] mmc1: Skipping voltage switch
    &lt;4&gt;[13145.645941] mmc1: Skipping voltage switch
    &lt;3&gt;[13146.153969] INFO: task halt:30352 blocked for more than 122 seconds.
    ...

Fixes: f2119df6b764 ("mmc: sd: add support for signal voltage switch procedure")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Brian Norris &lt;briannorris@chromium.org&gt;
Reviewed-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/20220914014010.2076169-1-briannorris@chromium.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: core: Replace with already defined values for readability</title>
<updated>2022-10-26T11:19:17Z</updated>
<author>
<name>ChanWoo Lee</name>
</author>
<published>2022-07-06T00:48:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=809f108c8f1995ea25f3c06307bf71ecbb08edc2'/>
<id>urn:sha1:809f108c8f1995ea25f3c06307bf71ecbb08edc2</id>
<content type='text'>
commit e427266460826bea21b70f9b2bb29decfb2c2620 upstream.

SD_ROCR_S18A is already defined and is used to check the rocr value, so
let's replace with already defined values for readability.

Signed-off-by: ChanWoo Lee &lt;cw9316.lee@samsung.com&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Link: https://lore.kernel.org/r/20220706004840.24812-1-cw9316.lee@samsung.com
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Brian Norris &lt;briannorris@chromium.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mmc: core: Allow UHS-I voltage switch for SDSC cards if supported</title>
<updated>2021-07-20T14:16:04Z</updated>
<author>
<name>Christian Löhle</name>
</author>
<published>2021-05-12T16:03:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f7589b0224e46cdc5fe8f03d7aec08e023b491a9'/>
<id>urn:sha1:f7589b0224e46cdc5fe8f03d7aec08e023b491a9</id>
<content type='text'>
commit 09247e110b2efce3a104e57e887c373e0a57a412 upstream.

While initializing an UHS-I SD card, the mmc core first tries to switch to
1.8V I/O voltage, before it continues to change the settings for the bus
speed mode.

However, the current behaviour in the mmc core is inconsistent and doesn't
conform to the SD spec. More precisely, an SD card that supports UHS-I must
set both the SD_OCR_CCS bit and the SD_OCR_S18R bit in the OCR register
response. When switching to 1.8V I/O the mmc core correctly checks both of
the bits, but only the SD_OCR_S18R bit when changing the settings for bus
speed mode.

Rather than actually fixing the code to confirm to the SD spec, let's
deliberately deviate from it by requiring only the SD_OCR_S18R bit for both
parts. This enables us to support UHS-I for SDSC cards (outside spec),
which is actually being supported by some existing SDSC cards. Moreover,
this fixes the inconsistent behaviour.

Signed-off-by: Christian Loehle &lt;cloehle@hyperstone.com&gt;
Link: https://lore.kernel.org/r/CWXP265MB26803AE79E0AD5ED083BF2A6C4529@CWXP265MB2680.GBRP265.PROD.OUTLOOK.COM
Cc: stable@vger.kernel.org
[Ulf: Rewrote commit message and comments to clarify the changes]
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: Set read only for SD cards with permanent write protect bit</title>
<updated>2021-05-22T08:59:13Z</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=2e911496d874dd15aabda0dda3728d66a3b10d3d'/>
<id>urn:sha1:2e911496d874dd15aabda0dda3728d66a3b10d3d</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: core: Fix init of SD cards reporting an invalid VDD range</title>
<updated>2019-09-06T08:22: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=abc42341b6c4871161c99eeeb4733823f36af642'/>
<id>urn:sha1:abc42341b6c4871161c99eeeb4733823f36af642</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-05-31T13:46:07Z</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=d96a6c31e42e9b2f351fce9b7ae83a7214c4e843'/>
<id>urn:sha1:d96a6c31e42e9b2f351fce9b7ae83a7214c4e843</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: Rename -&gt;reset() bus ops to -&gt;hw_reset()</title>
<updated>2018-05-08T07:33:29Z</updated>
<author>
<name>Ulf Hansson</name>
</author>
<published>2018-04-05T11:24:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3a3db6030b64ceb4b4e41a6811168c5d90a9f7f8'/>
<id>urn:sha1:3a3db6030b64ceb4b4e41a6811168c5d90a9f7f8</id>
<content type='text'>
The bus ops -&gt;reset() executes a full HW reset of the card, as the calling
function mmc_hw_reset() also indicates by its name. Let's convert to follow
the similar names, for both the bus ops callback and for the corresponding
bus ops functions, as to clarify the purpose of code.

Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Tested-by: Quentin Schulz &lt;quentin.schulz@bootlin.com&gt;
Reviewed-by: Shawn Lin &lt;shawn.lin@rock-chips.com&gt;
</content>
</entry>
<entry>
<title>mmc: core: Add capability to avoid 3.3V signaling</title>
<updated>2018-05-02T13:08:44Z</updated>
<author>
<name>Kyle Roeschley</name>
</author>
<published>2018-04-13T21:54:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=247cfe53557524a94dd1001d19e5aa50bd5aca81'/>
<id>urn:sha1:247cfe53557524a94dd1001d19e5aa50bd5aca81</id>
<content type='text'>
Some SD host controllers cannot handle extended use of 3.3V signaling.
To accommodate these controllers, add a capability that requires us to
negotiate the voltage down from 3.3V during card initialization.

Signed-off-by: Kyle Roeschley &lt;kyle.roeschley@ni.com&gt;
Signed-off-by: Jennifer Dahm &lt;jennifer.dahm@ni.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: core: Export card RCA register via sysfs</title>
<updated>2018-03-15T13:43:05Z</updated>
<author>
<name>Harish Jenny K N</name>
</author>
<published>2018-03-07T05:01:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=974e85e90c84a32f49b70c6615f1e8f156f38a3c'/>
<id>urn:sha1:974e85e90c84a32f49b70c6615f1e8f156f38a3c</id>
<content type='text'>
This patch exports RCA register to sysfs which will help in reading the
disk identification information.

Reviewed-by: Shawn Lin &lt;shawn.lin@rock-chips.com&gt;
Signed-off-by: Harish Jenny K N &lt;harish_kandiga@mentor.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: sd: Remove redundant err assignment from mmc_read_switch</title>
<updated>2018-03-15T08:32:30Z</updated>
<author>
<name>Shawn Lin</name>
</author>
<published>2018-02-27T01:26:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3715ce57f4d26d09fc1813d157286abc5aa319a5'/>
<id>urn:sha1:3715ce57f4d26d09fc1813d157286abc5aa319a5</id>
<content type='text'>
Variable err would be firstly initialized by the return value of
mmc_sd_switch().

Signed-off-by: Shawn Lin &lt;shawn.lin@rock-chips.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
</feed>
