From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB912C433EF for ; Sat, 2 Oct 2021 06:39:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8696C60FDA for ; Sat, 2 Oct 2021 06:39:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8696C60FDA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=the-dreams.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Uxh7fXtas4BNK99uFetFsZIexxb/0BgW5ts1hRzjDf8=; b=2V/ktyuEuPYJ2Zqx+b9EfRYgEb nv9pRMlJ5ol5Dw47CBA+tDhSlOEG3i2KllCfLUVeFm5GbCC3sn7BWrTxZ827H/4QOXDpvC+ODB03b KMi+WSpU2DEASdvCcPHiwXPxPWJEFceHmm/fF595BnAYllKGRCfruAuBjm+fmI8Nqt0yBmYJQh8xL Y/bpRhTfkkwgjvV1bUCrIjpn+EZ7MQ77BNtRu5aoq4idw0F1o2seEtHiHg3CvB6+f/71W0fIYkjwt iaF4QWPe+uVNRlGeyRuGpOVYNdE2PDxtSbRhMZ3FsvDHaPMVR5m91HTAC7aDfMWsPO5Hw7RV9mF3F lD+6QpFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWYeL-001qHa-Q8; Sat, 02 Oct 2021 06:37:33 +0000 Received: from sauhun.de ([88.99.104.3] helo=pokefinder.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWYeH-001qGV-O4; Sat, 02 Oct 2021 06:37:31 +0000 Received: from localhost (p5486c558.dip0.t-ipconnect.de [84.134.197.88]) by pokefinder.org (Postfix) with ESMTPSA id 0370B2C01D8; Sat, 2 Oct 2021 08:37:28 +0200 (CEST) Date: Sat, 2 Oct 2021 08:37:28 +0200 From: Wolfram Sang To: Kewei Xu Cc: matthias.bgg@gmail.com, robh+dt@kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, srv_heupstream@mediatek.com, leilk.liu@mediatek.com, qii.wang@mediatek.com, liguo.zhang@mediatek.com, caiyu.chen@mediatek.com, ot_daolong.zhu@mediatek.com, yuhan.wei@mediatek.com Subject: Re: [PATCH v7 3/7] i2c: mediatek: Dump i2c/dma register when a timeout occurs Message-ID: Mail-Followup-To: Wolfram Sang , Kewei Xu , matthias.bgg@gmail.com, robh+dt@kernel.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, srv_heupstream@mediatek.com, leilk.liu@mediatek.com, qii.wang@mediatek.com, liguo.zhang@mediatek.com, caiyu.chen@mediatek.com, ot_daolong.zhu@mediatek.com, yuhan.wei@mediatek.com References: <20210917101416.20760-1-kewei.xu@mediatek.com> <20210917101416.20760-4-kewei.xu@mediatek.com> MIME-Version: 1.0 In-Reply-To: <20210917101416.20760-4-kewei.xu@mediatek.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211001_233729_959516_5F687472 X-CRM114-Status: GOOD ( 10.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1854690233790888176==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============1854690233790888176== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="WnN6qXzV7lU+Tq+i" Content-Disposition: inline --WnN6qXzV7lU+Tq+i Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > @@ -837,6 +839,57 @@ static int mtk_i2c_set_speed(struct mtk_i2c *i2c, unsigned int parent_clk) > return 0; > } > +static void i2c_dump_register(struct mtk_i2c *i2c) > +{ > + dev_err(i2c->dev, "SLAVE_ADDR: 0x%x, INTR_MASK: 0x%x\n", > + mtk_i2c_readw(i2c, OFFSET_SLAVE_ADDR), > + mtk_i2c_readw(i2c, OFFSET_INTR_MASK)); I think this is too verbose and should be a debugging only patch not really suited for upstream. But if you like it this way, then keep the verbosity. However, dev_err is too strong, this really needs to be dev_dbg. Timeouts can happen on an I2C bus, think about an EEPROM in a long erase cycle while you want to read it. Perfectly normal. > if (ret == 0) { > - dev_dbg(i2c->dev, "addr: %x, transfer timeout\n", msgs->addr); > + dev_err(i2c->dev, "addr: %x, transfer timeout\n", msgs->addr); > + i2c_dump_register(i2c); Needs to stay dev_dbg as well. --WnN6qXzV7lU+Tq+i Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmFX/igACgkQFA3kzBSg Kbbp2hAAglx55ZKyMUuZ9OqPQ9uAScg0Tf3qeup5IFLV3AR2uLSpW3ONvZT7aCZv E2rZ4gZl/mLdRmeMBRsWIOSbanA1bjG0ddCTOMnuPhYrGo9Rv5qVW7CUfBRp3cMj rt590cr0/Jqbn3TyrM9N7/baathuJDpoTS1RlOC3t0BtivDWmaPghBR3MKUryNmp lqCbNEpOwG3Xrd69O4oNFCo/Pox862cyaAdMEBJfoJvk8O31fHkVbtGuhnN4Vh1N Z3NXYvISdxon71h0XvwTkzs5oX2PpV3oR1oBXUdAv+mWsk9ti9uxQorOcmyL1x7B HWQaBYyl+gpyHFElcYlM4h3TTUw3I/WzWBHwba5mjKl5fRD4EPBKhwoBdWYccQn9 3nbmlOkEdhylMQBjI8pd0kpoAvegpHbtHfeGSo1/hyOi66UdX1kIA65emq+kaHjJ cCsjzGQE6QCm3GJ607qA1IIJaoCkqUvwrFTMy6VW0i/A9dMPtHiaN1spbFo8JyG1 wDiWziHNaiqage6Xo2jgevrqmfp+wV7JwcxR+JJHs6nTApYCzsfB3iaqupL9adBu 7fcNnGENR6oTSiaP8P55IaC/wHhqfZHcKDky02SqnOXQVfZvf4A7U5rQgTV7dL9y XbS16Zxl+/jIZyQi9Ys9cuj3HzoZnzVzkDwGT5M2rk45kvhUljI= =PiQy -----END PGP SIGNATURE----- --WnN6qXzV7lU+Tq+i-- --===============1854690233790888176== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============1854690233790888176==--