Re: [PATCH v2] uartlite: Update the default for the SERIAL_UARTLITE_NR_UARTS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 11/17/21 10:53, Ruediger Willenberg wrote:
Am 17.11.2021 um 06:16 schrieb Shubhrajyoti Datta:
"The uartlite is used by FPGAs that support a basically unlimited number
of uarts so limiting it at 16 dosn't make sense as users might need more
than that."
the commit also said that number should be unlimited. However it set the
default to 1 instead of 16.The original 16 written in driver should be
  quite reasonable default to cover most of the cases.

So change the default number of uarts back to 16.

Respectfully, this is an inadequate fix to a decade-old underlying issue
in the Xilinx device tree generator. The DTG assigns consecutive
"port-number" properties to UARTs handled by separate drivers (uartps,
uartlite, uartns), which are then used in drivers/tty/serial/uartlite.c
to index the struct uart_port[] array and set uart_port->line.
The DTG should number devices for each driver separately from 0;
serial_core.c checks for (0 <= uart_port->line < NR_UART_PORTS). As a
consequence, when a Zynq system has both a PS-UART and a Uartlite,
setting SERIAL_UARTLITE_NR_UARTS explicitly to 1 in Kconfig means
probing the uartlite fails, which is confusing to the unsuspecting
KConfig user. Setting the default to 16 just kicks the can down the
road because it will fail for more than 15 Uartlites (or less, if there
are more PS-UARTs or AXI 16550A UARTs).
I've submitted a patch for the DTG numbering scheme to git@xxxxxxxxxx
just yesterday. Will post a PATCH to this list later today or tomorrow
to handle the issue from the other end (uartlite.c).

I have no problem with your patch and it is correct (I would prefer a message to show for this option). But it doesn't mean that default 1 was correct value to setup especially when range was setup by Sam from 1-256. And originally number 16 was used.

And using aliases for serial id identification is around for a while and Xilinx DTG is aligned with it because via current dt you can't describe cases where you will have stable numbers for different tty names like
ttyS0, ttyUL0, ttyPS0, ttyAMA0, etc.
That's why DTG generates it per all serial IDs.

That's why I think this patch is still valid. If you don't like description it can be changed because definitely people are using systems with more then one uartlite and 1 is not reasonable default.
We can also take a look at default for others serial drivers

8250  - 4
SH - 3,10,18,2 depends on platform
TXX9 - 6
AR933X - 2
RP2 - 32

and none of them is using 1 as default. IIRC discussion about UARTPS it was said if number is not enough we can just extend it.

Thanks,
Michal






[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux