All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy_d_dunlap@linux.intel.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: linux-ide@vger.kernel.org, akpm@osdl.org, jgarzik@pobox.com
Subject: [PATCH 5/13] ATA ACPI: use debugging macros
Date: Wed, 22 Feb 2006 13:55:42 -0800	[thread overview]
Message-ID: <20060222135542.33fe242c.randy_d_dunlap@linux.intel.com> (raw)
In-Reply-To: <20060222133241.595a8509.randy_d_dunlap@linux.intel.com>

From: Randy Dunlap <randy_d_dunlap@linux.intel.com>

Add more libata-acpi debugging, plus controlled by libata.printk value.

Signed-off-by: Randy Dunlap <randy_d_dunlap@linux.intel.com>
---
 drivers/scsi/libata-acpi.c |   53 ++++++++++++++++++++++++++++-----------------
 1 file changed, 34 insertions(+), 19 deletions(-)

--- linux-2616-rc4-ata.orig/drivers/scsi/libata-acpi.c
+++ linux-2616-rc4-ata/drivers/scsi/libata-acpi.c
@@ -371,17 +371,20 @@ int do_drive_get_GTF(struct ata_port *ap
 	status = acpi_evaluate_object(atadev->obj_handle, "_GTF",
 					NULL, &output);
 	if (ACPI_FAILURE(status)) {
-		printk(KERN_DEBUG
-			"%s: Run _GTF error: status = 0x%x\n",
-			__FUNCTION__, status);
+		if (ata_msg_probe(ap))
+			printk(KERN_DEBUG
+				"%s: Run _GTF error: status = 0x%x\n",
+				__FUNCTION__, status);
 		goto out;
 	}
 
 	if (!output.length || !output.pointer) {
-		printk(KERN_DEBUG
-			"%s: Run _GTF: length or ptr is NULL (0x%llx, 0x%p)\n",
-			__FUNCTION__,
-			(unsigned long long)output.length, output.pointer);
+		if (ata_msg_probe(ap))
+			printk(KERN_DEBUG "%s: Run _GTF: "
+				"length or ptr is NULL (0x%llx, 0x%p)\n",
+				__FUNCTION__,
+				(unsigned long long)output.length,
+				output.pointer);
 		acpi_os_free(output.pointer);
 		goto out;
 	}
@@ -389,23 +392,32 @@ int do_drive_get_GTF(struct ata_port *ap
 	out_obj = output.pointer;
 	if (out_obj->type != ACPI_TYPE_BUFFER) {
 		acpi_os_free(output.pointer);
-		printk(KERN_DEBUG "%s: Run _GTF: error: "
-			"expected object type of ACPI_TYPE_BUFFER, got 0x%x\n",
-			__FUNCTION__, out_obj->type);
+		if (ata_msg_probe(ap))
+			printk(KERN_DEBUG "%s: Run _GTF: error: "
+				"expected object type of ACPI_TYPE_BUFFER, "
+				"got 0x%x\n",
+				__FUNCTION__, out_obj->type);
 		err = -ENOENT;
 		goto out;
 	}
 
-	if (out_obj->buffer.length % REGS_PER_GTF) {
+	if (!out_obj->buffer.length || !out_obj->buffer.pointer ||
+	    out_obj->buffer.length % REGS_PER_GTF) {
 		if (ata_msg_drv(ap))
-			printk(KERN_ERR "%s: unexpected GTF length (%d)\n",
-				__FUNCTION__, out_obj->buffer.length);
+			printk(KERN_ERR
+				"%s: unexpected GTF length (%d) or addr (0x%p)\n",
+				__FUNCTION__, out_obj->buffer.length,
+				out_obj->buffer.pointer);
 		err = -ENOENT;
 		goto out;
 	}
 
 	*gtf_length = out_obj->buffer.length;
 	*gtf_address = (unsigned long)out_obj->buffer.pointer;
+	if (ata_msg_probe(ap))
+		printk(KERN_DEBUG "%s: returning "
+			"gtf_length=%d, gtf_address=0x%lx\n",
+			__FUNCTION__, *gtf_length, *gtf_address);
 	err = 0;
 out:
 	return err;
@@ -510,8 +522,9 @@ int do_drive_set_taskfiles(struct ata_po
 
 	if (ata_msg_probe(ap))
 		printk(KERN_DEBUG
-			"%s: total GTF bytes = %u (0x%x), gtf_count = %d\n",
-			__FUNCTION__, gtf_length, gtf_length, gtf_count);
+			"%s: total GTF bytes=%u (0x%x), gtf_count=%d, addr=0x%lx\n",
+			__FUNCTION__, gtf_length, gtf_length, gtf_count,
+			gtf_address);
 	if (gtf_length % REGS_PER_GTF) {
 		if (ata_msg_drv(ap))
 			printk(KERN_ERR "%s: unexpected GTF length (%d)\n",
@@ -553,8 +566,9 @@ int ata_acpi_exec_tfs(struct ata_port *a
 		return 0;
 
 	for (ix = 0; ix < ATA_MAX_DEVICES; ix++) {
-		printk(KERN_DEBUG "%s: call get_GTF, ix=%d\n",
-			__FUNCTION__, ix);
+		if (ata_msg_probe(ap))
+			printk(KERN_DEBUG "%s: call get_GTF, ix=%d\n",
+				__FUNCTION__, ix);
 		ret = do_drive_get_GTF(ap, &ap->device[ix],
 				&gtf_length, &gtf_address);
 		if (ret < 0) {
@@ -564,8 +578,9 @@ int ata_acpi_exec_tfs(struct ata_port *a
 			break;
 		}
 
-		printk(KERN_DEBUG "%s: call set_taskfiles, ix=%d\n",
-			__FUNCTION__, ix);
+		if (ata_msg_probe(ap))
+			printk(KERN_DEBUG "%s: call set_taskfiles, ix=%d\n",
+				__FUNCTION__, ix);
 		ret = do_drive_set_taskfiles(ap, &ap->device[ix],
 				gtf_length, gtf_address);
 		acpi_os_free((void *)gtf_address);

  parent reply	other threads:[~2006-02-22 22:11 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060222133241.595a8509.randy_d_dunlap@linux.intel.com>
2006-02-22 21:40 ` [PATCH 1/13] ATA ACPI: Makefile/Kconfig/doc Randy Dunlap
2006-02-22 21:51 ` [PATCH 2/13] ATA ACPI: debugging infrastructure Randy Dunlap
2006-02-28 11:45   ` Pavel Machek
2006-02-28 12:00     ` Jeff Garzik
2006-02-28 12:04       ` Pavel Machek
2006-02-28 12:13         ` Jeff Garzik
2006-02-28 12:18       ` Andrew Morton
2006-02-28 12:31         ` Jeff Garzik
2006-02-28 18:35           ` Andrew Morton
2006-02-28 19:27             ` Jeff Garzik
2006-02-28 14:43         ` Mark Lord
2006-02-28 19:22           ` Randy Dunlap
2006-02-28 17:10         ` Phillip Susi
2006-03-01 10:29         ` James Courtier-Dutton
2006-03-01 10:45           ` Andrew Morton
2006-02-22 21:52 ` [PATCH 3/13] ATA ACPI: SATA methods Randy Dunlap
2006-02-22 21:54 ` [PATCH 4/13] ATA ACPI: add params/docs Randy Dunlap
2006-02-28 11:46   ` Pavel Machek
2006-02-28 11:57     ` Jeff Garzik
2006-02-22 21:55 ` Randy Dunlap [this message]
2006-02-28 11:47   ` [PATCH 5/13] ATA ACPI: use debugging macros Pavel Machek
2006-02-28 11:58     ` Jeff Garzik
2006-02-22 21:56 ` [PATCH 6/13] ATA ACPI: use correct acpi_object pointer Randy Dunlap
2006-02-22 21:58 ` [PATCH 7/13] ATA ACPI: more Makefile/Kconfig Randy Dunlap
2006-02-28 11:49   ` Pavel Machek
2006-02-28 12:03     ` Jeff Garzik
2006-02-28 15:27       ` Randy.Dunlap
2006-02-22 21:58 ` [PATCH 8/13] ATA ACPI: PATA methods Randy Dunlap
2006-02-28 11:55   ` Pavel Machek
2006-02-28 12:02     ` Jeff Garzik
2006-02-22 22:00 ` [PATCH 9/13] ATA ACPI: check SATA/PATA more carefully Randy Dunlap
2006-02-23  0:30   ` Alan Cox
2006-02-22 22:01 ` [PATCH 10/13] ATA ACPI: do taskfile before mode commands Randy Dunlap
2006-02-28 11:57   ` Pavel Machek
2006-02-28 12:05     ` Jeff Garzik
2006-02-28 12:08       ` Pavel Machek
2006-02-28 12:14         ` Jeff Garzik
2006-02-22 22:02 ` [PATCH 11/13] ATA ACPI: fix pata host typo Randy Dunlap
2006-02-22 22:06 ` [PATCH 12/13] ATA ACPI: use scsi_bus_shutdown for SATA/PATA Randy Dunlap
2006-02-28 11:58   ` Pavel Machek
2006-02-28 19:44     ` Randy Dunlap
2006-02-28 20:22       ` Pavel Machek
2006-02-22 22:07 ` [PATCH 13/13] ATA ACPI: enable writing PATA taskfiles Randy Dunlap
2006-02-28 11:59   ` Pavel Machek

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=20060222135542.33fe242c.randy_d_dunlap@linux.intel.com \
    --to=randy_d_dunlap@linux.intel.com \
    --cc=akpm@osdl.org \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.