<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/mmc/core/core.c, branch linux-5.0.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.0.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.0.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2019-03-23T19:11:18Z</updated>
<entry>
<title>mmc:fix a bug when max_discard is 0</title>
<updated>2019-03-23T19:11:18Z</updated>
<author>
<name>Jiong Wu</name>
</author>
<published>2019-02-28T16:18:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4a9932c94626ea4a574a91bfca64423ae8c0695d'/>
<id>urn:sha1:4a9932c94626ea4a574a91bfca64423ae8c0695d</id>
<content type='text'>
commit d4721339dcca7def04909a8e60da43c19a24d8bf upstream.

The original purpose of the code I fix is to replace max_discard with
max_trim if max_trim is less than max_discard. When max_discard is 0
we should replace max_discard with max_trim as well, because
max_discard equals 0 happens only when the max_do_calc_max_discard
process is overflowed, so if mmc_can_trim(card) is true, max_discard
should be replaced by an available max_trim.
However, in the original code, there are two lines of code interfere
the right process.
1) if (max_discard &amp;&amp; mmc_can_trim(card))
when max_discard is 0, it skips the process checking if max_discard
needs to be replaced with max_trim.
2) if (max_trim &lt; max_discard)
the condition is false when max_discard is 0. it also skips the process
that replaces max_discard with max_trim, in fact, we should replace the
0-valued max_discard with max_trim.

Signed-off-by: Jiong Wu &lt;Lohengrin1024@gmail.com&gt;
Fixes: b305882fbc87 (mmc: core: optimize mmc_calc_max_discard)
Cc: stable@vger.kernel.org # v4.17+
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 NULL ptr crash from mmc_should_fail_request</title>
<updated>2019-02-27T09:00:17Z</updated>
<author>
<name>Ritesh Harjani</name>
</author>
<published>2019-02-22T13:51:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e5723f95d6b493dd437f1199cacb41459713b32f'/>
<id>urn:sha1:e5723f95d6b493dd437f1199cacb41459713b32f</id>
<content type='text'>
In case of CQHCI, mrq-&gt;cmd may be NULL for data requests (non DCMD).
In such case mmc_should_fail_request is directly dereferencing
mrq-&gt;cmd while cmd is NULL.
Fix this by checking for mrq-&gt;cmd pointer.

Fixes: 72a5af554df8 ("mmc: core: Add support for handling CQE requests")
Signed-off-by: Ritesh Harjani &lt;riteshh@codeaurora.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: core: Introduce MMC_CAP_SYNC_RUNTIME_PM</title>
<updated>2018-12-17T07:26:24Z</updated>
<author>
<name>Ulf Hansson</name>
</author>
<published>2018-05-31T09:40:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7d5ef512575663695cf85f3aeb985a0aeb03e364'/>
<id>urn:sha1:7d5ef512575663695cf85f3aeb985a0aeb03e364</id>
<content type='text'>
To allow mmc host drivers to inform the mmc core about rather using
pm_runtime_put_sync_suspend() instead of pm_runtime_put_autosuspend(),
let's introduce MMC_CAP_SYNC_RUNTIME_PM.

This is especially useful for those mmc host drivers that don't benefit
from using the runtime PM autosuspend feature. Typically this is those that
relies on parent devices to power the card via runtime PM, like some USB
host drivers for example.

Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Tested-by: Kai-Heng Feng &lt;kai.heng.feng@canonical.com&gt;
Tested-by: Oleksandr Natalenko &lt;oleksandr@natalenko.name&gt;
</content>
</entry>
<entry>
<title>mmc: core: remove obsolete mmc_set_blockcount() function</title>
<updated>2018-12-17T07:26:24Z</updated>
<author>
<name>Wolfram Sang</name>
</author>
<published>2018-11-26T13:38:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b0715f04d0c136280da0cfd172f2bee49a64d2d2'/>
<id>urn:sha1:b0715f04d0c136280da0cfd172f2bee49a64d2d2</id>
<content type='text'>
The only user was converted to fill a sbc command which is the proper
way to do it because of AutoCMD23 feature of some hosts.

Signed-off-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Tested-by: Clément Péron &lt;peron.clem@gmail.com&gt;
Reviewed-by: Avri Altman &lt;avri.altman@wdc.com&gt;
Reviewed-by: Niklas Söderlund &lt;niklas.soderlund+renesas@ragnatech.se&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: core: Drop the unused mmc_power_save|restore_host()</title>
<updated>2018-07-16T09:21:45Z</updated>
<author>
<name>Ulf Hansson</name>
</author>
<published>2018-06-26T14:51:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=29772f8a73d88a5de648177d9d822055ab7d1ba6'/>
<id>urn:sha1:29772f8a73d88a5de648177d9d822055ab7d1ba6</id>
<content type='text'>
The last user of mmc_power_save|restore_host() APIs is gone, hence let's
drop them. Drop also the corresponding bus_ops callback,
-&gt;power_save|restore() as those becomes redundant.

Cc: Tony Lindgren &lt;tony@atomide.com&gt;
Cc: Eyal Reizer &lt;eyalreizer@gmail.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: core: Adjust and reuse the macro of R1_STATUS(x)</title>
<updated>2018-07-16T09:21:45Z</updated>
<author>
<name>Shawn Lin</name>
</author>
<published>2018-05-30T02:11:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a94a7483a91cb6a0d15a4413e8fc853f33a4e1b9'/>
<id>urn:sha1:a94a7483a91cb6a0d15a4413e8fc853f33a4e1b9</id>
<content type='text'>
R1_STATUS(x) now is only used by ioctl_rpmb_card_status_poll(),
which checks all bits as possible. But according to the spec,
bit 17 and bit 18 should be ignored, as well bit 14 which is
reserved(must be set to 0) quoting from the spec and these rule
apply to all places checking the device status. So change
its checking from 0xFFFFE000 to 0xFFF9A000.

As a bonus, we reuse it for mmc_do_erase() as well as
mmc_switch_status_error().
(1) Currently mmc_switch_status_error() doesn't check bit 25, but
it means device is locked but not unlocked by CMD42 prior to any
operations which need check busy, which is also not allowed.
(2) mmc_do_erase() also forgot to to check bit 15, WP_ERASE_SKIP.
The spec says "Only partial address space was erased due to existing
write protected blocks.", which obviously means we should fail this I/O.
Otherwise, the partial erased data stored in nonvalatile flash violates
the data integrity from the view of I/O owner, which probably confuse
it when further used.

So reusing R1_STATUS for them not only improve the readability but also
slove real problems.

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>
<entry>
<title>mmc: Throttle calls to MMC_SEND_STATUS during mmc_do_erase()</title>
<updated>2018-05-29T10:24:26Z</updated>
<author>
<name>Martin Hicks</name>
</author>
<published>2018-05-28T11:23:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=833b51170feeee1718990480f792bb05cb0ca17c'/>
<id>urn:sha1:833b51170feeee1718990480f792bb05cb0ca17c</id>
<content type='text'>
This drastically reduces the rate at which the MMC_SEND_STATUS cmd polls
for completion of the MMC Erase operation.  The patch does this by adding
a backoff sleep that starts by sleeping for short intervals (128-256us),
and ramps up to sleeping for 32-64ms.

Even on very quickly completing erase operations, the loop iterates a few
times, so not too much extra latency is added to these commands.

For long running discard operarations, like a full-device secure discard,
this change drops the interrupt rates on my single-core NXP I.MX6UL from
45000/s to about 20/s, and greatly improves system responsiveness.

Signed-off-by: Martin Hicks &lt;mort@bork.org&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: core: add tunable delay waiting for power to be stable</title>
<updated>2018-05-21T08:38:50Z</updated>
<author>
<name>Shawn Lin</name>
</author>
<published>2018-05-08T01:04:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6d796c68cd15234a33a4bd2ef7231125fea2dc6c'/>
<id>urn:sha1:6d796c68cd15234a33a4bd2ef7231125fea2dc6c</id>
<content type='text'>
The hard-coded 10ms delay in mmc_power_up came from
commit 79bccc5aefb4 ("mmc: increase power up delay"), which said "The TI
controller on Toshiba Tecra M5 needs more time to power up or the cards
will init incorrectly or not at all." But it's too engineering solution
for a special board but force all platforms to wait for that long time,
especially painful for mmc_power_up for eMMC when booting.

However, it's added since 2009, and we can't tell if other platforms
benefit from it. But in practise, the modern hardware are most likely to
have a stable power supply with 1ms after setting it for no matter PMIC
or discrete power. And more importnatly, most regulators implement the
callback of -&gt;set_voltage_time_sel() for regulator core to wait for
specific period of time for the power supply to be stable, which means
once regulator_set_voltage_* return, the power should reach the the
minimum voltage that works for initialization. Of course, if there
are some other ways for host to power the card, we should allow them
to argue a suitable delay as well.

With this patch, we could assign the delay from firmware, or we could
assigne it via -&gt;set_ios() callback from host drivers.

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>
<entry>
<title>mmc: core: Drop unused define for timeout</title>
<updated>2018-05-08T07:45:33Z</updated>
<author>
<name>Ulf Hansson</name>
</author>
<published>2018-05-02T13:13:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3ce7f76ff9033cbf966c1121ea59051b533f95ef'/>
<id>urn:sha1:3ce7f76ff9033cbf966c1121ea59051b533f95ef</id>
<content type='text'>
MMC_CORE_TIMEOUT_MS isn't being used no more, let's drop it.

Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: core: Share internal function to set initial signal voltage</title>
<updated>2018-05-08T07:33:50Z</updated>
<author>
<name>Ulf Hansson</name>
</author>
<published>2018-04-05T19:24:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=508c9864ccede5dd4b8a7220b3fe6998763e4407'/>
<id>urn:sha1:508c9864ccede5dd4b8a7220b3fe6998763e4407</id>
<content type='text'>
Move the corresponding code for setting the initial signal voltage, from
mmc_power_up() into a new function, mmc_set_initial_signal_voltage().

Make the function internally available to the mmc core, as to allow the
following changes to make use of it.

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>
</feed>
