mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-16 15:45:45 +00:00
ixgbe: fix LED blink logic to check for link
Previously the driver would force link without checking whether the link was already established. This caused some inconsistencies in the LED blink rate. Do not force link if link is already up. Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
ef456f8589
commit
8d233633ba
1 changed files with 11 additions and 7 deletions
|
@ -751,16 +751,20 @@ static s32 ixgbe_blink_led_start_X540(struct ixgbe_hw *hw, u32 index)
|
||||||
{
|
{
|
||||||
u32 macc_reg;
|
u32 macc_reg;
|
||||||
u32 ledctl_reg;
|
u32 ledctl_reg;
|
||||||
|
ixgbe_link_speed speed;
|
||||||
|
bool link_up;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In order for the blink bit in the LED control register
|
* Link should be up in order for the blink bit in the LED control
|
||||||
* to work, link and speed must be forced in the MAC. We
|
* register to work. Force link and speed in the MAC if link is down.
|
||||||
* will reverse this when we stop the blinking.
|
* This will be reversed when we stop the blinking.
|
||||||
*/
|
*/
|
||||||
macc_reg = IXGBE_READ_REG(hw, IXGBE_MACC);
|
hw->mac.ops.check_link(hw, &speed, &link_up, false);
|
||||||
macc_reg |= IXGBE_MACC_FLU | IXGBE_MACC_FSV_10G | IXGBE_MACC_FS;
|
if (link_up == false) {
|
||||||
IXGBE_WRITE_REG(hw, IXGBE_MACC, macc_reg);
|
macc_reg = IXGBE_READ_REG(hw, IXGBE_MACC);
|
||||||
|
macc_reg |= IXGBE_MACC_FLU | IXGBE_MACC_FSV_10G | IXGBE_MACC_FS;
|
||||||
|
IXGBE_WRITE_REG(hw, IXGBE_MACC, macc_reg);
|
||||||
|
}
|
||||||
/* Set the LED to LINK_UP + BLINK. */
|
/* Set the LED to LINK_UP + BLINK. */
|
||||||
ledctl_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
|
ledctl_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
|
||||||
ledctl_reg &= ~IXGBE_LED_MODE_MASK(index);
|
ledctl_reg &= ~IXGBE_LED_MODE_MASK(index);
|
||||||
|
|
Loading…
Reference in a new issue