Re: [PATCH] ide/libata: fix ata_id_is_cfa()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alan Cox wrote:

This is what I would favour:

libata: Fix CFA detection & improve version inlines

From: Alan Cox <alan@xxxxxxxxxx>

Sergei Shtylyov noticed thae ata_id_is_cfa checked the wrong word for the
secondary CFA test and posted a patch set to improve this, but which
removed the version checks.

   And did that completely correctly.

This patch keeps the version checks but incorporates the other suggestions
Sergei made including a better ata version check for the usual case where
we want to know "is version >= x" rather than "what version do you
support".

   Improvements should be mixed with fixes.

Signed-off-by: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>

   NAK.

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 88c2428..c17b62a 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
diff --git a/include/linux/ata.h b/include/linux/ata.h
index a53318b..e35d8de 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
[...]
@@ -734,15 +741,16 @@ static inline int ata_id_is_cfa(const u16 *id)
 	if (id[ATA_ID_CONFIG] == 0x848A)	/* Standard CF */
 		return 1;
 	/* Could be CF hiding as standard ATA */
-	if (ata_id_major_version(id) >= 3 &&
-	    id[ATA_ID_COMMAND_SET_1] != 0xFFFF &&
-	   (id[ATA_ID_COMMAND_SET_1] & (1 << 2)))
+	if (ata_id_has_version(id, 3) &&

   Refer to the CF specs (google for cfspc<x_><y>.pdf) as to why it's wrong.

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux