Re: [PATCH] libata: clean up IDENTIFY printing

2 messages, 2 authors, 2006-03-13 · open the first message on its own page

Re: [PATCH] libata: clean up IDENTIFY printing

From: Jeff Garzik <hidden>
Date: 2006-03-13 07:42:27

Tejun Heo wrote:
Printing info about IDENTIFY page used to be the responsibility of
ata_dev_read_id().  As all devices are revalidated after xfer mode
configuration, this resulted in two info messages about one device.
Also, ata_dump_id() was called from ata_dev_configure() which prints
some intersecting and some new information IDENTIFY page if ATA_DEBUG
is enabled.

This patch makes ata_dev_configure() soley responsible for printing
IDENTIFY info and kill all others.

The IDENTIFY info printing now looks like the following.

ata2: dev 1 cfg 49:2f00 53:0007 63:0007 64:0003 75:001f 80:00fe 81:0000 82:346b
                83:7d01 84:4023 85:3469 86:3c01 87:4023 88:207f 93:0000

Signed-off-by: Tejun Heo <redacted>

---

How about this one?  ata10's second line will be misaligned though. :-p
better, but

* I only want one line of dev->id printed, just like 2.6.15 etc. does now.  If you want more verbose dump of additional registers, that's a job for ap->msg_enable.

* [you know this was coming :)]  The use of new local 'id' should be split into a separate patch.

[PATCH 2/2] libata: move IDENTIFY info printing from ata_dev_read_id() to ata_dev_configure()

From: Tejun Heo <hidden>
Date: 2006-03-13 10:51:24

Move IDENTIFY info printing from ata_dev_read_id() to
ata_dev_configure() and print only if @print_info is non-zero.  This
kills duplicate IDENTIFY info printing during probing.

Signed-off-by: Tejun Heo <redacted>

---

Jeff, I think ap->msg_enable conversion should happen as bombing
raids.  Such that we have either ATA_DEBUG or msg_enable.  I'll leave
ata_dump_id() alone for the time being.

 libata-core.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 6fe41fb..714b42b 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -1120,12 +1120,6 @@ static int ata_dev_read_id(struct ata_po
 
 	swap_buf_le16(id, ATA_ID_WORDS);
 
-	/* print device capabilities */
-	printk(KERN_DEBUG "ata%u: dev %u cfg "
-	       "49:%04x 82:%04x 83:%04x 84:%04x 85:%04x 86:%04x 87:%04x 88:%04x\n",
-	       ap->id, dev->devno,
-	       id[49], id[82], id[83], id[84], id[85], id[86], id[87], id[88]);
-
 	/* sanity check */
 	if ((class == ATA_DEV_ATA) != ata_id_is_ata(id)) {
 		rc = -EINVAL;
@@ -1205,6 +1199,13 @@ static int ata_dev_configure(struct ata_
 
 	DPRINTK("ENTER, host %u, dev %u\n", ap->id, dev->devno);
 
+	/* print device capabilities */
+	if (print_info)
+		printk(KERN_DEBUG "ata%u: dev %u cfg 49:%04x 82:%04x 83:%04x "
+		       "84:%04x 85:%04x 86:%04x 87:%04x 88:%04x\n",
+		       ap->id, dev->devno, id[49], id[82], id[83],
+		       id[84], id[85], id[86], id[87], id[88]);
+
 	/* initialize to-be-configured parameters */
 	dev->flags = 0;
 	dev->max_sectors = 0;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help