From: "Ivan T. Ivanov" <iivanov@suse.de> To: Stefan Wahren <stefan.wahren@i2se.com> Cc: Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@kernel.org>, Nicolas Saenz Julienne <nsaenz@kernel.org>, Florian Fainelli <f.fainelli@gmail.com>, Ray Jui <rjui@broadcom.com>, Scott Branden <sbranden@broadcom.com>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Phil Elwell <phil@raspberrypi.org>, kernel test robot <lkp@intel.com>, bcm-kernel-feedback-list@broadcom.com, linux-clk@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] clk: bcm2835: Round UART input clock up Date: Mon, 18 Apr 2022 14:05:16 +0300 [thread overview] Message-ID: <20220418110516.s7jxsfa3jl7aagrf@suse> (raw) In-Reply-To: <0b3356c0-b4c8-91ed-dfde-9f50483ec36f@i2se.com> Hi Stefan, On 04-15 10:52, Stefan Wahren wrote: > > Hi Ivan, > > Am 14.04.22 um 12:56 schrieb Ivan T. Ivanov: > > Hi Stefan, > > > > Please, could you take a look into following patch? > yes, but i cannot give a technical review. But from my gut feeling this > doesn't look really elegant to me. > > > > Thanks! > > Ivan > > > > On 04-04 15:51, Ivan T. Ivanov wrote: > > > Subject: [PATCH v2] clk: bcm2835: Round UART input clock up > > > Message-Id: <20220404125113.80239-1-iivanov@suse.de> > > > > > > The UART clock is initialised to be as close to the requested > > > frequency as possible without exceeding it. Now that there is a > > > clock manager that returns the actual frequencies, an expected > > > 48MHz clock is reported as 47999625. If the requested baudrate > > > == requested clock/16, there is no headroom and the slight > > > reduction in actual clock rate results in failure. > > > > > > If increasing a clock by less than 0.1% changes it from ..999.. > > > to ..000.., round it up. > > Based on this commit message this looks like a fix / workaround for an > issue. It would be very helpful to know: > > What issue should be fixed? > > Why is it fixed here and not in the UART driver for instance? The UART driver is amba-pl011. Original fix, see below Github link, was inside pl011 module, but somehow it didn't look as the right place either. Beside that this rounding function is not exactly perfect for all possible clock values. So I deiced to move the hack to the platform which actually need it. > > In case it fixes a regression, a Fixes tag should be necessary. I found the issue because it was reported that RPi3[1] and RPi Zero 2W boards have issues with the Bluetooth. So it turns out that when switching from initial to operation speed host and device no longer can talk each other because host uses incorrect baud rate. I open to better solution of the issue. Thanks, Ivan > > In best case this is explained in the commit message. > > Best regards > > > > > > > This is reworked version of a downstream fix: > > > https://github.com/raspberrypi/linux/commit/ab3f1b39537f6d3825b8873006fbe2fc5ff057b7 > > > [1] https://bugzilla.suse.com/show_bug.cgi?id=1188238
WARNING: multiple messages have this Message-ID (diff)
From: "Ivan T. Ivanov" <iivanov@suse.de> To: Stefan Wahren <stefan.wahren@i2se.com> Cc: Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@kernel.org>, Nicolas Saenz Julienne <nsaenz@kernel.org>, Florian Fainelli <f.fainelli@gmail.com>, Ray Jui <rjui@broadcom.com>, Scott Branden <sbranden@broadcom.com>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Phil Elwell <phil@raspberrypi.org>, kernel test robot <lkp@intel.com>, bcm-kernel-feedback-list@broadcom.com, linux-clk@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] clk: bcm2835: Round UART input clock up Date: Mon, 18 Apr 2022 14:05:16 +0300 [thread overview] Message-ID: <20220418110516.s7jxsfa3jl7aagrf@suse> (raw) In-Reply-To: <0b3356c0-b4c8-91ed-dfde-9f50483ec36f@i2se.com> Hi Stefan, On 04-15 10:52, Stefan Wahren wrote: > > Hi Ivan, > > Am 14.04.22 um 12:56 schrieb Ivan T. Ivanov: > > Hi Stefan, > > > > Please, could you take a look into following patch? > yes, but i cannot give a technical review. But from my gut feeling this > doesn't look really elegant to me. > > > > Thanks! > > Ivan > > > > On 04-04 15:51, Ivan T. Ivanov wrote: > > > Subject: [PATCH v2] clk: bcm2835: Round UART input clock up > > > Message-Id: <20220404125113.80239-1-iivanov@suse.de> > > > > > > The UART clock is initialised to be as close to the requested > > > frequency as possible without exceeding it. Now that there is a > > > clock manager that returns the actual frequencies, an expected > > > 48MHz clock is reported as 47999625. If the requested baudrate > > > == requested clock/16, there is no headroom and the slight > > > reduction in actual clock rate results in failure. > > > > > > If increasing a clock by less than 0.1% changes it from ..999.. > > > to ..000.., round it up. > > Based on this commit message this looks like a fix / workaround for an > issue. It would be very helpful to know: > > What issue should be fixed? > > Why is it fixed here and not in the UART driver for instance? The UART driver is amba-pl011. Original fix, see below Github link, was inside pl011 module, but somehow it didn't look as the right place either. Beside that this rounding function is not exactly perfect for all possible clock values. So I deiced to move the hack to the platform which actually need it. > > In case it fixes a regression, a Fixes tag should be necessary. I found the issue because it was reported that RPi3[1] and RPi Zero 2W boards have issues with the Bluetooth. So it turns out that when switching from initial to operation speed host and device no longer can talk each other because host uses incorrect baud rate. I open to better solution of the issue. Thanks, Ivan > > In best case this is explained in the commit message. > > Best regards > > > > > > > This is reworked version of a downstream fix: > > > https://github.com/raspberrypi/linux/commit/ab3f1b39537f6d3825b8873006fbe2fc5ff057b7 > > > [1] https://bugzilla.suse.com/show_bug.cgi?id=1188238 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-04-18 11:05 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-04 12:51 [PATCH v2] clk: bcm2835: Round UART input clock up Ivan T. Ivanov 2022-04-04 12:51 ` Ivan T. Ivanov 2022-04-04 12:51 ` Ivan T. Ivanov 2022-04-14 10:56 ` Ivan T. Ivanov 2022-04-14 10:56 ` Ivan T. Ivanov 2022-04-14 10:56 ` Ivan T. Ivanov 2022-04-15 8:52 ` Stefan Wahren 2022-04-15 8:52 ` Stefan Wahren 2022-04-18 11:05 ` Ivan T. Ivanov [this message] 2022-04-18 11:05 ` Ivan T. Ivanov 2022-04-18 11:22 ` Stefan Wahren 2022-04-18 11:22 ` Stefan Wahren 2022-04-18 11:38 ` Ivan T. Ivanov 2022-04-18 11:38 ` Ivan T. Ivanov 2022-04-18 16:01 ` Stefan Wahren 2022-04-18 16:01 ` Stefan Wahren 2022-04-19 15:05 ` Ivan T. Ivanov 2022-04-19 15:05 ` Ivan T. Ivanov 2022-04-19 16:11 ` Stefan Wahren 2022-04-19 16:11 ` Stefan Wahren
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=20220418110516.s7jxsfa3jl7aagrf@suse \ --to=iivanov@suse.de \ --cc=aou@eecs.berkeley.edu \ --cc=bcm-kernel-feedback-list@broadcom.com \ --cc=f.fainelli@gmail.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-clk@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-rpi-kernel@lists.infradead.org \ --cc=lkp@intel.com \ --cc=mturquette@baylibre.com \ --cc=nsaenz@kernel.org \ --cc=palmer@dabbelt.com \ --cc=paul.walmsley@sifive.com \ --cc=phil@raspberrypi.org \ --cc=rjui@broadcom.com \ --cc=sboyd@kernel.org \ --cc=sbranden@broadcom.com \ --cc=stefan.wahren@i2se.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: linkBe 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.