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 BF3C8C433EF for ; Fri, 8 Oct 2021 07:17:53 +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 924756101A for ; Fri, 8 Oct 2021 07:17:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 924756101A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com 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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:CC:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1CN8ISXBT+1AU9Z+Af5Fn3GocisKstVGUXOl6Nf76kQ=; b=UtB5Z21mVshfUx oM+M2y8/zIFrBRTWFIWz0BbA0A+1lbkbcfuKnAHxqhT1W0INPC8wn/8LZwl+L0rQJLvAPSb1uuJxB mzUWEQql9FumwZDDsekWupxDXNNMN6cXiyucbwJxCD998M1jtNG3cDpabSPB5fvK37Rf3nmt+jYUw jqxj9kQ6jZV14SdpPAAV8n/eJunzvCZCnxNMpEuIRO5ynSmDJ9C5AyLtrFCxEFjXSRsTX0OtreDTh SbLD9VpKn+BX3ScWjjqnJhse1yolB4Ar6lpNnn3vx4JO/xHcMxRFKeypHdfj6vsLpOiRZr7e3EruO 3on8PAOVnJeLEevcFkEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYk73-001pFD-3S; Fri, 08 Oct 2021 07:16:13 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYk6z-001pDB-37; Fri, 08 Oct 2021 07:16:10 +0000 X-UUID: ba1dfd78cfea40cab0fe5e7dacd74452-20211008 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=qWjr+AiJvYo10hf1cS6L6W6bO/DtrFRJjsgwpRlO+3k=; b=rjLsj8+2NCkKY6qFoWiVjATBm9mrR/P/OnNoYMfPcJgOrPC+nkFCCJnFsCrKByACRiiG64Zahm9qw1AkGPl/6+H5LiXBfoC/xaYUXscmxXInOrLtTkvovnFGdzR+kCOhfLxr5PdQPeojBqE4JrRyQWNFvqlW2VdolCN6AqqOSgU=; X-UUID: ba1dfd78cfea40cab0fe5e7dacd74452-20211008 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1122887031; Fri, 08 Oct 2021 00:16:02 -0700 Received: from mtkmbs10n1.mediatek.inc (172.21.101.34) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 8 Oct 2021 00:13:20 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Fri, 8 Oct 2021 15:13:19 +0800 Received: from mhfsdcap04 (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 8 Oct 2021 15:13:18 +0800 Message-ID: <461ed34baaf49acda8a3287635f0b4670240cd35.camel@mediatek.com> Subject: Re: [PATCH v7 3/7] i2c: mediatek: Dump i2c/dma register when a timeout occurs From: Kewei Xu To: Wolfram Sang CC: , , , , , , , , , , , , , Date: Fri, 8 Oct 2021 15:13:21 +0800 In-Reply-To: References: <20210917101416.20760-1-kewei.xu@mediatek.com> <20210917101416.20760-4-kewei.xu@mediatek.com> X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211008_001609_159058_9F851A7B X-CRM114-Status: GOOD ( 16.95 ) 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, 2021-10-02 at 08:37 +0200, Wolfram Sang wrote: > > @@ -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. > > Yes, It is used for debugging,but dump the value of value of the > register is very important for debugging,so we think it is > necessary. We will use dev_dbg to replace dev_err in V8. Thanks~ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel