linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: Ulf Hansson <ulf.hansson@linaro.org>, John Keeping <john@metanate.com>
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] mmc: dw_mmc: use standard "mmc" alias stem
Date: Wed, 24 Nov 2021 18:54:12 +0900	[thread overview]
Message-ID: <315972c2-2253-ad10-b712-2d2c96b3da26@samsung.com> (raw)
In-Reply-To: <CAPDyKFp1zMBUfK7LteW0yEfTpqtU+P+EybLsJBFx_r54HwFdMg@mail.gmail.com>

On 11/24/21 4:34 AM, Ulf Hansson wrote:
> On Tue, 16 Nov 2021 at 20:02, John Keeping <john@metanate.com> wrote:
>>
>> The standard stem for MMC aliases is "mmc" and this is used by the MMC
>> core to set the slot index.
> 
> This isn't the correct description of the mmc aliases. The below text
> is copied from the DT doc:
> 
> "It is possible to assign a fixed index mmcN to an MMC host controller
> (and the corresponding mmcblkN devices) by defining an alias in the
> /aliases device tree node."
> 
>>
>> Use this in preference to the non-standard "mshc" stem when setting the
>> controller ID to avoid needing two aliases for each MMC device in order
>> to cover both the core and dw_mmc-specific functionality.
>>
>> The old "mshc" lookup is kept for backwards compatibility.
> 
> The mshc alias is really weird!
> 
> It looks like some leftover from when the dw_mmc controller supported
> multiple slots. This support was dropped a long time ago, simply
> because it never really worked - and it was not worth trying to. Only
> one slot per controller is supported.

As Ulf mentioned, dw_mmc controller can be supported multiple slot.
But I didn't see its case to use multiple slot. And I had been done to drop a long time ago.

mshc was used because of Mobile Storage Host Controller.

> 
> Rather than re-using the mmc alias in the same weird way as the mshc
> alias, I suggest we try to remove parsing of the mshc aliases
> completely. By looking at the corresponding code and in combination
> with the DTS files, it certainly looks doable to me. Do you want to
> have a look at it?

If possible to remove mshc, it's best.
I will check that removing mshc parsing in dw_mmc.c.

Best Regards,
Jaehoon Chung

> 
> Additionally, there is no need to deprecate the mshc alias binding, as
> it seems like it has never been documented. :-)
> 
> Kind regards
> Uffe
> 
>>
>> Signed-off-by: John Keeping <john@metanate.com>
>> ---
>>  drivers/mmc/host/dw_mmc.c | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>> index 37af1245304b..6ffaa354410a 100644
>> --- a/drivers/mmc/host/dw_mmc.c
>> +++ b/drivers/mmc/host/dw_mmc.c
>> @@ -112,7 +112,11 @@ int dw_mci_of_alias_get_id(struct dw_mci *host)
>>         if (WARN_ON(!host->dev->of_node))
>>                 return 0;
>>
>> -       ctrl_id = of_alias_get_id(host->dev->of_node, "mshc");
>> +       ctrl_id = of_alias_get_id(host->dev->of_node, "mmc");
>> +
>> +       /* Compatibility fallback for old device trees. */
>> +       if (ctrl_id < 0)
>> +               ctrl_id = of_alias_get_id(host->dev->of_node, "mshc");
>>
>>         if (ctrl_id < 0)
>>                 ctrl_id = 0;
>> --
>> 2.34.0
>>
> 


  reply	other threads:[~2021-11-24  9:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16 19:02 [PATCH 0/2] mmc: dw_mmc: use standard "mmc" alias stem John Keeping
2021-11-16 19:02 ` [PATCH 1/2] mmc: dw_mmc: extract ctrl_id lookup to a function John Keeping
2021-11-16 19:02 ` [PATCH 2/2] mmc: dw_mmc: use standard "mmc" alias stem John Keeping
2021-11-23 19:34   ` Ulf Hansson
2021-11-24  9:54     ` Jaehoon Chung [this message]
2021-11-24 12:29       ` John Keeping
2021-11-24 15:13         ` Ulf Hansson
2021-11-24 12:52       ` Christian Löhle

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=315972c2-2253-ad10-b712-2d2c96b3da26@samsung.com \
    --to=jh80.chung@samsung.com \
    --cc=john@metanate.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).