Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1921105imm; Thu, 19 Jul 2018 09:59:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfl8YMy64hJZyVuC7IzGSDYmaGb+zNw/j5QiYa25cFyBBk6Ikz7wYg/O9HYhlUhYk5oqdvw X-Received: by 2002:a62:f587:: with SMTP id b7-v6mr10353636pfm.158.1532019599046; Thu, 19 Jul 2018 09:59:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532019599; cv=none; d=google.com; s=arc-20160816; b=qxGTwbYwXSZ4IL6ccYCCyuMNYT5ZiZR3GZtkFOi/LrUxyYDwKPPD0n+UvZIOA3qBLk 9SRFFpTpu0Zzo6/irPtcK+0uhOHMNtBAgbb9aWddh0H0f0QCHNqZL7X3qXa47bQrOLvb 5GxdQ3fLyI/m6GxDRXbRxhbgKmd1S6J09AJAWj4lUIdRK6/akq7YgUI2H2xQTQ6O62it cc+1moYq7as2LMbKbd/c8DwBYbEVSqHUzNgOqX+gejAR5dr/gPW8T8RmPWVlstLWDpeF zA6DP/IGkv2z5RWacBUPmjIs3cvsOPwge9R2onMXv2//CpSePmJAw+6SEzWndTNQV9RR A84w== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:arc-authentication-results; bh=V6UTAm7MgBEBINyn1Dyk2k0uIZx+49YpcWgppKd7Ix0=; b=QS50vrcmUxwJtN47wG1kjNoHTXUn50VvjLWD1C/xhwCpGSqj2VRZA/rMnq9kBUmXRw cFdOT7Wl2XNCqKVvWP8h0LzrZbTiitLkySZa4CpcewGgT7cGwZTMgk4rFawnTAX9LWuP KZy3KBsfa9lOdGB2wPuuG24vWFqSdojDxmltGDNUbEsBedcnyaMf+4kXURMzrvQf/vXU jjDBXr4KRxCXxuhUMFK296G5V6qu3wDZeNm/+UVuxFhZR7fJ1Do8IKxKGyrRCO4RwsgP /JAS+/Im43AQGWX7YFo4J/HxM4As1myHBzrxifFA8VrIJkL0GJGv06VgO1sgkGfv5xh9 Tbtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=TOVGmeVw; 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 u4-v6si6365564pgm.454.2018.07.19.09.59.44; Thu, 19 Jul 2018 09:59:59 -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=TOVGmeVw; 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 S1732112AbeGSRmn (ORCPT + 99 others); Thu, 19 Jul 2018 13:42:43 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:35441 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732029AbeGSRmn (ORCPT ); Thu, 19 Jul 2018 13:42:43 -0400 Received: by mail-oi0-f65.google.com with SMTP id i12-v6so16272868oik.2 for ; Thu, 19 Jul 2018 09:58:39 -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:content-transfer-encoding; bh=V6UTAm7MgBEBINyn1Dyk2k0uIZx+49YpcWgppKd7Ix0=; b=TOVGmeVwEdw1QtNuvTErsPQ3U+ZaNXrSwj8M//JwtOgabKDkQReUGDic4ROaebLbwQ rgQvrZFnepptvGUrI1PZ7NRU7KtJzRAYwwnvvhGLubQtNMHn5o/RVrsGm9Ib1rujXAW4 pGDugZqnH2u58DE/FKp/I6QF7jYAgdyB9i+/e1reNYpceoAekv1qmAhCTmX/O1LizaCu MYLCv5D+4mkEB+ZmJqZ0RFnUiv9axj102whr0zIDOnhgt3T+aqVpyXcj/3RjS1IbiwIt zJQfsUxyyI1GQa7it3dl6q680Pjsd/Iin8rJ84lJTc/kQm+aX3c0y6rmdTyDdmjj8NMq 9E+A== 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:content-transfer-encoding; bh=V6UTAm7MgBEBINyn1Dyk2k0uIZx+49YpcWgppKd7Ix0=; b=BOxSqqKWiEdJZyjgdnhO/R2WZuU5E5ngl0atjk58HquptXqDF72MePUnX6tFMi/8TG 1N5/Elgn6l8pMigijuG8kGfkgTw6vik0kfMq09WAPDE9gJbBdDoC5SQD86LIQEOieKiU 9t9PYboxXrN6conVFcjzTeyN+xqBr4Z2dpMGG513soejd2HiBoqjGQ9ZpZB/ic967+5g ICmFgjOGvS8lhxNOeovgCEMsiarVhR+VeQBXaIso2jbH4K+yZzudweZEmB4QM1p8ZDaN O8+AG/Y0VemnByhMQogw8lfxRcvVYIujHS3VF1wYN0Z/8qPHjHS/hFAc3v5s/X7+C16O eUBA== X-Gm-Message-State: AOUpUlEhTApsVcDovj5wmEEBl0e6ZH0HZoBsjHJbqzXXVPhsx4i/JSvC w83ucHrZODQGrvBP8FNcBL2D1zztsghtRTib5jZkww== X-Received: by 2002:aca:c692:: with SMTP id w140-v6mr11167731oif.284.1532019518900; Thu, 19 Jul 2018 09:58:38 -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: Thu, 19 Jul 2018 09:58:27 -0700 Message-ID: Subject: Re: [PATCH] i2c: aspeed: Improve driver to support multi-master use cases stably To: gary_hsu@aspeedtech.com Cc: jae.hyun.yoo@linux.intel.com, 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 , Ryan Chen Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 15, 2018 at 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 so= me error conditions. So driver also can use these fields information to che= ck something. > As for how driver use these information in their code, I have no comment.= I don=E2=80=99t understand the driver. But these information is the real c= ontroller state, it had no problem to use information. Okay, so it was originally only intended for debugging, but then showed its= elf to be useful, got it. Just out of curiosity, why did you mark it that way i= n the documentation? It seems as though you are trying to discourage people f= rom using it. > > Best Regards, > > =E8=A8=B1=E9=A6=A5=E7=96=87 Gary Hsu > > =E4=BF=A1=E9=A9=8A=E7=A7=91=E6=8A=80=E8=82=A1=E4=BB=BD=E6=9C=89=E9=99=90= =E5=85=AC=E5=8F=B8 > ASPEED Technology Inc. > > 2F,No.15,Industry East Road 4.,Hsinchu Science Park, Hsinchu City 30077, = Taiwan > =E6=96=B0=E7=AB=B9=E7=A7=91=E5=AD=B8=E5=9C=92=E5=8D=80=E5=B7=A5=E6=A5=AD= =E6=9D=B1=E5=9B=9B=E8=B7=AF 15 =E8=99=9F 2F > > Tel : 886-3-5789568 ext:807 > Fax : 886-3-5789586 > Web : http://www.aspeedtech.com > > ************* Email Confidentiality Notice ******************** > =E5=85=8D=E8=B2=AC=E8=81=B2=E6=98=8E: > =E5=9B=A0=E6=87=89=E5=80=8B=E4=BA=BA=E8=B3=87=E6=96=99=E4=BF=9D=E8=AD=B7= =E6=B3=95=E6=96=BD=E8=A1=8C,=E6=9C=AC=E4=BF=A1=E4=BB=B6(=E6=88=96=E5=85=B6= =E9=99=84=E4=BB=B6)=E5=8F=AF=E8=83=BD=E5=8C=85=E5=90=AB=E6=A9=9F=E5=AF=86= =E8=B3=87=E8=A8=8A=EF=BC=8C=E4=B8=A6=E5=8F=97=E6=B3=95=E5=BE=8B=E4=BF=9D=E8= =AD=B7=E3=80=82=E5=A6=82 =E5=8F=B0=E7=AB=AF=E9=9D=9E=E6=8C=87=E5=AE=9A=E4= =B9=8B=E6=94=B6=E4=BB=B6=E8=80=85=EF=BC=8C=E8=AB=8B=E4=BB=A5=E9=9B=BB=E5=AD= =90=E9=83=B5=E4=BB=B6=E9=80=9A=E7=9F=A5=E6=9C=AC=E9=9B=BB=E5=AD=90=E9=83=B5= =E4=BB=B6=E4=B9=8B=E7=99=BC=E9=80=81=E8=80=85, =E4=B8=A6=E8=AB=8B=E7=AB=8B= =E5=8D=B3=E5=88=AA=E9=99=A4=E6=9C=AC=E9=9B=BB=E5=AD=90=E9=83=B5=E4=BB=B6=E5= =8F=8A=E5=85=B6=E9=99=84=E4=BB=B6=E5=92=8C=E9=8A=B7=E6=AF=80=E6=89=80=E6=9C= =89=E8=A4=87=E5=8D=B0=E4=BB=B6=E3=80=82=E8=AC=9D=E8=AC=9D=E6=82=A8=E7=9A=84= =E5=90=88=E4=BD=9C! > > DISCLAIMER: > This message (and any attachments) may contain legally privileged and/or = other confidential information. If you have received it in error, please no= tify the sender by reply e-mail and immediately delete the e-mail and any a= ttachments 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; O= penBMC 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 o= nly." > >>>>> 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 deb= ugging 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 > >