From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932692AbcHYEgW (ORCPT ); Thu, 25 Aug 2016 00:36:22 -0400 Received: from mailgw01.mediatek.com ([218.249.47.110]:44913 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754864AbcHYEgU (ORCPT ); Thu, 25 Aug 2016 00:36:20 -0400 Message-ID: <1472094906.19004.2.camel@mhfsdcap03> Subject: Re: [PATCH] serial: 8250_mtk: support big baud rate. From: Long Cheng To: Greg Kroah-Hartman CC: Jiri Slaby , Matthias Brugger , Eddie Huang , Peter Hurley , , , , , Date: Thu, 25 Aug 2016 11:15:06 +0800 In-Reply-To: <1470969671-17235-1-git-send-email-long.cheng@mediatek.com> References: <1470969671-17235-1-git-send-email-long.cheng@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2016-08-12 at 10:41 +0800, Long Cheng wrote: > From: Eddie Huang > > mediatek can support baud rate up to 4M. > the 'uart_get_baud_rate' function will limit the max baud rate. > Modify max baud to remove the limit. > > Signed-off-by: Long Cheng > --- > drivers/tty/serial/8250/8250_mtk.c | 6 +----- > drivers/tty/serial/8250/8250_port.c | 4 +--- > 2 files changed, 2 insertions(+), 8 deletions(-) > > diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c > index 3611ec9..ce0cc47 100644 > --- a/drivers/tty/serial/8250/8250_mtk.c > +++ b/drivers/tty/serial/8250/8250_mtk.c > @@ -62,7 +62,7 @@ mtk8250_set_termios(struct uart_port *port, struct ktermios *termios, > */ > baud = uart_get_baud_rate(port, termios, old, > port->uartclk / 16 / 0xffff, > - port->uartclk / 16); > + port->uartclk); > > if (baud <= 115200) { > serial_port_out(port, UART_MTK_HIGHS, 0x0); > @@ -76,10 +76,6 @@ mtk8250_set_termios(struct uart_port *port, struct ktermios *termios, > quot = DIV_ROUND_UP(port->uartclk, 4 * baud); > } else { > serial_port_out(port, UART_MTK_HIGHS, 0x3); > - > - /* Set to highest baudrate supported */ > - if (baud >= 1152000) > - baud = 921600; > quot = DIV_ROUND_UP(port->uartclk, 256 * baud); > } > > diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c > index 7481b95..c45c1e3 100644 > --- a/drivers/tty/serial/8250/8250_port.c > +++ b/drivers/tty/serial/8250/8250_port.c > @@ -2504,8 +2504,6 @@ static unsigned int serial8250_get_baud_rate(struct uart_port *port, > struct ktermios *termios, > struct ktermios *old) > { > - unsigned int tolerance = port->uartclk / 100; > - > /* > * Ask the core to calculate the divisor for us. > * Allow 1% tolerance at the upper limit so uart clks marginally > @@ -2514,7 +2512,7 @@ static unsigned int serial8250_get_baud_rate(struct uart_port *port, > */ > return uart_get_baud_rate(port, termios, old, > port->uartclk / 16 / 0xffff, > - (port->uartclk + tolerance) / 16); > + port->uartclk); > } > > void Ping? Any reaction to the above? Regards, thanks. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Long Cheng Subject: Re: [PATCH] serial: 8250_mtk: support big baud rate. Date: Thu, 25 Aug 2016 11:15:06 +0800 Message-ID: <1472094906.19004.2.camel@mhfsdcap03> References: <1470969671-17235-1-git-send-email-long.cheng@mediatek.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1470969671-17235-1-git-send-email-long.cheng-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+glpam-linux-mediatek=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: Greg Kroah-Hartman Cc: Peter Hurley , srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Jiri Slaby , Matthias Brugger , Eddie Huang , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: linux-serial@vger.kernel.org On Fri, 2016-08-12 at 10:41 +0800, Long Cheng wrote: > From: Eddie Huang > > mediatek can support baud rate up to 4M. > the 'uart_get_baud_rate' function will limit the max baud rate. > Modify max baud to remove the limit. > > Signed-off-by: Long Cheng > --- > drivers/tty/serial/8250/8250_mtk.c | 6 +----- > drivers/tty/serial/8250/8250_port.c | 4 +--- > 2 files changed, 2 insertions(+), 8 deletions(-) > > diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c > index 3611ec9..ce0cc47 100644 > --- a/drivers/tty/serial/8250/8250_mtk.c > +++ b/drivers/tty/serial/8250/8250_mtk.c > @@ -62,7 +62,7 @@ mtk8250_set_termios(struct uart_port *port, struct ktermios *termios, > */ > baud = uart_get_baud_rate(port, termios, old, > port->uartclk / 16 / 0xffff, > - port->uartclk / 16); > + port->uartclk); > > if (baud <= 115200) { > serial_port_out(port, UART_MTK_HIGHS, 0x0); > @@ -76,10 +76,6 @@ mtk8250_set_termios(struct uart_port *port, struct ktermios *termios, > quot = DIV_ROUND_UP(port->uartclk, 4 * baud); > } else { > serial_port_out(port, UART_MTK_HIGHS, 0x3); > - > - /* Set to highest baudrate supported */ > - if (baud >= 1152000) > - baud = 921600; > quot = DIV_ROUND_UP(port->uartclk, 256 * baud); > } > > diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c > index 7481b95..c45c1e3 100644 > --- a/drivers/tty/serial/8250/8250_port.c > +++ b/drivers/tty/serial/8250/8250_port.c > @@ -2504,8 +2504,6 @@ static unsigned int serial8250_get_baud_rate(struct uart_port *port, > struct ktermios *termios, > struct ktermios *old) > { > - unsigned int tolerance = port->uartclk / 100; > - > /* > * Ask the core to calculate the divisor for us. > * Allow 1% tolerance at the upper limit so uart clks marginally > @@ -2514,7 +2512,7 @@ static unsigned int serial8250_get_baud_rate(struct uart_port *port, > */ > return uart_get_baud_rate(port, termios, old, > port->uartclk / 16 / 0xffff, > - (port->uartclk + tolerance) / 16); > + port->uartclk); > } > > void Ping? Any reaction to the above? Regards, thanks. From mboxrd@z Thu Jan 1 00:00:00 1970 From: long.cheng@mediatek.com (Long Cheng) Date: Thu, 25 Aug 2016 11:15:06 +0800 Subject: [PATCH] serial: 8250_mtk: support big baud rate. In-Reply-To: <1470969671-17235-1-git-send-email-long.cheng@mediatek.com> References: <1470969671-17235-1-git-send-email-long.cheng@mediatek.com> Message-ID: <1472094906.19004.2.camel@mhfsdcap03> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Fri, 2016-08-12 at 10:41 +0800, Long Cheng wrote: > From: Eddie Huang > > mediatek can support baud rate up to 4M. > the 'uart_get_baud_rate' function will limit the max baud rate. > Modify max baud to remove the limit. > > Signed-off-by: Long Cheng > --- > drivers/tty/serial/8250/8250_mtk.c | 6 +----- > drivers/tty/serial/8250/8250_port.c | 4 +--- > 2 files changed, 2 insertions(+), 8 deletions(-) > > diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c > index 3611ec9..ce0cc47 100644 > --- a/drivers/tty/serial/8250/8250_mtk.c > +++ b/drivers/tty/serial/8250/8250_mtk.c > @@ -62,7 +62,7 @@ mtk8250_set_termios(struct uart_port *port, struct ktermios *termios, > */ > baud = uart_get_baud_rate(port, termios, old, > port->uartclk / 16 / 0xffff, > - port->uartclk / 16); > + port->uartclk); > > if (baud <= 115200) { > serial_port_out(port, UART_MTK_HIGHS, 0x0); > @@ -76,10 +76,6 @@ mtk8250_set_termios(struct uart_port *port, struct ktermios *termios, > quot = DIV_ROUND_UP(port->uartclk, 4 * baud); > } else { > serial_port_out(port, UART_MTK_HIGHS, 0x3); > - > - /* Set to highest baudrate supported */ > - if (baud >= 1152000) > - baud = 921600; > quot = DIV_ROUND_UP(port->uartclk, 256 * baud); > } > > diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c > index 7481b95..c45c1e3 100644 > --- a/drivers/tty/serial/8250/8250_port.c > +++ b/drivers/tty/serial/8250/8250_port.c > @@ -2504,8 +2504,6 @@ static unsigned int serial8250_get_baud_rate(struct uart_port *port, > struct ktermios *termios, > struct ktermios *old) > { > - unsigned int tolerance = port->uartclk / 100; > - > /* > * Ask the core to calculate the divisor for us. > * Allow 1% tolerance at the upper limit so uart clks marginally > @@ -2514,7 +2512,7 @@ static unsigned int serial8250_get_baud_rate(struct uart_port *port, > */ > return uart_get_baud_rate(port, termios, old, > port->uartclk / 16 / 0xffff, > - (port->uartclk + tolerance) / 16); > + port->uartclk); > } > > void Ping? Any reaction to the above? Regards, thanks.