Thread (22 messages) 22 messages, 4 authors, 2020-12-01

RE: [PATCH] arm64: dts: ls1028a: make the eMMC and SD card controllers use fixed indices

From: "Y.b. Lu" <yangbo.lu@nxp.com>
Date: 2020-11-24 10:22:56
Also in: linux-devicetree, linux-mmc, lkml

Hi Michael,
-----Original Message-----
From: Michael Walle <redacted>
Sent: Tuesday, November 24, 2020 5:43 PM
To: Y.b. Lu <yangbo.lu@nxp.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>; Shawn Guo
[off-list ref]; Leo Li [off-list ref]; Rob Herring
[off-list ref]; linux-arm-kernel@lists.infradead.org;
devicetree@vger.kernel.org; Adrian Hunter [off-list ref]; Ulf
Hansson [off-list ref]; linux-mmc@vger.kernel.org;
linux-kernel@vger.kernel.org; Ashish Kumar [off-list ref]
Subject: Re: [PATCH] arm64: dts: ls1028a: make the eMMC and SD card
controllers use fixed indices

Am 2020-11-24 10:22, schrieb Y.b. Lu:
quoted
Hi Michael,
quoted
-----Original Message-----
From: Michael Walle <redacted>
Sent: Tuesday, November 24, 2020 5:08 PM
To: Y.b. Lu <yangbo.lu@nxp.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>; Shawn Guo
[off-list ref]; Leo Li [off-list ref]; Rob Herring
[off-list ref]; linux-arm-kernel@lists.infradead.org;
devicetree@vger.kernel.org; Adrian Hunter [off-list ref];
Ulf
Hansson [off-list ref]; linux-mmc@vger.kernel.org;
linux-kernel@vger.kernel.org; Ashish Kumar [off-list ref]
Subject: Re: [PATCH] arm64: dts: ls1028a: make the eMMC and SD card
controllers use fixed indices

Am 2020-11-24 10:02, schrieb Y.b. Lu:
quoted
Hi Michael,
quoted
-----Original Message-----
From: Michael Walle <redacted>
Sent: Tuesday, November 24, 2020 4:55 PM
To: Y.b. Lu <yangbo.lu@nxp.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>; Shawn Guo
[off-list ref]; Leo Li [off-list ref]; Rob Herring
[off-list ref]; linux-arm-kernel@lists.infradead.org;
devicetree@vger.kernel.org; Adrian Hunter [off-list ref];
Ulf
Hansson [off-list ref]; linux-mmc@vger.kernel.org;
linux-kernel@vger.kernel.org; Ashish Kumar [off-list ref]
Subject: Re: [PATCH] arm64: dts: ls1028a: make the eMMC and SD card
controllers use fixed indices

Am 2020-11-24 09:47, schrieb Y.b. Lu:
quoted
Hi Michael,
quoted
-----Original Message-----
From: Michael Walle <redacted>
Sent: Tuesday, November 24, 2020 4:03 PM
To: Y.b. Lu <yangbo.lu@nxp.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>; Shawn Guo
[off-list ref]; Leo Li [off-list ref]; Rob Herring
[off-list ref]; linux-arm-kernel@lists.infradead.org;
devicetree@vger.kernel.org; Adrian Hunter
[off-list ref];
quoted
quoted
quoted
quoted
quoted
quoted
Ulf
Hansson [off-list ref]; linux-mmc@vger.kernel.org;
linux-kernel@vger.kernel.org; Ashish Kumar
[off-list ref]
quoted
quoted
quoted
quoted
quoted
quoted
Subject: Re: [PATCH] arm64: dts: ls1028a: make the eMMC and SD
card
quoted
quoted
quoted
quoted
quoted
quoted
controllers use fixed indices

Am 2020-11-24 08:41, schrieb Y.b. Lu:
quoted
Hi Vladimir,
quoted
-----Original Message-----
From: Vladimir Oltean <vladimir.oltean@nxp.com>
Sent: Friday, November 20, 2020 5:30 PM
To: Y.b. Lu <yangbo.lu@nxp.com>
Cc: Shawn Guo <shawnguo@kernel.org>; Leo Li
[off-list ref];
quoted
quoted
Rob
quoted
quoted
quoted
quoted
Herring [off-list ref];
linux-arm-kernel@lists.infradead.org;
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
devicetree@vger.kernel.org; Adrian Hunter
[off-list ref];
quoted
quoted
quoted
quoted
quoted
quoted
Ulf
Hansson [off-list ref]; linux-mmc@vger.kernel.org;
linux-kernel@vger.kernel.org; Ashish Kumar
[off-list ref];
quoted
quoted
quoted
quoted
quoted
quoted
Michael Walle [off-list ref]
Subject: Re: [PATCH] arm64: dts: ls1028a: make the eMMC and SD
card
quoted
quoted
quoted
quoted
quoted
quoted
controllers use fixed indices

On Fri, Nov 20, 2020 at 02:04:02AM +0000, Y.b. Lu wrote:
quoted
Hi Vladimir,

I have already upstreamed a patch for all affected layerscape
boards.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kern
quoted
quoted
quoted
quoted
quoted
quoted
el.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Fshawnguo%2Flinux.git%2
quoted
quoted
quoted
quoted
quoted
quoted
Fcommit%2F&amp;data=04%7C01%7Cyangbo.lu%40nxp.com%7C498622ade
quoted
quoted
quoted
quoted
quoted
quoted
e704fc0042008d8904f6184%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0
quoted
quoted
quoted
quoted
quoted
quoted
%7C0%7C637418017917635725%7CUnknown%7CTWFpbGZsb3d8ey
JW
quoted
quoted
Ijoi
quoted
quoted
M
quoted
quoted
C4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000
quoted
quoted
quoted
quoted
quoted
quoted
&amp;sdata=OciS3q%2BmP%2Bz4x1ewPHDigmUkgIZmBgUlRRTm4yaxB7s%3D
quoted
quoted
quoted
quoted
quoted
quoted
&amp;reserved=0?
quoted
quoted
h=imx/dt64&id=342ab37ecaf8c1b10dd3ca9a1271db29a6af0705
quoted
Please check whether it works for you.
Thanks, one can tell that I haven't done my due diligence of
checking
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
Shawn's tree first. I'll cherry-pick that patch and carry on with my
work.

However, the fact still remains that Michael has expressed his
opinion
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
regarding mmcblk0 vs mmcblk1. Do you think that we could make
the
quoted
quoted
quoted
quoted
quoted
quoted
aliases a per-board option instead of per-SoC? Consider that there
might
even be boards that only use SD card. It would be strange for the
block
device in that case to be called /dev/mmcblk1.
I don't think it's a problem in board dts to define board specific
thing, like re-defining alias, and disabling any IP it not using.
First, why would you put it in the architecture include anyway? That
is really board-specific. That is like you would say, we enable all
devices and a board could potentially disable it. TBH it seems that
this will fit your reference boards and you don't care about the
other ones which uses that include.
In soc dtsi, this is giving default alias for two esdhc controllers.
This is not board specific.
That's natural esdhc0 is mmc0 and esdhc1 is mmc1.
How could this be not board specific if there are at least three
different use cases the board can choose from - and needs three
different configurations:

(1) eMMC at /dev/mmcblk0, SD card at /dev/mmcblk1
(2) SD card at /dev/mmcblk0, eMMC at /dev/mmcblk1
(3) no eMMC at all, SD card at /dev/mmcblk0
Not matter it's SD card or eMMC card, if it's on esdhc0, use
/dev/mmcblk0.
Not matter it's SD card or eMMC card, if it's on esdhc1, use
/dev/mmcblk1.
It's not related to board and card type, it's only related to esdhc
interface in use.
And what interace is used is board specific, isn't it?
Again, for all boards, use /dev/mmcblk0 for card on esdhc0 interface,
and /dev/mmcblk1 for card on esdhc1 interface.
That's not board specific.
So why don't you enable the devices by default then? That would be the
same reasoning, wouldn't it? Or even enable all devices by default.
Nobody
does that. But the boards themselves enable the devices which _they_
are actually using.
I explained clearly.
Now the point is, I think the alias of mmc0 for esdhc0, mmc1 for esdhc1 is soc specific (no need to change the controller alias in board file), while you think it's totally board specific.
Let's wait others' comments.

Thanks.
quoted
quoted
quoted
quoted
your include only support (1). If a board needs (2) or (3) it has to
override the configuration in the _common_ include.
quoted
quoted
And as Vladimir pointed out, what do you do if you just have the
eMMC
quoted
quoted
quoted
quoted
quoted
quoted
on the LS1028A. It will be mmcblk1 unless you do something like the
following in the board dts:

mmc0 = &esdhc;
/delete-property/ mmc1;

That is really cumbersome, isnt it?
The soc dtsi gives default alias to make esdhc0 as mmc0, and esdhc1 as
mmc1, the use case just needs to consider which esdhc controller is
used. That's fixed index for it.
No matter how the board is designed, there are two esdhc controllers
in soc. It's probed as mmc0 and mmc1.
It's use case that should choose the right mmc device. It is not the
dts that should be changed to suit use case.
If the board owner insists to change alias to make esdhc1 as mmc0, I
think no problem. Just do it in board dts to override the default one.
Still, why would this be enforced in the common include? What is the
advnatage here? I only see disadvantages.
You didn't answer this unfortunately.
As I explained,
"Again, for all boards, use /dev/mmcblk0 for card on esdhc0 interface,
and /dev/mmcblk1 for card on esdhc1 interface.
That's not board specific."

Without such definition, the index is random for each booting.
No the question was why to include this into the common header. Not into
the board specific ones.

-michael
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help