psu-ng: Disable Communication, Logic, and Memory (CML) fault

Turn off CML fault logging as some of the power supplies don't support
all PMBus commands that could be sent from device driver or application.
The PSU sets the CML fault bit on when it receives unsupported PMBus
command.

Testing:
  - Tested the change on simulation by setting the CML status bit on and
    verified no error log reported.
  - Tested the change on BMC System as follow and verified no error log
    reported
    * Powered on the chassis
    * i2cget -f -y 3 0x68 0x6c w # causes information error log for
      tracing purpose.

Change-Id: Ie1b52e5350a29f65bd517ad11293c6dc522ac83e
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Signed-off-by: Faisal Awada <faisal@us.ibm.com>
diff --git a/phosphor-power-supply/power_supply.hpp b/phosphor-power-supply/power_supply.hpp
index 3c6408b..d745f48 100644
--- a/phosphor-power-supply/power_supply.hpp
+++ b/phosphor-power-supply/power_supply.hpp
@@ -460,11 +460,10 @@
 
     /**
      * @brief Returns true if the number of failed reads exceeds limit
-     * TODO: or CML bit on.
      */
     bool hasCommFault() const
     {
-        return ((readFail >= LOG_LIMIT) || (cmlFault >= DEGLITCH_LIMIT));
+        return (readFail >= LOG_LIMIT);
     }
 
     /**
diff --git a/phosphor-power-supply/test/power_supply_tests.cpp b/phosphor-power-supply/test/power_supply_tests.cpp
index 62f8b5d..7d2e4c9 100644
--- a/phosphor-power-supply/test/power_supply_tests.cpp
+++ b/phosphor-power-supply/test/power_supply_tests.cpp
@@ -485,56 +485,6 @@
         }
     }
 
-    EXPECT_CALL(mockPMBus, read(READ_VIN, _, _)).Times(1).WillOnce(Return(1));
-    EXPECT_CALL(mockPMBus, read("in1_lcrit_alarm", _, _))
-        .Times(1)
-        .WillOnce(Return(1));
-    psu2.clearFaults();
-
-    // CML fault
-    {
-        // First STATUS_WORD wit no bits set, then with CML fault.
-        PMBusExpectations expectations;
-        setPMBusExpectations(mockPMBus, expectations);
-        EXPECT_CALL(mockPMBus, readString(READ_VIN, _))
-            .Times(1)
-            .WillOnce(Return("214000"));
-        psu2.analyze();
-        // STATUS_WORD with CML fault bit on.
-        expectations.statusWordValue = (status_word::CML_FAULT);
-        // Turn on STATUS_CML fault bit(s)
-        expectations.statusCMLValue = 0xFF;
-        for (auto x = 1; x <= DEGLITCH_LIMIT; x++)
-        {
-            setPMBusExpectations(mockPMBus, expectations);
-            EXPECT_CALL(mockPMBus, readString(READ_VIN, _))
-                .Times(1)
-                .WillOnce(Return("215000"));
-            psu2.analyze();
-            EXPECT_EQ(psu2.isPresent(), true);
-            EXPECT_EQ(psu2.isFaulted(), x >= DEGLITCH_LIMIT);
-            EXPECT_EQ(psu2.hasCommFault(), x >= DEGLITCH_LIMIT);
-            EXPECT_EQ(psu2.hasInputFault(), false);
-            EXPECT_EQ(psu2.hasMFRFault(), false);
-            EXPECT_EQ(psu2.hasVINUVFault(), false);
-            EXPECT_EQ(psu2.hasVoutOVFault(), false);
-            EXPECT_EQ(psu2.hasIoutOCFault(), false);
-            EXPECT_EQ(psu2.hasVoutUVFault(), false);
-            EXPECT_EQ(psu2.hasFanFault(), false);
-            EXPECT_EQ(psu2.hasTempFault(), false);
-            EXPECT_EQ(psu2.hasPgoodFault(), false);
-            EXPECT_EQ(psu2.hasPSKillFault(), false);
-            EXPECT_EQ(psu2.hasPS12VcsFault(), false);
-            EXPECT_EQ(psu2.hasPSCS12VFault(), false);
-        }
-    }
-
-    EXPECT_CALL(mockPMBus, read(READ_VIN, _, _)).Times(1).WillOnce(Return(1));
-    EXPECT_CALL(mockPMBus, read("in1_lcrit_alarm", _, _))
-        .Times(1)
-        .WillOnce(Return(1));
-    psu2.clearFaults();
-
     // VOUT_OV_FAULT fault
     {
         // First STATUS_WORD with no bits set, then with VOUT/VOUT_OV fault.
@@ -869,7 +819,6 @@
         EXPECT_EQ(psu.hasInputFault(), x >= DEGLITCH_LIMIT);
         EXPECT_EQ(psu.hasMFRFault(), x >= DEGLITCH_LIMIT);
         EXPECT_EQ(psu.hasVINUVFault(), x >= DEGLITCH_LIMIT);
-        EXPECT_EQ(psu.hasCommFault(), x >= DEGLITCH_LIMIT);
         EXPECT_EQ(psu.hasVoutOVFault(), x >= DEGLITCH_LIMIT);
         EXPECT_EQ(psu.hasIoutOCFault(), x >= DEGLITCH_LIMIT);
         EXPECT_EQ(psu.hasFanFault(), x >= DEGLITCH_LIMIT);
@@ -942,8 +891,7 @@
     EXPECT_EQ(psu.hasInputFault(), true);
     EXPECT_EQ(psu.hasMFRFault(), true);
     EXPECT_EQ(psu.hasVINUVFault(), true);
-    // True due to CML fault bits on
-    EXPECT_EQ(psu.hasCommFault(), true);
+    EXPECT_EQ(psu.hasCommFault(), false);
     EXPECT_EQ(psu.hasVoutOVFault(), true);
     EXPECT_EQ(psu.hasIoutOCFault(), true);
     // Cannot have VOUT_OV_FAULT and VOUT_UV_FAULT.
@@ -977,7 +925,7 @@
     EXPECT_EQ(psu.hasInputFault(), false);
     EXPECT_EQ(psu.hasMFRFault(), true);
     EXPECT_EQ(psu.hasVINUVFault(), false);
-    EXPECT_EQ(psu.hasCommFault(), true);
+    EXPECT_EQ(psu.hasCommFault(), false);
     EXPECT_EQ(psu.hasVoutOVFault(), true);
     EXPECT_EQ(psu.hasIoutOCFault(), true);
     EXPECT_EQ(psu.hasVoutUVFault(), false);