linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] USB: serial: closing-wait cleanups
@ 2021-04-07 10:45 Johan Hovold
  2021-04-07 10:45 ` [PATCH 1/4] USB: serial: io_ti: drop closing_wait module parameter Johan Hovold
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Johan Hovold @ 2021-04-07 10:45 UTC (permalink / raw)
  To: Johan Hovold; +Cc: linux-usb, linux-kernel

Now that all USB serial drivers supports changing the closing_wait
parameter through TIOCSSERIAL (setserial), we can remove the related
driver-specific module parameters and settings.

These depend on the recently posted TIOCSSERIAL series.

Johan


Johan Hovold (4):
  USB: serial: io_ti: drop closing_wait module parameter
  USB: serial: io_ti: switch to 30-second closing wait
  USB: serial: ti_usb_3410_5052: drop closing_wait module parameter
  USB: serial: ti_usb_3410_5052: switch to 30-second closing wait

 drivers/usb/serial/io_ti.c            | 7 -------
 drivers/usb/serial/ti_usb_3410_5052.c | 9 ---------
 2 files changed, 16 deletions(-)

-- 
2.26.3


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] USB: serial: io_ti: drop closing_wait module parameter
  2021-04-07 10:45 [PATCH 0/4] USB: serial: closing-wait cleanups Johan Hovold
@ 2021-04-07 10:45 ` Johan Hovold
  2021-04-07 10:45 ` [PATCH 2/4] USB: serial: io_ti: switch to 30-second closing wait Johan Hovold
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Johan Hovold @ 2021-04-07 10:45 UTC (permalink / raw)
  To: Johan Hovold; +Cc: linux-usb, linux-kernel

Now that all USB serial drivers supports setting the closing_wait
parameter through TIOCSSERIAL (setserial) it's time to drop the
corresponding io_ti module parameter.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/usb/serial/io_ti.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index f548cdbf0a51..6eff0e5a7545 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -211,7 +211,6 @@ static const struct usb_device_id id_table_combined[] = {
 
 MODULE_DEVICE_TABLE(usb, id_table_combined);
 
-static int closing_wait = EDGE_CLOSING_WAIT;
 static bool ignore_cpu_rev;
 static int default_uart_mode;		/* RS232 */
 
@@ -2593,7 +2592,7 @@ static int edge_port_probe(struct usb_serial_port *port)
 	if (ret)
 		goto err;
 
-	port->port.closing_wait = msecs_to_jiffies(closing_wait * 10);
+	port->port.closing_wait = msecs_to_jiffies(EDGE_CLOSING_WAIT * 10);
 	port->port.drain_delay = 1;
 
 	return 0;
@@ -2759,9 +2758,6 @@ MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 MODULE_FIRMWARE("edgeport/down3.bin");
 
-module_param(closing_wait, int, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(closing_wait, "Maximum wait for data to drain, in .01 secs");
-
 module_param(ignore_cpu_rev, bool, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(ignore_cpu_rev,
 			"Ignore the cpu revision when connecting to a device");
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] USB: serial: io_ti: switch to 30-second closing wait
  2021-04-07 10:45 [PATCH 0/4] USB: serial: closing-wait cleanups Johan Hovold
  2021-04-07 10:45 ` [PATCH 1/4] USB: serial: io_ti: drop closing_wait module parameter Johan Hovold
@ 2021-04-07 10:45 ` Johan Hovold
  2021-04-07 10:45 ` [PATCH 3/4] USB: serial: ti_usb_3410_5052: drop closing_wait module parameter Johan Hovold
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Johan Hovold @ 2021-04-07 10:45 UTC (permalink / raw)
  To: Johan Hovold; +Cc: linux-usb, linux-kernel

Switch to using the system-wide default 30-second closing-wait timeout
instead of the driver specific 40-second timeout.

The timeout can be changed per port using TIOCSSERIAL (setserial) if
needed.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/usb/serial/io_ti.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 6eff0e5a7545..75325c2b295e 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -60,8 +60,6 @@
 #define EDGE_READ_URB_STOPPING	1
 #define EDGE_READ_URB_STOPPED	2
 
-#define EDGE_CLOSING_WAIT	4000	/* in .01 sec */
-
 
 /* Product information read from the Edgeport */
 struct product_info {
@@ -2592,7 +2590,6 @@ static int edge_port_probe(struct usb_serial_port *port)
 	if (ret)
 		goto err;
 
-	port->port.closing_wait = msecs_to_jiffies(EDGE_CLOSING_WAIT * 10);
 	port->port.drain_delay = 1;
 
 	return 0;
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] USB: serial: ti_usb_3410_5052: drop closing_wait module parameter
  2021-04-07 10:45 [PATCH 0/4] USB: serial: closing-wait cleanups Johan Hovold
  2021-04-07 10:45 ` [PATCH 1/4] USB: serial: io_ti: drop closing_wait module parameter Johan Hovold
  2021-04-07 10:45 ` [PATCH 2/4] USB: serial: io_ti: switch to 30-second closing wait Johan Hovold
@ 2021-04-07 10:45 ` Johan Hovold
  2021-04-07 10:45 ` [PATCH 4/4] USB: serial: ti_usb_3410_5052: switch to 30-second closing wait Johan Hovold
  2021-04-07 15:24 ` [PATCH 0/4] USB: serial: closing-wait cleanups Greg KH
  4 siblings, 0 replies; 7+ messages in thread
From: Johan Hovold @ 2021-04-07 10:45 UTC (permalink / raw)
  To: Johan Hovold; +Cc: linux-usb, linux-kernel

The ti_usb_3410_5052 has supported changing the closing_wait parameter
through TIOCSSERIAL (setserial) for about a decade and commit
f1175daa5312 ("USB: ti_usb_3410_5052: kill custom closing_wait").

It's time to drop the corresponding driver-specific module parameter.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/usb/serial/ti_usb_3410_5052.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index c312d0cce5fb..35cc1be738ef 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -344,8 +344,6 @@ static int ti_write_byte(struct usb_serial_port *port, struct ti_device *tdev,
 
 static int ti_download_firmware(struct ti_device *tdev);
 
-static int closing_wait = TI_DEFAULT_CLOSING_WAIT;
-
 static const struct usb_device_id ti_id_table_3410[] = {
 	{ USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) },
 	{ USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) },
@@ -497,10 +495,6 @@ MODULE_FIRMWARE("moxa/moxa-1131.fw");
 MODULE_FIRMWARE("moxa/moxa-1150.fw");
 MODULE_FIRMWARE("moxa/moxa-1151.fw");
 
-module_param(closing_wait, int, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(closing_wait,
-    "Maximum wait for data to drain in close, in .01 secs, default is 4000");
-
 MODULE_DEVICE_TABLE(usb, ti_id_table_combined);
 
 module_usb_serial_driver(serial_drivers, ti_id_table_combined);
@@ -608,7 +602,7 @@ static int ti_port_probe(struct usb_serial_port *port)
 		tport->tp_uart_base_addr = TI_UART1_BASE_ADDR;
 	else
 		tport->tp_uart_base_addr = TI_UART2_BASE_ADDR;
-	port->port.closing_wait = msecs_to_jiffies(10 * closing_wait);
+	port->port.closing_wait = msecs_to_jiffies(10 * TI_DEFAULT_CLOSING_WAIT);
 	tport->tp_port = port;
 	tport->tp_tdev = usb_get_serial_data(port->serial);
 
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] USB: serial: ti_usb_3410_5052: switch to 30-second closing wait
  2021-04-07 10:45 [PATCH 0/4] USB: serial: closing-wait cleanups Johan Hovold
                   ` (2 preceding siblings ...)
  2021-04-07 10:45 ` [PATCH 3/4] USB: serial: ti_usb_3410_5052: drop closing_wait module parameter Johan Hovold
@ 2021-04-07 10:45 ` Johan Hovold
  2021-04-07 15:24 ` [PATCH 0/4] USB: serial: closing-wait cleanups Greg KH
  4 siblings, 0 replies; 7+ messages in thread
From: Johan Hovold @ 2021-04-07 10:45 UTC (permalink / raw)
  To: Johan Hovold; +Cc: linux-usb, linux-kernel

Switch to using the system-wide default 30-second closing-wait timeout
instead of the driver specific 40-second timeout.

The timeout can be changed per port using TIOCSSERIAL (setserial) if
needed.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/usb/serial/ti_usb_3410_5052.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index 35cc1be738ef..03839289d6c0 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -270,8 +270,6 @@ struct ti_firmware_header {
 
 #define TI_TRANSFER_TIMEOUT	2
 
-#define TI_DEFAULT_CLOSING_WAIT	4000		/* in .01 secs */
-
 /* read urb states */
 #define TI_READ_URB_RUNNING	0
 #define TI_READ_URB_STOPPING	1
@@ -602,7 +600,6 @@ static int ti_port_probe(struct usb_serial_port *port)
 		tport->tp_uart_base_addr = TI_UART1_BASE_ADDR;
 	else
 		tport->tp_uart_base_addr = TI_UART2_BASE_ADDR;
-	port->port.closing_wait = msecs_to_jiffies(10 * TI_DEFAULT_CLOSING_WAIT);
 	tport->tp_port = port;
 	tport->tp_tdev = usb_get_serial_data(port->serial);
 
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] USB: serial: closing-wait cleanups
  2021-04-07 10:45 [PATCH 0/4] USB: serial: closing-wait cleanups Johan Hovold
                   ` (3 preceding siblings ...)
  2021-04-07 10:45 ` [PATCH 4/4] USB: serial: ti_usb_3410_5052: switch to 30-second closing wait Johan Hovold
@ 2021-04-07 15:24 ` Greg KH
  2021-04-08  8:00   ` Johan Hovold
  4 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2021-04-07 15:24 UTC (permalink / raw)
  To: Johan Hovold; +Cc: linux-usb, linux-kernel

On Wed, Apr 07, 2021 at 12:45:25PM +0200, Johan Hovold wrote:
> Now that all USB serial drivers supports changing the closing_wait
> parameter through TIOCSSERIAL (setserial), we can remove the related
> driver-specific module parameters and settings.
> 
> These depend on the recently posted TIOCSSERIAL series.

Yes!  Getting rid of the module parameter is so good...

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] USB: serial: closing-wait cleanups
  2021-04-07 15:24 ` [PATCH 0/4] USB: serial: closing-wait cleanups Greg KH
@ 2021-04-08  8:00   ` Johan Hovold
  0 siblings, 0 replies; 7+ messages in thread
From: Johan Hovold @ 2021-04-08  8:00 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-usb, linux-kernel

On Wed, Apr 07, 2021 at 05:24:52PM +0200, Greg Kroah-Hartman wrote:
> On Wed, Apr 07, 2021 at 12:45:25PM +0200, Johan Hovold wrote:
> > Now that all USB serial drivers supports changing the closing_wait
> > parameter through TIOCSSERIAL (setserial), we can remove the related
> > driver-specific module parameters and settings.
> > 
> > These depend on the recently posted TIOCSSERIAL series.
> 
> Yes!  Getting rid of the module parameter is so good...
> 
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Thanks for reviewing these. All three sets now applied.

Johan

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-04-08  8:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07 10:45 [PATCH 0/4] USB: serial: closing-wait cleanups Johan Hovold
2021-04-07 10:45 ` [PATCH 1/4] USB: serial: io_ti: drop closing_wait module parameter Johan Hovold
2021-04-07 10:45 ` [PATCH 2/4] USB: serial: io_ti: switch to 30-second closing wait Johan Hovold
2021-04-07 10:45 ` [PATCH 3/4] USB: serial: ti_usb_3410_5052: drop closing_wait module parameter Johan Hovold
2021-04-07 10:45 ` [PATCH 4/4] USB: serial: ti_usb_3410_5052: switch to 30-second closing wait Johan Hovold
2021-04-07 15:24 ` [PATCH 0/4] USB: serial: closing-wait cleanups Greg KH
2021-04-08  8:00   ` Johan Hovold

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).