lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190322154425.3852517-8-arnd@arndb.de>
Date:   Fri, 22 Mar 2019 16:43:58 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     stable@...r.kernel.org, Ulf Hansson <ulf.hansson@...aro.org>,
        Avri Altman <avri.altman@....com>,
        Shawn Lin <shawn.lin@...k-chips.com>,
        Martin Hicks <mort@...k.org>,
        Niklas Söderlund 
        <niklas.soderlund+renesas@...natech.se>,
        Wolfram Sang <wsa+renesas@...g-engineering.com>,
        Ritesh Harjani <riteshh@...eaurora.org>,
        Simon Horman <horms+renesas@...ge.net.au>,
        hongjiefang <hongjiefang@...micro.com>,
        Yinbo Zhu <yinbo.zhu@....com>,
        Kyle Roeschley <kyle.roeschley@...com>
Cc:     Arnd Bergmann <arnd@...db.de>, Jiong Wu <lohengrin1024@...il.com>,
        linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [BACKPORT 4.4.y 07/25] mmc: sanitize 'bus width' in debug output

From: Wolfram Sang <wsa+renesas@...g-engineering.com>

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 <wsa+renesas@...g-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@...aro.org>
(cherry picked from commit ed9feec72fc1fa194ebfdb79e14561b35decce63)
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 drivers/mmc/core/core.c | 2 +-
 drivers/mmc/core/mmc.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 299a83f1ad38..e2e927d1f7e4 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1039,7 +1039,7 @@ static inline void mmc_set_ios(struct mmc_host *host)
 		"width %u timing %u\n",
 		 mmc_hostname(host), ios->clock, ios->bus_mode,
 		 ios->power_mode, ios->chip_select, ios->vdd,
-		 ios->bus_width, ios->timing);
+		 1 << ios->bus_width, ios->timing);
 
 	host->ops->set_ios(host, ios);
 }
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index adc3291e9d6a..7286d0d324e1 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -952,7 +952,7 @@ static int mmc_select_bus_width(struct mmc_card *card)
 			break;
 		} else {
 			pr_warn("%s: switch to bus width %d failed\n",
-				mmc_hostname(host), ext_csd_bits[idx]);
+				mmc_hostname(host), 1 << bus_width);
 		}
 	}
 
-- 
2.20.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ