All of lore.kernel.org
 help / color / mirror / Atom feed
From: Elias Oltmanns <eo@nebensachen.de>
To: Tejun Heo <tj@kernel.org>
Cc: Mark Lord <liml@rtr.ca>, Evgeni Golov <sargentd@die-welt.net>,
	linux-ide@vger.kernel.org, Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: Odd behaviour of device in response to idleimmediate with unload
Date: Wed, 05 Nov 2008 14:47:43 +0100	[thread overview]
Message-ID: <873ai6cmio.fsf@denkblock.local> (raw)
In-Reply-To: 49116811.5000109@kernel.org

Tejun Heo <tj@kernel.org> wrote:
> Mark Lord wrote:
>> Evgeni Golov wrote:
>
>>> On Tue, 04 Nov 2008 13:13:16 -0500 Mark Lord wrote:
>>>
>>>> Okay, hdparm-9.3 is now out in the wild (sourceforge),
>>>> and has  --idle-immediate and --idle-unload  flags now,
>>>> so it can be used to help debug/test this problem.
>>>
>>> Okay, got it, built it.
>>> Neither --idle-immediate nor --idle-immediate brings up the reset,
>>> echo 1000 > /sys/block/sda/device/unload_heads does.

You really have tested --idle-unload as well, I suppose.

[...]
> Hmmm... maybe garbage values in unused TF regs?
[...]
> diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
> index 8077bdf..f0f3d11 100644
> --- a/drivers/ata/libata-eh.c
> +++ b/drivers/ata/libata-eh.c
> @@ -2649,7 +2649,7 @@ static void ata_eh_park_issue_cmd(struct ata_device *dev, int park)
>  		tf.command = ATA_CMD_CHK_POWER;
>  	}
> 
> -	tf.flags |= ATA_TFLAG_DEVICE | ATA_TFLAG_ISADDR;
> +	tf.flags |= ATA_TFLAG_DEVICE | ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;

After my embarrassing failure to parse a macro correctly a few days
back, I've got to be careful ;-). But still, what good does that patch
do? It doesn't really change anything, does it?

As a wild guess, I'm wondering whether ata_eh_revalidate_and_attach()
has anything to do with it. Unless you have a better suggestion, perhaps
the following debug patch would give some useful information.

Regards,

Elias
---
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 8077bdf..26dc4d9 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -3020,6 +3020,7 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
 	struct ata_device *dev;
 	int nr_failed_devs;
 	int rc;
+	int dev_parked = 0;
 	unsigned long flags, deadline;
 
 	DPRINTK("ENTER\n");
@@ -3123,6 +3124,7 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
 					continue;
 
 				ata_eh_park_issue_cmd(dev, 1);
+				dev_parked = 1;
 			}
 		}
 
@@ -3135,10 +3137,17 @@ int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset,
 	} while (deadline);
 	ata_port_for_each_link(link, ap) {
 		ata_link_for_each_dev(dev, link) {
+			u32 serror;
+
 			if (!(link->eh_context.unloaded_mask &
 			      (1 << dev->devno)))
 				continue;
 
+			sata_scr_read(link, SCR_ERROR, &serror);
+			ata_dev_printk(dev, KERN_INFO,
+				       "SError: 0x%x, hotplug: %d\n",
+				       serror,
+				       ap->pflags & ATA_PFLAG_SCSI_HOTPLUG ? 1 : 0);
 			ata_eh_park_issue_cmd(dev, 0);
 			ata_eh_done(link, dev, ATA_EH_PARK);
 		}
@@ -3203,6 +3212,9 @@ dev_fail:
 		}
 	}
 
+	if (dev_parked)
+		ata_port_printk(ap, KERN_INFO, "hotplug: %d, nr_failed: %d\n",
+				ap->pflags & ATA_PFLAG_SCSI_HOTPLUG ? 1 : 0, nr_failed_devs);
 	if (nr_failed_devs)
 		goto retry;
 

  reply	other threads:[~2008-11-05 13:47 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-04 10:31 Odd behaviour of device in response to idleimmediate with unload Elias Oltmanns
2008-11-04 10:40 ` Tejun Heo
2008-11-04 12:32   ` Evgeni Golov
2008-11-04 17:06     ` Mark Lord
2008-11-04 17:18       ` Mark Lord
2008-11-04 17:47         ` Mark Lord
2008-11-04 18:13           ` Mark Lord
2008-11-04 18:54             ` Evgeni Golov
2008-11-04 19:39               ` Mark Lord
2008-11-05  9:32                 ` Tejun Heo
2008-11-05 13:47                   ` Elias Oltmanns [this message]
2008-11-05 14:08                     ` Tejun Heo
2008-11-05 18:55                       ` Elias Oltmanns
2008-11-06 11:23                         ` Evgeni Golov
2008-11-06 12:12                           ` Elias Oltmanns
2008-11-05 19:34                       ` Evgeni Golov
2008-11-06 11:41                       ` Elias Oltmanns
2008-11-07  4:08                         ` Tejun Heo
2008-11-07  7:48                           ` Evgeni Golov
2008-11-10  9:00                             ` Tejun Heo
2008-11-10 10:26                               ` Evgeni Golov
2008-11-10 11:35                                 ` Elias Oltmanns
2008-11-13 11:33                                   ` Evgeni Golov
2008-11-13 12:29                                     ` Elias Oltmanns
2008-11-16  9:39                                     ` Tejun Heo
2008-11-17  7:15                                       ` Evgeni Golov
2008-11-17  7:19                                         ` Tejun Heo
2008-11-17  7:48                                           ` Evgeni Golov
2008-11-18  1:22                                             ` Tejun Heo
2008-11-18  7:37                                               ` Evgeni Golov
2008-11-21  6:41                                                 ` Tejun Heo
2008-11-21 19:40                                                   ` Evgeni Golov
2008-11-22  8:22                                                     ` Tejun Heo
2008-11-22  9:51                                                       ` Evgeni Golov
2008-11-22  9:58                                                       ` Evgeni Golov
2008-11-23 18:09                                                       ` Elias Oltmanns
2008-11-24  4:20                                                         ` Tejun Heo

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=873ai6cmio.fsf@denkblock.local \
    --to=eo@nebensachen.de \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=liml@rtr.ca \
    --cc=linux-ide@vger.kernel.org \
    --cc=sargentd@die-welt.net \
    --cc=tj@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.