From: marek.vasut@gmail.com (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: dts: rmobile: Drop MTD partitioning from DT
Date: Sun, 22 Jul 2018 12:10:08 +0200 [thread overview]
Message-ID: <9c77d8ae-637f-9713-83e3-3b40288b4b58@gmail.com> (raw)
In-Reply-To: <CAOesGMhAeRLf2fyw-igPBBCzoehcyT9fckVGuY=r8rjmdy-szg@mail.gmail.com>
On 07/22/2018 12:23 AM, Olof Johansson wrote:
[...]
>>>>> You end up with user space tools trying to parse the kernel command
>>>>> line to figure out what's on the flash, and other really bad habits.
>>>>> :(
>>>>
>>>> You should just read /proc/mtd , see
>>>> http://www.linux-mtd.infradead.org/doc/general.html
>>>
>>> Sure, I know that but not everybody does, and they do it in bad ways
>>> if given the opportunity.
>>
>> That's what the documentation is for. I assume whoever is using MTD is
>> also capable of reading the documentation and thus avoiding such basic
>> mistakes.
>
> Why read the docs when the information obviously is there when you grep it?
To do things correctly of course.
> I'm agreeing with you -- I've just seen it done wrong so many times.
> Making it harder to make mistakes is always a good thing.
If you follow this argument through, you could say we should start
plucking out random files from /proc because someone might cluelessly
misuse them. This might lead to a system that's hard to misuse indeed,
but likely also quite useless.
>>>>> I'd strongly advice you to keep this in the board files, unless you
>>>>> have an actual real motivation for changing it. This patch does not
>>>>> provide one.
>>>>
>>>> Partitioning is not hardware description, it should not be in DT.
>>>
>>> Read my reply again. It's part of _platform_ description, and belongs in DT.
>>
>> I can repartition the flash whichever way I want for my purposes, just
>> like I can repartition a harddrive. We don't have harddrive partitioning
>> in the DT, why should we have flash partitioning there ? How do those
>> differ ?
>
> A drive can be auto-probed. We have partition tables on the disk that
> self-describes the contents.
>
> That doesn't exist on flashes, at least not usually. This is really
> unfortunate, I wish we could change _that_ instead of argue here.
Technically it does. Consider the fact that those flashes have between
4-64 MiB in size and sector size of 256 kiB . If you waste one sector on
the 4 MiB flash for some sort of partition table, you waste 1/16th of
the flash, which is a lot.
The bootloader needs to know the flash layout and it must be in sync
with the kernel, so there has to be some sort of communication channel
between those two. I don't want to add handler for every possible
bootloader that can be used on those platforms into the kernel though.
> If you repartition your disk, you need to change the command line
> arguments to the kernel too. It's definitely not an argument to
> keeping it on the command line instead.
How so ? /dev/sdxy remains /dev/sdxy . Sure, you can use UUID and change
it, but that's a specific case.
> Also, you now have a dependencies between hardware description, probe
> order and stable naming in the kernel, and the command line. With DT,
> you have it all in one place, right next to the flash part. It doesn't
> matter what name it gets probed at, and nobody needs to know the
> mapping to get it right.
In this case it doesn't matter either, since you have only one flash device.
--
Best regards,
Marek Vasut
next prev parent reply other threads:[~2018-07-22 10:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-30 10:11 [PATCH] ARM: dts: rmobile: Drop MTD partitioning from DT Marek Vasut
2018-05-31 11:39 ` Simon Horman
2018-07-21 21:47 ` Olof Johansson
2018-07-21 21:54 ` Marek Vasut
2018-07-21 22:01 ` Olof Johansson
2018-07-21 22:11 ` Marek Vasut
2018-07-21 22:23 ` Olof Johansson
2018-07-22 10:10 ` Marek Vasut [this message]
2018-07-22 16:17 ` Olof Johansson
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=9c77d8ae-637f-9713-83e3-3b40288b4b58@gmail.com \
--to=marek.vasut@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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).