Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1087299imm; Fri, 13 Jul 2018 11:13:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd1yY16i06FDMD7qXUTYEc3I8UlkaAyiL6mdWK2zpYNvkVasWUF4ISWzpSTBCOVSmFFAVc2 X-Received: by 2002:a63:4450:: with SMTP id t16-v6mr7105261pgk.102.1531505638002; Fri, 13 Jul 2018 11:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531505637; cv=none; d=google.com; s=arc-20160816; b=HsbpZhLCbptaLyueJt9BrUQUaDKQ0oOm2QvnMIMIvvpANUKxxehk35EGlObcssCdSc HXJapxJYGP0UcuQ+iY/zrsX7C5CNlskP23rVCv/+6LIsH5+sPZTCVP20LiDSkN+3BzHv fZoi42bNWr30c3I2488meBZ5y62ZDQDuBIpTu2+F3RiyKMOpYZr8DBPRL9SusnmNyyF8 RcDhp43MC4fGeDg8BVzC8HyRxGljDQ11hEGa5avrFucA6Lk8Og1LVmhy+CD0h4JpMKL9 GKIY9FBBkieIyWSPM8Jr4SWESZt0lovTDu0UY7zuNlRMca4j6PzxgrWKavYbBE/51+bj XIKg== 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 :arc-authentication-results; bh=Qop5IxV6RcoTDB/Lt4qWrcoaLpC27ka4Ke3FcS3VCag=; b=OKfo4s0911GCGnATwEBpsD0XXol+6n17XtsF28eTCAApB6o92vjrF8uNg35sVO83Ik AwCueEjJqQl9qBI3KGCqxX9KqqJWs8ZZ1JnliyDg6E6wYVkVXVgs55Txi72zRKEHszN0 vvpsshvV2/0pn0Uu4R/K4SnCRKP/ShkGDiinZ8yFbvwlKr036JNL9A+iEkyqNonnaxbk RswsyIBk+6fCCNglQvX4woPLqN26ICX+ypvpvqBmQcmrpmPSUQU9hUZ08zYdSrjFcJKJ XHJMqUUt4RwZrdeimsRBZ9ZVFQwUPqqPrnK661hmusTbNKahBEYxYK07Kl/4QhmZjqJO qzXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=pf5HS34g; 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 a9-v6si20883126pgm.581.2018.07.13.11.13.42; Fri, 13 Jul 2018 11:13:57 -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=pf5HS34g; 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 S1731886AbeGMS2w (ORCPT + 99 others); Fri, 13 Jul 2018 14:28:52 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:34580 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731119AbeGMS2v (ORCPT ); Fri, 13 Jul 2018 14:28:51 -0400 Received: by mail-oi0-f68.google.com with SMTP id 13-v6so63858851ois.1 for ; Fri, 13 Jul 2018 11:13:08 -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=Qop5IxV6RcoTDB/Lt4qWrcoaLpC27ka4Ke3FcS3VCag=; b=pf5HS34gC/rJ3gFYn6Xru+GORC2+Lg0PQqkqZkW9rCE8AkPqKMFLeWc3LRQL2QvnYI Q225bQQF84LOMzFgxOWgDjVBD87nT14TjvVlNCd25s3JEcPxl/KGsWMmV1CprUdp2+GA RU28PafSBQOJ5QwaYY3XgGCFZLJvrkC1POGcJx86ir7gfu3xBJeSlh76AIyLYu6Ye2cH 8WEHze6hBxtGVU/N3qVRlaB4xJRXGSzie0ykDwAgMPCsec2L9WS9qBJs9Hq6PNVWmHHs 24K1UG4rBkbO7SHXVQPNwRp0KxCKYqFqk1od26g3MEgCZ+u9fN284HzFJDUixq3dkWkK mxsA== 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=Qop5IxV6RcoTDB/Lt4qWrcoaLpC27ka4Ke3FcS3VCag=; b=HzvNvPEfGq/aq+4WKJl6rVNyrxmZbLD6Wz+RQ4l+Vi0r5+eEcFWzfXxVhA4/JWpkbm kGLcat9GTPreGzQOQzF7CAuorVKOIcbagY60AYNUL0OOy9HF2p9OytdaIxvXqFqcYVBd HpFTumZAFtEdnXryROsREu30XgoeS4M3G7fiYXEPuTOvPTtZQO6k2DIDhe4eVgQG9Z1C Qdq3Xu6OgdoxR/CDF1Z1nZO0moF1Y9ig/QHep3bfEwJNk9ofIvpvcrjO+QgLBTLS9C33 oyxrE8erXBEcJ03Q8w4De5FgaNJhaqGmUwSYZqr4HigTEHKt08C9usIOpnwE0HtyZUWp PVrQ== X-Gm-Message-State: AOUpUlH+YsOl7GPLYyyQtX31NM5W2vOFcwsqYZ3eqSnJ+GeXKUMaSBgs AhjlDxkkSTy45DqGt+15h2yuQFp+VNB3/o2qJtkGAA== X-Received: by 2002:aca:a641:: with SMTP id p62-v6mr8168945oie.151.1531505587188; Fri, 13 Jul 2018 11:13:07 -0700 (PDT) MIME-Version: 1.0 References: <20180626165812.4141-1-jae.hyun.yoo@linux.intel.com> <921b1ab7-9c9f-0aeb-da89-5a1a27d009f0@linux.intel.com> In-Reply-To: From: Brendan Higgins Date: Fri, 13 Jul 2018 11:12:55 -0700 Message-ID: Subject: Re: [PATCH] i2c: aspeed: Improve driver to support multi-master use cases stably To: jae.hyun.yoo@linux.intel.com Cc: Benjamin Herrenschmidt , Joel Stanley , Andrew Jeffery , linux-i2c@vger.kernel.org, OpenBMC Maillist , Linux ARM , linux-aspeed@lists.ozlabs.org, Linux Kernel Mailing List , james.feist@linux.intel.com, vernon.mauery@linux.intel.com, Benjamin Fair , Patrick Venture , gary_hsu@aspeedtech.com, Ryan Chen 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 Fri, Jul 13, 2018 at 10:22 AM Jae Hyun Yoo wrote: > > On 7/12/2018 11:21 AM, Jae Hyun Yoo wrote: > > On 7/12/2018 2:33 AM, Brendan Higgins wrote: > >> On Wed, Jun 27, 2018 at 10:55 AM Jae Hyun Yoo > >> wrote: > >> > >>>>> + for (;;) { > >>>>> + if (!(readl(bus->base + ASPEED_I2C_CMD_REG) & > >>>>> + (ASPEED_I2CD_BUS_BUSY_STS | > >>>>> + ASPEED_I2CD_XFER_MODE_STS_MASK))) > >>>> > >>>> Is using the Transfer Mode State Machine bits necessary? The > >>>> documentation marks it as "for debugging purpose only," so relying on > >>>> it makes me nervous. > >>>> > >>> > >>> As you said, the documentation marks it as "for debugging purpose only." > >>> but ASPEED also uses this way in their SDK code because it's the best > >>> way for checking bus busy status which can cover both single and > >>> multi-master use cases. > >>> > >> > >> Well, it would also be really nice to have access to this bit if > >> someone wants > >> to implement MCTP. Could we maybe check with Aspeed what them meant by > >> "for > >> debugging purposes only" and document it here? It makes me nervous to > >> rely on > >> debugging functionality for normal usage. > >> > > > > Okay, I'll check it with Aspeed. Will let you know their response. > > > > I've checked it with Gary Hsu and he confirmed > that the bits reflect real information and good to be used in practical > code. Huh. For my own edification, could you ask them why they said "for debugging purpose only" in the documentation? I am just really curious what they meant by that. I would be satisfied if you just CC'ed me on your email thread with Gary, and I can ask him myself. > > I'll add a comment like below: > > /* > * This is marked as 'for debugging purpose only' in datasheet but > * ASPEED confirmed that this reflects real information and good > * to be used in practical code. > */ > > Is it acceptable then? Yeah, that's fine. Cheers