From patchwork Fri Nov 27 13:39:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 333620 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp2247364ilb; Fri, 27 Nov 2020 05:40:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzuNVM8THWVn5bk1IFXuCeQjG2DeTZ1bXT2xZMsVPT80s25pI8Q6HKnqpMS9WtKwhOEXM91 X-Received: by 2002:a05:6402:2059:: with SMTP id bc25mr7866292edb.13.1606484409492; Fri, 27 Nov 2020 05:40:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606484409; cv=none; d=google.com; s=arc-20160816; b=jg2ahiXZsmMKJXyK1m2/crwkQ8azrmjgdFS/RLl8EVr0nMPunlpyR8N5IfdAS44IKV Gsd+0i1YhA6lUHehujeVwJPAlRFxZvSxU+kkhAlRTg2rkfonTso/tZtCqFeNlyVWvMr2 GcGC8gNvRc4B2L1U+w149ifySAyIp+Dc5zWqqrZqfpdP+a2rUIsze5BUmgUaGmLZ3FCy mhtjlNZFb00YMIES0XoitjDfDGwcV+FTUNp/jkYVscKVxLrOIetsrM7W1QnLLeOFhXsL cR7S8DoVvB5JC89DWX6HSQVFfYvmhUBZuajtdF/c9LWlWpdo4ttjK9pQ7JgE5QxuT1wa tBEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=ZTzYDGlssiWZrUEFT2+YAeEh5ntk2vBgSh5UR1iN5dM=; b=RlojGa1j3tFNO1RQ2PnjyxiBGp1s3NGs3S2CJru7mdi7v/ANk0HTwTkmamY+mkpvwM +tR/HEo/80UWTqTgTL5XQLBzj9/82FQEOaxR8GtWcOVbpIfgZ+SP2FY0+wpHJk07iYmn lZtwHu0uHEqSJt0GFCIp9gHGL4LiFqlXYpr5zYOox2G1AILWFUGj05yw1ni5vjbH0D40 iMk0GYMeXOPg3G5N8ARCKQIG9Ti0oGaF+/z9eL54ds69bz3/twnvOO0cD2lYoT5UkQo1 CYQsHnX3gYP+0AkMjn1d+fxhVjewzZ5yJdkcbotC/vINQGJ1yQ4qHAOnbsGehbDqrbkj b/JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ULNlQGsr; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 91si6895697edy.541.2020.11.27.05.40.09; Fri, 27 Nov 2020 05:40:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-msm-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=@linaro.org header.s=google header.b=ULNlQGsr; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730517AbgK0Nj6 (ORCPT + 15 others); Fri, 27 Nov 2020 08:39:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729402AbgK0Nj5 (ORCPT ); Fri, 27 Nov 2020 08:39:57 -0500 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47BBDC0613D1 for ; Fri, 27 Nov 2020 05:39:56 -0800 (PST) Received: by mail-ej1-x641.google.com with SMTP id 7so7712470ejm.0 for ; Fri, 27 Nov 2020 05:39:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZTzYDGlssiWZrUEFT2+YAeEh5ntk2vBgSh5UR1iN5dM=; b=ULNlQGsr3qUNzH/jaEfgFSgEyxt6P0XKTUnq1MIA+5i44yiv0m/KnfBsBRFM19+Y+D RSScUObp4c25El6RzmLPoNg/JsufYS7LHJMAI8Oo+kbZBY1+ZE7komJ9u7CEfhmwBL2H HWZ6/nn2XkCunJ8v5w4GQxlK92VT28h5Wbc4n58j+Fc5AhffjZAgrVJ29bgICVLg5aoS aVC+WsED7UiDvLULIuqF4Duy778G+j1sR5X5VXB5v5owMwFLc0JYwo6JYhLowRBbuv0I 1780ULPOWodEfzXGZ1Pcy+rGSmYWLS8nhoLMTcoev+/wBAKySLxh4w8sVla71UFvlQ0U vSgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZTzYDGlssiWZrUEFT2+YAeEh5ntk2vBgSh5UR1iN5dM=; b=D3NUawx84dh9ClQAEp3r6ZKpO5oqU/Kbv4pq+594rFoWcsZngv4qeNn28kcgOfqaXH uGE4oMD64v+Gzb1GeoYgKI2LptMSebMCHzmAN4GjT84OYH6I1AWlQ5Fa8cTuf9k6oLTp gPqlTvqcNgEcnioOj/L7FL7Hc6fdQRzeQaDbQVEjSnZTTVdRM09ckUyCHCh9rnD6ee8b mZwhqJx3KGQ1cB5KBF3P+rtxmq0Yu3gOOQiq9nYNwc/EttJixdJbP7Aayo5V5RASqMHi JPYUBtAUXFnQUd5bTgVT4kTr9kLM79eKyTMvVrnLBuTVZ4Zl3T/Nrx2veUjU3tHePbkN r2nQ== X-Gm-Message-State: AOAM532rR3IJw9r52fpNVVCx1gVamrfvupxInadlFRYrPTQzRwsXZeIs AwkHPDlCYuXbNmAXuZ2KzOA+Kw== X-Received: by 2002:a17:906:7a18:: with SMTP id d24mr5856719ejo.324.1606484394871; Fri, 27 Nov 2020 05:39:54 -0800 (PST) Received: from localhost.localdomain ([2a02:2450:102f:d6a:a6a1:9dbe:c8e3:3524]) by smtp.gmail.com with ESMTPSA id z16sm4840092ejx.119.2020.11.27.05.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Nov 2020 05:39:54 -0800 (PST) From: Robert Foss To: loic.poulain@linaro.org, robert.foss@linaro.org, bjorn.andersson@linaro.org, wsa@kernel.org, todor.too@gmail.com, vkoul@kernel.org, linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam Subject: [PATCH v2] i2c: qcom: Fix IRQ error misassignement Date: Fri, 27 Nov 2020 14:39:37 +0100 Message-Id: <20201127133937.93208-1-robert.foss@linaro.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org During cci_isr() errors read from register fields belonging to i2c master1 are currently assigned to the status field belonging to i2c master0. This patch corrects this error, and always assigns master1 errors to the status field of master1. Fixes: e517526195de ("i2c: Add Qualcomm CCI I2C driver") Reported-by: Loic Poulain Suggested-by: Loic Poulain Signed-off-by: Robert Foss --- drivers/i2c/busses/i2c-qcom-cci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.27.0 Reviewed-by: Manivannan Sadhasivam diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c index f13735beca58..1c259b5188de 100644 --- a/drivers/i2c/busses/i2c-qcom-cci.c +++ b/drivers/i2c/busses/i2c-qcom-cci.c @@ -194,9 +194,9 @@ static irqreturn_t cci_isr(int irq, void *dev) if (unlikely(val & CCI_IRQ_STATUS_0_I2C_M1_ERROR)) { if (val & CCI_IRQ_STATUS_0_I2C_M1_Q0_NACK_ERR || val & CCI_IRQ_STATUS_0_I2C_M1_Q1_NACK_ERR) - cci->master[0].status = -ENXIO; + cci->master[1].status = -ENXIO; else - cci->master[0].status = -EIO; + cci->master[1].status = -EIO; writel(CCI_HALT_REQ_I2C_M1_Q0Q1, cci->base + CCI_HALT_REQ); ret = IRQ_HANDLED;