From: Michal Simek <michal.simek@xilinx.com>
To: Alan Cox <gnomes@lxorguk.ukuu.org.uk>,
Michal Simek <michal.simek@xilinx.com>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
Rob Herring <robh+dt@kernel.org>,
Sam Povilus <kernel.development@povil.us>,
linux-arm-kernel@lists.infradead.org,
linux-serial@vger.kernel.org, jslaby@suse.com,
soren.brinkmann@xilinx.com
Subject: Re: [PATCH 1/1] xilinx ps uart: Adding a kernel parameter for the number of xilinx ps uarts
Date: Wed, 24 May 2017 15:06:13 +0200 [thread overview]
Message-ID: <924433a1-7e27-6eb6-71ca-ed7baceb427f@xilinx.com> (raw)
In-Reply-To: <20170523210710.4e84dd2d@alans-desktop>
On 23.5.2017 22:07, Alan Cox wrote:
>> yep hardcoded max 4 where in probe first free space is found and used
>> (range 0-3) but still max3100s statically allocated.
>> Shouldn't be this also dynamically allocated?
>
> The code to do the dynamic allocation would be larger than the array of
> pointers for the sane worst case.
>
>> I am not quite sure how exactly you want to do this via DT.
>
> Count the number of DT entries for this kind of port and allocate that
> many ?
:-) I think there is no doubt how to calculate that number for
static/fixed system. But where do you want to put it? And who should
read it?
A lot of drivers are calling uart_register_driver in module_init.
Others are calling it in probe(pl011 for example).
In module init you probably don't have a pointer to DT to read this and
this should be in generic location not in node itself.
If all drivers should call it from probe then we should change that -
then reading property is easy and only location should be cleared.
That's why I am curious how exactly you would do it because I haven't
seen this before.
>
>>
>> Also what do you think is a safe maximum number? This is fpga - hundreds
>> of pins which can do just uart.
>>
>>> There are lots of options better than breaking the "one kernel many
>>> platforms" model.
>>
>> Another options is also module parameter and dynamically allocated array
>> in cdns_uart_init.
>
> For a given platform the number is constant and they need to be
> described, so it seems to make no sense to put it anywhere other than the
> DT for that platform.
Also I don't think this is really constant in all cases. Especially in
connection to fpga where you can put others IPs to PL. You never know
what it is present in partial region and how many of these are there.
It means having truly dynamic behavior would be welcome.
Can you call uart_register_driver() from probe for every instance? It
means nr is 1 all the time.
>
> Why should users have to pass magic config options not use DT as
> intended ?
I am not saying that config option is perfect solution. It is at least
aligned with 5 others serial drivers in the tree.
Thanks,
Michal
next prev parent reply other threads:[~2017-05-24 13:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-20 2:21 [PATCH 1/1] xilinx ps uart: Adding a kernel parameter for the number of xilinx ps uarts Sam Povilus
2017-05-20 16:20 ` Alan Cox
2017-05-22 7:02 ` Michal Simek
2017-05-22 18:26 ` Alan Cox
2017-05-23 11:44 ` Michal Simek
2017-05-23 20:07 ` Alan Cox
2017-05-24 13:06 ` Michal Simek [this message]
2017-05-24 13:31 ` Alan Cox
2017-05-24 16:09 ` Michal Simek
2017-05-25 9:27 ` Maarten Brock
2017-05-25 13:29 ` Alan Cox
2017-05-25 15:33 ` Michal Simek
2017-05-24 3:27 ` Sam Povilus
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=924433a1-7e27-6eb6-71ca-ed7baceb427f@xilinx.com \
--to=michal.simek@xilinx.com \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=kernel.development@povil.us \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=soren.brinkmann@xilinx.com \
/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