From patchwork Thu May 28 13:03:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Hiremath X-Patchwork-Id: 6498601 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C8A749F38C for ; Thu, 28 May 2015 13:16:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC396205C4 for ; Thu, 28 May 2015 13:16:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D18CD20529 for ; Thu, 28 May 2015 13:16:26 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yxxcm-0001VR-IF; Thu, 28 May 2015 13:13:28 +0000 Received: from mail-pa0-f54.google.com ([209.85.220.54]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YxxWu-0005Ag-Dn for linux-arm-kernel@lists.infradead.org; Thu, 28 May 2015 13:07:26 +0000 Received: by paza2 with SMTP id a2so23316719paz.3 for ; Thu, 28 May 2015 06:07:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Cj12ARvD2o45Qyb0uU96GbyUaEB/wT3pApWrA2+A+e8=; b=KOCGEUvH7c4RhQQI3CrQbRYw9vhfd7MHWvuGOo9gDCvR/rOD6nnKM4EaDyzI5rM7Nq W6SHDLKLXYmXShqVED8fNfKB02MGQ9aYxeEM7/0USQ9w76BpspkghxnAFQRFDNodAcln /49xDZug19IUGrgXXeJCdTdrPoV7Igm9RSp5ZqAmJOLy+N3jrmVEu3cF0XWPDoSVhPGm LSbiTrCEZeWz/Kg1eY4XkPGZEsz4F7sA/UOkZNTdTsOS97qqqrD43U3ItgVlEEVmCieV AQridtOluNCD7T998n85mERSxsUmJm8OQvUlFVVSZmfHEhN4Sf9t1Hk63J5Lp2I0EVQj nnXQ== X-Gm-Message-State: ALoCoQn8UKqVWV3p9AMCZkgDynlkgJMQyXUt5br+LfrRVtBvj3x+QeiskP/VThblnVXKaGpGM59M X-Received: by 10.70.100.168 with SMTP id ez8mr5232898pdb.129.1432818422571; Thu, 28 May 2015 06:07:02 -0700 (PDT) Received: from localhost.localdomain ([202.62.77.106]) by mx.google.com with ESMTPSA id dc5sm2392557pbc.53.2015.05.28.06.06.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 May 2015 06:07:01 -0700 (PDT) From: Vaibhav Hiremath To: linux-i2c@vger.kernel.org Subject: [PATCH 10/12] i2c: pxa: Update debug function to dump more info on error Date: Thu, 28 May 2015 18:33:42 +0530 Message-Id: <1432818224-17070-11-git-send-email-vaibhav.hiremath@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432818224-17070-1-git-send-email-vaibhav.hiremath@linaro.org> References: <1432818224-17070-1-git-send-email-vaibhav.hiremath@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150528_060724_535118_F72A9D90 X-CRM114-Status: GOOD ( 11.89 ) X-Spam-Score: -0.7 (/) Cc: "Jett.Zhou" , Vaibhav Hiremath , linux-arm-kernel@lists.infradead.org, Wolfram Sang X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Update i2c_pxa_scream_blue_murder() fn to print more information in case of error. Signed-off-by: Jett.Zhou [vaibhav.hiremath@linaro.org: Split patches into logical changes and update the Changelog] Signed-off-by: Vaibhav Hiremath Cc: Wolfram Sang Signed-off-by: Vaibhav Hiremath --- drivers/i2c/busses/i2c-pxa.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index cf6c383..065e647 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c @@ -147,6 +147,7 @@ struct pxa_i2c { unsigned int msg_idx; unsigned int msg_ptr; unsigned int slave_addr; + unsigned int req_slave_addr; struct i2c_adapter adap; struct clk *clk; @@ -335,11 +336,13 @@ err_out: static void i2c_pxa_scream_blue_murder(struct pxa_i2c *i2c, const char *why) { unsigned int i; - printk(KERN_ERR "i2c: error: %s\n", why); + printk(KERN_ERR"i2c: <%s> slave_0x%x error: %s\n", i2c->adap.name, + i2c->req_slave_addr >> 1, why); printk(KERN_ERR "i2c: msg_num: %d msg_idx: %d msg_ptr: %d\n", i2c->msg_num, i2c->msg_idx, i2c->msg_ptr); - printk(KERN_ERR "i2c: ICR: %08x ISR: %08x\n", - readl(_ICR(i2c)), readl(_ISR(i2c))); + printk(KERN_ERR "i2c: IBMR: %08x IDBR: %08x ICR: %08x ISR: %08x\n", + readl(_IBMR(i2c)), readl(_IDBR(i2c)), readl(_ICR(i2c)), + readl(_ISR(i2c))); printk(KERN_DEBUG "i2c: log: "); for (i = 0; i < i2c->irqlogidx; i++) printk("[%08x:%08x] ", i2c->isrlog[i], i2c->icrlog[i]); @@ -736,6 +739,7 @@ static inline void i2c_pxa_start_message(struct pxa_i2c *i2c) * Step 1: target slave address into IDBR */ writel(i2c_pxa_addr_byte(i2c->msg), _IDBR(i2c)); + i2c->req_slave_addr = i2c_pxa_addr_byte(i2c->msg); /* * Step 2: initiate the write. @@ -1055,6 +1059,7 @@ static void i2c_pxa_irq_txempty(struct pxa_i2c *i2c, u32 isr) * Write the next address. */ writel(i2c_pxa_addr_byte(i2c->msg), _IDBR(i2c)); + i2c->req_slave_addr = i2c_pxa_addr_byte(i2c->msg); /* * And trigger a repeated start, and send the byte.