* [PATCH] serial: sprd: Support 12 uart ports
@ 2023-08-07 8:07 Wenhua Lin
2023-08-07 8:41 ` Baolin Wang
0 siblings, 1 reply; 6+ messages in thread
From: Wenhua Lin @ 2023-08-07 8:07 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, Orson Zhai, Baolin Wang,
Chunyan Zhang
Cc: linux-serial, linux-kernel, wenhua lin, Wenhua Lin, Xiongpeng Wu
From: Wenhua Lin <wenhua.lin@unisoc.com>
Support 12 uart ports, which can solve the problem
of insufficient uart ports.
Signed-off-by: Wenhua Lin <wenhua.lin@unisoc.com>
---
drivers/tty/serial/sprd_serial.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
index b58f51296ace..2774df490899 100644
--- a/drivers/tty/serial/sprd_serial.c
+++ b/drivers/tty/serial/sprd_serial.c
@@ -22,7 +22,7 @@
#include <linux/tty_flip.h>
/* device name */
-#define UART_NR_MAX 8
+#define UART_NR_MAX 12
#define SPRD_TTY_NAME "ttyS"
#define SPRD_FIFO_SIZE 128
#define SPRD_DEF_RATE 26000000
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] serial: sprd: Support 12 uart ports
2023-08-07 8:07 [PATCH] serial: sprd: Support 12 uart ports Wenhua Lin
@ 2023-08-07 8:41 ` Baolin Wang
2023-08-09 5:52 ` wenhua lin
0 siblings, 1 reply; 6+ messages in thread
From: Baolin Wang @ 2023-08-07 8:41 UTC (permalink / raw)
To: Wenhua Lin, Greg Kroah-Hartman, Jiri Slaby, Orson Zhai,
Chunyan Zhang
Cc: linux-serial, linux-kernel, wenhua lin, Xiongpeng Wu
On 8/7/2023 4:07 PM, Wenhua Lin wrote:
> From: Wenhua Lin <wenhua.lin@unisoc.com>
>
> Support 12 uart ports, which can solve the problem
> of insufficient uart ports.
This sounds incorrect to me.
If this is a software bug, please add a Fixes tag to backport for stable
kernels. If the change of the max ports is only avaliable on the new
SPRD serial hardware, you should ensure the change is
backward-compatibility with old hardware.
> Signed-off-by: Wenhua Lin <wenhua.lin@unisoc.com>
> ---
> drivers/tty/serial/sprd_serial.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
> index b58f51296ace..2774df490899 100644
> --- a/drivers/tty/serial/sprd_serial.c
> +++ b/drivers/tty/serial/sprd_serial.c
> @@ -22,7 +22,7 @@
> #include <linux/tty_flip.h>
>
> /* device name */
> -#define UART_NR_MAX 8
> +#define UART_NR_MAX 12
> #define SPRD_TTY_NAME "ttyS"
> #define SPRD_FIFO_SIZE 128
> #define SPRD_DEF_RATE 26000000
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] serial: sprd: Support 12 uart ports
2023-08-07 8:41 ` Baolin Wang
@ 2023-08-09 5:52 ` wenhua lin
2023-08-09 6:23 ` Chunyan Zhang
2023-08-09 6:26 ` Baolin Wang
0 siblings, 2 replies; 6+ messages in thread
From: wenhua lin @ 2023-08-09 5:52 UTC (permalink / raw)
To: Baolin Wang
Cc: Wenhua Lin, Greg Kroah-Hartman, Jiri Slaby, Orson Zhai,
Chunyan Zhang, linux-serial, linux-kernel, Xiongpeng Wu
The change of the max ports is to adapt to an new
SPRD serial hardware,also is backward-compatibility with old hardware.
Baolin Wang <baolin.wang@linux.alibaba.com> 于2023年8月7日周一 16:41写道:
>
>
>
> On 8/7/2023 4:07 PM, Wenhua Lin wrote:
> > From: Wenhua Lin <wenhua.lin@unisoc.com>
> >
> > Support 12 uart ports, which can solve the problem
> > of insufficient uart ports.
>
> This sounds incorrect to me.
> If this is a software bug, please add a Fixes tag to backport for stable
> kernels. If the change of the max ports is only avaliable on the new
> SPRD serial hardware, you should ensure the change is
> backward-compatibility with old hardware.
>
> > Signed-off-by: Wenhua Lin <wenhua.lin@unisoc.com>
> > ---
> > drivers/tty/serial/sprd_serial.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
> > index b58f51296ace..2774df490899 100644
> > --- a/drivers/tty/serial/sprd_serial.c
> > +++ b/drivers/tty/serial/sprd_serial.c
> > @@ -22,7 +22,7 @@
> > #include <linux/tty_flip.h>
> >
> > /* device name */
> > -#define UART_NR_MAX 8
> > +#define UART_NR_MAX 12
> > #define SPRD_TTY_NAME "ttyS"
> > #define SPRD_FIFO_SIZE 128
> > #define SPRD_DEF_RATE 26000000
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] serial: sprd: Support 12 uart ports
2023-08-09 5:52 ` wenhua lin
@ 2023-08-09 6:23 ` Chunyan Zhang
2023-08-09 6:26 ` Baolin Wang
1 sibling, 0 replies; 6+ messages in thread
From: Chunyan Zhang @ 2023-08-09 6:23 UTC (permalink / raw)
To: wenhua lin
Cc: Baolin Wang, Wenhua Lin, Greg Kroah-Hartman, Jiri Slaby,
Orson Zhai, linux-serial, linux-kernel, Xiongpeng Wu
On Wed, 9 Aug 2023 at 13:52, wenhua lin <wenhua.lin1994@gmail.com> wrote:
>
> The change of the max ports is to adapt to an new
> SPRD serial hardware,also is backward-compatibility with old hardware.
This change seems not backward-compatible if the serial devices on
some old Unisoc SoCs can support 8 ports only.
BTW, please do not top-post your reply.
Thanks,
Chunyan
>
> Baolin Wang <baolin.wang@linux.alibaba.com> 于2023年8月7日周一 16:41写道:
> >
> >
> >
> > On 8/7/2023 4:07 PM, Wenhua Lin wrote:
> > > From: Wenhua Lin <wenhua.lin@unisoc.com>
> > >
> > > Support 12 uart ports, which can solve the problem
> > > of insufficient uart ports.
> >
> > This sounds incorrect to me.
> > If this is a software bug, please add a Fixes tag to backport for stable
> > kernels. If the change of the max ports is only avaliable on the new
> > SPRD serial hardware, you should ensure the change is
> > backward-compatibility with old hardware.
> >
> > > Signed-off-by: Wenhua Lin <wenhua.lin@unisoc.com>
> > > ---
> > > drivers/tty/serial/sprd_serial.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
> > > index b58f51296ace..2774df490899 100644
> > > --- a/drivers/tty/serial/sprd_serial.c
> > > +++ b/drivers/tty/serial/sprd_serial.c
> > > @@ -22,7 +22,7 @@
> > > #include <linux/tty_flip.h>
> > >
> > > /* device name */
> > > -#define UART_NR_MAX 8
> > > +#define UART_NR_MAX 12
> > > #define SPRD_TTY_NAME "ttyS"
> > > #define SPRD_FIFO_SIZE 128
> > > #define SPRD_DEF_RATE 26000000
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] serial: sprd: Support 12 uart ports
2023-08-09 5:52 ` wenhua lin
2023-08-09 6:23 ` Chunyan Zhang
@ 2023-08-09 6:26 ` Baolin Wang
2023-08-09 11:27 ` wenhua lin
1 sibling, 1 reply; 6+ messages in thread
From: Baolin Wang @ 2023-08-09 6:26 UTC (permalink / raw)
To: wenhua lin
Cc: Wenhua Lin, Greg Kroah-Hartman, Jiri Slaby, Orson Zhai,
Chunyan Zhang, linux-serial, linux-kernel, Xiongpeng Wu
On 8/9/2023 1:52 PM, wenhua lin wrote:
> The change of the max ports is to adapt to an new
> SPRD serial hardware,also is backward-compatibility with old hardware.
Again, DO NOT top-posting! Thanks.
>>
>> On 8/7/2023 4:07 PM, Wenhua Lin wrote:
>>> From: Wenhua Lin <wenhua.lin@unisoc.com>
>>>
>>> Support 12 uart ports, which can solve the problem
>>> of insufficient uart ports.
>>
>> This sounds incorrect to me.
>> If this is a software bug, please add a Fixes tag to backport for stable
>> kernels. If the change of the max ports is only avaliable on the new
>> SPRD serial hardware, you should ensure the change is
>> backward-compatibility with old hardware.
This is not backward-compatibility. Please see 'sprd_uart_driver'
structure as below:
static struct uart_driver sprd_uart_driver = {
.owner = THIS_MODULE,
.driver_name = "sprd_serial",
.dev_name = SPRD_TTY_NAME,
.major = 0,
.minor = 0,
.nr = UART_NR_MAX,
.cons = SPRD_CONSOLE,
};
That means you will still register 12 UART ports in the tty for old
serial hardwares which actually only support 8 UART ports, and if users
want to use another 4 ports which are not supported in the hardware,
then system crashes.
So I think you should add a SoC data in 'serial_ids' to change the
number of UART port according to different SoC.
>>> Signed-off-by: Wenhua Lin <wenhua.lin@unisoc.com>
>>> ---
>>> drivers/tty/serial/sprd_serial.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
>>> index b58f51296ace..2774df490899 100644
>>> --- a/drivers/tty/serial/sprd_serial.c
>>> +++ b/drivers/tty/serial/sprd_serial.c
>>> @@ -22,7 +22,7 @@
>>> #include <linux/tty_flip.h>
>>>
>>> /* device name */
>>> -#define UART_NR_MAX 8
>>> +#define UART_NR_MAX 12
>>> #define SPRD_TTY_NAME "ttyS"
>>> #define SPRD_FIFO_SIZE 128
>>> #define SPRD_DEF_RATE 26000000
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] serial: sprd: Support 12 uart ports
2023-08-09 6:26 ` Baolin Wang
@ 2023-08-09 11:27 ` wenhua lin
0 siblings, 0 replies; 6+ messages in thread
From: wenhua lin @ 2023-08-09 11:27 UTC (permalink / raw)
To: Baolin Wang
Cc: Wenhua Lin, Greg Kroah-Hartman, Jiri Slaby, Orson Zhai,
Chunyan Zhang, linux-serial, linux-kernel, Xiongpeng Wu
On Wed, Aug 9, 2023 at 2:27 PM Baolin Wang
<baolin.wang@linux.alibaba.com> wrote:
>
>
>
> On 8/9/2023 1:52 PM, wenhua lin wrote:
> > The change of the max ports is to adapt to an new
> > SPRD serial hardware,also is backward-compatibility with old hardware.
>
> Again, DO NOT top-posting! Thanks.
Thank you for your correction.
>
> >>
> >> On 8/7/2023 4:07 PM, Wenhua Lin wrote:
> >>> From: Wenhua Lin <wenhua.lin@unisoc.com>
> >>>
> >>> Support 12 uart ports, which can solve the problem
> >>> of insufficient uart ports.
> >>
> >> This sounds incorrect to me.
> >> If this is a software bug, please add a Fixes tag to backport for stable
> >> kernels. If the change of the max ports is only avaliable on the new
> >> SPRD serial hardware, you should ensure the change is
> >> backward-compatibility with old hardware.
>
> This is not backward-compatibility. Please see 'sprd_uart_driver'
> structure as below:
>
> static struct uart_driver sprd_uart_driver = {
> .owner = THIS_MODULE,
> .driver_name = "sprd_serial",
> .dev_name = SPRD_TTY_NAME,
> .major = 0,
> .minor = 0,
> .nr = UART_NR_MAX,
> .cons = SPRD_CONSOLE,
> };
>
> That means you will still register 12 UART ports in the tty for old
> serial hardwares which actually only support 8 UART ports, and if users
> want to use another 4 ports which are not supported in the hardware,
> then system crashes.
>
> So I think you should add a SoC data in 'serial_ids' to change the
> number of UART port according to different SoC.
>
Thank you for your valuable comments, we should probably consider
how to make changes based on your suggestions.
> >>> Signed-off-by: Wenhua Lin <wenhua.lin@unisoc.com>
> >>> ---
> >>> drivers/tty/serial/sprd_serial.c | 2 +-
> >>> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
> >>> index b58f51296ace..2774df490899 100644
> >>> --- a/drivers/tty/serial/sprd_serial.c
> >>> +++ b/drivers/tty/serial/sprd_serial.c
> >>> @@ -22,7 +22,7 @@
> >>> #include <linux/tty_flip.h>
> >>>
> >>> /* device name */
> >>> -#define UART_NR_MAX 8
> >>> +#define UART_NR_MAX 12
> >>> #define SPRD_TTY_NAME "ttyS"
> >>> #define SPRD_FIFO_SIZE 128
> >>> #define SPRD_DEF_RATE 26000000
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-08-09 11:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-07 8:07 [PATCH] serial: sprd: Support 12 uart ports Wenhua Lin
2023-08-07 8:41 ` Baolin Wang
2023-08-09 5:52 ` wenhua lin
2023-08-09 6:23 ` Chunyan Zhang
2023-08-09 6:26 ` Baolin Wang
2023-08-09 11:27 ` wenhua lin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox