From patchwork Mon Jun 15 15:49:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Hiremath X-Patchwork-Id: 49877 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A6714205DE for ; Mon, 15 Jun 2015 15:53:42 +0000 (UTC) Received: by laka10 with SMTP id a10sf5760528lak.2 for ; Mon, 15 Jun 2015 08:53:41 -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=DplgDgiS2n4xFPbW3+4k2W41yYBD0Ve8bCgm04FAAg8=; b=dZ80M34JZd7jKwJmIuAOxoZ2LTfJQldpuaUlPt1yUOiBgiykcUKovcV1ss0FgB3/wU jdr2U8dR7PRRVhtMg4hHfxGXgZIwvwB8iPLt7c6T0fiJ9IkN0i1mId12QfXLdkgfwtKd 07nbLLC4kBPoCcTi7Ac44xnH+1g9zsLpAoCNFdQXEJcB0fUw8nFV9/WZDVxahW8GsH5L kSFF4ZifIPpWUOv+ajRKBoSeyyd06+xCAfntGJu8b54epEYDcAORpaVSewFvMwm+i75a L38iP1NIbUia4EKeA0f+8cpt2EHKbgVE2mhH62O3/LA2xVsvBVK7P0JbBY+EoLOtNs6B RGGQ== X-Gm-Message-State: ALoCoQljs6FFn7ugnIRWUyKNrPyzchDNlAbKHWOIwad7RpjJLCbNhi3rYNgmUlNmJziRjrqKrvgt X-Received: by 10.180.89.231 with SMTP id br7mr20203289wib.0.1434383621651; Mon, 15 Jun 2015 08:53:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.97 with SMTP id c1ls843602laf.66.gmail; Mon, 15 Jun 2015 08:53:41 -0700 (PDT) X-Received: by 10.112.142.232 with SMTP id rz8mr887617lbb.74.1434383621462; Mon, 15 Jun 2015 08:53:41 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id q3si10778006laj.148.2015.06.15.08.53.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jun 2015 08:53:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbbti3 with SMTP id ti3so18908173lbb.1 for ; Mon, 15 Jun 2015 08:53:41 -0700 (PDT) X-Received: by 10.112.140.231 with SMTP id rj7mr908627lbb.76.1434383621355; Mon, 15 Jun 2015 08:53:41 -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 hn6csp1508886lbb; Mon, 15 Jun 2015 08:53:40 -0700 (PDT) X-Received: by 10.70.37.167 with SMTP id z7mr49853679pdj.55.1434383619327; Mon, 15 Jun 2015 08:53:39 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i6si18495084pdr.64.2015.06.15.08.53.38; Mon, 15 Jun 2015 08:53:39 -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 S1755803AbbFOPxi (ORCPT + 1 other); Mon, 15 Jun 2015 11:53:38 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:34952 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755790AbbFOPxh (ORCPT ); Mon, 15 Jun 2015 11:53:37 -0400 Received: by pacyx8 with SMTP id yx8so68112109pac.2 for ; Mon, 15 Jun 2015 08:53:36 -0700 (PDT) X-Received: by 10.68.65.6 with SMTP id t6mr30358893pbs.94.1434383616842; Mon, 15 Jun 2015 08:53:36 -0700 (PDT) Received: from localhost.localdomain ([202.62.77.106]) by mx.google.com with ESMTPSA id fs16sm12662484pdb.12.2015.06.15.08.53.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Jun 2015 08:53:35 -0700 (PDT) From: Vaibhav Hiremath To: linux-i2c@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, wsa@the-dreams.de, robert.jarzmik@free.fr, Vaibhav Hiremath , "Jett.Zhou" Subject: [PATCH-V2 06/12] i2c: pxa: Update debug function to dump more info on error Date: Mon, 15 Jun 2015 21:19:53 +0530 Message-Id: <1434383399-2370-7-git-send-email-vaibhav.hiremath@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434383399-2370-1-git-send-email-vaibhav.hiremath@linaro.org> References: <1434383399-2370-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.217.173 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. Also, use dev_err variants instead of printk. Signed-off-by: Jett.Zhou Signed-off-by: Vaibhav Hiremath Cc: Wolfram Sang --- drivers/i2c/busses/i2c-pxa.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index 810e9d0..b8b3856 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c @@ -132,6 +132,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; @@ -255,15 +256,20 @@ static void i2c_pxa_show_state(struct pxa_i2c *i2c, int lno, const char *fname) 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: msg_num: %d msg_idx: %d msg_ptr: %d\n", + struct device *dev = &i2c->adap.dev; + + dev_err(dev, "slave_0x%x error: %s\n", + i2c->req_slave_addr >> 1, why); + dev_err(dev, "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_DEBUG "i2c: log: "); + dev_err(dev, "IBMR: %08x IDBR: %08x ICR: %08x ISR: %08x\n", + readl(_IBMR(i2c)), readl(_IDBR(i2c)), readl(_ICR(i2c)), + readl(_ISR(i2c))); + dev_dbg(dev, "log: "); for (i = 0; i < i2c->irqlogidx; i++) - printk("[%08x:%08x] ", i2c->isrlog[i], i2c->icrlog[i]); - printk("\n"); + pr_debug("[%08x:%08x] ", i2c->isrlog[i], i2c->icrlog[i]); + + pr_debug("\n"); } #else /* ifdef DEBUG */ @@ -640,6 +646,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. @@ -959,6 +966,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.