rpms/libatasmart/F-11 0001-Get-rid-of-qurik-9_UNKNOWN-again.patch, NONE, 1.1 0001-black-list-a-few-attributes-on-FUJITSU-MHY2120BH-008.patch, NONE, 1.1

Lennart Poettering lennart at fedoraproject.org
Wed May 6 19:01:30 UTC 2009


Author: lennart

Update of /cvs/pkgs/rpms/libatasmart/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv31614

Added Files:
	0001-Get-rid-of-qurik-9_UNKNOWN-again.patch 
	0001-black-list-a-few-attributes-on-FUJITSU-MHY2120BH-008.patch 
Log Message:
add missing patches

0001-Get-rid-of-qurik-9_UNKNOWN-again.patch:

--- NEW FILE 0001-Get-rid-of-qurik-9_UNKNOWN-again.patch ---
>From e9e9be9def29ecf57c5d6c1187c7e7e00f165e47 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart at poettering.net>
Date: Fri, 24 Apr 2009 00:52:02 +0200
Subject: [PATCH] Get rid of qurik 9_UNKNOWN again

Apparently Seagate seems to use the MSB's of the raw data of the
power-on-time field for something else on some disks, so let's just look
at the lower 32bits of that field and we get a value that works on all
disks including those from Seagate. 32bit should be more than enough to
encode the power-on-time for almost all disks so this should not be much
of a limitation.
---
 atasmart.c |   15 +++------------
 1 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/atasmart.c b/atasmart.c
index 5cf6c30..8e21adb 100644
--- a/atasmart.c
+++ b/atasmart.c
@@ -1128,7 +1128,7 @@ static void make_pretty(SkSmartAttributeParsedData *a) {
         else if (!strcmp(a->name, "power-on-hours") ||
                  !strcmp(a->name, "loaded-hours") ||
                  !strcmp(a->name, "head-flying-hours"))
-                a->pretty_value = fourtyeight * 60 * 60 * 1000;
+                a->pretty_value = (fourtyeight & 0xFFFFFFFFU) * 60 * 60 * 1000;
         else if (!strcmp(a->name, "reallocated-sector-count"))
                 a->pretty_value = fourtyeight & 0xFFFFFFFFU;
         else
@@ -1204,8 +1204,7 @@ typedef enum SkSmartQuirk {
         SK_SMART_QUIRK_194_10XCELSIUS = 32,
         SK_SMART_QUIRK_194_UNKNOWN = 64,
         SK_SMART_QUIRK_200_WRITEERRORCOUNT = 128,
-        SK_SMART_QUIRK_201_DETECTEDTACOUNT = 256,
-        SK_SMART_QUIRK_9_UNKNOWN = 512
+        SK_SMART_QUIRK_201_DETECTEDTACOUNT = 256
 } SkSmartQuirk;
 
 /* %STRINGPOOLSTART% */
@@ -1219,7 +1218,6 @@ static const char *quirk_name[] = {
         "194_UNKNOWN",
         "200_WRITEERRORCOUNT",
         "201_DETECTEDTACOUNT",
-        "9_UNKNOWN",
         NULL
 };
 /* %STRINGPOOLSTOP% */
@@ -1232,12 +1230,6 @@ typedef struct SkSmartQuirkDatabase {
 
 static const SkSmartQuirkDatabase quirk_database[] = { {
 
-        /*** Seagate */
-                "^ST9160821AS$",
-                NULL,
-                SK_SMART_QUIRK_9_UNKNOWN
-        }, {
-
         /*** Fujitsu */
                 "^FUJITSU MHR2040AT$",
                 NULL,
@@ -1459,8 +1451,7 @@ static const SkSmartAttributeInfo *lookup_attribute(SkDisk *d, uint8_t id) {
                                                 "power-on-half-minutes", SK_SMART_ATTRIBUTE_UNIT_MSECONDS
                                         };
                                         return &a;
-                                } else if (quirk & SK_SMART_QUIRK_9_UNKNOWN)
-                                        return NULL;
+                                }
                                 /* %STRINGPOOLSTOP% */
 
                                 break;
-- 
1.6.2.2


0001-black-list-a-few-attributes-on-FUJITSU-MHY2120BH-008.patch:

--- NEW FILE 0001-black-list-a-few-attributes-on-FUJITSU-MHY2120BH-008.patch ---
>From 15ffa130b985fb057d49d9b2ae287420c42ff980 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart at poettering.net>
Date: Wed, 6 May 2009 20:29:50 +0200
Subject: [PATCH] black list a few attributes on FUJITSU MHY2120BH/0085000B

---
 atasmart.c |   29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/atasmart.c b/atasmart.c
index bd78c9f..d0ead75 100644
--- a/atasmart.c
+++ b/atasmart.c
@@ -1205,7 +1205,10 @@ typedef enum SkSmartQuirk {
         SK_SMART_QUIRK_194_10XCELSIUS = 32,
         SK_SMART_QUIRK_194_UNKNOWN = 64,
         SK_SMART_QUIRK_200_WRITEERRORCOUNT = 128,
-        SK_SMART_QUIRK_201_DETECTEDTACOUNT = 256
+        SK_SMART_QUIRK_201_DETECTEDTACOUNT = 256,
+        SK_SMART_QUIRK_9_UNKNOWN = 512,
+        SK_SMART_QUIRK_197_UNKNOWN = 1024,
+        SK_SMART_QUIRK_198_UNKNOWN = 2048,
 } SkSmartQuirk;
 
 /* %STRINGPOOLSTART% */
@@ -1219,6 +1222,9 @@ static const char *quirk_name[] = {
         "194_UNKNOWN",
         "200_WRITEERRORCOUNT",
         "201_DETECTEDTACOUNT",
+        "9_UNKNOWN",
+        "197_UNKNOWN",
+        "198_UNKNOWN",
         NULL
 };
 /* %STRINGPOOLSTOP% */
@@ -1232,6 +1238,12 @@ typedef struct SkSmartQuirkDatabase {
 static const SkSmartQuirkDatabase quirk_database[] = { {
 
         /*** Fujitsu */
+                "^FUJITSU MHY2120BH$",
+                "^0085000B$", /* seems to be specific to this firmware */
+                SK_SMART_QUIRK_9_UNKNOWN|
+                SK_SMART_QUIRK_197_UNKNOWN|
+                SK_SMART_QUIRK_198_UNKNOWN
+        }, {
                 "^FUJITSU MHR2040AT$",
                 NULL,
                 SK_SMART_QUIRK_9_POWERONSECONDS|
@@ -1452,7 +1464,8 @@ static const SkSmartAttributeInfo *lookup_attribute(SkDisk *d, uint8_t id) {
                                                 "power-on-half-minutes", SK_SMART_ATTRIBUTE_UNIT_MSECONDS
                                         };
                                         return &a;
-                                }
+                                } else if (quirk & SK_SMART_QUIRK_9_UNKNOWN)
+                                        return NULL;
                                 /* %STRINGPOOLSTOP% */
 
                                 break;
@@ -1482,6 +1495,18 @@ static const SkSmartAttributeInfo *lookup_attribute(SkDisk *d, uint8_t id) {
 
                                 break;
 
+                        case 197:
+                                if (quirk & SK_SMART_QUIRK_197_UNKNOWN)
+                                        return NULL;
+
+                                break;
+
+                        case 198:
+                                if (quirk & SK_SMART_QUIRK_198_UNKNOWN)
+                                        return NULL;
+
+                                break;
+
                         case 200:
                                 /* %STRINGPOOLSTART% */
                                 if (quirk & SK_SMART_QUIRK_200_WRITEERRORCOUNT) {
-- 
1.6.2.2





More information about the scm-commits mailing list