linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 02/10] sata_nv: add back some verbosity into ADMA error_handler
@ 2007-04-26  7:19 akpm
  2007-04-28 19:11 ` Jeff Garzik
  0 siblings, 1 reply; 4+ messages in thread
From: akpm @ 2007-04-26  7:19 UTC (permalink / raw)
  To: jeff; +Cc: linux-ide, akpm, hancockr, htejun

From: Robert Hancock <hancockr@shaw.ca>

Some debug output in the ADMA error_handler function was removed recently,
but it may be useful in certain cases, like NCQ commands timing out.  Add
it back in, but make it a bit more intelligent so that it only prints if
command(s) are active and only prints the CPBs for those commands.  That
way it won't spew at inappropriate times like suspend/resume.

[akpm@osdl.org: cleanup]
Signed-off-by: Robert Hancock <hancockr@shaw.ca>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/ata/sata_nv.c |   31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff -puN drivers/ata/sata_nv.c~sata_nv-add-back-some-verbosity-into-adma-error_handler drivers/ata/sata_nv.c
--- a/drivers/ata/sata_nv.c~sata_nv-add-back-some-verbosity-into-adma-error_handler
+++ a/drivers/ata/sata_nv.c
@@ -1455,11 +1455,38 @@ static void nv_adma_error_handler(struct
 			}
 		}
 
+		if (ata_tag_valid(ap->active_tag) || ap->sactive) {
+			u32 notifier = readl(mmio + NV_ADMA_NOTIFIER);
+			u32 notifier_error = readl(mmio + NV_ADMA_NOTIFIER_ERROR);
+			u32 gen_ctl = readl(pp->gen_block + NV_ADMA_GEN_CTL);
+			u32 status = readw(mmio + NV_ADMA_STAT);
+
+			ata_port_printk(ap, KERN_ERR, "EH in ADMA mode, "
+				"notifier 0x%X notifier_error 0x%X gen_ctl "
+				"0x%X status 0x%X\n",
+				notifier, notifier_error, gen_ctl, status);
+
+			for (i = 0; i < NV_ADMA_MAX_CPBS; i++) {
+				struct nv_adma_cpb *cpb = &pp->cpb[i];
+				if ((ata_tag_valid(ap->active_tag) &&
+						i == ap->active_tag) ||
+						ap->sactive & (1 << i))
+					ata_port_printk(ap, KERN_ERR, "CPB %d: "
+						"ctl_flags 0x%x, resp_flags "
+						"0x%x\n",
+						i, cpb->ctl_flags,
+						cpb->resp_flags);
+			}
+		}
+
 		/* Push us back into port register mode for error handling. */
 		nv_adma_register_mode(ap);
 
-		/* Mark all of the CPBs as invalid to prevent them from being executed */
-		for( i=0;i<NV_ADMA_MAX_CPBS;i++)
+		/*
+		 * Mark all of the CPBs as invalid to prevent them from being
+		 * executed
+		*/
+		for (i = 0; i< NV_ADMA_MAX_CPBS; i++)
 			pp->cpb[i].ctl_flags &= ~NV_CPB_CTL_CPB_VALID;
 
 		/* clear CPB fetch count */
_

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch 02/10] sata_nv: add back some verbosity into ADMA error_handler
  2007-04-26  7:19 [patch 02/10] sata_nv: add back some verbosity into ADMA error_handler akpm
@ 2007-04-28 19:11 ` Jeff Garzik
  2007-04-28 19:56   ` Robert Hancock
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Garzik @ 2007-04-28 19:11 UTC (permalink / raw)
  To: hancockr; +Cc: akpm, linux-ide, htejun

akpm@linux-foundation.org wrote:
> From: Robert Hancock <hancockr@shaw.ca>
> 
> Some debug output in the ADMA error_handler function was removed recently,
> but it may be useful in certain cases, like NCQ commands timing out.  Add
> it back in, but make it a bit more intelligent so that it only prints if
> command(s) are active and only prints the CPBs for those commands.  That
> way it won't spew at inappropriate times like suspend/resume.
> 
> [akpm@osdl.org: cleanup]
> Signed-off-by: Robert Hancock <hancockr@shaw.ca>
> Cc: Jeff Garzik <jeff@garzik.org>
> Cc: Tejun Heo <htejun@gmail.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  drivers/ata/sata_nv.c |   31 +++++++++++++++++++++++++++++--
>  1 file changed, 29 insertions(+), 2 deletions(-)

Robert, is this patch still wanted?

It looks OK; I've held because I thought it was created to debug a 
special situation.

But I might be mistaken...

	Jeff



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch 02/10] sata_nv: add back some verbosity into ADMA error_handler
  2007-04-28 19:11 ` Jeff Garzik
@ 2007-04-28 19:56   ` Robert Hancock
  2007-04-28 20:08     ` Jeff Garzik
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Hancock @ 2007-04-28 19:56 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: akpm, linux-ide, htejun

Jeff Garzik wrote:
> akpm@linux-foundation.org wrote:
>> From: Robert Hancock <hancockr@shaw.ca>
>>
>> Some debug output in the ADMA error_handler function was removed 
>> recently,
>> but it may be useful in certain cases, like NCQ commands timing out.  Add
>> it back in, but make it a bit more intelligent so that it only prints if
>> command(s) are active and only prints the CPBs for those commands.  That
>> way it won't spew at inappropriate times like suspend/resume.
>>
>> [akpm@osdl.org: cleanup]
>> Signed-off-by: Robert Hancock <hancockr@shaw.ca>
>> Cc: Jeff Garzik <jeff@garzik.org>
>> Cc: Tejun Heo <htejun@gmail.com>
>> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>> ---
>>
>>  drivers/ata/sata_nv.c |   31 +++++++++++++++++++++++++++++--
>>  1 file changed, 29 insertions(+), 2 deletions(-)
> 
> Robert, is this patch still wanted?
> 
> It looks OK; I've held because I thought it was created to debug a 
> special situation.
> 
> But I might be mistaken...
> 
>     Jeff

Wait a minute, this patch is essentially already merged in mainline:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=2cb27853b7cbf0c908444e25c61b62fa336b88cd

The only part that hasn't been merged is the whitespace cleanup that 
Andrew added in his tree.

-- 
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch 02/10] sata_nv: add back some verbosity into ADMA error_handler
  2007-04-28 19:56   ` Robert Hancock
@ 2007-04-28 20:08     ` Jeff Garzik
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2007-04-28 20:08 UTC (permalink / raw)
  To: Robert Hancock; +Cc: akpm, linux-ide, htejun

Robert Hancock wrote:
> Jeff Garzik wrote:
>> akpm@linux-foundation.org wrote:
>>> From: Robert Hancock <hancockr@shaw.ca>
>>>
>>> Some debug output in the ADMA error_handler function was removed 
>>> recently,
>>> but it may be useful in certain cases, like NCQ commands timing out.  
>>> Add
>>> it back in, but make it a bit more intelligent so that it only prints if
>>> command(s) are active and only prints the CPBs for those commands.  That
>>> way it won't spew at inappropriate times like suspend/resume.
>>>
>>> [akpm@osdl.org: cleanup]
>>> Signed-off-by: Robert Hancock <hancockr@shaw.ca>
>>> Cc: Jeff Garzik <jeff@garzik.org>
>>> Cc: Tejun Heo <htejun@gmail.com>
>>> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>>> ---
>>>
>>>  drivers/ata/sata_nv.c |   31 +++++++++++++++++++++++++++++--
>>>  1 file changed, 29 insertions(+), 2 deletions(-)
>>
>> Robert, is this patch still wanted?
>>
>> It looks OK; I've held because I thought it was created to debug a 
>> special situation.
>>
>> But I might be mistaken...
>>
>>     Jeff
> 
> Wait a minute, this patch is essentially already merged in mainline:
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=2cb27853b7cbf0c908444e25c61b62fa336b88cd 
> 
> 
> The only part that hasn't been merged is the whitespace cleanup that 
> Andrew added in his tree.

ah, indeed.  That's probably why my scripts thought the changes had not 
yet been applied.

Sorry for the noise.

	Jeff




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-04-28 20:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-26  7:19 [patch 02/10] sata_nv: add back some verbosity into ADMA error_handler akpm
2007-04-28 19:11 ` Jeff Garzik
2007-04-28 19:56   ` Robert Hancock
2007-04-28 20:08     ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).