* [PATCH] libata: Set longer timeout for SETFEATURES_SPINUP
@ 2016-03-18 4:49 Damien Le Moal
2016-03-18 6:59 ` Hannes Reinecke
2016-03-18 15:02 ` Martin K. Petersen
0 siblings, 2 replies; 4+ messages in thread
From: Damien Le Moal @ 2016-03-18 4:49 UTC (permalink / raw)
To: linux-scsi@vger.kernel.org, Hannes Reinecke
libata: Set longer timeout for SETFEATURES_SPINUP
For SATA drives with power-up in standby (PUIS) feature set,
SETFEATURES_SPINUP execution may be required to get
complete IDENTIFY data. However, the timeout used for its
execution is the same as for all other SETFEATURES commands,
that is, 5 seconds. This is too short for some disks to complete
timeout and allow IDENTIFY to return complete data (e.g.
disks with large indirection tables stored on media), resulting
in ata_dev_read_id to fail. For this feature, allow a larger
timeout of 30 seconds.
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index e83fc3d..ecbbee2 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4537,7 +4537,8 @@ unsigned int ata_dev_set_feature(struct ata_device *dev, u8 enable, u8 feature)
tf.protocol = ATA_PROT_NODATA;
tf.nsect = feature;
- err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
+ err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0,
+ enable == SETFEATURES_SPINUP ? SETFEATURES_SPINUP_TIMEOUT : 0);
DPRINTK("EXIT, err_mask=%x\n", err_mask);
return err_mask;
diff --git a/include/linux/ata.h b/include/linux/ata.h
index fed3641..e3a9ab6 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -371,6 +371,7 @@ enum {
SETFEATURES_AAM_OFF = 0xC2,
SETFEATURES_SPINUP = 0x07, /* Spin-up drive */
+ SETFEATURES_SPINUP_TIMEOUT = 30000,
SETFEATURES_SATA_ENABLE = 0x10, /* Enable use of SATA feature */
SETFEATURES_SATA_DISABLE = 0x90, /* Disable use of SATA feature */
------------------------
Damien Le Moal, Ph.D.
Sr. Manager, System Software Group, HGST Research,
HGST, a Western Digital company
Damien.LeMoal@hgst.com
(+81) 0466-98-3593 (ext. 513593)
1 kirihara-cho, Fujisawa,
Kanagawa, 252-0888 Japan
www.hgst.com
Western Digital Corporation (and its subsidiaries) E-mail Confidentiality Notice & Disclaimer:
This e-mail and any files transmitted with it may contain confidential or legally privileged information of WDC and/or its affiliates, and are intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited. If you have received this e-mail in error, please notify the sender immediately and delete the e-mail in its entirety from your system.
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] libata: Set longer timeout for SETFEATURES_SPINUP
2016-03-18 4:49 [PATCH] libata: Set longer timeout for SETFEATURES_SPINUP Damien Le Moal
@ 2016-03-18 6:59 ` Hannes Reinecke
2016-03-18 8:24 ` Damien Le Moal
2016-03-18 15:02 ` Martin K. Petersen
1 sibling, 1 reply; 4+ messages in thread
From: Hannes Reinecke @ 2016-03-18 6:59 UTC (permalink / raw)
To: Damien Le Moal, linux-scsi@vger.kernel.org
On 03/18/2016 05:49 AM, Damien Le Moal wrote:
>
> libata: Set longer timeout for SETFEATURES_SPINUP
>
> For SATA drives with power-up in standby (PUIS) feature set,
> SETFEATURES_SPINUP execution may be required to get
> complete IDENTIFY data. However, the timeout used for its
> execution is the same as for all other SETFEATURES commands,
> that is, 5 seconds. This is too short for some disks to complete
> timeout and allow IDENTIFY to return complete data (e.g.
> disks with large indirection tables stored on media), resulting
> in ata_dev_read_id to fail. For this feature, allow a larger
> timeout of 30 seconds.
>
Reviewed-by: Hannes Reinecke <hare@suse.com>
(BTW, you might want to add your Signed-off-by:, too :-)
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] libata: Set longer timeout for SETFEATURES_SPINUP
2016-03-18 6:59 ` Hannes Reinecke
@ 2016-03-18 8:24 ` Damien Le Moal
0 siblings, 0 replies; 4+ messages in thread
From: Damien Le Moal @ 2016-03-18 8:24 UTC (permalink / raw)
To: Hannes Reinecke, linux-scsi@vger.kernel.org
>On 03/18/2016 05:49 AM, Damien Le Moal wrote:
>>
>> libata: Set longer timeout for SETFEATURES_SPINUP
>>
>> For SATA drives with power-up in standby (PUIS) feature set,
>> SETFEATURES_SPINUP execution may be required to get
>> complete IDENTIFY data. However, the timeout used for its
>> execution is the same as for all other SETFEATURES commands,
>> that is, 5 seconds. This is too short for some disks to complete
>> timeout and allow IDENTIFY to return complete data (e.g.
>> disks with large indirection tables stored on media), resulting
>> in ata_dev_read_id to fail. For this feature, allow a larger
>> timeout of 30 seconds.
>>
>Reviewed-by: Hannes Reinecke <hare@suse.com>
>
>(BTW, you might want to add your Signed-off-by:, too :-)
Hannes,
Sorry about this. Here it is...
libata: Set longer timeout for SETFEATURES_SPINUP
For SATA drives with power-up in standby (PUIS) feature set,
SETFEATURES_SPINUP execution may be required to get
complete IDENTIFY data. However, the timeout used for its
execution is the same as for all other SETFEATURES commands,
that is, 5 seconds. This is too short for some disks to complete
spinup and allow IDENTIFY to return complete data (e.g.
disks with large indirection tables stored on media), resulting
in ata_dev_read_id to fail. For this feature, allow a larger
timeout of 30 seconds.
Signed-off-by: Damien Le Moal <damien.lemoal@hgst.com>
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index e83fc3d..ecbbee2 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4537,7 +4537,8 @@ unsigned int ata_dev_set_feature(struct ata_device *dev, u8 enable, u8 feature)
tf.protocol = ATA_PROT_NODATA;
tf.nsect = feature;
- err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
+ err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0,
+ enable == SETFEATURES_SPINUP ? SETFEATURES_SPINUP_TIMEOUT : 0);
DPRINTK("EXIT, err_mask=%x\n", err_mask);
return err_mask;
diff --git a/include/linux/ata.h b/include/linux/ata.h
index fed3641..e3a9ab6 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -371,6 +371,7 @@ enum {
SETFEATURES_AAM_OFF = 0xC2,
SETFEATURES_SPINUP = 0x07, /* Spin-up drive */
+ SETFEATURES_SPINUP_TIMEOUT = 30000,
SETFEATURES_SATA_ENABLE = 0x10, /* Enable use of SATA feature */
SETFEATURES_SATA_DISABLE = 0x90, /* Disable use of SATA feature */
------------------------
Damien Le Moal, Ph.D.
Sr. Manager, System Software Group, HGST Research,
HGST, a Western Digital company
Damien.LeMoal@hgst.com
(+81) 0466-98-3593 (ext. 513593)
1 kirihara-cho, Fujisawa,
Kanagawa, 252-0888 Japan
www.hgst.com
Western Digital Corporation (and its subsidiaries) E-mail Confidentiality Notice & Disclaimer:
This e-mail and any files transmitted with it may contain confidential or legally privileged information of WDC and/or its affiliates, and are intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited. If you have received this e-mail in error, please notify the sender immediately and delete the e-mail in its entirety from your system.
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] libata: Set longer timeout for SETFEATURES_SPINUP
2016-03-18 4:49 [PATCH] libata: Set longer timeout for SETFEATURES_SPINUP Damien Le Moal
2016-03-18 6:59 ` Hannes Reinecke
@ 2016-03-18 15:02 ` Martin K. Petersen
1 sibling, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2016-03-18 15:02 UTC (permalink / raw)
To: Damien Le Moal; +Cc: linux-scsi@vger.kernel.org, Hannes Reinecke
>>>>> "Damien" == Damien Le Moal <Damien.LeMoal@hgst.com> writes:
Damien,
Damien> libata: Set longer timeout for SETFEATURES_SPINUP
Please submit to linux-ide@vger.kernel.org.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-03-18 15:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-18 4:49 [PATCH] libata: Set longer timeout for SETFEATURES_SPINUP Damien Le Moal
2016-03-18 6:59 ` Hannes Reinecke
2016-03-18 8:24 ` Damien Le Moal
2016-03-18 15:02 ` Martin K. Petersen
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.