From patchwork Wed Apr 7 10:45:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 12187745 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF999C433B4 for ; Wed, 7 Apr 2021 10:45:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A69416108B for ; Wed, 7 Apr 2021 10:45:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351375AbhDGKqB (ORCPT ); Wed, 7 Apr 2021 06:46:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:52182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351337AbhDGKp4 (ORCPT ); Wed, 7 Apr 2021 06:45:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B2DAD61359; Wed, 7 Apr 2021 10:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617792346; bh=tuhj7jh5AU83zBF8kyzmCMl/L2g7M5sJe4u25kmtwfE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Oc3+6DQV0+WNooqsfOO5Oof9wpsIZfryhnpcQAcvVpZGq/3yX0bHoQmzowSh18F7Q DbKU5TU54PdFVPRE14ZzekGlT+PWfiNQN3vy03vU1HZv5ez6KVZs8xcJiVQxHgxqUh IpWvWWb2EWjX7FgHUMU+WP/XtgheKXXy0f1S51NYF6ze+gY+b5kkuUkGqVUmBiavXa LsUsUvIO3DMDmQ0NWgJRGPzXU0BcLkFUnFoqnS/l7rk5yMXi1PD2DTiipgJdcvpRfU kgNbnHdThRj/VvwA5kOqLo1DNCngS/9Nnbd+99QqABt1eA+niC4xR8CZk6ShVH5iiT exFX2ggCRj6Fg== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lU5gp-0000Ik-D9; Wed, 07 Apr 2021 12:45:39 +0200 From: Johan Hovold To: Johan Hovold Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] USB: serial: io_ti: drop closing_wait module parameter Date: Wed, 7 Apr 2021 12:45:26 +0200 Message-Id: <20210407104529.1110-2-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210407104529.1110-1-johan@kernel.org> References: <20210407104529.1110-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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 --- 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"); From patchwork Wed Apr 7 10:45:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 12187743 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9352FC433ED for ; Wed, 7 Apr 2021 10:45:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4E97F613B3 for ; Wed, 7 Apr 2021 10:45:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351350AbhDGKp7 (ORCPT ); Wed, 7 Apr 2021 06:45:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:52168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351331AbhDGKp4 (ORCPT ); Wed, 7 Apr 2021 06:45:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AB8C061242; Wed, 7 Apr 2021 10:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617792346; bh=5RpLl+K2zJzuTo57KUNBM+mnePq192jK+8wSyGK2u6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GZiVEOuxtUBWHEYZckzaCPEPhHFuYWnYOW4TGgT3OKXC/H154AQqy/e9Ib6vAOyTp 0qW+SOJIMkjEu5HZE+hZxP2/Z0DiiWxdbBazw9Fjg/jBsyjJ7JHrcIcjMoajW8Y8em +eeZaTtRA+QN65qknjGyK403PYIMKXlboYzhmqRf2wTlXjlTmW50/iXxW+nL0lCPVO 9iO/vCW/pw4uZufZeJKNbSUDy3GYKPUcQSgFfnoz3tA8OPj6jlSGJjKraBDO/uKem2 ShAtxX3BMFMJxq/ADI9+qMWMH2rPrSgDeicPHiihns1pBkOwDchYed1Z0gh6mQPEG2 b9BVF6TKcNmXw== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lU5gp-0000In-FW; Wed, 07 Apr 2021 12:45:39 +0200 From: Johan Hovold To: Johan Hovold Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] USB: serial: io_ti: switch to 30-second closing wait Date: Wed, 7 Apr 2021 12:45:27 +0200 Message-Id: <20210407104529.1110-3-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210407104529.1110-1-johan@kernel.org> References: <20210407104529.1110-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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 --- 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; From patchwork Wed Apr 7 10:45:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 12187749 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9E97C43461 for ; Wed, 7 Apr 2021 10:45:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 88E756108B for ; Wed, 7 Apr 2021 10:45:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351408AbhDGKqF (ORCPT ); Wed, 7 Apr 2021 06:46:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:52188 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351339AbhDGKp4 (ORCPT ); Wed, 7 Apr 2021 06:45:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B760B613A0; Wed, 7 Apr 2021 10:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617792346; bh=TW3dYg3jLvzppmitvf970CQZyFxMpiK3Cl4p/9esRb8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z3YTfKICQ0MdGoI2blKHkqXGSX/7TfgArnk0eJpaZ83M6ibe6NLmaDryAJeBeF5Kt iHQ5FF9QMTTQzir7Anqin5EgJWFpTZ199aSICEOzedwPBZoW7SKrrhXJmsPogNDBTz ncvcdWzdt8vByZja6HMAuGfvJA/joUCWaVgLsMRB6fj+D86k9Cy4p7wCl4BPEOmAqM a6kl7gu74BbRr/UQFUbtySrQzRLMn++gXQ7MzuiEoLg5ps/xqS+VxLeodMCa5GLFY0 G4Wf39eAJPk0HJs+aK6JfiIb5MIvpJE4t6PqJlheMaXYNuJzmy/EMTPgmlRTFR2rnF eahLc2eV3112g== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lU5gp-0000Ip-I2; Wed, 07 Apr 2021 12:45:39 +0200 From: Johan Hovold To: Johan Hovold Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] USB: serial: ti_usb_3410_5052: drop closing_wait module parameter Date: Wed, 7 Apr 2021 12:45:28 +0200 Message-Id: <20210407104529.1110-4-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210407104529.1110-1-johan@kernel.org> References: <20210407104529.1110-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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 --- 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); From patchwork Wed Apr 7 10:45:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 12187751 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F554C433B4 for ; Wed, 7 Apr 2021 10:45:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 017CD6108B for ; Wed, 7 Apr 2021 10:45:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351393AbhDGKqG (ORCPT ); Wed, 7 Apr 2021 06:46:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:52190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351346AbhDGKp4 (ORCPT ); Wed, 7 Apr 2021 06:45:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B96DC613A3; Wed, 7 Apr 2021 10:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617792346; bh=C4a/i1CuhCQyJSi3pONPclFagfGlFG4SMsYuXPQzoCs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rhQ9OHuNQN/hF7NHqI5mlQ/Axu9RK8jSBEEMnJw4WuGkxxD1a17xFieim1EmZ4dzW HJMqoTeQnaLcTf6gbsVOqnhAo1lNsMZ29/Xgzfvl8uaAnWiipBe1G7S3vuMGonph6c vNKjLVWeei4kA4DMp7AW+cuEmfSH1SYt+AlcB8+Sp220NjEmoCNh1UBcrdICqgfpB6 7enZJBd/JZ7NUkeUFvw921MYefT0cjzBOXUO5qE9L/iilLtTsJlf1htlxNyPfeioTC ydeouX2cSS6gE9ZvwNpScUwAOlq9b24Ft48ctnNn+jPPHyBC/BPi0IT37f8pOoryCE SNc59zLTo7Uog== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lU5gp-0000It-K9; Wed, 07 Apr 2021 12:45:39 +0200 From: Johan Hovold To: Johan Hovold Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] USB: serial: ti_usb_3410_5052: switch to 30-second closing wait Date: Wed, 7 Apr 2021 12:45:29 +0200 Message-Id: <20210407104529.1110-5-johan@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210407104529.1110-1-johan@kernel.org> References: <20210407104529.1110-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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 --- 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);