2018-12-18 12:22:21

by Michal Simek

[permalink] [raw]
Subject: [PATCH v2 0/4] serial: uartps: Driver updates

Hi,

I am sending 4 patches in series to fix some issues we found.
Patches were sent separately but I have been asked to send them in
serial that's why I am also adding cover letter to explain this v2
version.

Thanks,
Michal

Changes in v2:
- Change description based on request from Greg
- Fix Nava's email address to align with patch email address

Michal Simek (1):
serial: uartps: Fix error path when alloc failed

Nava kishore Manne (1):
serial: uartps: Fix interrupt mask issue to handle the RX interrupts
properly

Shubhrajyoti Datta (2):
serial: uartps: Add the device_init_wakeup
serial: uartps: Check if the device is a console

drivers/tty/serial/xilinx_uartps.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)

--
1.9.1



2018-12-18 12:20:09

by Michal Simek

[permalink] [raw]
Subject: [PATCH v2 3/4] serial: uartps: Fix error path when alloc failed

When cdns_uart_console allocation failed there is a need to also clear
ID from ID list.

Fixes: ae1cca3fa347 ("serial: uartps: Change uart ID port allocation")
Signed-off-by: Michal Simek <[email protected]>
---

Changes in v2: None

drivers/tty/serial/xilinx_uartps.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 9cdc36be5b13..c6d38617d622 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1508,8 +1508,10 @@ static int cdns_uart_probe(struct platform_device *pdev)
#ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE
cdns_uart_console = devm_kzalloc(&pdev->dev, sizeof(*cdns_uart_console),
GFP_KERNEL);
- if (!cdns_uart_console)
- return -ENOMEM;
+ if (!cdns_uart_console) {
+ rc = -ENOMEM;
+ goto err_out_id;
+ }

strncpy(cdns_uart_console->name, CDNS_UART_TTY_NAME,
sizeof(cdns_uart_console->name));
--
1.9.1


2018-12-18 12:20:15

by Michal Simek

[permalink] [raw]
Subject: [PATCH v2 4/4] serial: uartps: Fix interrupt mask issue to handle the RX interrupts properly

From: Nava kishore Manne <[email protected]>

This patch Correct the RX interrupt mask value to handle the
RX interrupts properly.

Fixes: c8dbdc842d30 ("serial: xuartps: Rewrite the interrupt handling logic")
Signed-off-by: Nava kishore Manne <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
---

Changes in v2:
- Fix Nava's email address to align with patch email address

drivers/tty/serial/xilinx_uartps.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index c6d38617d622..094f2958cb2b 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -123,7 +123,7 @@
#define CDNS_UART_IXR_RXTRIG 0x00000001 /* RX FIFO trigger interrupt */
#define CDNS_UART_IXR_RXFULL 0x00000004 /* RX FIFO full interrupt. */
#define CDNS_UART_IXR_RXEMPTY 0x00000002 /* RX FIFO empty interrupt. */
-#define CDNS_UART_IXR_MASK 0x00001FFF /* Valid bit mask */
+#define CDNS_UART_IXR_RXMASK 0x000021e7 /* Valid RX bit mask */

/*
* Do not enable parity error interrupt for the following
@@ -364,7 +364,7 @@ static irqreturn_t cdns_uart_isr(int irq, void *dev_id)
cdns_uart_handle_tx(dev_id);
isrstatus &= ~CDNS_UART_IXR_TXEMPTY;
}
- if (isrstatus & CDNS_UART_IXR_MASK)
+ if (isrstatus & CDNS_UART_IXR_RXMASK)
cdns_uart_handle_rx(dev_id, isrstatus);

spin_unlock(&port->lock);
--
1.9.1


2018-12-18 12:20:24

by Michal Simek

[permalink] [raw]
Subject: [PATCH v2 1/4] serial: uartps: Add the device_init_wakeup

From: Shubhrajyoti Datta <[email protected]>

Initialise the device wakeup.

The device_init_wakeup is needed for the wakeup to work by default.
Uart can be configured as the primary wakeup source so it is good to
enable wakeup by default.

The same functionality is enabled also by 8250_omap, atmel_serial,
omap-serial and stm32-usart.

Signed-off-by: Shubhrajyoti Datta <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
---

Changes in v2:
- Change description based on request from Greg

drivers/tty/serial/xilinx_uartps.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 379242b96790..0140644391df 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1624,6 +1624,7 @@ static int cdns_uart_probe(struct platform_device *pdev)
pm_runtime_set_autosuspend_delay(&pdev->dev, UART_AUTOSUSPEND_TIMEOUT);
pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);
+ device_init_wakeup(port->dev, true);

#ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE
/*
@@ -1702,6 +1703,7 @@ static int cdns_uart_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_dont_use_autosuspend(&pdev->dev);
+ device_init_wakeup(&pdev->dev, false);

#ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE
if (console_port == port)
--
1.9.1


2018-12-18 12:21:45

by Michal Simek

[permalink] [raw]
Subject: [PATCH v2 2/4] serial: uartps: Check if the device is a console

From: Shubhrajyoti Datta <[email protected]>

While checking for console_suspend_enabled also check if the
device is a console.

Signed-off-by: Shubhrajyoti Datta <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
---

Changes in v2: None

drivers/tty/serial/xilinx_uartps.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 0140644391df..9cdc36be5b13 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1255,7 +1255,7 @@ static int cdns_uart_suspend(struct device *device)

may_wake = device_may_wakeup(device);

- if (console_suspend_enabled && may_wake) {
+ if (console_suspend_enabled && uart_console(port) && may_wake) {
unsigned long flags = 0;

spin_lock_irqsave(&port->lock, flags);
@@ -1293,7 +1293,7 @@ static int cdns_uart_resume(struct device *device)

may_wake = device_may_wakeup(device);

- if (console_suspend_enabled && !may_wake) {
+ if (console_suspend_enabled && uart_console(port) && !may_wake) {
clk_enable(cdns_uart->pclk);
clk_enable(cdns_uart->uartclk);

--
1.9.1


2018-12-19 19:22:39

by Maarten Brock

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] serial: uartps: Driver updates

Hello Michal,

On 2018-12-18 13:18, Michal Simek wrote:
> Hi,
>
> I am sending 4 patches in series to fix some issues we found.
> Patches were sent separately but I have been asked to send them in
> serial that's why I am also adding cover letter to explain this v2
> version.
>
> Thanks,
> Michal

I'm wondering why, when reading the linux-serial mailing list, I can
only see this cover letter.
Are you perhaps using a different To/Cc for the actual patches? And if
so, is that on purpose?

Kind regards,
Maarten


2018-12-20 08:26:34

by Michal Simek

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] serial: uartps: Driver updates

Hi,

On 19. 12. 18 19:40, Maarten Brock wrote:
> Hello Michal,
>
> On 2018-12-18 13:18, Michal Simek wrote:
>> Hi,
>>
>> I am sending 4 patches in series to fix some issues we found.
>> Patches were sent separately but I have been asked to send them in
>> serial that's why I am also adding cover letter to explain this v2
>> version.
>>
>> Thanks,
>> Michal
>
> I'm wondering why, when reading the linux-serial mailing list, I can
> only see this cover letter.
> Are you perhaps using a different To/Cc for the actual patches? And if
> so, is that on purpose?
>

I have checked linux-serial mailing list and I see all of them there.
https://www.spinics.net/lists/linux-serial/

Individual here.
https://www.spinics.net/lists/linux-serial/msg32919.html
https://www.spinics.net/lists/linux-serial/msg32916.html
https://www.spinics.net/lists/linux-serial/msg32917.html
https://www.spinics.net/lists/linux-serial/msg32918.html

Also I see linux-serial@ in CC in all emails I have sent.

Thanks,
Michal


2018-12-20 19:22:14

by Maarten Brock

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] serial: uartps: Driver updates

On 2018-12-20 07:52, Michal Simek wrote:
> Hi,
>
> On 19. 12. 18 19:40, Maarten Brock wrote:
>> Hello Michal,
>>
>> On 2018-12-18 13:18, Michal Simek wrote:
>>> Hi,
>>>
>>> I am sending 4 patches in series to fix some issues we found.
>>> Patches were sent separately but I have been asked to send them in
>>> serial that's why I am also adding cover letter to explain this v2
>>> version.
>>>
>>> Thanks,
>>> Michal
>>
>> I'm wondering why, when reading the linux-serial mailing list, I can
>> only see this cover letter.
>> Are you perhaps using a different To/Cc for the actual patches? And if
>> so, is that on purpose?
>>
>
> I have checked linux-serial mailing list and I see all of them there.
> https://www.spinics.net/lists/linux-serial/
>
> Individual here.
> https://www.spinics.net/lists/linux-serial/msg32919.html
> https://www.spinics.net/lists/linux-serial/msg32916.html
> https://www.spinics.net/lists/linux-serial/msg32917.html
> https://www.spinics.net/lists/linux-serial/msg32918.html
>
> Also I see linux-serial@ in CC in all emails I have sent.
>
> Thanks,
> Michal

Thanks, I see them there too. But the odd thing is that I did not
receive
them in my mailbox. And I had noticed this before that I was missing
your
posts following a cover letter.

I normally do receive other peoples patches after a cover letter.

Maarten