All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Anssi Hannula <anssi.hannula@bitwise.fi>,
	Ulf Hansson <ulf.hansson@linaro.org>
Subject: [PATCH 4.9 05/22] mmc: core: fix multi-bit bus width without high-speed mode
Date: Tue, 21 Feb 2017 14:03:19 +0100	[thread overview]
Message-ID: <20170221130219.117797203@linuxfoundation.org> (raw)
In-Reply-To: <20170221130218.888428471@linuxfoundation.org>

4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Anssi Hannula <anssi.hannula@bitwise.fi>

commit 3d4ef329757cfd5e0b23cce97cdeca7e2df89c99 upstream.

Commit 577fb13199b1 ("mmc: rework selection of bus speed mode")
refactored bus width selection code to mmc_select_bus_width().

However, it also altered the behavior to not call the selection code in
non-high-speed modes anymore.

This causes 1-bit mode to always be used when the high-speed mode is not
enabled, even though 4-bit and 8-bit bus are valid bus widths in the
backwards-compatibility (legacy) mode as well (see e.g. 5.3.2 Bus Speed
Modes in JEDEC 84-B50). This results in a significant regression in
transfer speeds.

Fix the code to allow 4-bit and 8-bit widths even without high-speed
mode, as before.

Tested with a Zynq-7000 PicoZed 7020 board.

Fixes: 577fb13199b1 ("mmc: rework selection of bus speed mode")
Signed-off-by: Anssi Hannula <anssi.hannula@bitwise.fi>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mmc/core/mmc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1690,10 +1690,10 @@ static int mmc_init_card(struct mmc_host
 		err = mmc_select_hs400(card);
 		if (err)
 			goto free_card;
-	} else if (mmc_card_hs(card)) {
+	} else {
 		/* Select the desired bus width optionally */
 		err = mmc_select_bus_width(card);
-		if (err > 0) {
+		if (err > 0 && mmc_card_hs(card)) {
 			err = mmc_select_hs_ddr(card);
 			if (err)
 				goto free_card;

  parent reply	other threads:[~2017-02-21 13:04 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21 13:03 [PATCH 4.9 00/22] 4.9.12-stable review Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 01/22] vfs: fix uninitialized flags in splice_to_pipe() Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 02/22] [media] siano: make it work again with CONFIG_VMAP_STACK Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 03/22] fuse: fix use after free issue in fuse_dev_do_read() Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 04/22] fuse: fix uninitialized flags in pipe_buffer Greg Kroah-Hartman
2017-02-21 13:03 ` Greg Kroah-Hartman [this message]
2017-02-21 13:03 ` [PATCH 4.9 06/22] powerpc/64: Disable use of radix under a hypervisor Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 07/22] scsi: dont BUG_ON() empty DMA transfers Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 08/22] Fix missing sanity check in /dev/sg Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 09/22] Input: elan_i2c - add ELAN0605 to the ACPI table Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 11/22] drm/dp/mst: fix kernel oops when turning off secondary monitor Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 12/22] futex: Move futex_init() to core_initcall Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 13/22] ARM: 8658/1: uaccess: fix zeroing of 64-bit get_user() Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 14/22] Revert "i2c: designware: detect when dynamic tar update is possible" Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 15/22] PCI/PME: Restore pcie_pme_driver.remove Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 16/22] printk: use rcuidle console tracepoint Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 17/22] timekeeping: Use deferred printk() in debug code Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 18/22] NTB: ntb_transport: fix debugfs_remove_recursive Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 19/22] ntb: ntb_perf missing dmaengine_unmap_put Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 20/22] ntb_transport: Pick an unused queue Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 21/22] bcache: Make gc wakeup sane, remove set_task_state() Greg Kroah-Hartman
2017-02-21 13:03 ` [PATCH 4.9 22/22] [media] videodev2.h: go back to limited range YCbCr for SRGB and, ADOBERGB Greg Kroah-Hartman
2017-02-21 16:16 ` [PATCH 4.9 00/22] 4.9.12-stable review Guenter Roeck
2017-02-23 16:53   ` Greg Kroah-Hartman
2017-02-21 23:40 ` Shuah Khan
2017-02-23 16:53   ` Greg Kroah-Hartman
     [not found] ` <58ac905b.0d212e0a.6fb29.ac9c@mx.google.com>
2017-02-23 16:53   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170221130219.117797203@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=anssi.hannula@bitwise.fi \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.