Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3662448pxb; Tue, 19 Apr 2022 07:29:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWPwK+1bbX/f8l75OUgTWuPd7QRocFQPcka0A5DWOST1ghs65FRwpbBNHp5KqS+Z4ktuPW X-Received: by 2002:a17:90b:124c:b0:1bc:369b:7db5 with SMTP id gx12-20020a17090b124c00b001bc369b7db5mr24229442pjb.179.1650378569632; Tue, 19 Apr 2022 07:29:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650378569; cv=none; d=google.com; s=arc-20160816; b=hGaDCvaKwCJQArlLzxNuhNVnN/eIyPa46GdyHkfbANZ/BB14AEJrKi9KekjoYCbDxJ q7yiHz9iXhfpkv0KmDW6z5SY0Tj6fPMvBbDuomGq1FCHrnCxPqxmIYZtuXWrXq0kbn3V jlH3IFhqw9mrxuL/3NVg4cLarVe84UbVpHyaWsFwloNpwAieb6CC5Pfeh70/35UNOnm1 ych3tjlOuG+OL/7qAa+G4wJH/XiWEFk6x5tQ2oJRuEi6716SR6fdIPNfJY22gbmTEgbW 1I4cHwroK75/bs9TiqLsoZfkqy+1hSPHpHEgUkkZxKs0H6Rfdck9LlTyxYe9yO+SP5io DJmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=TbRknrTjqcZQLj9bQONGiVyMtqLOj4pkBWNrFhAEU3M=; b=AVned6ILryQWvP1n/HjmvhDvxUKEr6q07R6ATqi8T7RhS0nAgDnQm8Jbf9PecLxUAP AUYEdDNs9ZyCZCYImfIT8OA6b5oBXuTHeRnZnGZs5fL5ymrbSNtsUBQN0DlDUa0cxmtR o1oIIlC6C1+n280kFsTuiiaEpnIKKfXlM9Aj1Ap8avVyIX/TRb7dgEx2fk5D9HxgddIs S9dyWYNg/4cCwLUa37SIE1qo5Bvef3g78gJInPsQtyKW+zqiBtEo71qD1opP3PxxJeys BLZ32s/FO4en8/mTiAxOkpb5HzuDUmTZrfNc3rUYju0xOrz8O98pvS4tsic7ilY1d4K1 I8lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=TevqHiPD; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="YxZ/OdyX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rj5-20020a17090b3e8500b001cba7bb10basi2605163pjb.149.2022.04.19.07.29.12; Tue, 19 Apr 2022 07:29:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=TevqHiPD; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="YxZ/OdyX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235662AbiDRLkp (ORCPT + 99 others); Mon, 18 Apr 2022 07:40:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234797AbiDRLkm (ORCPT ); Mon, 18 Apr 2022 07:40:42 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0FBF1571C; Mon, 18 Apr 2022 04:38:03 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7FA9B1F74E; Mon, 18 Apr 2022 11:38:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1650281882; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TbRknrTjqcZQLj9bQONGiVyMtqLOj4pkBWNrFhAEU3M=; b=TevqHiPDO5sDzTMD9KoJV7kCn9asimT+v60nKh0cpf+/BvaY15cK4/J+7zWSSQ+evR+DZ5 8vvIo4R3TYjA8PIQDaOXu2c2U3M/ejdyKNP7x0UVkj+xjko8/w6OZhPVVth9rjNHIiKmEM 1TyzqKUqEsHEI3puTYJXcYqhtcuwzPo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1650281882; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TbRknrTjqcZQLj9bQONGiVyMtqLOj4pkBWNrFhAEU3M=; b=YxZ/OdyX/3fSMyny6Ud4835gtkMzpUaWKFFO81IUzfRn+3wEQlOSju3KvZW5I9QQBcYsbH /kIkx4/LWOJsnHAw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5F4DE13A9B; Mon, 18 Apr 2022 11:38:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id bBPVFppNXWJYHAAAMHmgww (envelope-from ); Mon, 18 Apr 2022 11:38:02 +0000 Date: Mon, 18 Apr 2022 14:38:01 +0300 From: "Ivan T. Ivanov" To: Stefan Wahren 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 Subject: Re: [PATCH v2] clk: bcm2835: Round UART input clock up Message-ID: <20220418113801.uree7rvkzxpiwyni@suse> References: <20220404125113.80239-1-iivanov@suse.de> <20220414105656.qt52zmr5vjmjdcxc@suse> <0b3356c0-b4c8-91ed-dfde-9f50483ec36f@i2se.com> <20220418110516.s7jxsfa3jl7aagrf@suse> <2a46bd1c-600b-5bd9-1c19-20c809f63945@i2se.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2a46bd1c-600b-5bd9-1c19-20c809f63945@i2se.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04-18 13:22, Stefan Wahren wrote: > > 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 have workaranded this the same, at first, but then decided to look at vendor tree and voilĂ ! > 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? > For (open)SUSE we use downstream DTS. Do you think that if I put better description in commit message fix will be more acceptable. Or if someone could suggest anything else I am open to discussion. Regards, Ivan