From de90cd71f68e947d3bd6c3f2ef5731ead010a768 Mon Sep 17 00:00:00 2001 From: Shane Huang Date: Sun, 18 Nov 2012 04:44:41 +0800 Subject: libata: check SATA_SETTINGS log with HW Feature Ctrl NCQ capability was used to check availability of SATA Settings page from Identify Device Data Log, which contains DevSlp timing variables. It does not work on some HDDs and leads to error messages. IDENTIFY word 78 bit 5(Hardware Feature Control) should be used. Quoting SATA spec 3.1: If Hardware Feature Control is supported, then: a) IDENTIFY DEVICE data word 78 bit 5 (see 13.2.1.18) shall be set to one; b) the SET FEATURES Select Hardware Feature Control subcommand shall be supported (see 13.3.8); c) page 08h of the Identify Device Data log (see 13.7.7) shall be supported; This patch is not tested on SATA HDD with DevSlp supported. Reported-by: Borislav Petkov Signed-off-by: Shane Huang Signed-off-by: Jeff Garzik --- drivers/ata/libata-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index f46fbd3bd3fb..caffe73c1e4a 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -2330,9 +2330,8 @@ int ata_dev_configure(struct ata_device *dev) /* Obtain SATA Settings page from Identify Device Data Log, * which contains DevSlp timing variables etc. - * Exclude old devices with ata_id_has_ncq() */ - if (ata_id_has_ncq(dev->id)) { + if (ata_id_has_hw_feature_ctrl(dev->id)) { err_mask = ata_read_log_page(dev, ATA_LOG_SATA_ID_DEV_DATA, ATA_LOG_SATA_SETTINGS, -- cgit v1.2.3