Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp303522rwe; Wed, 24 Aug 2022 00:57:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR7WHWHx8ypAs1qhIXSwUp/z5gjsRkEEOhkXcAyPOoz34xPNfbpprI7LnQrY9o15fSXc4qrA X-Received: by 2002:a17:907:7b92:b0:72b:67fb:8985 with SMTP id ne18-20020a1709077b9200b0072b67fb8985mr2009888ejc.569.1661327875201; Wed, 24 Aug 2022 00:57:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661327875; cv=none; d=google.com; s=arc-20160816; b=Pk9bmzB3bet0gdZO8jTtpIozj5SOag9Qp4dJjIE6NHTQFuo59RWDrdfS1h/ZjOGSg5 6+AR+mNi9TKEfYiRW3j8r3aFtvzEJ8OI3mJhlASgtHliJG+qg98glJajxMsch9vPTqX0 YE6uk//bspaCNq1JpI17Uk05vlfpiK3HsG1dRq35ONteIQxKPBdYWDT2F6Qo8vQkqu2V NXFQq2Dqw67HZOS8qhvRLNKiOCTkzIu+D8B//c8ZYQpaY3oRZFNrU8siguvhTU+FIg8e +LPtPOemA/3F7OQuN1hPMyl15zoNs2N9NDKfL/eEK242fl7znxYpt7xoBWns7dP0IKx5 Mn1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=9r/o+kbVQuRgd3he3vY5TSCEIo6rMCGZbm88wIqFP8Q=; b=xQsUcjSqM/nNyfQKTFnU1zWaqlKmvX6DlEco2THwt7nXsWKrnanrrv+61mSAoh9Tb6 MTISoIQhCNtyEUI0kOnEV8ioTsgAbm9qNGnNqe9mlOynEiFFbllF5OzBgcf/JjIjgtsl LkKJUqXIEaGvTNRw7jln3hlq6WBmvwXbQMkh4EiVgUoy3uzEHNFedgnpqTS9X2k7aM9h Yxdhsb6U8swx6k6+T0l5Gql1y/EeUKX/cmPieZkxfiBSq2lWfba3lGulSGjABEYKbsUQ ilgdhZoSOzwCfM38yvjPl5f/6T1albZ+UJB7n07ho/aADLDLJ5mudKN8hk92C/cZQRva 4jOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@raspberrypi.com header.s=google header.b=eMXIxPRG; 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=raspberrypi.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa11-20020a170907868b00b0073d785d443asi1609153ejc.708.2022.08.24.00.57.28; Wed, 24 Aug 2022 00:57:55 -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=@raspberrypi.com header.s=google header.b=eMXIxPRG; 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=raspberrypi.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235113AbiHXHxJ (ORCPT + 99 others); Wed, 24 Aug 2022 03:53:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230002AbiHXHxG (ORCPT ); Wed, 24 Aug 2022 03:53:06 -0400 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41A5C83F06 for ; Wed, 24 Aug 2022 00:53:04 -0700 (PDT) Received: by mail-io1-xd2a.google.com with SMTP id 10so12784423iou.2 for ; Wed, 24 Aug 2022 00:53:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=9r/o+kbVQuRgd3he3vY5TSCEIo6rMCGZbm88wIqFP8Q=; b=eMXIxPRGdnHxWWurrEzfpDzZsVgdUEI1TRoy42m0Dzr7/LEOSVr0qgBLVn2S4cdjNg 8NNplilxBrpW4w2v/+0aYUstSMgr6x114Xh5WblS6A781kvgUwgoepfN2jxcjHdvN/zf ieSXvQh3KEV7EdsSt/U71vN6Bxvan0bGM0hOq/3BV71XvylDtFvnoj6V6uFVeyP+ZEtF 7fGtUUOQa7bk3lWTEh2JROmiGw0qRkcPwjRqUO/49Lb35nrCUhS2zXshjXZoHAUdbJkW nZSI5huxEmCPfjOG/GV0m8XuNP0eIZs4Kp5dOxVfAA7IYIJYUt7Lf4fZx7N1fTmGCBhc UTvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=9r/o+kbVQuRgd3he3vY5TSCEIo6rMCGZbm88wIqFP8Q=; b=RmqZQ8VZ04qt69Qdj+8DlON3fdPL+jk2ol3K0L1hkzbgR22MmkBn3hKf5owUVkhmYo 9x9HVExZFhe6WiGCnRbpatjOcgg0dYeY20WH+eVhxNleBd3qXDtqlnRBuekWf1XpAXtV 4i3/CnwhuAacwV3QbFay7yEZci9VvOsHFwoORip60Et3otSS6nLodGjTb/RuNb976xRN UVYDP7l16uaKHsvKvwVPSv0jak8YbN/SH8xvPL0qSZfhKHEmoaBY0UvIl88pOnIO5PcC I5gzTZ+HrXhj/XQLrOUsuzDyFJ9p9Vu875Nqa9jUjuKGUaTDwAZwLNyNX3A4xV8Sbbpm 7xRw== X-Gm-Message-State: ACgBeo0XW0b5yZvlHimocH+5kDcUd2Mj2bBSaH74MzjRX3uv40TjFXEF C8VODQaZK3wotrAsRsKgZwfsJogb2E2bnZh4c6i47Q== X-Received: by 2002:a02:3f63:0:b0:349:cef9:d8c2 with SMTP id c35-20020a023f63000000b00349cef9d8c2mr7667351jaf.231.1661327583663; Wed, 24 Aug 2022 00:53:03 -0700 (PDT) MIME-Version: 1.0 References: <20220527102900.144894-1-iivanov@suse.de> <20220823230842.AB8BAC433C1@smtp.kernel.org> <20220824074443.nvrnqhpvqrtn72p4@suse> In-Reply-To: <20220824074443.nvrnqhpvqrtn72p4@suse> From: Phil Elwell Date: Wed, 24 Aug 2022 08:52:53 +0100 Message-ID: Subject: Re: [PATCH v3] clk: bcm2835: Round UART input clock up To: "Ivan T. Ivanov" Cc: Stephen Boyd , Albert Ou , Broadcom internal kernel review list , Florian Fainelli , Michael Turquette , Nicolas Saenz Julienne , Palmer Dabbelt , Paul Walmsley , Ray Jui , Scott Branden , Stefan Wahren , Phil Elwell , kernel test robot , linux-clk@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Hi Ivan. On Wed, 24 Aug 2022 at 08:44, Ivan T. Ivanov wrote: > > On 08-23 16:08, Stephen Boyd wrote: > > Date: Tue, 23 Aug 2022 16:08:40 -0700 > > From: Stephen Boyd > > To: Albert Ou , Broadcom internal kernel review list > > , Florian Fainelli > > , "Ivan T. Ivanov" , Michael > > Turquette , Nicolas Saenz Julienne > > , Palmer Dabbelt , Paul Walmsley > > , Ray Jui , Scott Branden > > , Stefan Wahren > > Cc: "Ivan T. Ivanov" , Phil Elwell , > > kernel test robot , linux-clk@vger.kernel.org, > > linux-rpi-kernel@lists.infradead.org, > > linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, > > linux-riscv@lists.infradead.org > > Subject: Re: [PATCH v3] clk: bcm2835: Round UART input clock up > > Message-Id: <20220823230842.AB8BAC433C1@smtp.kernel.org> > > > > Quoting Ivan T. Ivanov (2022-05-27 03:29:00) > > > 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 > > > --- > > > > This is waiting for someone like Stefan to review. It's customary to > > include previous reviewers on new versions of patches. > > Thanks for fixing me mistake. If I am going to be mentioned in the commit (and I'm not bothered either way), I would prefer it to be as phil@raspberrypi.com - the .org address will expire at some point. Thanks, Phil