Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp881607imu; Wed, 16 Jan 2019 09:04:13 -0800 (PST) X-Google-Smtp-Source: ALg8bN4B0uJLLq8B1GrWFCe5GbLGsIBpqjzHHmN0oMpekjLLKTw7UWfrA+3PRmhSJUXPC1zHCr2x X-Received: by 2002:a63:3703:: with SMTP id e3mr9631626pga.348.1547658253865; Wed, 16 Jan 2019 09:04:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547658253; cv=none; d=google.com; s=arc-20160816; b=u/GlrrJVdsaBaQLBhayE+UJl8LUh7zmNfYSO6DdpDUnB7BXI0VYv8QJd9n0KPq2DJb A798ZEZ8R6YEh6WHHScrdoCJQJSpKa0bo1gmHYFKbPJ7SHqNiU9byz4OJuAi6cLYedCZ NYfIZuOGznFAPE4ApoTvN3/WCY1OfridsJ4Ya8NZOeeCsV/a6GnKJeIwoV8TAmcEbFfU OHtNa8D0LmG3CDi/zQ0d50WCkDsEL2oVQfNqOUflLFUqcuQfbdqrYXzsDRi2JXPZUy4b VGMg8qlaj1b0ax4MoaOkzZ4tzmRdHEgRwK9cufCUNTI2uDZC9Ug99MPEQvBNUxgy1gNg lUAA== 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; bh=TS6Nfxa3WekFSN3TrYBqaRERnz+E1zcxktXlgYLbruI=; b=WWoU++JIkW+2bmjcRjLdQth+ilXI2CoHa4zKa67nhYrPY+UgGUr5lqQdbih5QUIn/R 6pLSFJDN+bnZkTa6mllkd3tAKnhsueq85mvwyJtl/gH6ugU6sMlaXN6NHpcCXw/p3TEP f28pVeo01GLm6oOs3pyT3s58yiqNpFGFhdyatoV5+yJbwtRZL8EftZiouK2854SsoIHQ Pj7sd+9VybFh4rgq7KqCFJ5bXd+kPGF7WPqV3PcsVGiXH1t67BbeNL+saVHLXBDZZjBH cQmv1vbuYFF/qsvWD+wuNXkvzrk0BiFUraisIrpwAP0ehU4ZdWFphACGAthlGuDDu8jU hodg== 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 u17si6491299pgl.586.2019.01.16.09.03.51; Wed, 16 Jan 2019 09:04:13 -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; 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 S2391439AbfAOXcf (ORCPT + 99 others); Tue, 15 Jan 2019 18:32:35 -0500 Received: from mga14.intel.com ([192.55.52.115]:42108 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728841AbfAOXce (ORCPT ); Tue, 15 Jan 2019 18:32:34 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jan 2019 15:32:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,483,1539673200"; d="scan'208";a="267421640" Received: from yoojae-mobl1.amr.corp.intel.com (HELO [10.7.153.143]) ([10.7.153.143]) by orsmga004.jf.intel.com with ESMTP; 15 Jan 2019 15:32:34 -0800 Subject: Re: [PATCH i2c-next v9 0/5] i2c: aspeed: Add bus idle waiting logic for multi-master use cases To: Wolfram Sang Cc: Brendan Higgins , Rob Herring , Joel Stanley , Benjamin Herrenschmidt , Mark Rutland , Andrew Jeffery , linux-i2c@vger.kernel.org, openbmc@lists.ozlabs.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, Jarkko Nikula , James Feist , Vernon Mauery References: <20181030210917.32711-1-jae.hyun.yoo@linux.intel.com> <20190115224713.duoha332mjlrmwji@ninjato> From: Jae Hyun Yoo Message-ID: Date: Tue, 15 Jan 2019 15:32:33 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <20190115224713.duoha332mjlrmwji@ninjato> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/15/2019 2:47 PM, Wolfram Sang wrote: > On Tue, Oct 30, 2018 at 02:09:11PM -0700, 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 a >> case can be happened that this master tries to send data through >> the master_xfer function but slave data from peer master is still >> being processed by this driver. To prevent state corruption in the >> case, this patch adds checking code if any slave operation is >> ongoing and it waits up to the bus timeout duration before starting >> a master_xfer operation. >> >> To support this change, it introduces changes on i2c-core-base to >> make that able to read the bus timeout and master transfer retries >> count values from device tree properties. >> >> Please review this patch set. > > Marking this as "Changes requested". I think if the mutex approach > works, these patches become obsolete then. > Hi Wolfram, Thanks for your touching base. I made and tested a new patch in my local. Actually, I couldn't use a mutex because it should provide locking between driver context and interrupt context. Instead, after taking lots of experiments, I checked that idle waiting can be supported by this H/W so I didn't need to use any locking method in the driver code for multi-master handling. I'll submit a new patch tomorrow using a different thread. Please drop this patch set. Thanks, Jae