* [PATCH] serial: uartps: Fix uartps_major handling
@ 2019-09-13 7:28 Michal Simek
2019-10-04 12:52 ` Greg Kroah-Hartman
0 siblings, 1 reply; 3+ messages in thread
From: Michal Simek @ 2019-09-13 7:28 UTC (permalink / raw)
To: linux-kernel, monstr, michal.simek, git, Paul Thomas
Cc: Greg Kroah-Hartman, linux-serial, linux-arm-kernel, Jiri Slaby
There are two parts which should be fixed. The first one is to assigned
uartps_major at the end of probe() to avoid complicated logic when
something fails.
The second part is initialized uartps_major number to 0 when last device is
removed. This will ensure that on next probe driver will ask for new
dynamic major number.
Fixes: c9712e333809 ("serial: uartps: Use the same dynamic major number for all ports")
Reported-by: Paul Thomas <pthomas8589@gmail.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
drivers/tty/serial/xilinx_uartps.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index f145946f659b..92df0c4f1c7a 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1550,7 +1550,6 @@ static int cdns_uart_probe(struct platform_device *pdev)
goto err_out_id;
}
- uartps_major = cdns_uart_uart_driver->tty_driver->major;
cdns_uart_data->cdns_uart_driver = cdns_uart_uart_driver;
/*
@@ -1680,6 +1679,7 @@ static int cdns_uart_probe(struct platform_device *pdev)
console_port = NULL;
#endif
+ uartps_major = cdns_uart_uart_driver->tty_driver->major;
cdns_uart_data->cts_override = of_property_read_bool(pdev->dev.of_node,
"cts-override");
return 0;
@@ -1741,6 +1741,12 @@ static int cdns_uart_remove(struct platform_device *pdev)
console_port = NULL;
#endif
+ /* If this is last instance major number should be initialized */
+ mutex_lock(&bitmap_lock);
+ if (bitmap_empty(bitmap, MAX_UART_INSTANCES))
+ uartps_major = 0;
+ mutex_unlock(&bitmap_lock);
+
uart_unregister_driver(cdns_uart_data->cdns_uart_driver);
return rc;
}
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] serial: uartps: Fix uartps_major handling
2019-09-13 7:28 [PATCH] serial: uartps: Fix uartps_major handling Michal Simek
@ 2019-10-04 12:52 ` Greg Kroah-Hartman
2019-10-04 13:04 ` Michal Simek
0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2019-10-04 12:52 UTC (permalink / raw)
To: Michal Simek
Cc: monstr, Paul Thomas, linux-kernel, git, linux-serial, Jiri Slaby,
linux-arm-kernel
On Fri, Sep 13, 2019 at 09:28:29AM +0200, Michal Simek wrote:
> There are two parts which should be fixed. The first one is to assigned
> uartps_major at the end of probe() to avoid complicated logic when
> something fails.
> The second part is initialized uartps_major number to 0 when last device is
> removed. This will ensure that on next probe driver will ask for new
> dynamic major number.
>
> Fixes: c9712e333809 ("serial: uartps: Use the same dynamic major number for all ports")
This is not a valid sha1 in Linus's tree :(
Please fix up and resend.
thanks,
greg k-h
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] serial: uartps: Fix uartps_major handling
2019-10-04 12:52 ` Greg Kroah-Hartman
@ 2019-10-04 13:04 ` Michal Simek
0 siblings, 0 replies; 3+ messages in thread
From: Michal Simek @ 2019-10-04 13:04 UTC (permalink / raw)
To: Greg Kroah-Hartman, Michal Simek
Cc: monstr, Paul Thomas, linux-kernel, git, linux-serial, Jiri Slaby,
linux-arm-kernel
On 04. 10. 19 14:52, Greg Kroah-Hartman wrote:
> On Fri, Sep 13, 2019 at 09:28:29AM +0200, Michal Simek wrote:
>> There are two parts which should be fixed. The first one is to assigned
>> uartps_major at the end of probe() to avoid complicated logic when
>> something fails.
>> The second part is initialized uartps_major number to 0 when last device is
>> removed. This will ensure that on next probe driver will ask for new
>> dynamic major number.
>>
>> Fixes: c9712e333809 ("serial: uartps: Use the same dynamic major number for all ports")
>
> This is not a valid sha1 in Linus's tree :(
>
> Please fix up and resend.
grr. It is sha1 from stable tree. Will resend.
Thanks,
Michal
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-10-04 13:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-13 7:28 [PATCH] serial: uartps: Fix uartps_major handling Michal Simek
2019-10-04 12:52 ` Greg Kroah-Hartman
2019-10-04 13:04 ` Michal Simek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).