2024-02-03 02:21:12

by Tamseel Shams

[permalink] [raw]
Subject: [PATCH 1/2] serial: samsung: honor fifosize from dts at first

Currently for platforms which passes UART fifosize from DT gets
override by local driver structure "s3c24xx_serial_drv_data",
which is not indentded. Change the code to honor fifosize from
device tree at first.

Signed-off-by: Tamseel Shams <[email protected]>
---
drivers/tty/serial/samsung_tty.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index 71d17d804fda..e4c4c9f4f9b0 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -1990,8 +1990,7 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
}

if (np) {
- of_property_read_u32(np,
- "samsung,uart-fifosize", &ourport->port.fifosize);
+ ret = of_property_read_u32(np, "samsung,uart-fifosize", &ourport->port.fifosize);

if (of_property_read_u32(np, "reg-io-width", &prop) == 0) {
switch (prop) {
@@ -2009,10 +2008,13 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
}
}

- if (ourport->drv_data->fifosize[index])
- ourport->port.fifosize = ourport->drv_data->fifosize[index];
- else if (ourport->info->fifosize)
- ourport->port.fifosize = ourport->info->fifosize;
+ if (ret) {
+ if (ourport->drv_data->fifosize[index])
+ ourport->port.fifosize = ourport->drv_data->fifosize[index];
+ else if (ourport->info->fifosize)
+ ourport->port.fifosize = ourport->info->fifosize;
+ }
+
ourport->port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_SAMSUNG_CONSOLE);

/*
--
2.17.1



2024-02-03 02:21:36

by Tamseel Shams

[permalink] [raw]
Subject: [PATCH 2/2] arm64: dts: fsd: Add fifosize for UART in Device Tree

UART in FSD SoC has fifosize of 64 bytes.
Set fifosize as 64 bytes for UART from Device Tree.

Signed-off-by: Tamseel Shams <[email protected]>
---
arch/arm64/boot/dts/tesla/fsd.dtsi | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/tesla/fsd.dtsi b/arch/arm64/boot/dts/tesla/fsd.dtsi
index aaffb50b8b60..047a83cee603 100644
--- a/arch/arm64/boot/dts/tesla/fsd.dtsi
+++ b/arch/arm64/boot/dts/tesla/fsd.dtsi
@@ -601,6 +601,7 @@
clocks = <&clock_peric PERIC_PCLK_UART0>,
<&clock_peric PERIC_SCLK_UART0>;
clock-names = "uart", "clk_uart_baud0";
+ samsung,uart-fifosize = <64>;
status = "disabled";
};

@@ -613,6 +614,7 @@
clocks = <&clock_peric PERIC_PCLK_UART1>,
<&clock_peric PERIC_SCLK_UART1>;
clock-names = "uart", "clk_uart_baud0";
+ samsung,uart-fifosize = <64>;
status = "disabled";
};

--
2.17.1


2024-02-05 07:40:41

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/2] serial: samsung: honor fifosize from dts at first

On 02/02/2024 22:24, Tamseel Shams wrote:
> Currently for platforms which passes UART fifosize from DT gets
> override by local driver structure "s3c24xx_serial_drv_data",
> which is not indentded. Change the code to honor fifosize from
> device tree at first.
>
> Signed-off-by: Tamseel Shams <[email protected]>
> ---
> drivers/tty/serial/samsung_tty.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
> index 71d17d804fda..e4c4c9f4f9b0 100644
> --- a/drivers/tty/serial/samsung_tty.c
> +++ b/drivers/tty/serial/samsung_tty.c
> @@ -1990,8 +1990,7 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
> }
>
> if (np) {
> - of_property_read_u32(np,
> - "samsung,uart-fifosize", &ourport->port.fifosize);
> + ret = of_property_read_u32(np, "samsung,uart-fifosize", &ourport->port.fifosize);
>
> if (of_property_read_u32(np, "reg-io-width", &prop) == 0) {
> switch (prop) {
> @@ -2009,10 +2008,13 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
> }
> }
>
> - if (ourport->drv_data->fifosize[index])
> - ourport->port.fifosize = ourport->drv_data->fifosize[index];
> - else if (ourport->info->fifosize)
> - ourport->port.fifosize = ourport->info->fifosize;

I think ret is not initialized here.



Best regards,
Krzysztof


2024-02-05 07:41:36

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 2/2] arm64: dts: fsd: Add fifosize for UART in Device Tree

On 02/02/2024 22:24, Tamseel Shams wrote:
> UART in FSD SoC has fifosize of 64 bytes.
> Set fifosize as 64 bytes for UART from Device Tree.
>
> Signed-off-by: Tamseel Shams <[email protected]>
> ---
> arch/arm64/boot/dts/tesla/fsd.dtsi | 2 ++

Please split SoC changes from patches sent to serial, so it will be easy
to apply for Greg and others.

Unless you want to say that there is dependency, but there cannot be
such - it would be a NAK.

Best regards,
Krzysztof


2024-02-05 10:31:55

by Tamseel Shams

[permalink] [raw]
Subject: RE: [PATCH 1/2] serial: samsung: honor fifosize from dts at first



> -----Original Message-----
> From: Krzysztof Kozlowski [mailto:[email protected]]
> Sent: 05 February 2024 13:10
> To: Tamseel Shams <[email protected]>; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected]
> Cc: [email protected]; linux-samsung-
> [email protected]; [email protected]; linux-
> [email protected]; [email protected]
> Subject: Re: [PATCH 1/2] serial: samsung: honor fifosize from dts at first
>
> On 02/02/2024 22:24, Tamseel Shams wrote:
> > Currently for platforms which passes UART fifosize from DT gets
> > override by local driver structure "s3c24xx_serial_drv_data", which is
> > not indentded. Change the code to honor fifosize from device tree at
> > first.
> >
> > Signed-off-by: Tamseel Shams <[email protected]>
> > ---
> > drivers/tty/serial/samsung_tty.c | 14 ++++++++------
> > 1 file changed, 8 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/tty/serial/samsung_tty.c
> > b/drivers/tty/serial/samsung_tty.c
> > index 71d17d804fda..e4c4c9f4f9b0 100644
> > --- a/drivers/tty/serial/samsung_tty.c
> > +++ b/drivers/tty/serial/samsung_tty.c
> > @@ -1990,8 +1990,7 @@ static int s3c24xx_serial_probe(struct
> platform_device *pdev)
> > }
> >
> > if (np) {
> > - of_property_read_u32(np,
> > - "samsung,uart-fifosize", &ourport->port.fifosize);
> > + ret = of_property_read_u32(np, "samsung,uart-fifosize",
> > +&ourport->port.fifosize);
> >
> > if (of_property_read_u32(np, "reg-io-width", &prop) == 0) {
> > switch (prop) {
> > @@ -2009,10 +2008,13 @@ static int s3c24xx_serial_probe(struct
> platform_device *pdev)
> > }
> > }
> >
> > - if (ourport->drv_data->fifosize[index])
> > - ourport->port.fifosize = ourport->drv_data->fifosize[index];
> > - else if (ourport->info->fifosize)
> > - ourport->port.fifosize = ourport->info->fifosize;
>
> I think ret is not initialized here.
>
>
Thanks for review. Will fix it in the version.


Thanks & Regards
Tamseel Shams




2024-02-05 10:32:15

by Tamseel Shams

[permalink] [raw]
Subject: RE: [PATCH 2/2] arm64: dts: fsd: Add fifosize for UART in Device Tree



> -----Original Message-----
> From: Krzysztof Kozlowski [mailto:[email protected]]
> Sent: 05 February 2024 13:11
> To: Tamseel Shams <[email protected]>; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected]
> Cc: [email protected]; linux-samsung-
> [email protected]; [email protected]; linux-
> [email protected]; [email protected]
> Subject: Re: [PATCH 2/2] arm64: dts: fsd: Add fifosize for UART in Device Tree
>
> On 02/02/2024 22:24, Tamseel Shams wrote:
> > UART in FSD SoC has fifosize of 64 bytes.
> > Set fifosize as 64 bytes for UART from Device Tree.
> >
> > Signed-off-by: Tamseel Shams <[email protected]>
> > ---
> > arch/arm64/boot/dts/tesla/fsd.dtsi | 2 ++
>
> Please split SoC changes from patches sent to serial, so it will be easy to apply
> for Greg and others.
>
> Unless you want to say that there is dependency, but there cannot be such -
> it would be a NAK.
>
Thanks for review. Will take care of this the next version.

Thanks & Regards,
Tamseel Shams