Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1139755imd; Thu, 1 Nov 2018 10:48:38 -0700 (PDT) X-Google-Smtp-Source: AJdET5c2D0sEuZg6Ky54ih76ckiLEKfARBlRWcKMv2dpeSv4opCgvpv0kFN3bhDfm3Kdq+n1FyWW X-Received: by 2002:a17:902:8a8c:: with SMTP id p12-v6mr8458565plo.133.1541094518594; Thu, 01 Nov 2018 10:48:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541094518; cv=none; d=google.com; s=arc-20160816; b=BmZ0a2xfIaKkGGtxXxeRYRJE4r1IiVu8O519ZG+yUVzQkm+xBRl1quREdccbndphKX Xni7YOBJaAye6KC/xD7eWADsU4ct+at664BDEU2A3zKPu/8j3ZWYf2QBrZC8p4/Mdd8U uCHJl6MTUzQlAXexoohLn+WQP0JvKKvpuIdACUAUUXFj3SHj97BIz85TzkOWQvKIk+gv 1rQGdxwtc5qLkNct3z8oubWQMP9Nj1adM4yWF4VcMMQ21ROrtKs3GR9O4E2zG5SiCWKm oz9hFv9LxpxhVwdWzns7vGQjMU/sm8RjqTCkLaE5aTLol0X+EsN2o5+8T3ATixAHBZbQ SjSA== 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=6Tdkb7Ij6K06fqNZALd4gKEHVJ2uFTniHkkqxifeHtA=; b=lvtZbaPBsTj1UAPuLunM5l5LG7J6+UFOWLkp7V8traGeoMJweIT5oIQfqFiB6gmOEC ztwti0AYA4GRgea2Qf4dxJ3g0xYqQf5iRfDlbn3VANhQ4xgCWrg2yyt2bLTW9p23lH64 urmdlC2pQJJ4y7tGiZTO2JIEOyifHLe7yBfsyp+TANwdYGfCPMWv0R7vMF1WI7kK+Y8m 05wzU6ZI4yrOfMblq0+dxmCIxB9PskEurPtYQvMSzWMNkNKco17LHlLyJ7sQUr1UZgwP wIhYpWf2RHSG6zsXL2SlLuMY3vk/Vxl6F2Q5GYrFcu0F5JA8R/gpYALEL3TsydqoH7yg CHZA== 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 gn11si29600523plb.19.2018.11.01.10.48.23; Thu, 01 Nov 2018 10:48:38 -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 S1728020AbeKBCuX (ORCPT + 99 others); Thu, 1 Nov 2018 22:50:23 -0400 Received: from mga01.intel.com ([192.55.52.88]:61502 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727465AbeKBCuX (ORCPT ); Thu, 1 Nov 2018 22:50:23 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Nov 2018 10:46:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,453,1534834800"; d="scan'208";a="82693278" Received: from maru.jf.intel.com ([10.54.51.77]) by fmsmga007.fm.intel.com with ESMTP; 01 Nov 2018 10:46:25 -0700 From: Jae Hyun Yoo To: Brendan Higgins , Benjamin Herrenschmidt , Joel Stanley , Andrew Jeffery , linux-i2c@vger.kernel.org, openbmc@lists.ozlabs.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: aspeed: Fix an incorrect error log printing Date: Thu, 1 Nov 2018 10:46:21 -0700 Message-Id: <20181101174621.8266-1-jae.hyun.yoo@linux.intel.com> X-Mailer: git-send-email 2.19.1 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 Usually a SLAVE_MATCH and an RX_DONE intterupts come together at the same time in most cases but rarely these come separately like SLAVE_MATCH first and then RX_DONE right after that. Current slave irq handler prints out an error message if the latter case happens but this is not an actual error, so this commit fixes the incorrect error log printing and makes the handler initialize slave state if an incorrect state actually happens. Signed-off-by: Jae Hyun Yoo --- drivers/i2c/busses/i2c-aspeed.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c index 8dc9161ced38..e9312d90ff7d 100644 --- a/drivers/i2c/busses/i2c-aspeed.c +++ b/drivers/i2c/busses/i2c-aspeed.c @@ -311,9 +311,13 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status) case ASPEED_I2C_SLAVE_STOP: i2c_slave_event(slave, I2C_SLAVE_STOP, &value); break; + case ASPEED_I2C_SLAVE_START: + /* Slave was just started. Waiting for the next irq. */; + break; default: - dev_err(bus->dev, "unhandled slave_state: %d\n", + dev_err(bus->dev, "unknown slave_state: %d\n", bus->slave_state); + bus->slave_state = ASPEED_I2C_SLAVE_STOP; break; } -- 2.19.1