From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6A282C433FE for ; Fri, 30 Sep 2022 21:31:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:To:Cc:From:Subject: References:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bUsGL1SrAPSI6m75gxDT8UaPp5MUKwHdmIKjWX85ee8=; b=5ARQfHtN51V1bK NeTgxQIlw7Z+csrse/O3iw6MIoQoqZeDn2LaIzu+dnHYIh+dV0o4jJ/UAYJfcws+onXZ5vqMx88E4 1drnk5PWJW9/KBe5KdPJaxbmi4PVWTNybdBpYqudadLMXHCMxb0PY6Df5jg/lWT/xiGAr6HX5qaov XwJMpxF3/LmSkv2Lo4FDgOqVRmx500WdKR8tTgHbOM0MT+O5+QYDsNXlADDkElnIWAmEaIGLOqB07 9wTM5E27If3W7bP45H0P0YZX3wWjjv3bNU7dGkI7RTU/WNqKC+1jVX+sF2sgXwOyVM1EYxM2yXMdk pRG6QpXoBQ/ba276Ziig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oeNaG-00BdAX-H3; Fri, 30 Sep 2022 21:30:12 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oeNaC-00Bd8r-KV; Fri, 30 Sep 2022 21:30:10 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1D202B82A3C; Fri, 30 Sep 2022 21:30:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D07A2C433D6; Fri, 30 Sep 2022 21:30:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664573405; bh=XCMjZbcu9ei9D3lgyufXrE16/dqb+//OwrGLmAe8x/4=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=hEvswREeIo+ADotoxLx+d73z05hZP5ctmDAghMObwUQhAvoAdabIETdmwI6/JKopA KfmXRmKAYPPVJl/euTUV1aMFIH5wYS3m2UFbmReKvPXUmxbtm42Y7w9/cCDkc4FciL D6mlrU+8keq43LshKlm61SUVdPd2IBLMJ2iwpYxAOi1f2Mlqwbqe0PLlezxQJ17nnD kb7FAsLtlJD0c5a87IP5sWrMGstmihxQDapA5XXI++bn1lh1dRhHelQlwvbetsv+34 SlmUb34ZagAENYQOKoIiqQisezT3aLJdV6aZ2U0x2mC/L14XxdwxbEaVEvGXT222Oh RwIj8BlAYXevQ== MIME-Version: 1.0 In-Reply-To: <20220912081306.24662-1-iivanov@suse.de> References: <20220912081306.24662-1-iivanov@suse.de> Subject: Re: [PATCH v5] clk: bcm2835: Round UART input clock up From: Stephen Boyd Cc: Phil Elwell , linux-clk@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org To: Broadcom internal kernel review list , Florian Fainelli , Ivan T. Ivanov , Maxime Ripard , Michael Turquette , Nicolas Saenz Julienne , Ray Jui , Scott Branden , Stefan Wahren Date: Fri, 30 Sep 2022 14:30:02 -0700 User-Agent: alot/0.10 Message-Id: <20220930213005.D07A2C433D6@smtp.kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220930_143008_848127_6B46F581 X-CRM114-Status: GOOD ( 14.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Quoting Ivan T. Ivanov (2022-09-12 01:13:04) > It was reported that RPi3[1] and RPi Zero 2W boards have issues with > the Bluetooth. It turns out that when switching from initial to > operation speed host and device no longer can talk each other because > host uses incorrect UART baud rate. > > The UART driver used in this case is amba-pl011. Original fix, see > below Github link[2], was inside pl011 module, but somehow it didn't > look as the right place to fix. Beside that this original 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. > > 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 baud rate > == 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. > > [1] https://bugzilla.suse.com/show_bug.cgi?id=1188238 > [2] https://github.com/raspberrypi/linux/commit/ab3f1b39537f6d3825b8873006fbe2fc5ff057b7 > > Cc: Phil Elwell > Signed-off-by: Ivan T. Ivanov > Reviewed-by: Stefan Wahren > --- Applied to clk-next _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel