On some hardware LEDs would not blink after command 'ethtool -p {eth-port}'
in certain circumstances. Now, function does not care about the activity
of the LED (though still preserves its state) but forcibly executes
identification blinking and then restores the LED state.

Signed-off-by: Piotr Marczak <piotr.marc...@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktio...@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong...@intel.com>
---
 drivers/net/i40e/base/i40e_common.c | 35 -----------------------------
 1 file changed, 35 deletions(-)

diff --git a/drivers/net/i40e/base/i40e_common.c 
b/drivers/net/i40e/base/i40e_common.c
index a87d2fa6b..f6e55e3a9 100644
--- a/drivers/net/i40e/base/i40e_common.c
+++ b/drivers/net/i40e/base/i40e_common.c
@@ -1589,7 +1589,6 @@ static u32 i40e_led_is_mine(struct i40e_hw *hw, int idx)
  **/
 u32 i40e_led_get(struct i40e_hw *hw)
 {
-       u32 current_mode = 0;
        u32 mode = 0;
        int i;
 
@@ -1601,27 +1600,10 @@ u32 i40e_led_get(struct i40e_hw *hw)
 
                if (!gpio_val)
                        continue;
-
-               /* ignore gpio LED src mode entries related to the activity
-                *  LEDs
-                */
-               current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK)
-                               >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT);
-               switch (current_mode) {
-               case I40E_COMBINED_ACTIVITY:
-               case I40E_FILTER_ACTIVITY:
-               case I40E_MAC_ACTIVITY:
-               case I40E_LINK_ACTIVITY:
-                       continue;
-               default:
-                       break;
-               }
-
                mode = (gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >>
                        I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT;
                break;
        }
-
        return mode;
 }
 
@@ -1636,7 +1618,6 @@ u32 i40e_led_get(struct i40e_hw *hw)
  **/
 void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink)
 {
-       u32 current_mode = 0;
        int i;
 
        if (mode & 0xfffffff0)
@@ -1650,22 +1631,6 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool 
blink)
 
                if (!gpio_val)
                        continue;
-
-               /* ignore gpio LED src mode entries related to the activity
-                * LEDs
-                */
-               current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK)
-                               >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT);
-               switch (current_mode) {
-               case I40E_COMBINED_ACTIVITY:
-               case I40E_FILTER_ACTIVITY:
-               case I40E_MAC_ACTIVITY:
-               case I40E_LINK_ACTIVITY:
-                       continue;
-               default:
-                       break;
-               }
-
                gpio_val &= ~I40E_GLGEN_GPIO_CTL_LED_MODE_MASK;
                /* this & is a bit of paranoia, but serves as a range check */
                gpio_val |= ((mode << I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT) &
-- 
2.17.1

Reply via email to