mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: leon.woestenberg@gmail.com
To: jarod@wilsonet.com
To: "Naren (Narendra) Sankar" <nsankar@broadcom.com>
To: "hancockrwd@gmail.com" <hancockrwd@gmail.com>
To: "jarod@redhat.com" <jarod@redhat.com>
To: "davilla@4pi.com" <davilla@4pi.com>
To: "abraham.manu@gmail.com" <abraham.manu@gmail.com>
To: Linux Kernel List <linux-kernel@vger.kernel.org>
To: Leon Woestenberg <leon@sidebranch.com>
Subject: [PATCH] staging: crystalhd: printk register accesses to debug for big-endian systems
Date: Tue, 23 Mar 2010 06:43:00 -0700 (PDT)	[thread overview]
Message-ID: <4ba8c564.8109cc0a.6677.4856@mx.google.com> (raw)

The CrystalHD device driver assumes a little endian host. In order to verify future work on
endianess-independence, this patch adds printk's to track the register access to the device.

This helps verify bitfield endianess correctness as well as any hard-coded assumptions in
the driver code.

Signed-off-by: Leon Woestenberg <leon@sidebranch.com>



--- git.orig/drivers/staging/crystalhd/crystalhd_misc.c	2010-03-21 16:05:52.000000000 +0100
+++ git/drivers/staging/crystalhd/crystalhd_misc.c	2010-03-23 13:44:45.324121364 +0100
@@ -140,12 +140,14 @@
  */
 uint32_t bc_dec_reg_rd(struct crystalhd_adp *adp, uint32_t reg_off)
 {
+	uint32_t val;
 	if (!adp || (reg_off > adp->pci_mem_len)) {
 		BCMLOG_ERR("dec_rd_reg_off outof range: 0x%08x\n", reg_off);
 		return 0;
 	}
-
-	return readl(adp->addr + reg_off);
+	val = readl(adp->addr + reg_off);
+	printk(KERN_DEBUG "bc_dec_reg_rd(): read(0x%p) = 0x%08x\n", adp->addr + reg_off, val);
+	return val;
 }
 
 /**
@@ -167,6 +169,7 @@
 		BCMLOG_ERR("dec_wr_reg_off outof range: 0x%08x\n", reg_off);
 		return;
 	}
+	printk(KERN_DEBUG "bc_dec_reg_wr(): writel(0x%08x @ 0x%p).\n", val, adp->addr + reg_off);
 	writel(val, adp->addr + reg_off);
 	udelay(8);
 }
@@ -186,11 +189,14 @@
  */
 uint32_t crystalhd_reg_rd(struct crystalhd_adp *adp, uint32_t reg_off)
 {
+	uint32_t val;
 	if (!adp || (reg_off > adp->pci_i2o_len)) {
-		BCMLOG_ERR("link_rd_reg_off outof range: 0x%08x\n", reg_off);
+		printk(KERN_DEBUG "link_rd_reg_off outof range: 0x%08x\n", reg_off);
 		return 0;
 	}
-	return readl(adp->i2o_addr + reg_off);
+	val = readl(adp->i2o_addr + reg_off);
+	printk(KERN_DEBUG "crystalhd_reg_rd(): read(0x%p) = 0x%08x\n", adp->i2o_addr + reg_off, val);
+	return val;
 }
 
 /**
@@ -213,6 +219,7 @@
 		BCMLOG_ERR("link_wr_reg_off outof range: 0x%08x\n", reg_off);
 		return;
 	}
+	printk(KERN_DEBUG "crystalhd_reg_wr(): writel(0x%08x @ 0x%p).\n", val, adp->i2o_addr + reg_off);
 	writel(val, adp->i2o_addr + reg_off);
 }
 

                 reply	other threads:[~2010-03-23 13:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ba8c564.8109cc0a.6677.4856@mx.google.com \
    --to=leon.woestenberg@gmail.com \
    --cc=jarod@wilsonet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome