All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Jeff Garzik <jeff@garzik.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linux-ide@vger.kernel.org, Forrest Zhao <forrest.zhao@gmail.com>
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 01/12] libata: update EH report formatting
Date: Sun, 1 Jul 2007 18:53:36 +0900	[thread overview]
Message-ID: <1183283616149-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <118328361627-git-send-email-htejun@gmail.com>

Update formatting for LLD provided error descriptions such that...

* No default () around it
* Each element is separated by <> not ,

This change makes each element responsible for putting a space after
itself instead of before - e.g. "<elem> " not ", elem".  This is more
conventional and allows more flexible combination of messages.

Signed-off-by: Tejun Heo <htejun@gmail.com>
---
 drivers/ata/ahci.c          |    8 ++++----
 drivers/ata/libata-core.c   |    2 +-
 drivers/ata/libata-eh.c     |    4 ++--
 drivers/ata/sata_inic162x.c |    2 +-
 drivers/ata/sata_nv.c       |   19 ++++++++++---------
 drivers/ata/sata_promise.c  |    2 +-
 drivers/ata/sata_sil24.c    |   10 +++++-----
 7 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index b14e7ef..ff0b70d 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1197,7 +1197,7 @@ static void ahci_error_intr(struct ata_port *ap, u32 irq_stat)
 	ahci_scr_write(ap, SCR_ERROR, serror);
 
 	/* analyze @irq_stat */
-	ata_ehi_push_desc(ehi, "irq_stat 0x%08x", irq_stat);
+	ata_ehi_push_desc(ehi, "irq_stat 0x%08x ", irq_stat);
 
 	/* some controllers set IRQ_IF_ERR on device errors, ignore it */
 	if (ap->flags & AHCI_FLAG_IGN_IRQ_IF_ERR)
@@ -1217,12 +1217,12 @@ static void ahci_error_intr(struct ata_port *ap, u32 irq_stat)
 	if (irq_stat & PORT_IRQ_IF_ERR) {
 		err_mask |= AC_ERR_ATA_BUS;
 		action |= ATA_EH_SOFTRESET;
-		ata_ehi_push_desc(ehi, ", interface fatal error");
+		ata_ehi_push_desc(ehi, "<interface fatal error> ");
 	}
 
 	if (irq_stat & (PORT_IRQ_CONNECT | PORT_IRQ_PHYRDY)) {
 		ata_ehi_hotplugged(ehi);
-		ata_ehi_push_desc(ehi, ", %s", irq_stat & PORT_IRQ_CONNECT ?
+		ata_ehi_push_desc(ehi, "<%s> ", irq_stat & PORT_IRQ_CONNECT ?
 			"connection status changed" : "PHY RDY changed");
 	}
 
@@ -1231,7 +1231,7 @@ static void ahci_error_intr(struct ata_port *ap, u32 irq_stat)
 
 		err_mask |= AC_ERR_HSM;
 		action |= ATA_EH_SOFTRESET;
-		ata_ehi_push_desc(ehi, ", unknown FIS %08x %08x %08x %08x",
+		ata_ehi_push_desc(ehi, "<unknown FIS %08x %08x %08x %08x> ",
 				  unk[0], unk[1], unk[2], unk[3]);
 	}
 
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index e5364af..8570975 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5581,7 +5581,7 @@ inline unsigned int ata_host_intr (struct ata_port *ap,
 
 	if (unlikely(qc->err_mask) && (qc->tf.protocol == ATA_PROT_DMA ||
 				       qc->tf.protocol == ATA_PROT_ATAPI_DMA))
-		ata_ehi_push_desc(ehi, "BMDMA stat 0x%x", host_stat);
+		ata_ehi_push_desc(ehi, "BMDMA stat 0x%x ", host_stat);
 
 	return 1;	/* irq handled */
 
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 9ee0a8c..744665a 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1524,14 +1524,14 @@ static void ata_eh_report(struct ata_port *ap)
 			       ehc->i.err_mask, ap->sactive, ehc->i.serror,
 			       ehc->i.action, frozen);
 		if (desc)
-			ata_dev_printk(ehc->i.dev, KERN_ERR, "(%s)\n", desc);
+			ata_dev_printk(ehc->i.dev, KERN_ERR, "%s\n", desc);
 	} else {
 		ata_port_printk(ap, KERN_ERR, "exception Emask 0x%x "
 				"SAct 0x%x SErr 0x%x action 0x%x%s\n",
 				ehc->i.err_mask, ap->sactive, ehc->i.serror,
 				ehc->i.action, frozen);
 		if (desc)
-			ata_port_printk(ap, KERN_ERR, "(%s)\n", desc);
+			ata_port_printk(ap, KERN_ERR, "%s\n", desc);
 	}
 
 	for (tag = 0; tag < ATA_MAX_QUEUE; tag++) {
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c
index e8525d7..4f1fc28 100644
--- a/drivers/ata/sata_inic162x.c
+++ b/drivers/ata/sata_inic162x.c
@@ -310,7 +310,7 @@ static void inic_host_intr(struct ata_port *ap)
 	}
 
 	/* error */
-	ata_ehi_push_desc(ehi, "irq_stat=0x%x", irq_stat);
+	ata_ehi_push_desc(ehi, "irq_stat=0x%x ", irq_stat);
 
 	if (irq_stat & (PIRQ_OFFLINE | PIRQ_ONLINE)) {
 		ata_ehi_hotplugged(ehi);
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index adfa693..e9701c7 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -714,19 +714,20 @@ static int nv_adma_check_cpb(struct ata_port *ap, int cpb_num, int force_err)
 		int freeze = 0;
 
 		ata_ehi_clear_desc(ehi);
-		ata_ehi_push_desc(ehi, "CPB resp_flags 0x%x", flags );
+		ata_ehi_push_desc(ehi, "<CPB resp_flags 0x%x", flags );
 		if (flags & NV_CPB_RESP_ATA_ERR) {
-			ata_ehi_push_desc(ehi, ": ATA error");
+			ata_ehi_push_desc(ehi, ": ATA error> ");
 			ehi->err_mask |= AC_ERR_DEV;
 		} else if (flags & NV_CPB_RESP_CMD_ERR) {
-			ata_ehi_push_desc(ehi, ": CMD error");
+			ata_ehi_push_desc(ehi, ": CMD error> ");
 			ehi->err_mask |= AC_ERR_DEV;
 		} else if (flags & NV_CPB_RESP_CPB_ERR) {
-			ata_ehi_push_desc(ehi, ": CPB error");
+			ata_ehi_push_desc(ehi, ": CPB error> ");
 			ehi->err_mask |= AC_ERR_SYSTEM;
 			freeze = 1;
 		} else {
 			/* notifier error, but no error in CPB flags? */
+			ata_ehi_push_desc(ehi, ": unknown> ");
 			ehi->err_mask |= AC_ERR_OTHER;
 			freeze = 1;
 		}
@@ -853,19 +854,19 @@ static irqreturn_t nv_adma_interrupt(int irq, void *dev_instance)
 				struct ata_eh_info *ehi = &ap->eh_info;
 
 				ata_ehi_clear_desc(ehi);
-				ata_ehi_push_desc(ehi, "ADMA status 0x%08x", status );
+				ata_ehi_push_desc(ehi, "<ADMA status 0x%08x", status );
 				if (status & NV_ADMA_STAT_TIMEOUT) {
 					ehi->err_mask |= AC_ERR_SYSTEM;
-					ata_ehi_push_desc(ehi, ": timeout");
+					ata_ehi_push_desc(ehi, ": timeout> ");
 				} else if (status & NV_ADMA_STAT_HOTPLUG) {
 					ata_ehi_hotplugged(ehi);
-					ata_ehi_push_desc(ehi, ": hotplug");
+					ata_ehi_push_desc(ehi, ": hotplug> ");
 				} else if (status & NV_ADMA_STAT_HOTUNPLUG) {
 					ata_ehi_hotplugged(ehi);
-					ata_ehi_push_desc(ehi, ": hot unplug");
+					ata_ehi_push_desc(ehi, ": hot unplug> ");
 				} else if (status & NV_ADMA_STAT_SERROR) {
 					/* let libata analyze SError and figure out the cause */
-					ata_ehi_push_desc(ehi, ": SError");
+					ata_ehi_push_desc(ehi, ": SError> ");
 				}
 				ata_port_freeze(ap);
 				continue;
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c
index 7fcc4fe..ff3d5c8 100644
--- a/drivers/ata/sata_promise.c
+++ b/drivers/ata/sata_promise.c
@@ -634,7 +634,7 @@ static void pdc_error_intr(struct ata_port *ap, struct ata_queued_cmd *qc,
 	unsigned int ac_err_mask = 0;
 
 	ata_ehi_clear_desc(ehi);
-	ata_ehi_push_desc(ehi, "port_status 0x%08x", port_status);
+	ata_ehi_push_desc(ehi, "port_status 0x%08x ", port_status);
 	port_status &= err_mask;
 
 	if (port_status & PDC_DRIVE_ERR)
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 0ddfae9..23650f3 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -765,11 +765,11 @@ static void sil24_error_intr(struct ata_port *ap)
 	/* first, analyze and record host port events */
 	ata_ehi_clear_desc(ehi);
 
-	ata_ehi_push_desc(ehi, "irq_stat 0x%08x", irq_stat);
+	ata_ehi_push_desc(ehi, "irq_stat 0x%08x ", irq_stat);
 
 	if (irq_stat & (PORT_IRQ_PHYRDY_CHG | PORT_IRQ_DEV_XCHG)) {
 		ata_ehi_hotplugged(ehi);
-		ata_ehi_push_desc(ehi, ", %s",
+		ata_ehi_push_desc(ehi, "<%s> ",
 			       irq_stat & PORT_IRQ_PHYRDY_CHG ?
 			       "PHY RDY changed" : "device exchanged");
 		freeze = 1;
@@ -778,7 +778,7 @@ static void sil24_error_intr(struct ata_port *ap)
 	if (irq_stat & PORT_IRQ_UNK_FIS) {
 		ehi->err_mask |= AC_ERR_HSM;
 		ehi->action |= ATA_EH_SOFTRESET;
-		ata_ehi_push_desc(ehi , ", unknown FIS");
+		ata_ehi_push_desc(ehi, "<unknown FIS> ");
 		freeze = 1;
 	}
 
@@ -797,11 +797,11 @@ static void sil24_error_intr(struct ata_port *ap)
 		if (ci && ci->desc) {
 			err_mask |= ci->err_mask;
 			action |= ci->action;
-			ata_ehi_push_desc(ehi, ", %s", ci->desc);
+			ata_ehi_push_desc(ehi, "<%s> ", ci->desc);
 		} else {
 			err_mask |= AC_ERR_OTHER;
 			action |= ATA_EH_SOFTRESET;
-			ata_ehi_push_desc(ehi, ", unknown command error %d",
+			ata_ehi_push_desc(ehi, "<unknown command error %d> ",
 					  cerr);
 		}
 
-- 
1.5.0.3



  reply	other threads:[~2007-07-01  9:53 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-01  9:53 [PATCHSET 1/4] libata: misc updates in preparation of PMP support Tejun Heo
2007-07-01  9:53 ` Tejun Heo [this message]
2007-07-03 14:22   ` [PATCH 01/12] libata: update EH report formatting Jeff Garzik
2007-07-03 15:02     ` Tejun Heo
2007-07-01  9:53 ` [PATCH 03/12] libata: make ->scr_read/write callbacks return error code Tejun Heo
2007-07-03 14:26   ` Jeff Garzik
2007-07-01  9:53 ` [PATCH 05/12] ahci: implement SCR_NOTIFICATION r/w Tejun Heo
2007-07-03 14:31   ` Jeff Garzik
2007-07-03 15:00     ` Tejun Heo
2007-07-13 11:53     ` Tejun Heo
2007-07-01  9:53 ` [PATCH 04/12] ahci: make NO_NCQ handling more consistent Tejun Heo
2007-07-03 14:28   ` Jeff Garzik
2007-07-01  9:53 ` [PATCH 02/12] libata: implement AC_ERR_NCQ Tejun Heo
2007-07-03 14:24   ` Jeff Garzik
2007-07-03 14:58     ` Tejun Heo
2007-07-01  9:53 ` [PATCH 09/12] libata: reorganize ata_ehi_hotplugged() Tejun Heo
2007-07-01  9:53 ` [PATCH 06/12] libata: improve SATA PHY speed down logic Tejun Heo
2007-07-01  9:53 ` [PATCH 12/12] libata: implement EH fast drain Tejun Heo
2007-07-03 14:37   ` Jeff Garzik
2007-07-03 15:09     ` Tejun Heo
2007-07-01  9:53 ` [PATCH 07/12] libata: quickly trigger SATA SPD down after debouncing failed Tejun Heo
2007-07-01  9:53 ` [PATCH 11/12] libata: schedule probing after SError access failure during autopsy Tejun Heo
2007-07-03 14:35   ` Jeff Garzik
2007-07-03 15:05     ` Tejun Heo
2007-07-01  9:53 ` [PATCH 08/12] libata: improve SCSI scan failure handling Tejun Heo
2007-07-01  9:53 ` [PATCH 10/12] libata: clear HOTPLUG flag after a reset Tejun Heo
2007-07-03 14:34   ` Jeff Garzik

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=1183283616149-git-send-email-htejun@gmail.com \
    --to=htejun@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=forrest.zhao@gmail.com \
    --cc=jeff@garzik.org \
    --cc=linux-ide@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.