Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1144427ybi; Wed, 19 Jun 2019 14:26:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwYC6k/GMNSnMrZrHh1plZw0CIRXG29MpfLyy9sLJaEmLVqwobWrLyMn7wLitxwWANaXrGm X-Received: by 2002:a17:90a:5884:: with SMTP id j4mr13943564pji.142.1560979598365; Wed, 19 Jun 2019 14:26:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560979598; cv=none; d=google.com; s=arc-20160816; b=GDjpgCuJ6zhDj9erVfootCaYE1h8nfyeBLfIlDlKE3xIlKk4NcG50P1oI5lf8P6D+8 agU+x5rMm73GcmS2sLegg+Kh+lOz24dZLd9+3yIew1S65DtDVrXgYDTQM2ZvTpVjoZbT adbdV78E7mQINRf3zdR3TYvCuGhjofvsFTvfK1rMrxaLITCpWXPjwmnKquVgzu6pNqwi wzXrfMjfSnpN2ixBzq7U2beKoX6z7rJhchvutUuJ3j053uSfJ37mm7kOozUDBUBKGXjs uRR1pla7jzEc7Uxr08y+ssTEo2NhVZHVpF8nTomELBByRUICBUtivE2VQovMDjjSTiji 7hDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=y9mMQK9sKtWkYVn2tTLrqE2pA0vjVcq3E0qdtFwjDm0=; b=Mb/ZM1HXRj92djzz+qx+updqZ6mzMqCmpj7xoKqHlcMju7NQLojlf2KMbJNE+arz/T F7WUfDFs/c0uXOY10eO6E4lYeEeeyo3BHyzvEVFJjSYs/c677aQ1LEt75o19BCu6mo+Y lcpYpZ4hjozEsuOfpRPMAfO7M5/EbGUOlBSOB8eLK3vsqPeVE1DmDWsf0stG1/v1KGAS kp6dTk9Mguq6AGSVilMZCJ+QdlUfF5OcecBYhTkpaoqVKwnR3bztF6BRHKP3O2xNwVlD QxdzwSTLYMxYFIVnkHUlodZX24SZAVAl11EvZSYUBL1Mv2Jfv7K9AWBp7Nq62/WV1NBI G6sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="P5V/sT+i"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id c12si3659428pgq.533.2019.06.19.14.26.21; Wed, 19 Jun 2019 14:26:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="P5V/sT+i"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1730443AbfFSVZm (ORCPT + 99 others); Wed, 19 Jun 2019 17:25:42 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:36404 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726244AbfFSVZm (ORCPT ); Wed, 19 Jun 2019 17:25:42 -0400 Received: by mail-pf1-f196.google.com with SMTP id r7so342328pfl.3 for ; Wed, 19 Jun 2019 14:25:41 -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=y9mMQK9sKtWkYVn2tTLrqE2pA0vjVcq3E0qdtFwjDm0=; b=P5V/sT+i6r81AGxDHVHYVwgTBdH9hf/mud3jTlfe52eCS6W+5ngfmHBS5Z0sHkjZdw P/hyp+SElxNTgemRSGOtbTDIUYWWHxkBwrIyTDtPXANTdBjE7SWyRMT0/BHQiAkYqtPc CSlOqLbY6l+1vYT1oVdeGzUXQmPLiA74Y4dL0y1Zj8En/UvVab1vDGuLxQtsk4rddVhb OcAr5e4o52ldWylZ/rrctkX2uy8M7eUQyGn8gsZDMCHYREcdFW24LXs34IwCBkBGl5ae N8iqEYxxI6acRivHQIYSUz5sAU6zqbAlhwwRES74c0CoBDLOtl1msA3bIVAvdRuQwNoZ KoRw== 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=y9mMQK9sKtWkYVn2tTLrqE2pA0vjVcq3E0qdtFwjDm0=; b=OPPv6fNdEIMdY0rD0WG/KagNBzt5mstz/D+0BbMJWXdW8viQs+/3XtDlnzBdu7oHlz Yr2wzv5ptqqC6BKZhmeThZ94dStkPtXHlxST/SwgMSj5Nmkv956hgSUxxGDjwfVmWWgD R2U1Apx4/DnEOMVWT4WiD6oVUbYx0mODyPZs7ZIi9VJJ7HzU4+Tet4jRWg3hfOhZGLlo neWGc0d8+2Tp3ezIUqNoo2noh6NY4O6ik4Y9SYM4dpKbPC8f7nu0lDDXwZMeu82/rTmG /3qTUP7eyaN/p1yICHzAvWAhstgcfCWZopBqW8DoddpuwZbjk6IKLzxO18tvppy4t0We bKHA== X-Gm-Message-State: APjAAAXkMrlc79u4b8kmLZN5FNvO3Fha2z2kXCLaJZOg/d+5zt3wfNSB AvhtuKs3QD+ujOeLxSD+KM8w5Sv2g3dvQSz+KW+8wA== X-Received: by 2002:a63:c94f:: with SMTP id y15mr9670654pgg.159.1560979540781; Wed, 19 Jun 2019 14:25:40 -0700 (PDT) MIME-Version: 1.0 References: <20190619205009.4176588-1-taoren@fb.com> In-Reply-To: <20190619205009.4176588-1-taoren@fb.com> From: Brendan Higgins Date: Wed, 19 Jun 2019 14:25:29 -0700 Message-ID: Subject: Re: [PATCH 1/2] i2c: aspeed: allow to customize base clock divisor To: Tao Ren Cc: Benjamin Herrenschmidt , Joel Stanley , Andrew Jeffery , Rob Herring , Mark Rutland , linux-i2c@vger.kernel.org, OpenBMC Maillist , Linux ARM , linux-aspeed@lists.ozlabs.org, Linux Kernel Mailing List , devicetree Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 19, 2019 at 2:00 PM Tao Ren wrote: > > Some intermittent I2C transaction failures are observed on Facebook CMM and > Minipack (ast2500) BMC platforms, because slave devices (such as CPLD, BIC > and etc.) NACK the address byte sometimes. The issue can be resolved by > increasing base clock divisor which affects ASPEED I2C Controller's base > clock and other AC timing parameters. > > This patch allows to customize ASPEED I2C Controller's base clock divisor > in device tree. First off, are you sure you actually need this? You should be able to achieve an effectively equivalent result by just lowering the `bus-frequency` property specified in the DT. The `bus-frequency` property ultimately determines all the register values, and you should be able to set it to whatever you want by refering to the Aspeed documentation. Nevertheless, the code that determines the correct dividers from the frequency is based on the tables in the Aspeed documentation. I don't think the equation makes sense when the base_clk_divisor is fixed; I mean it will probably just set the other divisor to max or min depending on the values chosen. I think if someone really wants to program this parameter manually, they probably want to set the other parameters manually too. [snip]