Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3728974imm; Tue, 17 Jul 2018 09:19:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpffXEckhaQqS7DYK0aSD/Bvtql5K7R70nA+aVK4iWyZwB1bCFj9cVQpWjGA0sAxYGmxHhgf X-Received: by 2002:a62:1089:: with SMTP id 9-v6mr1345335pfq.30.1531844388321; Tue, 17 Jul 2018 09:19:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531844388; cv=none; d=google.com; s=arc-20160816; b=J9hmED+8GZH+S3GlsZ7kxG4dige9vfYMaZUSU1Tvt6QYNG3wBTVDbh4z4C1J8J1Opn J8Y6nIf2kiw9xwmA8wnSOSeZ2oa9kM6ovqPejltB/LeS+TDzobMoGvRjdVnJvI59za47 ERkGfA8aOuxPYszszaw5I1vt1O/CTd4fqMQgjoMZYyBcXAh80mhbNpNTGhBivxrRjzls Q4GXowEIz2y3YGG4WbRm4FjPRjv933f7fdxAqM64hSak7FcJ9hGuPFoTSb049UbDpvyO oZ2Gh26vtaK70OMv9Y52tCto/g2GuUBMI+o5DpLo36LRKNiGNDEFBTF4w8tPL8PZNJLL BXVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=YSj2XU3W7jl3AKHOux60M/CUwh/YzhcQ9V5axfAigZc=; b=M9FuUp0Dh3wPDk6tO1pcmV/a5/R63VvPJ5Cd+XP5s1xMJHtFluQTtnn7pqrVXWdTyG QEjrbAraYJfnoFgsrDUvQsm1BRVEvexc5xTNVpxQH+GMj5wg1dslLyL/12JUQTQnoFP0 d7csfDgyHPE4DLFDHcpvaI5EXS+3T5WQi/WraFV/anL1On7xZ1S91z/XB0hcI//ZTcWn D2ZkH+scP62B22syFnH3zr7R2mvIgLHN0nFViRbkn0jzMjT2uV0lsDtwDvA6w+TiS9Pv iNL11g58ZpKwxNME0DSgfROG00nomBIf/Fpj8tOJ6RrpnOYUXZ5Vm+zdpZmIZjLSva2i E9Xg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w9-v6si1108015plp.395.2018.07.17.09.19.33; Tue, 17 Jul 2018 09:19:48 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729756AbeGQQvm (ORCPT + 99 others); Tue, 17 Jul 2018 12:51:42 -0400 Received: from mga02.intel.com ([134.134.136.20]:3412 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729508AbeGQQvm (ORCPT ); Tue, 17 Jul 2018 12:51:42 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2018 09:18:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,366,1526367600"; d="scan'208";a="216739584" Received: from yoojae-mobl1.amr.corp.intel.com (HELO [10.7.153.149]) ([10.7.153.149]) by orsmga004.jf.intel.com with ESMTP; 17 Jul 2018 09:18:17 -0700 Subject: Re: [PATCH] i2c: aspeed: Improve driver to support multi-master use cases stably To: Gary Hsu , Brendan Higgins Cc: Ryan Chen , Benjamin Fair , "linux-aspeed@lists.ozlabs.org" , "james.feist@linux.intel.com" , Andrew Jeffery , OpenBMC Maillist , Linux Kernel Mailing List , Patrick Venture , "vernon.mauery@linux.intel.com" , Linux ARM , "linux-i2c@vger.kernel.org" References: <20180626165812.4141-1-jae.hyun.yoo@linux.intel.com> <921b1ab7-9c9f-0aeb-da89-5a1a27d009f0@linux.intel.com> From: Jae Hyun Yoo Message-ID: <26400cb7-972e-7be9-81ba-8e08d42abd4e@linux.intel.com> Date: Tue, 17 Jul 2018 09:18:14 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/15/2018 8:05 PM, Gary Hsu wrote: > Hi Jae, > > In originally, we reserved these register bits for debug purpose. But for some error handling case, we found it is also useful to help to clarify some error conditions. So driver also can use these fields information to check something. > As for how driver use these information in their code, I have no comment. I don’t understand the driver. But these information is the real controller state, it had no problem to use information. > Thanks Gary! Hi Brendan, Is it acceptable now if I add this as a comment like below? Thanks, Jae > Best Regards, > > 許馥疇 Gary Hsu > > 信驊科技股份有限公司 > ASPEED Technology Inc. > > 2F,No.15,Industry East Road 4.,Hsinchu Science Park, Hsinchu City 30077, Taiwan > 新竹科學園區工業東四路 15 號 2F > > Tel : 886-3-5789568 ext:807 > Fax : 886-3-5789586 > Web : http://www.aspeedtech.com > > ************* Email Confidentiality Notice ******************** > 免責聲明: > 因應個人資料保護法施行,本信件(或其附件)可能包含機密資訊,並受法律保護。如 台端非指定之收件者,請以電子郵件通知本電子郵件之發送者, 並請立即刪除本電子郵件及其附件和銷毀所有複印件。謝謝您的合作! > > DISCLAIMER: > This message (and any attachments) may contain legally privileged and/or other confidential information. If you have received it in error, please notify the sender by reply e-mail and immediately delete the e-mail and any attachments without copying or disclosing the contents. Thank you. > > -----Original Message----- > From: Jae Hyun Yoo [mailto:jae.hyun.yoo@linux.intel.com] > Sent: Saturday, July 14, 2018 2:54 AM > To: Brendan Higgins > 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 ; Ryan Chen > Subject: Re: [PATCH] i2c: aspeed: Improve driver to support multi-master use cases stably > > On 7/13/2018 11:12 AM, Brendan Higgins wrote: >> 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've already CC'ed Gary and Ryan in this thread. > > Hi Gary, > > Can you explain why the documentation says that the bit field is 'for debugging purpose only'? Any plan to change the description? > > Thanks, > > Jae > >>> >>> 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 >>