All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Daniel Winkler <danielwinkler@google.com>,
	Serge Semin <fancer.lancer@gmail.com>,
	linux-serial@vger.kernel.org, linux-mediatek@lists.infradead.org,
	Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
	BlueZ <linux-bluetooth@vger.kernel.org>,
	chromeos-bluetooth-upstreaming 
	<chromeos-bluetooth-upstreaming@chromium.org>,
	stable@vger.kernel.org, abhishekpandit@chromium.org,
	Aaron Sierra <asierra@xes-inc.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Jiri Slaby <jslaby@suse.com>, Lukas Wunner <lukas@wunner.de>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 0/1] Revert "serial: 8250: Fix max baud limit in generic 8250 port"
Date: Thu, 2 Jul 2020 09:37:20 +0200	[thread overview]
Message-ID: <20200702073720.GE1073011@kroah.com> (raw)
In-Reply-To: <20200701223713.gavale4aramu3xnb@mobilestation>

On Thu, Jul 02, 2020 at 01:37:13AM +0300, Serge Semin wrote:
> On Wed, Jul 01, 2020 at 02:13:36PM -0700, Daniel Winkler wrote:
> > 
> > This change regresses the QCA6174A-3 bluetooth chip, preventing
> > firmware from being properly loaded. Without this change, the
> > chip works as intended.
> > 
> > The device is the Kukui Chromebook using the Mediatek chipset
> > and the 8250_mtk uart. Initial controller baudrate is 115200
> > and operating speed is 3000000. Our entire suite of bluetooth
> > tests now fail on this platform due to an apparent failure to
> > sync its firmware on initialization.
> 
> Ok. It's mediatek 8250 driver, which is responsible for the failure.
> Then we'll have two options:
> 
> 1) Add a new capability like UART_CAP_NO16DIV and take it into account
>    in the serial8250_get_baud_rate() method.
>  
> I don't have a documentation for the Mediatek UART port, but it seems to me
> that that controller calculates the baud rate differently from the standard
> 8250 port. A standard 8250 port does that by the next formulae:
>   baud = uartclk / (16 * divisor).
> While it seems to me that the Mediatek port uses the formulae like:
>   baud = uartclk / divisor. (Please, correct me if I'm wrong)
> If so, then we could introduce a new capability like UART_CAP_NO16DIV. The
> 8250_mtk driver will add it to the 8250-port capabilities field. The
> serial8250_get_baud_rate() method should be altered in a way so one would check
> whether the UART_CAP_NO16DIV flag is set and if it is then the
> uart_get_baud_rate() function will be called without uartclk normalized by the
> factor of 16.
> 
> 2) Manually call serial8250_do_set_divisor() in the custom set_termios()
>    callback.
> 
> Just add the uart_update_timeout() and serial8250_do_set_divisor() methods
> invocation into the mtk8250_set_termios() function, which the original commit
> 81bb549fdf14 ("serial: 8250_mtk: support big baud rate") author should have
> done in the first place.

Sounds like a sane fix, thanks for looking into this.

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: chromeos-bluetooth-upstreaming
	<chromeos-bluetooth-upstreaming@chromium.org>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Jiri Slaby <jslaby@suse.com>,
	linux-kernel@vger.kernel.org,
	Serge Semin <fancer.lancer@gmail.com>,
	Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,
	BlueZ <linux-bluetooth@vger.kernel.org>,
	Lukas Wunner <lukas@wunner.de>,
	linux-mediatek@lists.infradead.org, stable@vger.kernel.org,
	linux-serial@vger.kernel.org,
	Daniel Winkler <danielwinkler@google.com>,
	abhishekpandit@chromium.org, Aaron Sierra <asierra@xes-inc.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH v2 0/1] Revert "serial: 8250: Fix max baud limit in generic 8250 port"
Date: Thu, 2 Jul 2020 09:37:20 +0200	[thread overview]
Message-ID: <20200702073720.GE1073011@kroah.com> (raw)
In-Reply-To: <20200701223713.gavale4aramu3xnb@mobilestation>

On Thu, Jul 02, 2020 at 01:37:13AM +0300, Serge Semin wrote:
> On Wed, Jul 01, 2020 at 02:13:36PM -0700, Daniel Winkler wrote:
> > 
> > This change regresses the QCA6174A-3 bluetooth chip, preventing
> > firmware from being properly loaded. Without this change, the
> > chip works as intended.
> > 
> > The device is the Kukui Chromebook using the Mediatek chipset
> > and the 8250_mtk uart. Initial controller baudrate is 115200
> > and operating speed is 3000000. Our entire suite of bluetooth
> > tests now fail on this platform due to an apparent failure to
> > sync its firmware on initialization.
> 
> Ok. It's mediatek 8250 driver, which is responsible for the failure.
> Then we'll have two options:
> 
> 1) Add a new capability like UART_CAP_NO16DIV and take it into account
>    in the serial8250_get_baud_rate() method.
>  
> I don't have a documentation for the Mediatek UART port, but it seems to me
> that that controller calculates the baud rate differently from the standard
> 8250 port. A standard 8250 port does that by the next formulae:
>   baud = uartclk / (16 * divisor).
> While it seems to me that the Mediatek port uses the formulae like:
>   baud = uartclk / divisor. (Please, correct me if I'm wrong)
> If so, then we could introduce a new capability like UART_CAP_NO16DIV. The
> 8250_mtk driver will add it to the 8250-port capabilities field. The
> serial8250_get_baud_rate() method should be altered in a way so one would check
> whether the UART_CAP_NO16DIV flag is set and if it is then the
> uart_get_baud_rate() function will be called without uartclk normalized by the
> factor of 16.
> 
> 2) Manually call serial8250_do_set_divisor() in the custom set_termios()
>    callback.
> 
> Just add the uart_update_timeout() and serial8250_do_set_divisor() methods
> invocation into the mtk8250_set_termios() function, which the original commit
> 81bb549fdf14 ("serial: 8250_mtk: support big baud rate") author should have
> done in the first place.

Sounds like a sane fix, thanks for looking into this.

greg k-h

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

  parent reply	other threads:[~2020-07-02  7:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01 21:13 [PATCH v2 0/1] Revert "serial: 8250: Fix max baud limit in generic 8250 port" Daniel Winkler
2020-07-01 21:13 ` Daniel Winkler
2020-07-01 21:13 ` [PATCH v2 1/1] " Daniel Winkler
2020-07-01 21:13   ` Daniel Winkler
2020-07-02  7:36   ` Greg Kroah-Hartman
2020-07-02  7:36     ` Greg Kroah-Hartman
2020-07-01 22:37 ` [PATCH v2 0/1] " Serge Semin
2020-07-01 22:37   ` Serge Semin
2020-07-02  4:11   ` Lukas Wunner
2020-07-02  8:46     ` Andy Shevchenko
2020-07-02  8:46       ` Andy Shevchenko
2020-07-02  7:37   ` Greg Kroah-Hartman [this message]
2020-07-02  7:37     ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200702073720.GE1073011@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Alexey.Malahov@baikalelectronics.ru \
    --cc=Sergey.Semin@baikalelectronics.ru \
    --cc=abhishekpandit@chromium.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=asierra@xes-inc.com \
    --cc=chromeos-bluetooth-upstreaming@chromium.org \
    --cc=danielwinkler@google.com \
    --cc=fancer.lancer@gmail.com \
    --cc=jslaby@suse.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=stable@vger.kernel.org \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.