Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3159605pxa; Tue, 25 Aug 2020 13:08:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLW7sC8cztalTRFKcaTC/iNYo/AmQmUtwJd2ZWcpF93bpbK3IsZ0DKD/pj7idtNoPhM5TC X-Received: by 2002:a17:906:5902:: with SMTP id h2mr12930497ejq.423.1598386113807; Tue, 25 Aug 2020 13:08:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598386113; cv=none; d=google.com; s=arc-20160816; b=gO/SJxXetTgzUIipS3dtjOnf8+mF3C13T+qX1rvbiBl+bYmptRpHqITAABItXfUk+k /0Zt0cPRD7tXhAb5th9JB0aS5QtGpJ9aB8GH7rd2VbbRP4MzZl8HaTMvwNRKicQHWwdm oZXGiABuss6SJU8VycMtpYqBRdu0N9N8MQQiI/8hYm8s0QW1K+b+jsSb3lNIr4D5z2I/ vDokCP508/Fq5folINXUAKIvrif4oSSRPyoj83T2W/QFqw4jDyEarkP77RFsa3e5smqZ jmUWCjWNnjiEcNLNXCCMnb9z3gBoUxWakbpkWnya2jVn11xXEMQCdecV+PZRWVYi1QNi 9+qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ONP7fZ70W2uCdTHIa7UQWtYrSdBuzbghSeSM9bNYZbY=; b=vRx3Sxx5rb4oPbWULnrVcS9o/AeaCupoDhbcyULT0s0EQ15KZpzgYv0AWtN8SwhWwR zcbIEu/BwaUB47QKB0Grk7nMke8nJ/US2Cwt3G/Al8Cw5GirF1aa/Du32VrGNwH07OCS K7NPlesbhANuxBAVIY+NjTqFNnawUaBFLjG46PmfKvWj6Evevm4iUM0EEwJvMXIKD8MK 5J+1FKW1ec6OA7o+tK4XByOVnrAlnKbATrRBiuJCxKPMfZ+OVsp1N1PC979PYL8n2nH1 aXg2qBiTUpycew7ZV0CQFcIDFAWG68sL4mcavFOTrcnskxdrDKG6HchFmFzbw9cWX9cl UOmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tgbmbD+w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bh4si43210ejb.193.2020.08.25.13.08.10; Tue, 25 Aug 2020 13:08:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tgbmbD+w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726645AbgHYUFd (ORCPT + 99 others); Tue, 25 Aug 2020 16:05:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726158AbgHYUFc (ORCPT ); Tue, 25 Aug 2020 16:05:32 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 339D3C061574; Tue, 25 Aug 2020 13:05:32 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id d19so7570250pgl.10; Tue, 25 Aug 2020 13:05:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ONP7fZ70W2uCdTHIa7UQWtYrSdBuzbghSeSM9bNYZbY=; b=tgbmbD+wfpJT0QWPEnhlgQF5kw4Vo5saQ52d9A56Z8Nv6AXKi4ehf1K3DM9u/s2bgF dTROYbcBlMs+/ptni+PJ0GjhZPMqvtTPGtl9YPsR2U80BWlbUqbs0BvOowHLqlcwqDSb aMS0u/X/DRHH4mdqzt/Wiwm+TORwj6G1JoziCoNnlxN20hY6ceAGoOVoebxtTkyTsA/t BT1ydtHIVivdjkMaIkMLzu6VyJmeJHd/pZY7fZ09qrDetg7EnCoiZsmx6r2J3R4zPnZB NshksLlzD2CKL3iR00HiCu8kXf2uUVbt14A45g3Pvc9WHzqrJJX8quZr7L/tQVZb2ded gaWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ONP7fZ70W2uCdTHIa7UQWtYrSdBuzbghSeSM9bNYZbY=; b=GLMK+FjETPSa8w+CIYFoADF3D13hyhs2qLlYr2/EvKlGuAO9/tLvZJ0/ph9hAenMDV A4tdclfZQXsRLfo5sv4GjXDO9IVl3APhUiSst0xTTsleqmAaD0xdAhSWqHtG24nMWa13 xlctVmakvy4HV76/e+9UA4JRjxPu3e50pk14gVOyph/Nrf0pOuQ6jaUId+s3cQm0MC09 NozBVpd2pbtE0Xt3bVVa7moyGzwmTB65Sip2Wikjcn/gh+JiMsLH571Xg1pDvFUC8ZQZ XmMftb7y9ynfjWUaL3Z7HGvGaaDR1s/qSQmdwUaJDmjJmRQFqXkvtHr0igNZ1CTNY/v7 mQXg== X-Gm-Message-State: AOAM530Pqnr3Y58/IQ9pKeqTU5rs8IgMRlWG0Fw/nJojUFpxgVFX8Hy7 hfv58q+Yf/gvPPRrFP1pKkJotx7V9ckR/MZv X-Received: by 2002:a62:1483:: with SMTP id 125mr8939252pfu.186.1598385931482; Tue, 25 Aug 2020 13:05:31 -0700 (PDT) Received: from taoren-ubuntu-R90MNF91 (c-73-252-146-110.hsd1.ca.comcast.net. [73.252.146.110]) by smtp.gmail.com with ESMTPSA id g8sm59446pfo.132.2020.08.25.13.05.30 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Aug 2020 13:05:30 -0700 (PDT) Date: Tue, 25 Aug 2020 13:05:24 -0700 From: Tao Ren To: Eddie James Cc: Joel Stanley , devicetree , linux-aspeed , dmitry.torokhov@gmail.com, Brendan Higgins , Linux Kernel Mailing List , Rob Herring , linux-i2c@vger.kernel.org, linux-input@vger.kernel.org, ryan_chen@aspeedtech.com Subject: Re: [PATCH 3/5] i2c: aspeed: Mask IRQ status to relevant bits Message-ID: <20200825200523.GA22083@taoren-ubuntu-R90MNF91> References: <20200820161152.22751-1-eajames@linux.ibm.com> <20200820161152.22751-4-eajames@linux.ibm.com> <8fc365dd-8a89-9e5c-ed70-093ef2bf7265@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8fc365dd-8a89-9e5c-ed70-093ef2bf7265@linux.ibm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 25, 2020 at 02:47:51PM -0500, Eddie James wrote: > > On 8/25/20 1:38 AM, Joel Stanley wrote: > > On Thu, 20 Aug 2020 at 16:12, Eddie James wrote: > > > Mask the IRQ status to only the bits that the driver checks. This > > > prevents excessive driver warnings when operating in slave mode > > > when additional bits are set that the driver doesn't handle. > > > > > > Signed-off-by: Eddie James > > > --- > > > drivers/i2c/busses/i2c-aspeed.c | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c > > > index 31268074c422..abf40f2af8b4 100644 > > > --- a/drivers/i2c/busses/i2c-aspeed.c > > > +++ b/drivers/i2c/busses/i2c-aspeed.c > > > @@ -604,6 +604,7 @@ static irqreturn_t aspeed_i2c_bus_irq(int irq, void *dev_id) > > > writel(irq_received & ~ASPEED_I2CD_INTR_RX_DONE, > > > bus->base + ASPEED_I2C_INTR_STS_REG); > > > readl(bus->base + ASPEED_I2C_INTR_STS_REG); > > > + irq_received &= 0xf000ffff; > > > irq_remaining = irq_received; > > This would defeat the check for irq_remaining. I don't think we want to do this. > > > > Can you explain why these bits are being set in slave mode? > > > No, I don't have any documentation for the bits that are masked off here, so > I don't know why they would get set. > > The check for irq_remaining is still useful for detecting that the driver > state machine might be out of sync with what the master is doing. I have a similar patch in my local tree, and the reason being: AST2600 I2C Controller may set I2CD10[25:24] to report Current Slave Parking Status (defined in new register I2CS24) even though the new register mode is off. The 2 bits can be ignored in legacy mode, and Ryan from ASPEED could confirm it. Cheers, Tao