All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] mmc: block: Support the fixed index for mmcblk with aliases nodes
@ 2016-03-29 10:43 Jaehoon Chung
  2016-03-29 10:49 ` Jisheng Zhang
  0 siblings, 1 reply; 10+ messages in thread
From: Jaehoon Chung @ 2016-03-29 10:43 UTC (permalink / raw)
  To: linux-mmc; +Cc: Ulf Hansson, Shawn Lin, Adrian Hunter

This patch is just RFC. I want to know opinions.

Now, index of mmcblk is allocated in accordance with probing time.
If want to use the mmcblk1 for some device, it can use alias.

aliases {
	mmc0 = &mmc0;	/* mmcblk0 for eMMC */
	mmc1 = &mmc2;	/* mmcblk1 for SD */
	mmc2 = &mmc1;	/* mmcblk2 for SDIO*/
};

If there are no corresponding values, it might be allocated with
existing scheme.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
 Documentation/devicetree/bindings/mmc/mmc.txt | 11 +++++++++++
 drivers/mmc/card/block.c                      | 17 ++++++++++++++++-
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt
index ed23b9b..e37ea29 100644
--- a/Documentation/devicetree/bindings/mmc/mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/mmc.txt
@@ -71,6 +71,10 @@ Optional SDIO properties:
 - wakeup-source: Enables wake up of host system on SDIO IRQ assertion
 		 (Legacy property supported: "enable-sdio-wakeup")
 
+Aliases (Optional):
+- If you want to use the fixed index for block device like mmcblkX, should be
+represented in the aliases node using following format "mmc(X)".
+(X is an unique number for the alias.)
 
 MMC power sequences:
 --------------------
@@ -145,3 +149,10 @@ mmc3: mmc@01c12000 {
 		interrupt-names = "host-wake";
 	};
 };
+
+Example with aliases nodes:
+
+aliases {
+	mmc0 = &mmc0;	/* Fixed to mmcblk0 for &mmc0 */
+	mmc1 = &mmc2;	/* Fixed to mmcblk1 for &mmc2 */
+};
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 3bdbe50..6a40de5 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -35,6 +35,7 @@
 #include <linux/capability.h>
 #include <linux/compat.h>
 #include <linux/pm_runtime.h>
+#include <linux/of.h>
 
 #include <linux/mmc/ioctl.h>
 #include <linux/mmc/card.h>
@@ -2190,6 +2191,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
 {
 	struct mmc_blk_data *md;
 	int devidx, ret;
+	int idx = 0;
 
 	devidx = find_first_zero_bit(dev_use, max_devices);
 	if (devidx >= max_devices)
@@ -2209,7 +2211,20 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
 	 * index anymore so we keep track of a name index.
 	 */
 	if (!subname) {
-		md->name_idx = find_first_zero_bit(name_use, max_devices);
+		if (card->dev.parent->parent->of_node)
+			idx = of_alias_get_id(card->dev.parent->parent->of_node,
+					"mmc");
+
+		if (idx < 0)
+			md->name_idx = find_first_zero_bit(name_use,
+					max_devices);
+		else {
+			if (test_bit(idx, name_use))
+				md->name_idx = find_first_zero_bit(name_use,
+						max_devices);
+			else
+				md->name_idx = (unsigned int)idx;
+		}
 		__set_bit(md->name_idx, name_use);
 	} else
 		md->name_idx = ((struct mmc_blk_data *)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [RFC PATCH] mmc: block: Support the fixed index for mmcblk with aliases nodes
  2016-03-29 10:43 [RFC PATCH] mmc: block: Support the fixed index for mmcblk with aliases nodes Jaehoon Chung
@ 2016-03-29 10:49 ` Jisheng Zhang
  2016-03-30  0:15   ` Shawn Lin
  0 siblings, 1 reply; 10+ messages in thread
From: Jisheng Zhang @ 2016-03-29 10:49 UTC (permalink / raw)
  To: Jaehoon Chung, Ulf Hansson; +Cc: linux-mmc, Shawn Lin, Adrian Hunter

Hi Jaehoon,

On Tue, 29 Mar 2016 19:43:34 +0900 Jaehoon Chung wrote:

> This patch is just RFC. I want to know opinions.
> 
> Now, index of mmcblk is allocated in accordance with probing time.
> If want to use the mmcblk1 for some device, it can use alias.
> 
> aliases {
> 	mmc0 = &mmc0;	/* mmcblk0 for eMMC */
> 	mmc1 = &mmc2;	/* mmcblk1 for SD */
> 	mmc2 = &mmc1;	/* mmcblk2 for SDIO*/
> };

I like this feature and we do need it. In the past, we have to put emmc dt node
before the sd node, but on our platform, the register base of sdhc host for emmc
is higher than the one for sd, putting emmc dt node before sd looks a bit
strange, but we have no better solutions.

Thanks,
Jisheng

> 
> If there are no corresponding values, it might be allocated with
> existing scheme.
> 
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> ---
>  Documentation/devicetree/bindings/mmc/mmc.txt | 11 +++++++++++
>  drivers/mmc/card/block.c                      | 17 ++++++++++++++++-
>  2 files changed, 27 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt
> index ed23b9b..e37ea29 100644
> --- a/Documentation/devicetree/bindings/mmc/mmc.txt
> +++ b/Documentation/devicetree/bindings/mmc/mmc.txt
> @@ -71,6 +71,10 @@ Optional SDIO properties:
>  - wakeup-source: Enables wake up of host system on SDIO IRQ assertion
>  		 (Legacy property supported: "enable-sdio-wakeup")
>  
> +Aliases (Optional):
> +- If you want to use the fixed index for block device like mmcblkX, should be
> +represented in the aliases node using following format "mmc(X)".
> +(X is an unique number for the alias.)
>  
>  MMC power sequences:
>  --------------------
> @@ -145,3 +149,10 @@ mmc3: mmc@01c12000 {
>  		interrupt-names = "host-wake";
>  	};
>  };
> +
> +Example with aliases nodes:
> +
> +aliases {
> +	mmc0 = &mmc0;	/* Fixed to mmcblk0 for &mmc0 */
> +	mmc1 = &mmc2;	/* Fixed to mmcblk1 for &mmc2 */
> +};
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index 3bdbe50..6a40de5 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -35,6 +35,7 @@
>  #include <linux/capability.h>
>  #include <linux/compat.h>
>  #include <linux/pm_runtime.h>
> +#include <linux/of.h>
>  
>  #include <linux/mmc/ioctl.h>
>  #include <linux/mmc/card.h>
> @@ -2190,6 +2191,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
>  {
>  	struct mmc_blk_data *md;
>  	int devidx, ret;
> +	int idx = 0;
>  
>  	devidx = find_first_zero_bit(dev_use, max_devices);
>  	if (devidx >= max_devices)
> @@ -2209,7 +2211,20 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
>  	 * index anymore so we keep track of a name index.
>  	 */
>  	if (!subname) {
> -		md->name_idx = find_first_zero_bit(name_use, max_devices);
> +		if (card->dev.parent->parent->of_node)
> +			idx = of_alias_get_id(card->dev.parent->parent->of_node,
> +					"mmc");
> +
> +		if (idx < 0)
> +			md->name_idx = find_first_zero_bit(name_use,
> +					max_devices);
> +		else {
> +			if (test_bit(idx, name_use))
> +				md->name_idx = find_first_zero_bit(name_use,
> +						max_devices);
> +			else
> +				md->name_idx = (unsigned int)idx;
> +		}
>  		__set_bit(md->name_idx, name_use);
>  	} else
>  		md->name_idx = ((struct mmc_blk_data *)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC PATCH] mmc: block: Support the fixed index for mmcblk with aliases nodes
  2016-03-29 10:49 ` Jisheng Zhang
@ 2016-03-30  0:15   ` Shawn Lin
  2016-04-04  2:08     ` Jaehoon Chung
  0 siblings, 1 reply; 10+ messages in thread
From: Shawn Lin @ 2016-03-30  0:15 UTC (permalink / raw)
  To: Jisheng Zhang, Jaehoon Chung, Ulf Hansson
  Cc: shawn.lin, linux-mmc, Adrian Hunter

在 2016/3/29 18:49, Jisheng Zhang 写道:
> Hi Jaehoon,
>
> On Tue, 29 Mar 2016 19:43:34 +0900 Jaehoon Chung wrote:
>
>> This patch is just RFC. I want to know opinions.
>>
>> Now, index of mmcblk is allocated in accordance with probing time.
>> If want to use the mmcblk1 for some device, it can use alias.
>>
>> aliases {
>> 	mmc0 = &mmc0;	/* mmcblk0 for eMMC */
>> 	mmc1 = &mmc2;	/* mmcblk1 for SD */
>> 	mmc2 = &mmc1;	/* mmcblk2 for SDIO*/
>> };
>
> I like this feature and we do need it. In the past, we have to put emmc dt node
> before the sd node, but on our platform, the register base of sdhc host for emmc
> is higher than the one for sd, putting emmc dt node before sd looks a bit
> strange, but we have no better solutions.
>

:) That is also what I suffered currently. I have to prepare two
seperate firmware with two diff fstab files to assign the mount point
since sometime I need to boot from sd, but sometimes from emmc....
With this patch, I only need to dtc a new dtb... quite simple.

> Thanks,
> Jisheng
>
>>
>> If there are no corresponding values, it might be allocated with
>> existing scheme.
>>
>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>> ---
>>   Documentation/devicetree/bindings/mmc/mmc.txt | 11 +++++++++++
>>   drivers/mmc/card/block.c                      | 17 ++++++++++++++++-
>>   2 files changed, 27 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt
>> index ed23b9b..e37ea29 100644
>> --- a/Documentation/devicetree/bindings/mmc/mmc.txt
>> +++ b/Documentation/devicetree/bindings/mmc/mmc.txt
>> @@ -71,6 +71,10 @@ Optional SDIO properties:
>>   - wakeup-source: Enables wake up of host system on SDIO IRQ assertion
>>   		 (Legacy property supported: "enable-sdio-wakeup")
>>
>> +Aliases (Optional):
>> +- If you want to use the fixed index for block device like mmcblkX, should be
>> +represented in the aliases node using following format "mmc(X)".
>> +(X is an unique number for the alias.)
>>
>>   MMC power sequences:
>>   --------------------
>> @@ -145,3 +149,10 @@ mmc3: mmc@01c12000 {
>>   		interrupt-names = "host-wake";
>>   	};
>>   };
>> +
>> +Example with aliases nodes:
>> +
>> +aliases {
>> +	mmc0 = &mmc0;	/* Fixed to mmcblk0 for &mmc0 */
>> +	mmc1 = &mmc2;	/* Fixed to mmcblk1 for &mmc2 */
>> +};
>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>> index 3bdbe50..6a40de5 100644
>> --- a/drivers/mmc/card/block.c
>> +++ b/drivers/mmc/card/block.c
>> @@ -35,6 +35,7 @@
>>   #include <linux/capability.h>
>>   #include <linux/compat.h>
>>   #include <linux/pm_runtime.h>
>> +#include <linux/of.h>
>>
>>   #include <linux/mmc/ioctl.h>
>>   #include <linux/mmc/card.h>
>> @@ -2190,6 +2191,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
>>   {
>>   	struct mmc_blk_data *md;
>>   	int devidx, ret;
>> +	int idx = 0;
>>
>>   	devidx = find_first_zero_bit(dev_use, max_devices);
>>   	if (devidx >= max_devices)
>> @@ -2209,7 +2211,20 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
>>   	 * index anymore so we keep track of a name index.
>>   	 */
>>   	if (!subname) {
>> -		md->name_idx = find_first_zero_bit(name_use, max_devices);
>> +		if (card->dev.parent->parent->of_node)
>> +			idx = of_alias_get_id(card->dev.parent->parent->of_node,
>> +					"mmc");
>> +
>> +		if (idx < 0)
>> +			md->name_idx = find_first_zero_bit(name_use,
>> +					max_devices);
>> +		else {
>> +			if (test_bit(idx, name_use))
>> +				md->name_idx = find_first_zero_bit(name_use,
>> +						max_devices);
>> +			else
>> +				md->name_idx = (unsigned int)idx;
>> +		}
>>   		__set_bit(md->name_idx, name_use);
>>   	} else
>>   		md->name_idx = ((struct mmc_blk_data *)
>
>
>
>


-- 
Best Regards
Shawn Lin


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC PATCH] mmc: block: Support the fixed index for mmcblk with aliases nodes
  2016-03-30  0:15   ` Shawn Lin
@ 2016-04-04  2:08     ` Jaehoon Chung
  2016-04-04 12:14       ` Ulf Hansson
  0 siblings, 1 reply; 10+ messages in thread
From: Jaehoon Chung @ 2016-04-04  2:08 UTC (permalink / raw)
  To: Shawn Lin, Jisheng Zhang, Ulf Hansson; +Cc: linux-mmc, Adrian Hunter

Hi All,

Are there any other opinion for this RFC patch?

Best Regards,
Jaehoon Chung

On 03/30/2016 09:15 AM, Shawn Lin wrote:
> 在 2016/3/29 18:49, Jisheng Zhang 写道:
>> Hi Jaehoon,
>>
>> On Tue, 29 Mar 2016 19:43:34 +0900 Jaehoon Chung wrote:
>>
>>> This patch is just RFC. I want to know opinions.
>>>
>>> Now, index of mmcblk is allocated in accordance with probing time.
>>> If want to use the mmcblk1 for some device, it can use alias.
>>>
>>> aliases {
>>>     mmc0 = &mmc0;    /* mmcblk0 for eMMC */
>>>     mmc1 = &mmc2;    /* mmcblk1 for SD */
>>>     mmc2 = &mmc1;    /* mmcblk2 for SDIO*/
>>> };
>>
>> I like this feature and we do need it. In the past, we have to put emmc dt node
>> before the sd node, but on our platform, the register base of sdhc host for emmc
>> is higher than the one for sd, putting emmc dt node before sd looks a bit
>> strange, but we have no better solutions.
>>
> 
> :) That is also what I suffered currently. I have to prepare two
> seperate firmware with two diff fstab files to assign the mount point
> since sometime I need to boot from sd, but sometimes from emmc....
> With this patch, I only need to dtc a new dtb... quite simple.
> 
>> Thanks,
>> Jisheng
>>
>>>
>>> If there are no corresponding values, it might be allocated with
>>> existing scheme.
>>>
>>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>>> ---
>>>   Documentation/devicetree/bindings/mmc/mmc.txt | 11 +++++++++++
>>>   drivers/mmc/card/block.c                      | 17 ++++++++++++++++-
>>>   2 files changed, 27 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt
>>> index ed23b9b..e37ea29 100644
>>> --- a/Documentation/devicetree/bindings/mmc/mmc.txt
>>> +++ b/Documentation/devicetree/bindings/mmc/mmc.txt
>>> @@ -71,6 +71,10 @@ Optional SDIO properties:
>>>   - wakeup-source: Enables wake up of host system on SDIO IRQ assertion
>>>            (Legacy property supported: "enable-sdio-wakeup")
>>>
>>> +Aliases (Optional):
>>> +- If you want to use the fixed index for block device like mmcblkX, should be
>>> +represented in the aliases node using following format "mmc(X)".
>>> +(X is an unique number for the alias.)
>>>
>>>   MMC power sequences:
>>>   --------------------
>>> @@ -145,3 +149,10 @@ mmc3: mmc@01c12000 {
>>>           interrupt-names = "host-wake";
>>>       };
>>>   };
>>> +
>>> +Example with aliases nodes:
>>> +
>>> +aliases {
>>> +    mmc0 = &mmc0;    /* Fixed to mmcblk0 for &mmc0 */
>>> +    mmc1 = &mmc2;    /* Fixed to mmcblk1 for &mmc2 */
>>> +};
>>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>>> index 3bdbe50..6a40de5 100644
>>> --- a/drivers/mmc/card/block.c
>>> +++ b/drivers/mmc/card/block.c
>>> @@ -35,6 +35,7 @@
>>>   #include <linux/capability.h>
>>>   #include <linux/compat.h>
>>>   #include <linux/pm_runtime.h>
>>> +#include <linux/of.h>
>>>
>>>   #include <linux/mmc/ioctl.h>
>>>   #include <linux/mmc/card.h>
>>> @@ -2190,6 +2191,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
>>>   {
>>>       struct mmc_blk_data *md;
>>>       int devidx, ret;
>>> +    int idx = 0;
>>>
>>>       devidx = find_first_zero_bit(dev_use, max_devices);
>>>       if (devidx >= max_devices)
>>> @@ -2209,7 +2211,20 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
>>>        * index anymore so we keep track of a name index.
>>>        */
>>>       if (!subname) {
>>> -        md->name_idx = find_first_zero_bit(name_use, max_devices);
>>> +        if (card->dev.parent->parent->of_node)
>>> +            idx = of_alias_get_id(card->dev.parent->parent->of_node,
>>> +                    "mmc");
>>> +
>>> +        if (idx < 0)
>>> +            md->name_idx = find_first_zero_bit(name_use,
>>> +                    max_devices);
>>> +        else {
>>> +            if (test_bit(idx, name_use))
>>> +                md->name_idx = find_first_zero_bit(name_use,
>>> +                        max_devices);
>>> +            else
>>> +                md->name_idx = (unsigned int)idx;
>>> +        }
>>>           __set_bit(md->name_idx, name_use);
>>>       } else
>>>           md->name_idx = ((struct mmc_blk_data *)
>>
>>
>>
>>
> 
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC PATCH] mmc: block: Support the fixed index for mmcblk with aliases nodes
  2016-04-04  2:08     ` Jaehoon Chung
@ 2016-04-04 12:14       ` Ulf Hansson
  2016-04-06  2:00         ` Jaehoon Chung
  0 siblings, 1 reply; 10+ messages in thread
From: Ulf Hansson @ 2016-04-04 12:14 UTC (permalink / raw)
  To: Jaehoon Chung, Shawn Lin, Jisheng Zhang; +Cc: linux-mmc, Adrian Hunter

On 4 April 2016 at 04:08, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> Hi All,
>
> Are there any other opinion for this RFC patch?
>
> Best Regards,
> Jaehoon Chung
>
> On 03/30/2016 09:15 AM, Shawn Lin wrote:
>> 在 2016/3/29 18:49, Jisheng Zhang 写道:
>>> Hi Jaehoon,
>>>
>>> On Tue, 29 Mar 2016 19:43:34 +0900 Jaehoon Chung wrote:
>>>
>>>> This patch is just RFC. I want to know opinions.
>>>>
>>>> Now, index of mmcblk is allocated in accordance with probing time.
>>>> If want to use the mmcblk1 for some device, it can use alias.
>>>>
>>>> aliases {
>>>>     mmc0 = &mmc0;    /* mmcblk0 for eMMC */
>>>>     mmc1 = &mmc2;    /* mmcblk1 for SD */
>>>>     mmc2 = &mmc1;    /* mmcblk2 for SDIO*/
>>>> };
>>>
>>> I like this feature and we do need it. In the past, we have to put emmc dt node
>>> before the sd node, but on our platform, the register base of sdhc host for emmc
>>> is higher than the one for sd, putting emmc dt node before sd looks a bit
>>> strange, but we have no better solutions.
>>>
>>
>> :) That is also what I suffered currently. I have to prepare two
>> seperate firmware with two diff fstab files to assign the mount point
>> since sometime I need to boot from sd, but sometimes from emmc....
>> With this patch, I only need to dtc a new dtb... quite simple.
>>
>>> Thanks,
>>> Jisheng

I am not immediately opposed to this patch, although let me think a
bit more about it.

What I would like to understand is why UUID/PARTUUID isn't working for
your case. Did you try to use that?

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC PATCH] mmc: block: Support the fixed index for mmcblk with aliases nodes
  2016-04-04 12:14       ` Ulf Hansson
@ 2016-04-06  2:00         ` Jaehoon Chung
  2016-04-28 23:07           ` Doug Anderson
  0 siblings, 1 reply; 10+ messages in thread
From: Jaehoon Chung @ 2016-04-06  2:00 UTC (permalink / raw)
  To: Ulf Hansson, Shawn Lin, Jisheng Zhang; +Cc: linux-mmc, Adrian Hunter

On 04/04/2016 09:14 PM, Ulf Hansson wrote:
> On 4 April 2016 at 04:08, Jaehoon Chung <jh80.chung@samsung.com> wrote:
>> Hi All,
>>
>> Are there any other opinion for this RFC patch?
>>
>> Best Regards,
>> Jaehoon Chung
>>
>> On 03/30/2016 09:15 AM, Shawn Lin wrote:
>>> 在 2016/3/29 18:49, Jisheng Zhang 写道:
>>>> Hi Jaehoon,
>>>>
>>>> On Tue, 29 Mar 2016 19:43:34 +0900 Jaehoon Chung wrote:
>>>>
>>>>> This patch is just RFC. I want to know opinions.
>>>>>
>>>>> Now, index of mmcblk is allocated in accordance with probing time.
>>>>> If want to use the mmcblk1 for some device, it can use alias.
>>>>>
>>>>> aliases {
>>>>>     mmc0 = &mmc0;    /* mmcblk0 for eMMC */
>>>>>     mmc1 = &mmc2;    /* mmcblk1 for SD */
>>>>>     mmc2 = &mmc1;    /* mmcblk2 for SDIO*/
>>>>> };
>>>>
>>>> I like this feature and we do need it. In the past, we have to put emmc dt node
>>>> before the sd node, but on our platform, the register base of sdhc host for emmc
>>>> is higher than the one for sd, putting emmc dt node before sd looks a bit
>>>> strange, but we have no better solutions.
>>>>
>>>
>>> :) That is also what I suffered currently. I have to prepare two
>>> seperate firmware with two diff fstab files to assign the mount point
>>> since sometime I need to boot from sd, but sometimes from emmc....
>>> With this patch, I only need to dtc a new dtb... quite simple.
>>>
>>>> Thanks,
>>>> Jisheng
> 
> I am not immediately opposed to this patch, although let me think a
> bit more about it.
> 
> What I would like to understand is why UUID/PARTUUID isn't working for
> your case. Did you try to use that?

I have used with UUID/PARTUUID/PARTLABEL and etc.. I think it's not problem.
But that is why some guys wants to use the fixed index.
(Almost all SoCs are still using "root=mmcblk0pX" in bootloader.)

I'm considering more what is better. :)

Best Regards,
Jaehoon Chung

> 
> Kind regards
> Uffe
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC PATCH] mmc: block: Support the fixed index for mmcblk with aliases nodes
  2016-04-06  2:00         ` Jaehoon Chung
@ 2016-04-28 23:07           ` Doug Anderson
  0 siblings, 0 replies; 10+ messages in thread
From: Doug Anderson @ 2016-04-28 23:07 UTC (permalink / raw)
  To: Jaehoon Chung
  Cc: Ulf Hansson, Shawn Lin, Jisheng Zhang, linux-mmc, Adrian Hunter

Hi,

On Tue, Apr 5, 2016 at 7:00 PM, Jaehoon Chung <jh80.chung@samsung.com> wrote:
>> I am not immediately opposed to this patch, although let me think a
>> bit more about it.
>>
>> What I would like to understand is why UUID/PARTUUID isn't working for
>> your case. Did you try to use that?
>
> I have used with UUID/PARTUUID/PARTLABEL and etc.. I think it's not problem.
> But that is why some guys wants to use the fixed index.
> (Almost all SoCs are still using "root=mmcblk0pX" in bootloader.)
>
> I'm considering more what is better. :)

I like the idea of consistent numbering here.  IMHO that solves a few
different problems:

1. For poor, feeble-minded humans like me, have sane numbering for
devices helps a lot.  When grepping through dmesg it's terribly handy
if a given SDMMC device has a consistent number.  I know that I can do
"dmesg | grep mmc0" or "dmesg | grep mmcblk0" to find info about the
eMMC.  I know that I can do "dmesg | grep mmc1" to find info about the
SD card slot.  I don't want it to matter which one probed first, I
don't want it to matter if I'm working on a variant of the hardware
that has the SD card slot disabled, and I don't want to care what my
boot device was.  Worrying about what device number I got increases my
cognitive load.

2. There are cases where it's not trivially easy during development to
use the UUID.  Specifically I work a lot with coreboot / depthcharge
as a BIOS.  When configured properly, that BIOS has a nice feature to
allow you to fetch the kernel and kernel command line from TFTP by
pressing Ctrl-N.  In this particular case the BIOS doesn't actually
know which disk I'd like for my root filesystem, so it's not so easy
for it to put the right UUID into the command line.  For this purpose,
knowing that "mmcblk0" will always refer to eMMC is handy.


Note that I would personally prefer that the old patches to solve this
problem were resurrected.  Those old patches:

* Also ensure consistent numbering for "mmc", not just "mmcblk"

* Are slightly cleaner in the "mmcblk".


I've just rebased and cleaned up those patches and included the
Documentation from here.  I'll post them now.


-Doug

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC PATCH] mmc: block: Support the fixed index for mmcblk with aliases nodes
  2017-02-13  0:34   ` Jaehoon Chung
@ 2017-02-15 12:50     ` Tomas Melin
  0 siblings, 0 replies; 10+ messages in thread
From: Tomas Melin @ 2017-02-15 12:50 UTC (permalink / raw)
  To: Jaehoon Chung, Ulf Hansson; +Cc: linux-mmc, jszhang, shawn.lin, dianders, CPGS

Hi Jaehoon,

On 02/13/2017 02:34 AM, Jaehoon Chung wrote:
> Hi,
> 
> On 02/10/2017 08:35 PM, Tomas Melin wrote:
>> Hi,
>>
>> It looks as this RFC was never posted as a real patch.
>> For embedded devices with several memory devices, some being removable,
>> providing a way to define aliases for the nodes in the device tree is a benefit.
>> I have tested the patch from Jaehoon and it works nicely.
> 
> I'm not sure there is more better solution than this.
The same approach to use aliases in DT and parse them is if I understand
correctly also how serial ports are sorted in uart drivers.

> But I guess it's useful to someone..
> If someone want to use this, i will resend the patch based on latest mmc.

That would be great.

Tomas

> 
> Best Regards,
> Jaehoon Chung
> 
>>
>> Could this be reposted and considered for inclusion?
>>
>> Found the original patch here: https://patchwork.kernel.org/patch/8685711/
>>
>> Best Regards
>> Tomas
>>
>>
>> On 04/04/2016 09:14 PM, Ulf Hansson wrote:
>>> On 4 April 2016 at 04:08, Jaehoon Chung <jh80.chung@samsung.com> wrote:
>>>> Hi All,
>>>>
>>>> Are there any other opinion for this RFC patch?
>>>>
>>>> Best Regards,
>>>> Jaehoon Chung
>>>>
>>>> On 03/30/2016 09:15 AM, Shawn Lin wrote:
>>>>> 在 2016/3/29 18:49, Jisheng Zhang 写道:
>>>>>> Hi Jaehoon,
>>>>>>
>>>>>> On Tue, 29 Mar 2016 19:43:34 +0900 Jaehoon Chung wrote:
>>>>>>
>>>>>>> This patch is just RFC. I want to know opinions.
>>>>>>>
>>>>>>> Now, index of mmcblk is allocated in accordance with probing time.
>>>>>>> If want to use the mmcblk1 for some device, it can use alias.
>>>>>>>
>>>>>>> aliases {
>>>>>>>     mmc0 = &mmc0;    /* mmcblk0 for eMMC */
>>>>>>>     mmc1 = &mmc2;    /* mmcblk1 for SD */
>>>>>>>     mmc2 = &mmc1;    /* mmcblk2 for SDIO*/
>>>>>>> };
>>>>>>
>>>>>> I like this feature and we do need it. In the past, we have to put emmc dt node
>>>>>> before the sd node, but on our platform, the register base of sdhc host for
>> emmc
>>>>>> is higher than the one for sd, putting emmc dt node before sd looks a bit
>>>>>> strange, but we have no better solutions.
>>>>>>
>>>>>
>>>>> :) That is also what I suffered currently. I have to prepare two
>>>>> seperate firmware with two diff fstab files to assign the mount point
>>>>> since sometime I need to boot from sd, but sometimes from emmc....
>>>>> With this patch, I only need to dtc a new dtb... quite simple.
>>>>>
>>>>>> Thanks,
>>>>>> Jisheng
>>>
>>> I am not immediately opposed to this patch, although let me think a
>>> bit more about it.
>>>
>>> What I would like to understand is why UUID/PARTUUID isn't working for
>>> your case. Did you try to use that?
>>
>> I have used with UUID/PARTUUID/PARTLABEL and etc.. I think it's not problem.
>> But that is why some guys wants to use the fixed index.
>> (Almost all SoCs are still using "root=mmcblk0pX" in bootloader.)
>>
>> I'm considering more what is better. :)
>>
>> Best Regards,
>> Jaehoon Chung
>>
>>>
>>> Kind regards
>>> Uffe
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>>
>>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC PATCH] mmc: block: Support the fixed index for mmcblk with aliases nodes
  2017-02-10 11:35 ` Tomas Melin
@ 2017-02-13  0:34   ` Jaehoon Chung
  2017-02-15 12:50     ` Tomas Melin
  0 siblings, 1 reply; 10+ messages in thread
From: Jaehoon Chung @ 2017-02-13  0:34 UTC (permalink / raw)
  To: Tomas Melin, Ulf Hansson; +Cc: linux-mmc, jszhang, shawn.lin, dianders, CPGS

Hi,

On 02/10/2017 08:35 PM, Tomas Melin wrote:
> Hi,
> 
> It looks as this RFC was never posted as a real patch.
> For embedded devices with several memory devices, some being removable,
> providing a way to define aliases for the nodes in the device tree is a benefit.
> I have tested the patch from Jaehoon and it works nicely.

I'm not sure there is more better solution than this.
But I guess it's useful to someone..
If someone want to use this, i will resend the patch based on latest mmc.

Best Regards,
Jaehoon Chung

> 
> Could this be reposted and considered for inclusion?
> 
> Found the original patch here: https://patchwork.kernel.org/patch/8685711/
> 
> Best Regards
> Tomas
> 
> 
> On 04/04/2016 09:14 PM, Ulf Hansson wrote:
>> On 4 April 2016 at 04:08, Jaehoon Chung <jh80.chung@samsung.com> wrote:
>>> Hi All,
>>>
>>> Are there any other opinion for this RFC patch?
>>>
>>> Best Regards,
>>> Jaehoon Chung
>>>
>>> On 03/30/2016 09:15 AM, Shawn Lin wrote:
>>>> 在 2016/3/29 18:49, Jisheng Zhang 写道:
>>>>> Hi Jaehoon,
>>>>>
>>>>> On Tue, 29 Mar 2016 19:43:34 +0900 Jaehoon Chung wrote:
>>>>>
>>>>>> This patch is just RFC. I want to know opinions.
>>>>>>
>>>>>> Now, index of mmcblk is allocated in accordance with probing time.
>>>>>> If want to use the mmcblk1 for some device, it can use alias.
>>>>>>
>>>>>> aliases {
>>>>>>     mmc0 = &mmc0;    /* mmcblk0 for eMMC */
>>>>>>     mmc1 = &mmc2;    /* mmcblk1 for SD */
>>>>>>     mmc2 = &mmc1;    /* mmcblk2 for SDIO*/
>>>>>> };
>>>>>
>>>>> I like this feature and we do need it. In the past, we have to put emmc dt node
>>>>> before the sd node, but on our platform, the register base of sdhc host for
> emmc
>>>>> is higher than the one for sd, putting emmc dt node before sd looks a bit
>>>>> strange, but we have no better solutions.
>>>>>
>>>>
>>>> :) That is also what I suffered currently. I have to prepare two
>>>> seperate firmware with two diff fstab files to assign the mount point
>>>> since sometime I need to boot from sd, but sometimes from emmc....
>>>> With this patch, I only need to dtc a new dtb... quite simple.
>>>>
>>>>> Thanks,
>>>>> Jisheng
>>
>> I am not immediately opposed to this patch, although let me think a
>> bit more about it.
>>
>> What I would like to understand is why UUID/PARTUUID isn't working for
>> your case. Did you try to use that?
> 
> I have used with UUID/PARTUUID/PARTLABEL and etc.. I think it's not problem.
> But that is why some guys wants to use the fixed index.
> (Almost all SoCs are still using "root=mmcblk0pX" in bootloader.)
> 
> I'm considering more what is better. :)
> 
> Best Regards,
> Jaehoon Chung
> 
>>
>> Kind regards
>> Uffe
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [RFC PATCH] mmc: block: Support the fixed index for mmcblk with aliases nodes
@ 2017-02-10 11:35 ` Tomas Melin
  2017-02-13  0:34   ` Jaehoon Chung
  0 siblings, 1 reply; 10+ messages in thread
From: Tomas Melin @ 2017-02-10 11:35 UTC (permalink / raw)
  To: Jaehoon Chung, Ulf Hansson; +Cc: linux-mmc, jszhang, shawn.lin, dianders

Hi,

It looks as this RFC was never posted as a real patch.
For embedded devices with several memory devices, some being removable,
providing a way to define aliases for the nodes in the device tree is a benefit.
I have tested the patch from Jaehoon and it works nicely.

Could this be reposted and considered for inclusion?

Found the original patch here: https://patchwork.kernel.org/patch/8685711/

Best Regards
Tomas


On 04/04/2016 09:14 PM, Ulf Hansson wrote:
> On 4 April 2016 at 04:08, Jaehoon Chung <jh80.chung@samsung.com> wrote:
>> Hi All,
>>
>> Are there any other opinion for this RFC patch?
>>
>> Best Regards,
>> Jaehoon Chung
>>
>> On 03/30/2016 09:15 AM, Shawn Lin wrote:
>>> 在 2016/3/29 18:49, Jisheng Zhang 写道:
>>>> Hi Jaehoon,
>>>>
>>>> On Tue, 29 Mar 2016 19:43:34 +0900 Jaehoon Chung wrote:
>>>>
>>>>> This patch is just RFC. I want to know opinions.
>>>>>
>>>>> Now, index of mmcblk is allocated in accordance with probing time.
>>>>> If want to use the mmcblk1 for some device, it can use alias.
>>>>>
>>>>> aliases {
>>>>>     mmc0 = &mmc0;    /* mmcblk0 for eMMC */
>>>>>     mmc1 = &mmc2;    /* mmcblk1 for SD */
>>>>>     mmc2 = &mmc1;    /* mmcblk2 for SDIO*/
>>>>> };
>>>>
>>>> I like this feature and we do need it. In the past, we have to put emmc dt node
>>>> before the sd node, but on our platform, the register base of sdhc host for
emmc
>>>> is higher than the one for sd, putting emmc dt node before sd looks a bit
>>>> strange, but we have no better solutions.
>>>>
>>>
>>> :) That is also what I suffered currently. I have to prepare two
>>> seperate firmware with two diff fstab files to assign the mount point
>>> since sometime I need to boot from sd, but sometimes from emmc....
>>> With this patch, I only need to dtc a new dtb... quite simple.
>>>
>>>> Thanks,
>>>> Jisheng
>
> I am not immediately opposed to this patch, although let me think a
> bit more about it.
>
> What I would like to understand is why UUID/PARTUUID isn't working for
> your case. Did you try to use that?

I have used with UUID/PARTUUID/PARTLABEL and etc.. I think it's not problem.
But that is why some guys wants to use the fixed index.
(Almost all SoCs are still using "root=mmcblk0pX" in bootloader.)

I'm considering more what is better. :)

Best Regards,
Jaehoon Chung

>
> Kind regards
> Uffe
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-02-15 12:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-29 10:43 [RFC PATCH] mmc: block: Support the fixed index for mmcblk with aliases nodes Jaehoon Chung
2016-03-29 10:49 ` Jisheng Zhang
2016-03-30  0:15   ` Shawn Lin
2016-04-04  2:08     ` Jaehoon Chung
2016-04-04 12:14       ` Ulf Hansson
2016-04-06  2:00         ` Jaehoon Chung
2016-04-28 23:07           ` Doug Anderson
     [not found] <CGME20170210113539epcas1p4ef88bafa36c5da229dc81a02c3924fa2@epcas1p4.samsung.com>
2017-02-10 11:35 ` Tomas Melin
2017-02-13  0:34   ` Jaehoon Chung
2017-02-15 12:50     ` Tomas Melin

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.