Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp170192pxv; Thu, 15 Jul 2021 01:24:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiw5AU+3anodISj+haXblXXM4onzygBw7VK65Y0NP3Y7OYYTB3ds8+GjhfvCY42Cipfkmi X-Received: by 2002:a17:907:1c8d:: with SMTP id nb13mr4225020ejc.155.1626337466407; Thu, 15 Jul 2021 01:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626337466; cv=none; d=google.com; s=arc-20160816; b=ZV/Vb4rBfIIdcqAVuB3CMjSpOL+IcplLKC54QMCP7rpupFzuxg5ECTx9gudf1flqdA c/eF51nWX0y+NH4mfgXeRmLhua+J9vwwqk6Us9ydKRNjwR9xlzEFi9dEvWntRFxlt76E gVJIwQYBGkmOoKz1FrSapZ/DGqwKfrKbZ9O0UZEOIvCZu8TutM31cJNL4PpK2pptFTrE v2OO8GhuBZcHdDP1m6gZuJyLWt6XJHfbnOorgq0uO73aYqrQ3nGyRIm5yIVclUPLy2zK mLR0Tj4w83uzpCeowvv2p9yZaDI9tTUkE3S4sm+nzYtUpzeijr9m8sVNFKHUBV9ZcVyK MIVw== 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=9B+oTQwgmo4p1Ky+jMiYsVX5twnQnFrh+/KabLkfKoM=; b=LhICx04wLVBA1vZjzYbSbACAzmItA8yxSuKFbgeBoWAEWjRr3i493nYj5grRD6T9NL mGxPQXL8UaVwQXbWyU2xz7SstzyjRJubaDzCndRLLHWWAxPMZq5cOzvaRLGycDQTRgVN 3Ka7rRRQinunU5Rm9VhCHV0TiCW/YfL7TV37mAhEp4iyeISEON4CNEFI7o75YFhGfiyu YxnNkSnwS35IliiDhdWqmVR/Ztr8m2cODqchsA6YjazW7tZl3xVon+oms+6RXOkNIcHo bNy1mQzjDeamgPgJsF8gbepDnBaIh2/9ODcFKh24iUpBe2BOOUPzkaBxl//u48r+6Jlj yvcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gXX+pNEe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hk6si6582821ejb.587.2021.07.15.01.24.00; Thu, 15 Jul 2021 01:24:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gXX+pNEe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233763AbhGOHMa (ORCPT + 99 others); Thu, 15 Jul 2021 03:12:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236815AbhGOHM3 (ORCPT ); Thu, 15 Jul 2021 03:12:29 -0400 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F7F1C061760 for ; Thu, 15 Jul 2021 00:09:36 -0700 (PDT) Received: by mail-il1-x132.google.com with SMTP id w1so4097186ilg.10 for ; Thu, 15 Jul 2021 00:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9B+oTQwgmo4p1Ky+jMiYsVX5twnQnFrh+/KabLkfKoM=; b=gXX+pNEeNfCIXnvpl5zzg72jHjH+3zkYJyYwbmO1kzh6ft7/OouMUm8xc5cxG1XPp8 Vfl1oHQrkntzz2y4B62MFB0npJvEz/EllABrsOjYb23ZWwcji9c17WbupAJqSMCKjf0q P9puY5/sExP8rW+vR6b7vTTJ9DDQLHDyikWKMFxq6Z+CSp+C0hNwnB5kLycCHNfoPdF0 ZME0I/BW6gRIqG6XyZirldBU3sEofWoFpeDFdYt+CBSvj2oKp21RqmylUxRHM9lqPuuJ Njxiq/CD9vBHyByW1XrAxcB0Y//F+cqnQDlTU5eH2uxU8VpUmofQm/oQOYs4ipZrnaFl xsFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9B+oTQwgmo4p1Ky+jMiYsVX5twnQnFrh+/KabLkfKoM=; b=CjoLZpo9QKOn0wu+knfXvQ4rcNkAzAao7eB3WALQbUhJjzS+6+ISlUJBiyfD5lorJ+ a0T9enVpFH2nnjQouclGNEZOLtqawIkaSUvfzWa1ZBQ+Re/+o8nlKr5tN3nG3TaOifZ8 oE/whRX94DdJE1u2Li+oCdqYR+S76CkWKjutXjFJ/OY9fFjzDJxDo5Nb0o21QYmdqVNJ UCRwaM6z6DlCoBMfWR44iLWp0aVJtA8edI3emx3sTVH2VehQroR/Zz+r2Oto1tuvOgYY 7ei/GbsUN6xj+poEK5/O6nv5n6YRjy4cELQUbDO9ouIqP11Nm7wqeFDj9ZQggvhM41gg inBg== X-Gm-Message-State: AOAM533OeEwp3q3PCNKSEIul0J7fYEaru7pB0Tk7e/Vvp+8lkVtRbAy0 lWCYQmxdKs4bDdcCYWqZxrCWHcskwFIvW8f2E4RG0w== X-Received: by 2002:a92:d990:: with SMTP id r16mr1786919iln.204.1626332975821; Thu, 15 Jul 2021 00:09:35 -0700 (PDT) MIME-Version: 1.0 References: <1626316157-24935-1-git-send-email-kewei.xu@mediatek.com> <1626316157-24935-9-git-send-email-kewei.xu@mediatek.com> In-Reply-To: <1626316157-24935-9-git-send-email-kewei.xu@mediatek.com> From: Tzung-Bi Shih Date: Thu, 15 Jul 2021 15:09:25 +0800 Message-ID: Subject: Re: [PATCH 8/8] i2c: mediatek: modify bus speed calculation formula To: Kewei Xu Cc: wsa@the-dreams.de, matthias.bgg@gmail.com, robh+dt@kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, srv_heupstream@mediatek.com, leilk.liu@mediatek.com, qii.wang@mediatek.com, qiangming.xia@mediatek.com, ot_daolong.zhu@mediatek.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 15, 2021 at 10:32 AM Kewei Xu wrote: > When clock-div is 0 or greater than 1, the bus speed > calculated by the old speed calculation formula will be > larger than the target speed. So we update the formula. The patch sounds like a fix up. Need a "Fixes" tag. > for (clk_div = 1; clk_div <= max_clk_div; clk_div++) { > clk_src = parent_clk / clk_div; > + i2c->ac_timing.inter_clk_div = clk_div - 1; Using the way to pass the parameter "inter_clk_div" to mtk_i2c_calculate_speed() looks like a hack. inter_clk_div is set again[1] next to the for loop. [1]: https://elixir.bootlin.com/linux/v5.14-rc1/source/drivers/i2c/busses/i2c-mt65xx.c#L831 I have no domain knowledge of what/how the patch fixes. But if this is a standalone fixup patch, suggest separating to an independent patch.