From patchwork Fri Oct 31 16:36:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Brugger X-Patchwork-Id: 5205721 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B3B739F349 for ; Fri, 31 Oct 2014 16:39:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CCE1B2013D for ; Fri, 31 Oct 2014 16:39:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 159E52011D for ; Fri, 31 Oct 2014 16:39:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XkFCV-0001Kx-4S; Fri, 31 Oct 2014 16:37:23 +0000 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XkFCS-0001JQ-88 for linux-arm-kernel@lists.infradead.org; Fri, 31 Oct 2014 16:37:21 +0000 Received: by mail-wi0-f170.google.com with SMTP id q5so1723530wiv.3 for ; Fri, 31 Oct 2014 09:36:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=YK4ua8aof/Ve4VNGuf2aLC/6AG4JHNTMS5Olmhc28wY=; b=CIU3N7QrKKH/daZjU4EzvrjMicJexzCnZIfTVPv37kahCZTW+H1abi+7mEQT9PIAD4 F3TxTB1txLk5D7I3+EGP9rA2RHqt3MfVMsTifKa8fNQiCdYO4IARHfrjZBzldWZyXYVY HvFzDGXzocMIyXuMRVXAFHWRNi0NAOw3VryruxrXrB1NL9C0la16aNFn8xFFCjlC1n/I VdF5YvEvb0EmCw7HHuSV0RvGL0sDgYBeBmf2uxznC8AneqZJSTtJt3sjNx2LaBZKEJvg Xdbx6wedDnmPFSnUDsgEyoqGnBAVDWTANJ//AKXjx3yGm2QyFiHJHFOniP0kJAOaD7Tt Ac7w== X-Received: by 10.194.63.145 with SMTP id g17mr30121389wjs.80.1414773416988; Fri, 31 Oct 2014 09:36:56 -0700 (PDT) Received: from localhost.localdomain (230.Red-2-136-28.dynamicIP.rima-tde.net. [2.136.28.230]) by mx.google.com with ESMTPSA id da3sm12640963wjb.12.2014.10.31.09.36.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 31 Oct 2014 09:36:55 -0700 (PDT) From: Matthias Brugger X-Google-Original-From: Matthias Brugger To: gregkh@linuxfoundation.org Subject: [PATCH RESEND] tty: serial: 8250_mtk: Fix quot calculation Date: Fri, 31 Oct 2014 17:36:35 +0100 Message-Id: <1414773395-9916-1-git-send-email-matthias.brugger@bq.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141031_093720_436230_566FF9DD X-CRM114-Status: GOOD ( 10.43 ) X-Spam-Score: -0.8 (/) Cc: heiko@sntech.de, yingjoe.chen@gmail.com, linux-kernel@vger.kernel.org, ibanezchen@gmail.com, linux-serial@vger.kernel.org, matthias.bgg@gmail.com, jslaby@suse.cz, linux-arm-kernel@lists.infradead.org, alan@linux.intel.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Matthias Brugger The calculation of value quot for highspeed register set to three was wrong. This patch fixes the calculation so that the serial port for baudrates bigger then 576000 baud is working correctly. Signed-off-by: Matthias Brugger --- drivers/tty/serial/8250/8250_mtk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c index 8f37d57..de7aae5 100644 --- a/drivers/tty/serial/8250/8250_mtk.c +++ b/drivers/tty/serial/8250/8250_mtk.c @@ -81,7 +81,7 @@ mtk8250_set_termios(struct uart_port *port, struct ktermios *termios, /* Set to highest baudrate supported */ if (baud >= 1152000) baud = 921600; - quot = DIV_ROUND_CLOSEST(port->uartclk, 256 * baud); + quot = (port->uartclk / (256 * baud)) + 1; } /*