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]
Date:	Fri, 29 Apr 2016 10:32:18 -0700
From:	Douglas Anderson <dianders@...omium.org>
To:	ulf.hansson@...aro.org, jh80.chung@...sung.com
Cc:	shawn.lin@...k-chips.com, adrian.hunter@...el.com, stefan@...er.ch,
	linux-mmc@...r.kernel.org, computersforpeace@...il.com,
	dmitry.torokhov@...il.com, Heiko Stuebner <heiko@...ech.de>,
	jszhang@...vell.com, linux-rockchip@...ts.infradead.org,
	devicetree-spec@...r.kernel.org,
	Douglas Anderson <dianders@...omium.org>, jonathanh@...dia.com,
	grundler@...omium.org, lporzio@...ron.com,
	linux-kernel@...r.kernel.org
Subject: [PATCH v2 3/4] mmc: use SD/MMC host ID for block device name ID

From: Stefan Agner <stefan@...er.ch>

By using the SD/MMC host device ID as a starting point for block
device numbering, one can reliably predict the first block device
name (at least for the first controller). This is especially useful
for SoCs with multiple SD/MMC host controller, where the controller
with index 0 is connected to a eMMC device.

Usually the first controller gets the first block device name ID,
however this is not guaranteed. Also if the first controller is
aliased as second controller and visa-versa (using device tree
aliases), the block device name ID assignation is not ordered by
the SD/MMC host device ID (since mmc_rescan is called in order of
the memory mapped pheripherial addresses).

Signed-off-by: Stefan Agner <stefan@...er.ch>
Signed-off-by: Douglas Anderson <dianders@...omium.org>
---
Changes in v2:
- Rebased atop mmc-next

 drivers/mmc/card/block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 9ce679255775..360700f3e0ea 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -2197,7 +2197,7 @@ again:
 		return ERR_PTR(-ENOMEM);
 
 	spin_lock(&mmc_blk_lock);
-	ret = ida_get_new(&mmc_blk_ida, &devidx);
+	ret = ida_get_new_above(&mmc_blk_ida, card->host->index, &devidx);
 	spin_unlock(&mmc_blk_lock);
 
 	if (ret == -EAGAIN)
-- 
2.8.0.rc3.226.g39d4020

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ