* [PATCH] serial: sh-sci: Fix could not remove dev_attr_rx_fifo_timeout
@ 2018-10-30 6:13 Yoshihiro Shimoda
2018-10-30 7:01 ` Ulrich Hecht
0 siblings, 1 reply; 2+ messages in thread
From: Yoshihiro Shimoda @ 2018-10-30 6:13 UTC (permalink / raw)
To: gregkh, jslaby, linux-serial; +Cc: linux-renesas-soc, stable, Yoshihiro Shimoda
This patch fixes an issue that the sci_remove() could not remove
dev_attr_rx_fifo_timeout because uart_remove_one_port() set
the port->port.type to PORT_UNKNOWN.
Reported-by: Hiromitsu Yamasaki <hiromitsu.yamasaki.ym@renesas.com>
Fixes: 5d23188a473d ("serial: sh-sci: make RX FIFO parameters tunable via sysfs")
Cc: <stable@vger.kernel.org> # v4.11+
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
drivers/tty/serial/sh-sci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index ab3f6e91..3649b83 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -3102,6 +3102,7 @@ static inline int sci_probe_earlyprintk(struct platform_device *pdev)
static int sci_remove(struct platform_device *dev)
{
struct sci_port *port = platform_get_drvdata(dev);
+ unsigned int type = port->port.type; /* uart_remove_... clears it */
sci_ports_in_use &= ~BIT(port->port.line);
uart_remove_one_port(&sci_uart_driver, &port->port);
@@ -3112,8 +3113,7 @@ static int sci_remove(struct platform_device *dev)
sysfs_remove_file(&dev->dev.kobj,
&dev_attr_rx_fifo_trigger.attr);
}
- if (port->port.type == PORT_SCIFA || port->port.type == PORT_SCIFB ||
- port->port.type == PORT_HSCIF) {
+ if (type == PORT_SCIFA || type == PORT_SCIFB || type == PORT_HSCIF) {
sysfs_remove_file(&dev->dev.kobj,
&dev_attr_rx_fifo_timeout.attr);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] serial: sh-sci: Fix could not remove dev_attr_rx_fifo_timeout
2018-10-30 6:13 [PATCH] serial: sh-sci: Fix could not remove dev_attr_rx_fifo_timeout Yoshihiro Shimoda
@ 2018-10-30 7:01 ` Ulrich Hecht
0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Hecht @ 2018-10-30 7:01 UTC (permalink / raw)
To: Yoshihiro Shimoda, gregkh, jslaby, linux-serial; +Cc: linux-renesas-soc, stable
Thanks for your patch!
> On October 30, 2018 at 7:13 AM Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> wrote:
>
>
> This patch fixes an issue that the sci_remove() could not remove
> dev_attr_rx_fifo_timeout because uart_remove_one_port() set
> the port->port.type to PORT_UNKNOWN.
>
> Reported-by: Hiromitsu Yamasaki <hiromitsu.yamasaki.ym@renesas.com>
> Fixes: 5d23188a473d ("serial: sh-sci: make RX FIFO parameters tunable via sysfs")
> Cc: <stable@vger.kernel.org> # v4.11+
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
> drivers/tty/serial/sh-sci.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
> index ab3f6e91..3649b83 100644
> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c
> @@ -3102,6 +3102,7 @@ static inline int sci_probe_earlyprintk(struct platform_device *pdev)
> static int sci_remove(struct platform_device *dev)
> {
> struct sci_port *port = platform_get_drvdata(dev);
> + unsigned int type = port->port.type; /* uart_remove_... clears it */
>
> sci_ports_in_use &= ~BIT(port->port.line);
> uart_remove_one_port(&sci_uart_driver, &port->port);
> @@ -3112,8 +3113,7 @@ static int sci_remove(struct platform_device *dev)
> sysfs_remove_file(&dev->dev.kobj,
> &dev_attr_rx_fifo_trigger.attr);
> }
> - if (port->port.type == PORT_SCIFA || port->port.type == PORT_SCIFB ||
> - port->port.type == PORT_HSCIF) {
> + if (type == PORT_SCIFA || type == PORT_SCIFB || type == PORT_HSCIF) {
> sysfs_remove_file(&dev->dev.kobj,
> &dev_attr_rx_fifo_timeout.attr);
> }
> --
> 1.9.1
>
Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
CU
Uli
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-30 15:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-30 6:13 [PATCH] serial: sh-sci: Fix could not remove dev_attr_rx_fifo_timeout Yoshihiro Shimoda
2018-10-30 7:01 ` Ulrich Hecht
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.