From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756338AbcDGMH6 (ORCPT ); Thu, 7 Apr 2016 08:07:58 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:38472 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756223AbcDGMHx (ORCPT ); Thu, 7 Apr 2016 08:07:53 -0400 X-AuditID: cbfee68e-f79d96d0000012b1-1f-57064d96aecc Message-id: <57064D96.1050402@samsung.com> Date: Thu, 07 Apr 2016 21:07:50 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-version: 1.0 To: Ulf Hansson , linux-mmc@vger.kernel.org Cc: Adrian Hunter , Jisheng Zhang , Peter Hurley , Laszlo Fiat , linux-kernel@vger.kernel.org, Linus Torvalds , stable@vger.kernel.org Subject: Re: [PATCH] mmc: block: Use the mmc host device index as the mmcblk device index References: <1460015861-14004-1-git-send-email-ulf.hansson@linaro.org> In-reply-to: <1460015861-14004-1-git-send-email-ulf.hansson@linaro.org> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrEIsWRmVeSWpSXmKPExsWyRsSkSHeaL1u4wd9F6hYnn6xhs3h3fDeL xZu2djaLy7vmsFkc+d/PaHHs0j9GiwUbHzFaPOp7y25xfG24A6fHzll32T1W/FnP5rF4z0sm jzvX9rB5nJjxm8Vj8sKLzB6fN8kFsEdx2aSk5mSWpRbp2yVwZZz8d4+tYJ5SRdvrV8wNjNel uxg5OSQETCQuL/zBBGGLSVy4t56ti5GLQ0hgBaPExDuHWboYOcCKZhzigogvZZQ40fOZFcJ5 wCjxYtFidpBuXgEtieMTtoBNYhFQlZi/q4sFxGYT0JHY/u04WFxUIEziwbq9rBD1ghI/Jt8D qxERcJZo2rmeHWQos0AXk8Tfae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RexSiRWpBcUJyUnmuYl1qu V5yYW1yal66XnJ+7iREc+8+kdjAe3OV+iFGAg1GJh9eikzVciDWxrLgy9xCjBAezkghviwdb uBBvSmJlVWpRfnxRaU5q8SFGU2AITGSWEk3OB6alvJJ4Q2MTMyNLI3NDCyNjcyVx3sf/14UJ CaQnlqRmp6YWpBbB9DFxcEo1MMrbbJl2Xq+2uD6ep57hHesbP31j3pXV93fab6k3/9zgyZp0 f/ktncf5u61sz/QrT3aY/nCy0P1TqUuEq2rnNJpJJFqn7hY3iroR2PhhYZgl44stybFsP7Y2 2K5YUFI9SUjkj3iB+hYvpha/hazeeQuvzf66T6FWOqxu+c6DeYqliq9T2CS+K7EUZyQaajEX FScCADoYt0cTAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/07/2016 04:57 PM, Ulf Hansson wrote: > Commit 520bd7a8b415 ("mmc: core: Optimize boot time by detecting cards > simultaneously") causes regressions for some platforms. > > These platforms relies on fixed mmcblk device indexes, instead of > deploying the defacto standard with UUID/PARTUUID. In other words their > rootfs needs to be available at hardcoded paths, like /dev/mmcblk0p2. > > Such guarantees have never been made by the kernel, but clearly the above > commit changes the behaviour. More precisely, because of that the order > changes of how cards becomes detected, so do their corresponding mmcblk > device indexes. > > As the above commit significantly improves boot time for some platforms > (magnitude of seconds), let's avoid reverting this change but instead > restore the behaviour of how mmcblk device indexes becomes picked. > > By using the same index for the mmcblk device as for the corresponding mmc > host device, the probe order of mmc host devices decides the index we get > for the mmcblk device. > > For those platforms that suffers from a regression, one could expect that > this updated behaviour should be sufficient to meet their expectations of > "fixed" mmcblk device indexes. > > Another side effect from this change, is that the same index is used for > the mmc host device, the mmcblk device and the mmc block queue. That > should clarify their relationship. I have tested with this patch..but there also are side-effects. Exynos4 series has the two host controller..one is sdhci, one is dwmmc for eMMC. In this case, dwmmc controller is probed after sdhci controller. Then eMMC is always assigned to mmcblk1. I think it's not good that make another problem for solving something. It needs more discussion for this.. Best Regards, Jaehoon Chung > > Reported-by: Peter Hurley > Reported-by: Laszlo Fiat > Cc: Linus Torvalds > Fixes: 520bd7a8b415 ("mmc: core: Optimize boot time by detecting cards > simultaneously") > Cc: > Signed-off-by: Ulf Hansson > --- > drivers/mmc/card/block.c | 18 +----------------- > 1 file changed, 1 insertion(+), 17 deletions(-) > > diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c > index 3bdbe50..8a0147d 100644 > --- a/drivers/mmc/card/block.c > +++ b/drivers/mmc/card/block.c > @@ -86,7 +86,6 @@ static int max_devices; > > /* TODO: Replace these with struct ida */ > static DECLARE_BITMAP(dev_use, MAX_DEVICES); > -static DECLARE_BITMAP(name_use, MAX_DEVICES); > > /* > * There is one mmc_blk_data per slot. > @@ -105,7 +104,6 @@ struct mmc_blk_data { > unsigned int usage; > unsigned int read_only; > unsigned int part_type; > - unsigned int name_idx; > unsigned int reset_done; > #define MMC_BLK_READ BIT(0) > #define MMC_BLK_WRITE BIT(1) > @@ -2202,19 +2200,6 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, > goto out; > } > > - /* > - * !subname implies we are creating main mmc_blk_data that will be > - * associated with mmc_card with dev_set_drvdata. Due to device > - * partitions, devidx will not coincide with a per-physical card > - * index anymore so we keep track of a name index. > - */ > - if (!subname) { > - md->name_idx = find_first_zero_bit(name_use, max_devices); > - __set_bit(md->name_idx, name_use); > - } else > - md->name_idx = ((struct mmc_blk_data *) > - dev_to_disk(parent)->private_data)->name_idx; > - > md->area_type = area_type; > > /* > @@ -2264,7 +2249,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, > */ > > snprintf(md->disk->disk_name, sizeof(md->disk->disk_name), > - "mmcblk%u%s", md->name_idx, subname ? subname : ""); > + "mmcblk%u%s", card->host->index, subname ? subname : ""); > > if (mmc_card_mmc(card)) > blk_queue_logical_block_size(md->queue.queue, > @@ -2418,7 +2403,6 @@ static void mmc_blk_remove_parts(struct mmc_card *card, > struct list_head *pos, *q; > struct mmc_blk_data *part_md; > > - __clear_bit(md->name_idx, name_use); > list_for_each_safe(pos, q, &md->part) { > part_md = list_entry(pos, struct mmc_blk_data, part); > list_del(pos); >