nvme_manager: Change to report present while SSD is powered off
Report present while SSD is powered off and also keep reading
SSD temperature to indicate the invalid information
Signed-off-by: George Hung <george.hung@quantatw.com>
Change-Id: I0e41619913b2b9ea07e79d72aa809911726999e7
diff --git a/nvme_manager.cpp b/nvme_manager.cpp
index 07ce839..9f4aa17 100644
--- a/nvme_manager.cpp
+++ b/nvme_manager.cpp
@@ -597,10 +597,10 @@
if (getGPIOValueOfNvme(devPwrGoodPath) != POWERGD)
{
-
- // Present pin is true but power good pin is false
- // remove nvme d-bus path, clean all properties in inventory
- // and turn on fault LED
+ // IFDET should be used to provide the final say
+ // in SSD's presence - IFDET showing SSD is present
+ // but the power is off (if the drive is plugged in)
+ // is a valid state.
setFaultLED(config.locateLedGroupPath,
config.faultLedGroupPath, true);
@@ -609,8 +609,7 @@
config.locateLedControllerPath, false);
nvmeData = NVMeData();
- setNvmeInventoryProperties(false, nvmeData, inventoryPath);
- nvmes.erase(config.index);
+ setNvmeInventoryProperties(true, nvmeData, inventoryPath);
if (isErrorPower[config.index] != true)
{
@@ -623,6 +622,11 @@
isErrorPower[config.index] = true;
}
+
+ // Keep reading to report the invalid temperature
+ // (To make thermal loop know that the sensor reading
+ // is invalid).
+ readNvmeData(config);
continue;
}
}