Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1780646pxb; Fri, 5 Feb 2021 00:57:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlDBAUhGv1hbT7IE1iFDluXcWfuxCD794keIvWaEHfxR3l9/8CGSPwa5liaM46AayzPqVV X-Received: by 2002:a17:906:494c:: with SMTP id f12mr3179642ejt.56.1612515444362; Fri, 05 Feb 2021 00:57:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612515444; cv=none; d=google.com; s=arc-20160816; b=lkhf9RJeElV9Pm405Tt9b0YaEstu7i7FWTVwBvcgDye1lyxTYMfiSTke3ZGpDZEsbp iWgymGHto9JszJ+f4+oC7egioJ4F8K00x+x2pxcDdRPUDsdvcjX7NVWLSBzKYIwhOcR6 QEhRIYX4TVT2v2UytCrwetflms1PWcOIs9xMrQyDfhltpTGN2VpHYMkC+VLcSYX1Q9Ro WSOYAaViXn3O5lW9iMy09Bd21rzp+QJ/YHeqHJQ/S3OG9L8HYY7nSlIBNmvQNizgCG/j YbZPzkevxZ0dSPgA+eAV9TUoiZXrgZWmQblMCuGg4LLQ5GebfK5c5GN8LmajkFUvJLzW jYeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=a/WzW5u9oZm4Te6wakI3Z6sVptDelyDPT1JPG6TGgag=; b=KsIrmAtfFnpvByBfqBMSrSje5r0uEjmVZ35otjZCiAMwRaxlPtwj0FEKyrqkiKfFM0 udg11Q3u/nrcVKLfYPwAvLXPV9+dsUD0Y3IVjEzRANGQ185VafcaiRj8CPI0GYLHuTd9 vjrhesDxICuoQmUxwKlJOfoFviN5euqPFrkijOFn3zxj27qz+y8SkuQQ72Y/O3KxvRO8 MQs71Zh4/jPqg7aXsi6RHQTQ0Mox/kO2U5I/+q0wHDjz0fmlwOKdrDbhW3Kol0jv0nKF vRGAHSHrHpTuSjc+n9fRxaWp1QJ9GfWeYNQQW+l6sFyj50YOGmXSFVn1O58faLrvxbur PzvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=1HK5VDL7; 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=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u23si5956213edi.71.2021.02.05.00.56.59; Fri, 05 Feb 2021 00:57:24 -0800 (PST) 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=@foss.st.com header.s=selector1 header.b=1HK5VDL7; 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=NONE dis=NONE) header.from=foss.st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229894AbhBEIxX (ORCPT + 99 others); Fri, 5 Feb 2021 03:53:23 -0500 Received: from mx07-00178001.pphosted.com ([185.132.182.106]:53886 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229720AbhBEIxE (ORCPT ); Fri, 5 Feb 2021 03:53:04 -0500 Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1158oe9c025982; Fri, 5 Feb 2021 09:52:08 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=selector1; bh=a/WzW5u9oZm4Te6wakI3Z6sVptDelyDPT1JPG6TGgag=; b=1HK5VDL7zr91nt5H11oRqFSg0FkcSCEJBolqlEV70tfB/9m18AgHD/ptj9S6khitsXrr 70yrP5TemjJdQ8Djj7iF4bwmS+hWTWAUkVMuhOsE8PKwRn8bI9D0BoFlKZJhRpGPzfYj fN0GEUbxza4y7Ym5LAMbVy4JpFpGGmSF2VyGz7C3TY3UiwNv/dsI9lZu7hklFHfHoxVy AZqbIJqdpIeBuTvh05kmGmVn9BDOt6/SlRwAUDj+oy8p9Iu/tCytjDSy16FGTkoy80Vf RPwVsTAaGP314HTckLDaNSxHyJ6GFsOp51TwPKDA+172okHp7kmB2xQQfyoIc+oclkPQ 2w== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 36ey7hev2k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 05 Feb 2021 09:52:08 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 2CA82100038; Fri, 5 Feb 2021 09:52:08 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node3.st.com [10.75.127.6]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 17FB8221794; Fri, 5 Feb 2021 09:52:08 +0100 (CET) Received: from localhost (10.75.127.46) by SFHDAG2NODE3.st.com (10.75.127.6) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 5 Feb 2021 09:52:07 +0100 From: Alain Volmat To: , CC: , , , , , , , , , , Subject: [PATCH 5/5] i2c: stm32f7: indicate the address being accessed on errors Date: Fri, 5 Feb 2021 09:51:44 +0100 Message-ID: <1612515104-838-6-git-send-email-alain.volmat@foss.st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1612515104-838-1-git-send-email-alain.volmat@foss.st.com> References: <1612515104-838-1-git-send-email-alain.volmat@foss.st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG3NODE1.st.com (10.75.127.7) To SFHDAG2NODE3.st.com (10.75.127.6) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.737 definitions=2021-02-05_06:2021-02-05,2021-02-05 signatures=0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To help debugging issues, add the address of the slave being accessed when getting an error. Signed-off-by: Alain Volmat --- drivers/i2c/busses/i2c-stm32f7.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c index f77cd6512a86..ef642fe1eb2c 100644 --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers/i2c/busses/i2c-stm32f7.c @@ -1602,7 +1602,8 @@ static irqreturn_t stm32f7_i2c_isr_error(int irq, void *data) /* Bus error */ if (status & STM32F7_I2C_ISR_BERR) { - dev_err(dev, "<%s>: Bus error\n", __func__); + dev_err(dev, "<%s>: Bus error accessing addr 0x%x\n", + __func__, f7_msg->addr); writel_relaxed(STM32F7_I2C_ICR_BERRCF, base + STM32F7_I2C_ICR); stm32f7_i2c_release_bus(&i2c_dev->adap); f7_msg->result = -EIO; @@ -1610,13 +1611,15 @@ static irqreturn_t stm32f7_i2c_isr_error(int irq, void *data) /* Arbitration loss */ if (status & STM32F7_I2C_ISR_ARLO) { - dev_dbg(dev, "<%s>: Arbitration loss\n", __func__); + dev_dbg(dev, "<%s>: Arbitration loss accessing addr 0x%x\n", + __func__, f7_msg->addr); writel_relaxed(STM32F7_I2C_ICR_ARLOCF, base + STM32F7_I2C_ICR); f7_msg->result = -EAGAIN; } if (status & STM32F7_I2C_ISR_PECERR) { - dev_err(dev, "<%s>: PEC error in reception\n", __func__); + dev_err(dev, "<%s>: PEC error in reception accessing addr 0x%x\n", + __func__, f7_msg->addr); writel_relaxed(STM32F7_I2C_ICR_PECCF, base + STM32F7_I2C_ICR); f7_msg->result = -EINVAL; } -- 2.17.1