Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp787900imj; Thu, 7 Feb 2019 11:50:49 -0800 (PST) X-Google-Smtp-Source: AHgI3IYtOa6bVJExp4RGrnnGmCr4x/IktBGS5vk1eHjVrODnjwxadMHQoAR1o6jcFyCErnr6C/EL X-Received: by 2002:a63:2744:: with SMTP id n65mr16438069pgn.65.1549569049008; Thu, 07 Feb 2019 11:50:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549569049; cv=none; d=google.com; s=arc-20160816; b=cqVQXVqxFMFJMu8j/eV6wqL/o2OcZV7Ve2IxpEycEEGNhjemZ0AHzJd5E49JAOi6Ay +zI9ry4VHd+AYE2S9XgL0k27guAIxMB7EMj0SoeUZNb4l+48qGVMB9bp/FRpoyT4tWca I9DLCjojEVE4tOGHw324cbyrGhYQu7Sx7N/1JJkJQCaJJaFxGUJb2gZb0I2Lu3XTdji6 L2NMtUKWCHSleh4aJw1W4rUWQR+E1sh/+gIkCdgiNGYDHOZQBfwfvnINiPfYCPu8E9ee BQh9woAPRcjctNRLaeaXixKeG3AB3F3Z0EP8T4rAbAVi1yoxGRPuHWkQvwqjAcwQTH6s TbFA== 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=32dcltOQ1P4EoeLXctHavIhMS0EvxGLs/iMVzRHCsGU=; b=EAiu+kifR9rmnNPHa8/Tu3uTVJS4R/KVoKcx06c1g0+Dpw1qNB9wEdI7kCq1AlTvz3 VVXSs281td4yVLQKFdHZgbr3vp+ZVW6bj2XySlFObmY+LQImoMHFSk31K2z+QcnhlBYl Ahv6xgNdxkLQnyaq16XyegsANI3IoNqavrfR5LZdEqiz37zHgHr6bzl+K0XjdyJm5Rey 4c3BdqJJdLf09syO+i1axkVJLTlIxk8C140D/E5/y7QZy6NffVn0OGlVVdz6aWKfBOG/ RDdYxibiEHT1JPyqQLgQFFKPDMjs5IQ9ptF60f3co2qrc99DJHTv+bozYhvckQBrMnfz tnbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jPKZZF7t; 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 f20si2445790plr.419.2019.02.07.11.50.33; Thu, 07 Feb 2019 11:50:48 -0800 (PST) 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=jPKZZF7t; 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 S1727225AbfBGTtF (ORCPT + 99 others); Thu, 7 Feb 2019 14:49:05 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:44917 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727084AbfBGTtE (ORCPT ); Thu, 7 Feb 2019 14:49:04 -0500 Received: by mail-ot1-f66.google.com with SMTP id e24so1858546otp.11 for ; Thu, 07 Feb 2019 11:49:04 -0800 (PST) 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=32dcltOQ1P4EoeLXctHavIhMS0EvxGLs/iMVzRHCsGU=; b=jPKZZF7tN7/34sOt1r8tSTVBcxcos+cBMXyBuXvH6dVtt3C4pIb+IpiZG+HKpC+ot7 dhEh/OcLGMV03sN9KWVOjb3a+CjR/P/GIghAyJxJta1IvRicRvLuzrfK51fdxKiSiUo3 3EGtVjonMdx9hOeumg9x/oGgJVgiGFFJm4+a9Elg0RdflhKaMbYJu1crfwPUyxGae9FQ UZNRbppQejlKbAVjRtHIEjnH05TXMjeCNM4YyW+LO/CcproE/ug/kmXyr74T+TEG/fcb Dz5scdqDJ9tqLGTbSYugLPGPmaatIdhpcAmAlZWAz1kGP/IXJ22cmI1odr3YBd5ObWuR ftLA== 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=32dcltOQ1P4EoeLXctHavIhMS0EvxGLs/iMVzRHCsGU=; b=ertxVYxfzDiGzZ/WAPcYZqHfVp9/yVfvQFPec5qsmBiJUmXmq3lwsIx7eDE8zAEAUU RSPOsAKPKyDqNfE4ECXy5jU0DjANVN373398bMS4ya0xaILf5MH0CCjtj1xY8azjfG55 b+7MiW+cVsK/vbmHOhW56mD9KvNLDy1Vesdw5izaOjc04UbEZIaxV0bVfGjc7AXh81na JBStkruGqrMS1UGAKwx5gC+Iq4YM9aGi9WMw4FkO6QiRG46fdAjFsjsYVzafBtzzeTrC dFQQzBULQbznZHNpoJm+qcoCcmlNm3Rv0tSR/1AHd5oSP2+K4Ac1EHdW92znkTcXa1a8 aVMQ== X-Gm-Message-State: AHQUAuadVZoFiDL7G3bqDV11F4vk8BkwBTz2RRyxUBrBiUFFpOZUKYkJ TcLh6G/4wPhFAVls+tTUFwHXb6G8GdsAV2TfRLBdRQ== X-Received: by 2002:aca:eb13:: with SMTP id j19mr1311537oih.100.1549568943164; Thu, 07 Feb 2019 11:49:03 -0800 (PST) MIME-Version: 1.0 References: <20190116193958.6049-1-jae.hyun.yoo@linux.intel.com> In-Reply-To: <20190116193958.6049-1-jae.hyun.yoo@linux.intel.com> From: Brendan Higgins Date: Thu, 7 Feb 2019 11:48:51 -0800 Message-ID: Subject: Re: [PATCH] i2c: aspeed: Add multi-master use case support To: Jae Hyun Yoo Cc: Wolfram Sang , Benjamin Herrenschmidt , Joel Stanley , Andrew Jeffery , linux-i2c@vger.kernel.org, OpenBMC Maillist , Linux ARM , linux-aspeed@lists.ozlabs.org, Linux Kernel Mailing List , Jarkko Nikula , James Feist , Vernon Mauery 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, Jan 16, 2019 at 11:40 AM Jae Hyun Yoo wrote: > > In multi-master environment, this driver's master cannot know > exactly when a peer master sends data to this driver's slave so > cases can be happened that this master tries sending data through > the master_xfer function but slave data from a peer master is still > being processed or slave xfer is started by a peer immediately > after it queues a master command. To support multi-master use cases > properly, this H/W provides arbitration in physical level and it > provides priority based command handling too to avoid conflicts in > multi-master environment, means that if a master and a slave events > happen at the same time, H/W will handle a higher priority event > first and a pending event will be handled when bus comes back to > the idle state. > > To support this H/W feature properly, this patch adds the 'pending' > state of master and its handling code so that the pending master > xfer can be continued after slave operation properly. > > Signed-off-by: Jae Hyun Yoo > --- > drivers/i2c/busses/i2c-aspeed.c | 118 +++++++++++++++++++++++++------- > 1 file changed, 92 insertions(+), 26 deletions(-) > Reviewed-by: Brendan Higgins