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 3940DC433EF for ; Mon, 18 Apr 2022 11:24:11 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=De1ZC5kRdwKiFTAASPcQrI0MbVkHe8WVdEHCRmUNj2M=; b=myfqWbfkKdrAYw YgEnWm7Y4Wxt5gWtPKPFAccYEkrn53dIEkALYbmxQNUDOqsXJocxi4HHt+vP7QnFMsFc5FCXRe4n7 S8xDpA9UZeEayguZEfOe+tOhqELbdLAHg6KCjQLHDBbMUOjK0Bicc7PCLdozAnMR0sb0/Ua37otDp iwOUnK5kb9pCaakPCvQFXlURtIUHwR4uNKTN2o6nFi+s8ITgVxcviOv2/fJWqycZ5OVzGvebnoB3Y T3sqfIyizKYGqWezbaLeu47+um5B6NgfIk3TqCpgyEpDdhYUDXhRo5NIK+R7GQ+05ZOszm137NlqY +Evycyn7J317bCI8APbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngPTH-00GRzh-DJ; Mon, 18 Apr 2022 11:23:07 +0000 Received: from mout.kundenserver.de ([212.227.126.133]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngPTD-00GRxK-Cb; Mon, 18 Apr 2022 11:23:05 +0000 Received: from [192.168.1.107] ([37.4.249.94]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MLzeb-1nOT6l1oQr-00Ht6j; Mon, 18 Apr 2022 13:22:46 +0200 Message-ID: <2a46bd1c-600b-5bd9-1c19-20c809f63945@i2se.com> Date: Mon, 18 Apr 2022 13:22:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v2] clk: bcm2835: Round UART input clock up Content-Language: en-US To: "Ivan T. Ivanov" Cc: Michael Turquette , Stephen Boyd , Nicolas Saenz Julienne , Florian Fainelli , Ray Jui , Scott Branden , Paul Walmsley , Palmer Dabbelt , Albert Ou , Phil Elwell , kernel test robot , 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 References: <20220404125113.80239-1-iivanov@suse.de> <20220414105656.qt52zmr5vjmjdcxc@suse> <0b3356c0-b4c8-91ed-dfde-9f50483ec36f@i2se.com> <20220418110516.s7jxsfa3jl7aagrf@suse> From: Stefan Wahren In-Reply-To: <20220418110516.s7jxsfa3jl7aagrf@suse> X-Provags-ID: V03:K1:XYHshlfjxi+RT/GL4GmBwzdxbmRf+BCvlC8OzxwcZuYRIC3lBQI mqxuml29UVfMGYn6W49CXof5Dy+d+X8yYAdj1vsVJw6PzIrl7O5u3gmyl06mPy/llHJS7eY 59Gg+i1kQsezcVP+mkiupAHXyZXw+hBN8/WtDX2jIhQesj7wUAHu43okpBuIC5yaNbs40na 4bQn7ELtf4LMsB/w/8pHw== X-UI-Out-Filterresults: notjunk:1;V03:K0:ysIhcjiCcPc=:lecKA5TUn4TZ3C8GYV0yat vpXwBLtY3lN4fhUwDTe5Gtw/OgXHG0nKqHqoJ113yjQ8URE88OwxfLXs9NuvQZZyEefEmQqMG byMIZWja/Zitw8pvlKLrI/f/AV77Mb9bAizaH/dLAp91Guh8gf6iTjUp0Oz7VcXRdPz4AZQwr XBMQTQRgsoevUofrlnbKZjkrM/Dg0LbDA8aWSpe3aKAKAM1vNJZE6QYTgkWQquCf8z+A5xSru twf2L4X3C4KeboWyAmmYWFungkBbSWaZQBTVB8QyBjYYgaTzxOBfZROGOZ1vbsJfUqqnG2eva cCODw+RgzCoyFPsYL7SjofaK0H9CPi3xAR3YHOsFwyv53+mkYU/L9W1Y1LYLVG74AlzeVCinM GEDEhPdsdrY4AGgGOQiTzoCuGHFdMdc4UQlI8kguLwLOiSxrubY+Q5VboK8/LJ0GxGF9++q31 n2FBcT3w4jgeOPpGVVaaDylH4uiv92fg8exRtq1ZcuZTJJKhy0gipc3GhgECauvMri1SgYClg 8pIoTfhPWiCEsSuzbICKI9F/P5TUZgELb0ul4vcyGtkp2l+o8Wf+OngI1PRQyPXvV0IZGAURe AShmR+5hr2zfWIbpESZjGMvbdh5e1tH6PIsWs7Lf5OV0C5SFoBwyBqT+Y9O0gbWQTNgA1ZgEo 8O/P1kpsRbXC9IPXZQpNrzf9NrHgmF6FWbcC5l9fl4JIIfeyxyqB4pVQt1lyokK/Gk6MngVND lOkESWV/9nQE/Xqg X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220418_042303_783159_C47A62C4 X-CRM114-Status: GOOD ( 23.81 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Ivan, Am 18.04.22 um 13:05 schrieb Ivan T. Ivanov: > 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. thanks for your explanation. These are import information which belongs in the commit log, because the motivation and the affected UART is very important. > >> 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. Now i remember this issue, for the mainline kernel we decide to workaround the issue by lowering the BT baudrate to 2000000 baud. I didn't investigate the issue further, but your approach is a better solution. Do you use the mainline DTS or the vendor DTS to see this issue? Best regards > 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