From 8daf1f1bfe9494d0cd0d8352715e28f2f64eaaef Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Tue, 15 Oct 2024 16:57:53 -0400 Subject: [PATCH] ata: SSDs: Only check for _legal_ "rotational rate" values I'm 98% sure that the "byteswapped" value I saw was due to another bug (bad PIO timings on ipods leading to data corruption) and none of the growing pile of identify device data files that I have include the backwards one. Change-Id: Iea47b7419b120a3c8a282b2e3a8f65b8965356ce --- firmware/export/ata.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/firmware/export/ata.h b/firmware/export/ata.h index 8ae28fc191..0d84a91524 100644 --- a/firmware/export/ata.h +++ b/firmware/export/ata.h @@ -176,7 +176,6 @@ static inline int ata_disk_isssd(void) 0x0401 -> 0xffe == RPM All others reserved - Some CF cards return 0x0100 (ie byteswapped 0x0001) so accept either. However, this is a relatively recent change, and we can't rely on it, especially for the FC1307A CF->SD adapters! @@ -199,14 +198,13 @@ static inline int ata_disk_isssd(void) then device is standard flash CF. However this is not foolproof as newer CF cards (and those CF->SD adapters) may report this. - */ - return ( (identify_info[217] == 0x0001 || identify_info[217] == 0x0100) /* "Solid state" rotational rate */ - || ((identify_info[168] & 0x0f) >= 0x06) /* Explicit SSD form factors */ - || (identify_info[169] & (1<<0)) /* TRIM supported */ - || (identify_info[163] > 0) /* CF Advanced timing modes */ - || ((identify_info[83] & (1<<2)) && /* CFA compliant */ - ((identify_info[160] & (1<<15)) == 0)) /* CF power level 0 */ + return ( (identify_info[217] == 0x0001) /* "Solid state" rotational rate */ + || ((identify_info[168] & 0x0f) >= 0x06) /* Explicit SSD form factors */ + || (identify_info[169] & (1<<0)) /* TRIM supported */ + || (identify_info[163] > 0) /* CF Advanced timing modes */ + || ((identify_info[83] & (1<<2)) && /* CFA compliant */ + ((identify_info[160] & (1<<15)) == 0)) /* CF power level 0 */ ); }