Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp252212imm; Wed, 3 Oct 2018 15:33:07 -0700 (PDT) X-Google-Smtp-Source: ACcGV60blrSannQrj0+obRQYvXT7LtCHGk82JiB6YNfY9Y39YhR6ahXlgv9ySNuuUMk407gBN41Y X-Received: by 2002:a62:c186:: with SMTP id i128-v6mr3756032pfg.248.1538605987772; Wed, 03 Oct 2018 15:33:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538605987; cv=none; d=google.com; s=arc-20160816; b=s1oJubKwJap+IRP0tWvhwTBnB3L9ovT4oaU99objCXw5dDeuBSdwzpFGgE4QJ+m2Mx P7psy9NZtSuiCTg81hzIXsp/UuaCJV6v5KMPJk5V2xA7zjjseQzna8UFNJtdYwGAciUK m08Xbbd5phr8EJm9x+AMXZuI+zayaf5r8OTLAYunQ8+uiBGMb/EnCeb0lcN1Da+ZZW61 rKjXSjaNSQF96ZQHr/zTKt8UmzDSAliy63yDgkoghbOtm6XHq9ahUrxZLA8DoQ8HLU2n cCznaPfDR0IEgSUTreuU+iyAbpuGzvmbeGeBDhLvnXmsGhPXL0ChVTaX7ne0h0SFT+Lf HQZQ== 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:mime-version :message-id:date:subject:cc:to:from; bh=g6EX/XwGdLUWA3a09qNrejZsp16CnSPHb+v2ZV/Alb0=; b=PAQCVmwoVKLFTQUbNNHE1tZ69zH1ZSEQQdDa+YcXSWNgM6MU9DIXRyXKpjyS953q6u SDFJxhTw5CMBJRjt/Be9JfqbrFQU/LgaZ8G+L22uZjvU78t614PgSoDQCmQPK5GpUm/S 0gOjRgNgzSICRELwmZIETQ7euykKXLIAM+i3uR/2as3C5v7xcIJcSwKz9EfLPiV2PmiC TZWxs/opULGlEDMhUnM16TyDC9jidsnrJIEpflr81HNkVQYIhZDvwCg+YJ9Pr4VlAf5E FfThSg2J1VTqV+89BUvrgxU+P0DTovhkGIfeCVehWOj1tfzVx0TdQXXQUdRLcUKoBAdm TU0A== 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 f2-v6si3252341pln.270.2018.10.03.15.32.52; Wed, 03 Oct 2018 15:33:07 -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 S1727279AbeJDFVa (ORCPT + 99 others); Thu, 4 Oct 2018 01:21:30 -0400 Received: from mga02.intel.com ([134.134.136.20]:1942 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726209AbeJDFVa (ORCPT ); Thu, 4 Oct 2018 01:21:30 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Oct 2018 15:31:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,337,1534834800"; d="scan'208";a="97208499" Received: from maru.jf.intel.com ([10.54.51.77]) by orsmga002.jf.intel.com with ESMTP; 03 Oct 2018 15:31:09 -0700 From: Jae Hyun Yoo To: Brendan Higgins , Wolfram Sang , Benjamin Herrenschmidt , Joel Stanley , Rob Herring , 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 Cc: Jarkko Nikula , James Feist , Vernon Mauery , Jae Hyun Yoo Subject: [PATCH i2c-next v5 0/5] i2c: aspeed: Add bus idle waiting logic for multi-master use cases Date: Wed, 3 Oct 2018 15:31:02 -0700 Message-Id: <20181003223107.16133-1-jae.hyun.yoo@linux.intel.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In multi-master environment, this driver's master cannot know exactly when 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. Thanks, -Jae Changes since v3: - Changed the property name to 'timeout' and made it use the default setting in i2c-core when not specified. Changes since v2: - Changed the property name to 'aspeed,timeout' and made it to update the adapter's timeout configuration. Changes since v1: - Changed define names of timeout related. Jae Hyun Yoo (5): dt-bindings: i2c: Add 'timeout-ms' and '#retries' properties as common optional i2c: Add support for 'timeout-ms' and '#retries' OF properties dt-bindings: i2c: aspeed: Add 'timeout-ms' property as an optional property i2c: aspeed: Remove hard-coded bus timeout value setting i2c: aspeed: Add bus idle waiting logic for multi-master use cases .../devicetree/bindings/i2c/i2c-aspeed.txt | 3 ++ Documentation/devicetree/bindings/i2c/i2c.txt | 6 +++ drivers/i2c/busses/i2c-aspeed.c | 54 +++++++++++++------ drivers/i2c/i2c-core-base.c | 18 ++++++- 4 files changed, 63 insertions(+), 18 deletions(-) -- 2.19.0