From patchwork Thu Apr 26 05:50:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 904863 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Wmn256mmz9s0R for ; Thu, 26 Apr 2018 16:07:18 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="vS6I6BsG"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40Wmn23L8wzF24s for ; Thu, 26 Apr 2018 16:07:18 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="vS6I6BsG"; dkim-atps=neutral X-Original-To: linux-aspeed@lists.ozlabs.org Delivered-To: linux-aspeed@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=oracle.com (client-ip=141.146.126.79; helo=aserp2130.oracle.com; envelope-from=dan.carpenter@oracle.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="vS6I6BsG"; dkim-atps=neutral Received: from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40WmQw4m7vzF24Y for ; Thu, 26 Apr 2018 15:51:30 +1000 (AEST) Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3Q5pElr178066; Thu, 26 Apr 2018 05:51:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=QYr5kXnSWwW0lgAAooKeVnBNn/f5fgUJDUIDtatNYmk=; b=vS6I6BsGFyrU1TjitCc1ga5RVvaJKFziRD8XBCNNHOTk46Q1uoz+s5ExGW3Kx4EPM4hb aGvjjzlbOKEZnl37x0wh+dUqGbiAORiO0RpLIxf1m/e1q5NgWEdFzmu0TMVA4TT+wm6O gRYsTaxQ5Q/Imo2nJgVXGL1SorUgVzlvSr/uqpqUtE0Cb5MXtFF8Lo9gVdexWsxlSZIQ HMsmiEGpEiDQI+8kOpo97difFDdj9S73v/OTtT43oegyFVBJe6fBy02ZyiT/+OLdXWiH LyNEfWqGglCJM3jHRizFxNL0ptwRh0ZJTRr3+3Y8UuTYrFP1xOnRHAnnrvHUjN6w/pTL rg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2hftty9nmv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Apr 2018 05:51:14 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w3Q5pCWc018477 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Apr 2018 05:51:12 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w3Q5p9vL027470; Thu, 26 Apr 2018 05:51:10 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 25 Apr 2018 22:51:09 -0700 Date: Thu, 26 Apr 2018 08:50:55 +0300 From: Dan Carpenter To: Greg Kroah-Hartman , Jeremy Kerr Subject: [PATCH] serial/aspeed-vuart: fix a couple mod_timer() calls Message-ID: <20180426055055.GA9742@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8874 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804260056 X-Mailman-Approved-At: Thu, 26 Apr 2018 16:07:15 +1000 X-BeenThere: linux-aspeed@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux ASPEED SoC development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , linux-aspeed@lists.ozlabs.org, kernel-janitors@vger.kernel.org, linux-serial@vger.kernel.org, Jiri Slaby , Alexey Khoroshilov Errors-To: linux-aspeed-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linux-aspeed" The "unthrottle_timeout" is HZ/10 but mod_timer() takes a the actual jiffie where you want it to timeout, not an offset. Fixes: 5909c0bf9c7a ("serial/aspeed-vuart: Implement quick throttle mechanism") Signed-off-by: Dan Carpenter Acked-by: Jeremy Kerr diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c b/drivers/tty/serial/8250/8250_aspeed_vuart.c index 023db3266757..435bec40dee6 100644 --- a/drivers/tty/serial/8250/8250_aspeed_vuart.c +++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c @@ -226,7 +226,8 @@ static void aspeed_vuart_unthrottle_exp(struct timer_list *timer) struct uart_8250_port *up = vuart->port; if (!tty_buffer_space_avail(&up->port.state->port)) { - mod_timer(&vuart->unthrottle_timer, unthrottle_timeout); + mod_timer(&vuart->unthrottle_timer, + jiffies + unthrottle_timeout); return; } @@ -271,7 +272,7 @@ static int aspeed_vuart_handle_irq(struct uart_port *port) if (!timer_pending(&vuart->unthrottle_timer)) { vuart->port = up; mod_timer(&vuart->unthrottle_timer, - unthrottle_timeout); + jiffies + unthrottle_timeout); } } else {