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: 49111 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ACCF8202A3 for ; Thu, 28 May 2015 13:07:08 +0000 (UTC) Received: by wifq9 with SMTP id q9sf13724005wif.3 for ; Thu, 28 May 2015 06:07:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=ajb2lhGOyCc6DQF8L1va/eviRD8uwtRNpUUSlsL0Dn0=; b=DkdDRUdWYqz0zqwPE6kcOo1/pIcngeuJqY2hgcuPWe8CldPnaQrRmcCalnlXwahFz0 b7nEV4H0fVA7Y+xRJpvvGo7C6p5ENTL2e+sdFiz+2ySeOqTGOJq4y0c2WJBOb+kqp8zZ xr5RZVD65XoMmwrQUc1NM8IueMn5zptKvTdTAlIgm2XFUZzg7Je5o63FY1qoH7L8+WwB k0Y8agQOBx0q6hTnUC3jQZAzSmnmOPjXq2576L1z5bzzl7uV/OgfC3Le1yPGVpKYwMBJ pu3rZ6IEuf6OWdHznIJht0z+5wv53FJ6foxHaddQmv6C8Lfz7zSnwlHwCEbFpNbhD6EC QSxQ== X-Gm-Message-State: ALoCoQl5DuUOf3NKwh2TvlLdAPuBqxD+eQppcX6UlKUNIvBiCZme0RSIYnkIzYGgNXiIj5l3xRWN X-Received: by 10.112.122.39 with SMTP id lp7mr2573115lbb.5.1432818427731; Thu, 28 May 2015 06:07:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.228 with SMTP id z4ls83407lal.90.gmail; Thu, 28 May 2015 06:07:07 -0700 (PDT) X-Received: by 10.152.21.136 with SMTP id v8mr2699305lae.19.1432818427585; Thu, 28 May 2015 06:07:07 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id qf12si1932339lbc.6.2015.05.28.06.07.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 May 2015 06:07:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lagv1 with SMTP id v1so31203950lag.3 for ; Thu, 28 May 2015 06:07:07 -0700 (PDT) X-Received: by 10.152.21.136 with SMTP id v8mr2699283lae.19.1432818427347; Thu, 28 May 2015 06:07:07 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1144627lbb; Thu, 28 May 2015 06:07:06 -0700 (PDT) X-Received: by 10.68.191.167 with SMTP id gz7mr5327061pbc.43.1432818425535; Thu, 28 May 2015 06:07:05 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id em5si3485083pbb.256.2015.05.28.06.07.04; Thu, 28 May 2015 06:07:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753678AbbE1NHD (ORCPT + 1 other); Thu, 28 May 2015 09:07:03 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:33311 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752113AbbE1NHD (ORCPT ); Thu, 28 May 2015 09:07:03 -0400 Received: by padbw4 with SMTP id bw4so23214192pad.0 for ; Thu, 28 May 2015 06:07:02 -0700 (PDT) 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 Cc: Wolfram Sang , linux-arm-kernel@lists.infradead.org, Vaibhav Hiremath , "Jett.Zhou" 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> Sender: linux-i2c-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-i2c@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: vaibhav.hiremath@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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.