<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/mmc, branch linux-3.16.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>mmc: spi: Toggle SPI polarity, do not hardcode it</title>
<updated>2020-05-22T20:19:16+00:00</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2019-12-04T15:27:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d525915ba099d34e08606ef44bf8cdc899c18f95'/>
<id>d525915ba099d34e08606ef44bf8cdc899c18f95</id>
<content type='text'>
commit af3ed119329cf9690598c5a562d95dfd128e91d6 upstream.

The code in mmc_spi_initsequence() tries to send a burst with
high chipselect and for this reason hardcodes the device into
SPI_CS_HIGH.

This is not good because the SPI_CS_HIGH flag indicates
logical "asserted" CS not always the physical level. In
some cases the signal is inverted in the GPIO library and
in that case SPI_CS_HIGH is already set, and enforcing
SPI_CS_HIGH again will actually drive it low.

Instead of hard-coding this, toggle the polarity so if the
default is LOW it goes high to assert chipselect but if it
is already high then toggle it low instead.

Cc: Phil Elwell &lt;phil@raspberrypi.org&gt;
Reported-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Reviewed-by: Mark Brown &lt;broonie@kernel.org&gt;
Link: https://lore.kernel.org/r/20191204152749.12652-1-linus.walleij@linaro.org
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit af3ed119329cf9690598c5a562d95dfd128e91d6 upstream.

The code in mmc_spi_initsequence() tries to send a burst with
high chipselect and for this reason hardcodes the device into
SPI_CS_HIGH.

This is not good because the SPI_CS_HIGH flag indicates
logical "asserted" CS not always the physical level. In
some cases the signal is inverted in the GPIO library and
in that case SPI_CS_HIGH is already set, and enforcing
SPI_CS_HIGH again will actually drive it low.

Instead of hard-coding this, toggle the polarity so if the
default is LOW it goes high to assert chipselect but if it
is already high then toggle it low instead.

Cc: Phil Elwell &lt;phil@raspberrypi.org&gt;
Reported-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Reviewed-by: Mark Brown &lt;broonie@kernel.org&gt;
Link: https://lore.kernel.org/r/20191204152749.12652-1-linus.walleij@linaro.org
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sdhci: fix minimum clock rate for v3 controller</title>
<updated>2020-04-28T18:03:33+00:00</updated>
<author>
<name>Michał Mirosław</name>
<email>mirq-linux@rere.qmqm.pl</email>
</author>
<published>2020-01-15T09:54:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=51c7752ea61a9c57858ef666233e25071e93d700'/>
<id>51c7752ea61a9c57858ef666233e25071e93d700</id>
<content type='text'>
commit 2a187d03352086e300daa2044051db00044cd171 upstream.

For SDHCIv3+ with programmable clock mode, minimal clock frequency is
still base clock / max(divider). Minimal programmable clock frequency is
always greater than minimal divided clock frequency. Without this patch,
SDHCI uses out-of-spec initial frequency when multiplier is big enough:

mmc1: mmc_rescan_try_freq: trying to init card at 468750 Hz
[for 480 MHz source clock divided by 1024]

The code in sdhci_calc_clk() already chooses a correct SDCLK clock mode.

Fixes: c3ed3877625f ("mmc: sdhci: add support for programmable clock mode")
Signed-off-by: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&gt;
Acked-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Link: https://lore.kernel.org/r/ffb489519a446caffe7a0a05c4b9372bd52397bb.1579082031.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 2a187d03352086e300daa2044051db00044cd171 upstream.

For SDHCIv3+ with programmable clock mode, minimal clock frequency is
still base clock / max(divider). Minimal programmable clock frequency is
always greater than minimal divided clock frequency. Without this patch,
SDHCI uses out-of-spec initial frequency when multiplier is big enough:

mmc1: mmc_rescan_try_freq: trying to init card at 468750 Hz
[for 480 MHz source clock divided by 1024]

The code in sdhci_calc_clk() already chooses a correct SDCLK clock mode.

Fixes: c3ed3877625f ("mmc: sdhci: add support for programmable clock mode")
Signed-off-by: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&gt;
Acked-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Link: https://lore.kernel.org/r/ffb489519a446caffe7a0a05c4b9372bd52397bb.1579082031.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sdhci-s3c: solve problem with sleeping in atomic context</title>
<updated>2020-02-11T20:03:57+00:00</updated>
<author>
<name>Paul Osmialowski</name>
<email>p.osmialowsk@samsung.com</email>
</author>
<published>2015-02-04T09:16:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1ce4b5294541cecb68d1b72f346569e9412c265a'/>
<id>1ce4b5294541cecb68d1b72f346569e9412c265a</id>
<content type='text'>
commit 017210d1c0dc2e2d3b142985cb31d90b98dc0f0f upstream.

This change addresses following problem:

[    2.560726] ------------[ cut here ]------------
[    2.565341] WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:2744 lockdep_trace_alloc+0xec/0x118()
[    2.574439] DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))
[    2.579821] Modules linked in:
[    2.583038] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G        W      3.18.0-next-20141216-00002-g4ff197fc1902-dirty #1318
[    2.593796] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[    2.599892] [&lt;c0014c44&gt;] (unwind_backtrace) from [&lt;c0011bbc&gt;] (show_stack+0x10/0x14)
[    2.607612] [&lt;c0011bbc&gt;] (show_stack) from [&lt;c04953b8&gt;] (dump_stack+0x70/0xbc)
[    2.614822] [&lt;c04953b8&gt;] (dump_stack) from [&lt;c0023444&gt;] (warn_slowpath_common+0x74/0xb0)
[    2.622885] [&lt;c0023444&gt;] (warn_slowpath_common) from [&lt;c0023514&gt;] (warn_slowpath_fmt+0x30/0x40)
[    2.631569] [&lt;c0023514&gt;] (warn_slowpath_fmt) from [&lt;c0063644&gt;] (lockdep_trace_alloc+0xec/0x118)
[    2.640246] [&lt;c0063644&gt;] (lockdep_trace_alloc) from [&lt;c00df52c&gt;] (__kmalloc+0x3c/0x1cc)
[    2.648240] [&lt;c00df52c&gt;] (__kmalloc) from [&lt;c0394970&gt;] (clk_fetch_parent_index+0xb8/0xd4)
[    2.656390] [&lt;c0394970&gt;] (clk_fetch_parent_index) from [&lt;c0394a6c&gt;] (clk_calc_new_rates+0xe0/0x1fc)
[    2.665415] [&lt;c0394a6c&gt;] (clk_calc_new_rates) from [&lt;c0394b40&gt;] (clk_calc_new_rates+0x1b4/0x1fc)
[    2.674181] [&lt;c0394b40&gt;] (clk_calc_new_rates) from [&lt;c0395408&gt;] (clk_set_rate+0x50/0xc8)
[    2.682265] [&lt;c0395408&gt;] (clk_set_rate) from [&lt;c0377708&gt;] (sdhci_cmu_set_clock+0x68/0x16c)
[    2.690503] [&lt;c0377708&gt;] (sdhci_cmu_set_clock) from [&lt;c03735cc&gt;] (sdhci_do_set_ios+0xf0/0x64c)
[    2.699095] [&lt;c03735cc&gt;] (sdhci_do_set_ios) from [&lt;c0373b48&gt;] (sdhci_set_ios+0x20/0x2c)
[    2.707080] [&lt;c0373b48&gt;] (sdhci_set_ios) from [&lt;c035ddf0&gt;] (mmc_power_up+0x118/0x1fc)
[    2.714889] [&lt;c035ddf0&gt;] (mmc_power_up) from [&lt;c035ecd0&gt;] (mmc_start_host+0x44/0x6c)
[    2.722615] [&lt;c035ecd0&gt;] (mmc_start_host) from [&lt;c035fd60&gt;] (mmc_add_host+0x58/0x7c)
[    2.730341] [&lt;c035fd60&gt;] (mmc_add_host) from [&lt;c037454c&gt;] (sdhci_add_host+0x968/0xd94)
[    2.738240] [&lt;c037454c&gt;] (sdhci_add_host) from [&lt;c0377b60&gt;] (sdhci_s3c_probe+0x354/0x52c)
[    2.746406] [&lt;c0377b60&gt;] (sdhci_s3c_probe) from [&lt;c0283b58&gt;] (platform_drv_probe+0x48/0xa4)
[    2.754733] [&lt;c0283b58&gt;] (platform_drv_probe) from [&lt;c02824e8&gt;] (driver_probe_device+0x13c/0x37c)
[    2.763585] [&lt;c02824e8&gt;] (driver_probe_device) from [&lt;c02827bc&gt;] (__driver_attach+0x94/0x98)
[    2.772003] [&lt;c02827bc&gt;] (__driver_attach) from [&lt;c0280a60&gt;] (bus_for_each_dev+0x54/0x88)
[    2.780163] [&lt;c0280a60&gt;] (bus_for_each_dev) from [&lt;c0281b48&gt;] (bus_add_driver+0xe4/0x200)
[    2.788322] [&lt;c0281b48&gt;] (bus_add_driver) from [&lt;c0282dfc&gt;] (driver_register+0x78/0xf4)
[    2.796308] [&lt;c0282dfc&gt;] (driver_register) from [&lt;c00089b0&gt;] (do_one_initcall+0xac/0x1f0)
[    2.804473] [&lt;c00089b0&gt;] (do_one_initcall) from [&lt;c0673d94&gt;] (kernel_init_freeable+0x10c/0x1d8)
[    2.813153] [&lt;c0673d94&gt;] (kernel_init_freeable) from [&lt;c0490058&gt;] (kernel_init+0x28/0x108)
[    2.821398] [&lt;c0490058&gt;] (kernel_init) from [&lt;c000f268&gt;] (ret_from_fork+0x14/0x2c)
[    2.828939] ---[ end trace 03cc00e539849d1f ]---

clk_set_rate() tries to take clk's prepare_lock mutex while being in atomic
context entered in sdhci_do_set_ios().

The solution is inspired by similar situation in sdhci_set_power() also called
from sdhci_do_set_ios():

                spin_unlock_irq(&amp;host-&gt;lock);
                mmc_regulator_set_ocr(mmc, mmc-&gt;supply.vmmc, vdd);
                spin_lock_irq(&amp;host-&gt;lock);

Note that since sdhci_s3c_set_clock() sets SDHCI_CLOCK_CARD_EN, proposed change
first resets this bit. It is reset anyway (by setting SDHCI_CLOCK_INT_EN bit
only) after call to clk_set_rate() in order to wait for the clock to stabilize
and is set again as soon as the clock becomes stable.

Signed-off-by: Paul Osmialowski &lt;p.osmialowsk@samsung.com&gt;
Tested-by: Jaehoon Chung &lt;jh80.chung@samsung.com&gt;
Acked-by: Jaehoon Chung &lt;jh80.chung@samsung.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 017210d1c0dc2e2d3b142985cb31d90b98dc0f0f upstream.

This change addresses following problem:

[    2.560726] ------------[ cut here ]------------
[    2.565341] WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:2744 lockdep_trace_alloc+0xec/0x118()
[    2.574439] DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))
[    2.579821] Modules linked in:
[    2.583038] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G        W      3.18.0-next-20141216-00002-g4ff197fc1902-dirty #1318
[    2.593796] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[    2.599892] [&lt;c0014c44&gt;] (unwind_backtrace) from [&lt;c0011bbc&gt;] (show_stack+0x10/0x14)
[    2.607612] [&lt;c0011bbc&gt;] (show_stack) from [&lt;c04953b8&gt;] (dump_stack+0x70/0xbc)
[    2.614822] [&lt;c04953b8&gt;] (dump_stack) from [&lt;c0023444&gt;] (warn_slowpath_common+0x74/0xb0)
[    2.622885] [&lt;c0023444&gt;] (warn_slowpath_common) from [&lt;c0023514&gt;] (warn_slowpath_fmt+0x30/0x40)
[    2.631569] [&lt;c0023514&gt;] (warn_slowpath_fmt) from [&lt;c0063644&gt;] (lockdep_trace_alloc+0xec/0x118)
[    2.640246] [&lt;c0063644&gt;] (lockdep_trace_alloc) from [&lt;c00df52c&gt;] (__kmalloc+0x3c/0x1cc)
[    2.648240] [&lt;c00df52c&gt;] (__kmalloc) from [&lt;c0394970&gt;] (clk_fetch_parent_index+0xb8/0xd4)
[    2.656390] [&lt;c0394970&gt;] (clk_fetch_parent_index) from [&lt;c0394a6c&gt;] (clk_calc_new_rates+0xe0/0x1fc)
[    2.665415] [&lt;c0394a6c&gt;] (clk_calc_new_rates) from [&lt;c0394b40&gt;] (clk_calc_new_rates+0x1b4/0x1fc)
[    2.674181] [&lt;c0394b40&gt;] (clk_calc_new_rates) from [&lt;c0395408&gt;] (clk_set_rate+0x50/0xc8)
[    2.682265] [&lt;c0395408&gt;] (clk_set_rate) from [&lt;c0377708&gt;] (sdhci_cmu_set_clock+0x68/0x16c)
[    2.690503] [&lt;c0377708&gt;] (sdhci_cmu_set_clock) from [&lt;c03735cc&gt;] (sdhci_do_set_ios+0xf0/0x64c)
[    2.699095] [&lt;c03735cc&gt;] (sdhci_do_set_ios) from [&lt;c0373b48&gt;] (sdhci_set_ios+0x20/0x2c)
[    2.707080] [&lt;c0373b48&gt;] (sdhci_set_ios) from [&lt;c035ddf0&gt;] (mmc_power_up+0x118/0x1fc)
[    2.714889] [&lt;c035ddf0&gt;] (mmc_power_up) from [&lt;c035ecd0&gt;] (mmc_start_host+0x44/0x6c)
[    2.722615] [&lt;c035ecd0&gt;] (mmc_start_host) from [&lt;c035fd60&gt;] (mmc_add_host+0x58/0x7c)
[    2.730341] [&lt;c035fd60&gt;] (mmc_add_host) from [&lt;c037454c&gt;] (sdhci_add_host+0x968/0xd94)
[    2.738240] [&lt;c037454c&gt;] (sdhci_add_host) from [&lt;c0377b60&gt;] (sdhci_s3c_probe+0x354/0x52c)
[    2.746406] [&lt;c0377b60&gt;] (sdhci_s3c_probe) from [&lt;c0283b58&gt;] (platform_drv_probe+0x48/0xa4)
[    2.754733] [&lt;c0283b58&gt;] (platform_drv_probe) from [&lt;c02824e8&gt;] (driver_probe_device+0x13c/0x37c)
[    2.763585] [&lt;c02824e8&gt;] (driver_probe_device) from [&lt;c02827bc&gt;] (__driver_attach+0x94/0x98)
[    2.772003] [&lt;c02827bc&gt;] (__driver_attach) from [&lt;c0280a60&gt;] (bus_for_each_dev+0x54/0x88)
[    2.780163] [&lt;c0280a60&gt;] (bus_for_each_dev) from [&lt;c0281b48&gt;] (bus_add_driver+0xe4/0x200)
[    2.788322] [&lt;c0281b48&gt;] (bus_add_driver) from [&lt;c0282dfc&gt;] (driver_register+0x78/0xf4)
[    2.796308] [&lt;c0282dfc&gt;] (driver_register) from [&lt;c00089b0&gt;] (do_one_initcall+0xac/0x1f0)
[    2.804473] [&lt;c00089b0&gt;] (do_one_initcall) from [&lt;c0673d94&gt;] (kernel_init_freeable+0x10c/0x1d8)
[    2.813153] [&lt;c0673d94&gt;] (kernel_init_freeable) from [&lt;c0490058&gt;] (kernel_init+0x28/0x108)
[    2.821398] [&lt;c0490058&gt;] (kernel_init) from [&lt;c000f268&gt;] (ret_from_fork+0x14/0x2c)
[    2.828939] ---[ end trace 03cc00e539849d1f ]---

clk_set_rate() tries to take clk's prepare_lock mutex while being in atomic
context entered in sdhci_do_set_ios().

The solution is inspired by similar situation in sdhci_set_power() also called
from sdhci_do_set_ios():

                spin_unlock_irq(&amp;host-&gt;lock);
                mmc_regulator_set_ocr(mmc, mmc-&gt;supply.vmmc, vdd);
                spin_lock_irq(&amp;host-&gt;lock);

Note that since sdhci_s3c_set_clock() sets SDHCI_CLOCK_CARD_EN, proposed change
first resets this bit. It is reset anyway (by setting SDHCI_CLOCK_INT_EN bit
only) after call to clk_set_rate() in order to wait for the clock to stabilize
and is set again as soon as the clock becomes stable.

Signed-off-by: Paul Osmialowski &lt;p.osmialowsk@samsung.com&gt;
Tested-by: Jaehoon Chung &lt;jh80.chung@samsung.com&gt;
Acked-by: Jaehoon Chung &lt;jh80.chung@samsung.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sdhci-s3c: Check if clk_set_rate() succeeds</title>
<updated>2020-02-11T20:03:57+00:00</updated>
<author>
<name>Mark Brown</name>
<email>broonie@linaro.org</email>
</author>
<published>2014-11-04T12:26:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=cddbf120b280582defabe3b0b34a62bba2c51520'/>
<id>cddbf120b280582defabe3b0b34a62bba2c51520</id>
<content type='text'>
commit cd0cfdd2485e6252b3c69284bf09d06c4d303116 upstream.

It is possible that we may fail to set the clock rate, if we do so then
log the failure and don't bother reprogramming the IP.

Signed-off-by: Mark Brown &lt;broonie@linaro.org&gt;
Acked-by: Jaehoon Chung &lt;jh80.chung@samsung.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit cd0cfdd2485e6252b3c69284bf09d06c4d303116 upstream.

It is possible that we may fail to set the clock rate, if we do so then
log the failure and don't bother reprogramming the IP.

Signed-off-by: Mark Brown &lt;broonie@linaro.org&gt;
Acked-by: Jaehoon Chung &lt;jh80.chung@samsung.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: mmc: fix switch timeout issue caused by jiffies precision</title>
<updated>2020-01-11T02:04:57+00:00</updated>
<author>
<name>Chaotian Jing</name>
<email>chaotian.jing@mediatek.com</email>
</author>
<published>2016-05-19T08:47:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d5252c1387ad16c99905b677b378f4cb71acf1ff'/>
<id>d5252c1387ad16c99905b677b378f4cb71acf1ff</id>
<content type='text'>
commit 987aa5f8059613bf85cbb6f64ffbd34f5cb7a9d1 upstream.

with CONFIG_HZ=100, the precision of jiffies is 10ms, and the
generic_cmd6_time of some card is also 10ms. then, may be current
time is only 5ms, but already timed out caused by jiffies precision.

Signed-off-by: Chaotian Jing &lt;chaotian.jing@mediatek.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 987aa5f8059613bf85cbb6f64ffbd34f5cb7a9d1 upstream.

with CONFIG_HZ=100, the precision of jiffies is 10ms, and the
generic_cmd6_time of some card is also 10ms. then, may be current
time is only 5ms, but already timed out caused by jiffies precision.

Signed-off-by: Chaotian Jing &lt;chaotian.jing@mediatek.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: block: Allow more than 8 partitions per card</title>
<updated>2020-01-11T02:04:49+00:00</updated>
<author>
<name>Colin Cross</name>
<email>ccross@android.com</email>
</author>
<published>2015-10-22T17:00:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=17855e598966731f47851d77ba6486a7941af1b9'/>
<id>17855e598966731f47851d77ba6486a7941af1b9</id>
<content type='text'>
commit 382c55f88ffeb218c446bf0c46d0fc25d2795fe2 upstream.

It is quite common for Android devices to utilize more
then 8 partitions on internal eMMC storage.

The vanilla kernel can support this via
CONFIG_MMC_BLOCK_MINORS, however that solution caps the
system to 256 minors total, which limits the number of
mmc cards the system can support.

This patch, which has been carried for quite awhile in
the AOSP common tree, provides an alternative solution
that doesn't seem to limit the total card count. So I
wanted to submit it for consideration upstream.

This patch sets the GENHD_FL_EXT_DEVT flag, which will
allocate minor number in major 259 for partitions past
disk-&gt;minors.

It also removes the use of disk_devt to determine devidx
from md-&gt;disk. md-&gt;disk-&gt;first_minor is always initialized
from devidx and can always be used to recover it.

Cc: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Cc: Chuanxiao Dong &lt;chuanxiao.dong@intel.com&gt;
Cc: Shawn Lin &lt;shawn.lin@rock-chips.com&gt;
Cc: Austin S Hemmelgarn &lt;ahferroin7@gmail.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Android Kernel Team &lt;kernel-team@android.com&gt;
Cc: linux-mmc@vger.kernel.org
Signed-off-by: Colin Cross &lt;ccross@android.com&gt;
[jstultz: Added context to commit message]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 382c55f88ffeb218c446bf0c46d0fc25d2795fe2 upstream.

It is quite common for Android devices to utilize more
then 8 partitions on internal eMMC storage.

The vanilla kernel can support this via
CONFIG_MMC_BLOCK_MINORS, however that solution caps the
system to 256 minors total, which limits the number of
mmc cards the system can support.

This patch, which has been carried for quite awhile in
the AOSP common tree, provides an alternative solution
that doesn't seem to limit the total card count. So I
wanted to submit it for consideration upstream.

This patch sets the GENHD_FL_EXT_DEVT flag, which will
allocate minor number in major 259 for partitions past
disk-&gt;minors.

It also removes the use of disk_devt to determine devidx
from md-&gt;disk. md-&gt;disk-&gt;first_minor is always initialized
from devidx and can always be used to recover it.

Cc: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Cc: Chuanxiao Dong &lt;chuanxiao.dong@intel.com&gt;
Cc: Shawn Lin &lt;shawn.lin@rock-chips.com&gt;
Cc: Austin S Hemmelgarn &lt;ahferroin7@gmail.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Android Kernel Team &lt;kernel-team@android.com&gt;
Cc: linux-mmc@vger.kernel.org
Signed-off-by: Colin Cross &lt;ccross@android.com&gt;
[jstultz: Added context to commit message]
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: core: fix using wrong io voltage if mmc_select_hs200 fails</title>
<updated>2020-01-11T02:04:44+00:00</updated>
<author>
<name>Dong Aisheng</name>
<email>aisheng.dong@nxp.com</email>
</author>
<published>2016-04-20T16:51:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=014ecb13adc7d76e9900641fd9abb8f32edf5ee6'/>
<id>014ecb13adc7d76e9900641fd9abb8f32edf5ee6</id>
<content type='text'>
commit e51534c806609c806d81bfb034f02737461f855c upstream.

Currently MMC core will keep going if HS200/HS timing switch failed
with -EBADMSG error by the assumption that the old timing is still valid.

However, for mmc_select_hs200 case, the signal voltage may have already
been switched. If the timing switch failed, we should fall back to
the old voltage in case the card is continue run with legacy timing.

If fall back signal voltage failed, we explicitly report an EIO error
to force retry during the next power cycle.

Signed-off-by: Dong Aisheng &lt;aisheng.dong@nxp.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
[bwh: Backported to 3.16:
 - Delete now-unused err label
 - Adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit e51534c806609c806d81bfb034f02737461f855c upstream.

Currently MMC core will keep going if HS200/HS timing switch failed
with -EBADMSG error by the assumption that the old timing is still valid.

However, for mmc_select_hs200 case, the signal voltage may have already
been switched. If the timing switch failed, we should fall back to
the old voltage in case the card is continue run with legacy timing.

If fall back signal voltage failed, we explicitly report an EIO error
to force retry during the next power cycle.

Signed-off-by: Dong Aisheng &lt;aisheng.dong@nxp.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
[bwh: Backported to 3.16:
 - Delete now-unused err label
 - Adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: core: shut up "voltage-ranges unspecified" pr_info()</title>
<updated>2020-01-11T02:04:43+00:00</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2016-01-29T09:43:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6b6329ef1b07fd3cd2b17da5bdcd9c1804ba122c'/>
<id>6b6329ef1b07fd3cd2b17da5bdcd9c1804ba122c</id>
<content type='text'>
commit 10a16a01d8f72e80f4780e40cf3122f4caffa411 upstream.

Each time a driver such as sdhci-esdhc-imx is probed, we get a info
printk complaining that the DT voltage-ranges property has not been
specified.

However, the DT binding specifically says that the voltage-ranges
property is optional.  That means we should not be complaining that
DT hasn't specified this property: by indicating that it's optional,
it is valid not to have the property in DT.

Silence the warning if the property is missing.

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 10a16a01d8f72e80f4780e40cf3122f4caffa411 upstream.

Each time a driver such as sdhci-esdhc-imx is probed, we get a info
printk complaining that the DT voltage-ranges property has not been
specified.

However, the DT binding specifically says that the voltage-ranges
property is optional.  That means we should not be complaining that
DT hasn't specified this property: by indicating that it's optional,
it is valid not to have the property in DT.

Silence the warning if the property is missing.

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sanitize 'bus width' in debug output</title>
<updated>2020-01-11T02:04:43+00:00</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa+renesas@sang-engineering.com</email>
</author>
<published>2016-01-29T08:27:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f111fe04cd2a2e1ea4ae0a52827934fba17938f3'/>
<id>f111fe04cd2a2e1ea4ae0a52827934fba17938f3</id>
<content type='text'>
commit ed9feec72fc1fa194ebfdb79e14561b35decce63 upstream.

The bus width is sometimes the actual bus width, and sometimes indices
to different arrays encoding the bus width. In my debugging case "2"
could mean 8-bit as well as 4-bit, which was extremly confusing. Let's
use the human-readable actual bus width in all places.

Signed-off-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit ed9feec72fc1fa194ebfdb79e14561b35decce63 upstream.

The bus width is sometimes the actual bus width, and sometimes indices
to different arrays encoding the bus width. In my debugging case "2"
could mean 8-bit as well as 4-bit, which was extremly confusing. Let's
use the human-readable actual bus width in all places.

Signed-off-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: debugfs: Add a restriction to mmc debugfs clock setting</title>
<updated>2020-01-11T02:04:42+00:00</updated>
<author>
<name>Chuanxiao Dong</name>
<email>chuanxiao.dong@intel.com</email>
</author>
<published>2016-01-21T12:57:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ebf3e68bd0f24e2d3380084cba7cf63b44b2e575'/>
<id>ebf3e68bd0f24e2d3380084cba7cf63b44b2e575</id>
<content type='text'>
commit e5905ff1281f0a0f5c9863c430ac1ed5faaf5707 upstream.

Clock frequency values written to an mmc host should not be less than
the minimum clock frequency which the mmc host supports.

Signed-off-by: Yuan Juntao &lt;juntaox.yuan@intel.com&gt;
Signed-off-by: Pawel Wodkowski &lt;pawelx.wodkowski@intel.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit e5905ff1281f0a0f5c9863c430ac1ed5faaf5707 upstream.

Clock frequency values written to an mmc host should not be less than
the minimum clock frequency which the mmc host supports.

Signed-off-by: Yuan Juntao &lt;juntaox.yuan@intel.com&gt;
Signed-off-by: Pawel Wodkowski &lt;pawelx.wodkowski@intel.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
</feed>
