Project

General

Profile

Actions

Bug #10255

closed

SES temperature thresholds 20 degrees too hot

Added by Garrett D'Amore over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Category:
driver - device drivers
Start date:
2019-01-16
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

The SES-2 specification supplies thresholds, which libses encodes in the nvlist, for temperatures.

For "bit efficiency" reasons, SES temperatures are encoded as a byte, where the 0 value is invalid, and all other values are supplied in degrees C, but offset by 20 degrees.

In otherwords, you need to substract 20 from the 8 bit value, giving a range of -19C to 235C. SES does this correctly for the value of the temperature.

But the thresholds are meant to have the same units and offest applied.

The issue is readily addressed in the ses2 plugin for libses.


Related issues

Related to illumos gate - Bug #8244: Some drives report a bogus reference temperatureIn Progress2017-05-17

Actions
Actions #1

Updated by Garrett D'Amore over 3 years ago

Our fix (Copyright to RackTop Systems):

--- a/usr/src/lib/scsi/plugins/ses/ses2/common/ses2_element.c
+++ b/usr/src/lib/scsi/plugins/ses/ses2/common/ses2_element.c
@@ -963,30 +963,37 @@ elem_parse_threshold(ses_plugin_t *sp, ses_node_t *np)
        VERIFY(nvlist_lookup_uint64(nvl, SES_PROP_ELEMENT_TYPE,
            &type) == 0);

+       if ((tp = ses_plugin_page_lookup(sp, snap,
+           SES2_DIAGPAGE_THRESHOLD_IO, np, &len)) == NULL)
+               return (0);
+
        switch (type) {
        case SES_ET_TEMPERATURE_SENSOR:
+               SES_NV_ADD(int64, nverr, nvl, SES_PROP_THRESH_CRIT_HI,
+                   (int)tp->sti_high_crit + SES2_ES_TEMP_OFFSET);
+               SES_NV_ADD(int64, nverr, nvl, SES_PROP_THRESH_WARN_HI,
+                   (int)tp->sti_high_warn + SES2_ES_TEMP_OFFSET);
+               SES_NV_ADD(int64, nverr, nvl, SES_PROP_THRESH_CRIT_LO,
+                   (int)tp->sti_low_crit + SES2_ES_TEMP_OFFSET);
+               SES_NV_ADD(int64, nverr, nvl, SES_PROP_THRESH_WARN_LO,
+                   (int)tp->sti_low_warn + SES2_ES_TEMP_OFFSET);
+               return (0);
+
        case SES_ET_UPS:
-       case SES_ET_VOLTAGE_SENSOR:
        case SES_ET_CURRENT_SENSOR:
-               break;
+       case SES_ET_VOLTAGE_SENSOR:
+               SES_NV_ADD(uint64, nverr, nvl, SES_PROP_THRESH_CRIT_HI,
+                   tp->sti_high_crit);
+               SES_NV_ADD(uint64, nverr, nvl, SES_PROP_THRESH_WARN_HI,
+                   tp->sti_high_warn);
:
+                   tp->sti_low_crit);
+               SES_NV_ADD(uint64, nverr, nvl, SES_PROP_THRESH_WARN_LO,
+                   tp->sti_low_warn);
+               return (0);
        default:
                return (0);
        }
-
-       if ((tp = ses_plugin_page_lookup(sp, snap,
-           SES2_DIAGPAGE_THRESHOLD_IO, np, &len)) == NULL)
-               return (0);
-
-       SES_NV_ADD(uint64, nverr, nvl, SES_PROP_THRESH_CRIT_HI,
-           tp->sti_high_crit);
-       SES_NV_ADD(uint64, nverr, nvl, SES_PROP_THRESH_WARN_HI,
-           tp->sti_high_warn);
-       SES_NV_ADD(uint64, nverr, nvl, SES_PROP_THRESH_CRIT_LO,
-           tp->sti_low_crit);
-       SES_NV_ADD(uint64, nverr, nvl, SES_PROP_THRESH_WARN_LO,
-           tp->sti_low_warn);
-
-       return (0);
 }

Actions #2

Updated by Joshua M. Clulow over 3 years ago

  • Related to Bug #8244: Some drives report a bogus reference temperature added
Actions #3

Updated by Garrett D'Amore about 3 years ago

  • Subject changed from SES temperature thresholds 20 degress too hot to SES temperature thresholds 20 degrees too hot
Actions #4

Updated by Garrett D'Amore about 3 years ago

  • Status changed from New to In Progress
Actions #5

Updated by Electric Monk about 3 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 1c124bccd08a671182130ddf2af8e454734b3897

commit  1c124bccd08a671182130ddf2af8e454734b3897
Author: Garrett D'Amore <garrett@damore.org>
Date:   2019-07-05T14:48:29.000Z

    10255 SES temperature thresholds 20 degrees too hot
    Reviewed by: Andrew Stormont <astormont@racktopsystems.com>
    Reviewed by: Sam Zaydel <szaydel@racktopsystems.com>
    Reviewed by: Jim Johnson <jjohnson@racktopsystems.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF