Skip to contentSkip to conversation

sil24: make error_intr less verbose

PATCH NAK Tejun Heo 4 participants 5 messages Nov 16, 2005 – Nov 17, 2005

Subsystems (2)
lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 5/5 sil24: make error_intr less verbose

sil24_error_intr is too verbose. Shut it up.

drivers/scsi/sata_sil24.c +3 -3
Index: work/drivers/scsi/sata_sil24.c
===================================================================
@@ -678,9 +678,9 @@ static void sil24_error_intr(struct ata_
 	if (serror)
 		writel(serror, port + PORT_SERROR);
 
-	printk(KERN_ERR DRV_NAME " ata%u: error interrupt on port%d\n"
-	       "  stat=0x%x irq=0x%x cmd_err=%d sstatus=0x%x serror=0x%x\n",
-	       ap->id, ap->port_no, slot_stat, irq_stat, cmd_err, sstatus, serror);
+	DPRINTK("ata%u: error interrupt on port%d\n"
+		"  stat=0x%x irq=0x%x cmd_err=%d sstatus=0x%x serror=0x%x\n",
+		ap->id, ap->port_no, slot_stat, irq_stat, cmd_err, sstatus, serror);
 
 	if (cmd_err == PORT_CERR_DEV || cmd_err == PORT_CERR_SDB) {
 		/*
#1 lore raw
Quoted 9 lines · Tejun Heo

sil24_error_intr is too verbose. Shut it up.

Index: work/drivers/scsi/sata_sil24.c
===================================================================

drivers/scsi/sata_sil24.c static void sil24_error_intr(struct ata_ · line 683

Quoted 9 lines
drivers/scsi/sata_sil24.c +3 -3
@@ -678,9 +678,9 @@ static void sil24_error_intr(struct ata_
 	if (serror)
 		writel(serror, port + PORT_SERROR);
 
-	printk(KERN_ERR DRV_NAME " ata%u: error interrupt on port%d\n"
-	       "  stat=0x%x irq=0x%x cmd_err=%d sstatus=0x%x serror=0x%x\n",
-	       ap->id, ap->port_no, slot_stat, irq_stat, cmd_err, sstatus, serror);
+	DPRINTK("ata%u: error interrupt on port%d\n"
+		"  stat=0x%x irq=0x%x cmd_err=%d sstatus=0x%x serror=0x%x\n",
+		ap->id, ap->port_no, slot_stat, irq_stat, cmd_err, sstatus, serror);

Mild NAK.

I am grappling with this on AHCI too :) This is because ATA_ERR is much more common on ATAPI, yes?

My preferred change would be

	if ((class != ATA_DEV_ATAPI) ||
	    (sil24_cmd_err > PORT_CERR_SDB))
		printk()

so that truly uncommon errors are always printed, but users logs are not spammed.

Another option is to do

if (ata_ratelimit())
printk()

Regards,

Jeff

author
#2 lore raw
Quoted 27 lines · Jeff Garzik
Quoted 11 lines · Tejun Heo

sil24_error_intr is too verbose. Shut it up.

Index: work/drivers/scsi/sata_sil24.c
===================================================================
--- work.orig/drivers/scsi/sata_sil24.c 2005-11-16
17:05:19.000000000 +0900
+++ work/drivers/scsi/sata_sil24.c 2005-11-16 17:08:05.000000000 +0900

drivers/scsi/sata_sil24.c +0 -0
@@ -678,9 +678,9 @@ static void sil24_error_intr(struct ata_
     if (serror)

drivers/scsi/sata_sil24.c static void sil24_error_intr(struct ata_ · line 685

Quoted 10 lines
drivers/scsi/sata_sil24.c +3 -3
         writel(serror, port + PORT_SERROR);
 
-    printk(KERN_ERR DRV_NAME " ata%u: error interrupt on port%d\n"
-           "  stat=0x%x irq=0x%x cmd_err=%d sstatus=0x%x serror=0x%x\n",
-           ap->id, ap->port_no, slot_stat, irq_stat, cmd_err, 
 sstatus, serror);
+    DPRINTK("ata%u: error interrupt on port%d\n"
+        "  stat=0x%x irq=0x%x cmd_err=%d sstatus=0x%x serror=0x%x\n",
+        ap->id, ap->port_no, slot_stat, irq_stat, cmd_err, sstatus, 
 serror);

Mild NAK.

Quoted 1 line

I am grappling with this on AHCI too :) This is because ATA_ERR is much more common on ATAPI, yes?

Yeap.

Quoted 7 lines

My preferred change would be

    if ((class != ATA_DEV_ATAPI) ||
        (sil24_cmd_err > PORT_CERR_SDB))
        printk()
Quoted 7 lines

so that truly uncommon errors are always printed, but users logs are not spammed.

Another option is to do

if (ata_ratelimit())
printk()

I'll go for the first one. ATAPI devices can spit a lot of harmless errors and I think it's best if users don't see any of those.

Signature · 1 line
tejun
#3 lore raw
In reply to Jeff Garzik
Quoted 11 lines
Quoted 9 lines
drivers/scsi/sata_sil24.c +0 -3
-    printk(KERN_ERR DRV_NAME " ata%u: error interrupt on port%d\n"
-           "  stat=0x%x irq=0x%x cmd_err=%d sstatus=0x%x serror=0x%x\n",
-           ap->id, ap->port_no, slot_stat, irq_stat, cmd_err, 

sstatus, serror);

drivers/scsi/sata_sil24.c +3 -0
+    DPRINTK("ata%u: error interrupt on port%d\n"
+        "  stat=0x%x irq=0x%x cmd_err=%d sstatus=0x%x serror=0x%x\n",
+        ap->id, ap->port_no, slot_stat, irq_stat, cmd_err, sstatus, 

serror);

Quoted 1 line

Mild NAK.

Agreed. Bear in mind that it's an extrordinarily exceptional circumstance for the driver to reach this point. If this happens, then something has truly gone wrong and the message should be logged.

Note that this point in the driver is *not* reached for an ordinary ATA errors, but only for the kind of errors that libata can't handle.

-ed falk

#4 lore raw
In reply to Jeff Garzik
Quoted 36 lines · Jeff Garzik
Quoted 11 lines · Tejun Heo

sil24_error_intr is too verbose. Shut it up.

Index: work/drivers/scsi/sata_sil24.c
===================================================================
--- work.orig/drivers/scsi/sata_sil24.c 2005-11-16
17:05:19.000000000 +0900
+++ work/drivers/scsi/sata_sil24.c 2005-11-16 17:08:05.000000000 +0900

(quoted diff) +0 -0
@@ -678,9 +678,9 @@ static void sil24_error_intr(struct ata_
     if (serror)

Review static void sil24_error_intr(struct ata_ · line 685

Quoted 10 lines
(quoted diff) +3 -3
         writel(serror, port + PORT_SERROR);
 
-    printk(KERN_ERR DRV_NAME " ata%u: error interrupt on port%d\n"
-           "  stat=0x%x irq=0x%x cmd_err=%d sstatus=0x%x serror=0x%x\n",
-           ap->id, ap->port_no, slot_stat, irq_stat, cmd_err,
 sstatus, serror);
+    DPRINTK("ata%u: error interrupt on port%d\n"
+        "  stat=0x%x irq=0x%x cmd_err=%d sstatus=0x%x serror=0x%x\n",
+        ap->id, ap->port_no, slot_stat, irq_stat, cmd_err, sstatus,
 serror);

Mild NAK.

I am grappling with this on AHCI too :) This is because ATA_ERR is much more common on ATAPI, yes?

My preferred change would be

    if ((class != ATA_DEV_ATAPI) ||
        (sil24_cmd_err > PORT_CERR_SDB))
        printk()
Quoted 8 lines

so that truly uncommon errors are always printed, but users logs are not spammed.

Another option is to do

if (ata_ratelimit())
printk()

The "PIO error" messages from ata_pio_error() are also noisy for ATAPI devices.

Ex.
scsi278 : pata_pdc2027x
Vendor: ASUS Model: CRW-5232AS Rev: 1.02
Type: CD-ROM ANSI SCSI revision: 05
Attached scsi generic sg3 at scsi277, channel 0, id 0, lun 0, type 5
ata1: PIO error, drv_stat 0x51 <==
Vendor: BENQ Model: DVD DD DW1620 Rev: B7T9
Type: CD-ROM ANSI SCSI revision: 05
ata1: PIO error, drv_stat 0x51 <==
ata1: PIO error, drv_stat 0x51 <==
sr0: scsi3-mmc drive: 40x/40x writer cd/rw xa/form2 cdda tray Attached scsi CD-ROM sr0 at scsi277, channel 0, id 0, lun 0
ata1: PIO error, drv_stat 0x51 <==
ata1: PIO error, drv_stat 0x51 <==
sr1: scsi3-mmc drive: 40x/40x writer cd/rw xa/form2 cdda tray Attached scsi CD-ROM sr1 at scsi277, channel 0, id 1, lun 0 Attached scsi generic sg4 at scsi277, channel 0, id 1, lun 0, type 5
ata1: PIO error, drv_stat 0x51 <==
ata1: PIO error, drv_stat 0x51 <==

Seven "PIO error" messages were logged during module loading simply because the hot-plug scripts are reading mode page unsupported by the ATAPI devices. These are not errors that needs much attention.

Could we print out the error only for the non-packet commands? (as in the attached patch)

Another idea, maybe we should not print out the error message in ata_pio_error(). ata_pio_error() doesn't have enough information to tell trivial errors from severe errors. How about moving the prink() to the complete functions or EH?

Albert

==========

drivers/scsi/libata-core.c +3 -2
@@ -3212,11 +3212,12 @@ static void ata_pio_error(struct ata_por
 {
 	struct ata_queued_cmd *qc;
 
-	printk(KERN_WARNING "ata%u: PIO error\n", ap->id);
-
 	qc = ata_qc_from_tag(ap, ap->active_tag);
 	assert(qc != NULL);
 
+	if (qc->tf.command != ATA_CMD_PACKET)
+		printk(KERN_WARNING "ata%u: PIO error\n", ap->id);
+
 	ap->hsm_task_state = HSM_ST_IDLE;
 
 	ata_poll_qc_complete(qc, AC_ERR_ATA_BUS);