mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wojciech Drewek <wojciech.drewek@intel.com>
To: Horatiu Vultur <horatiu.vultur@microchip.com>, <andrew@lunn.ch>,
	<hkallweit1@gmail.com>, <linux@armlinux.org.uk>,
	<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<UNGLinuxDriver@microchip.com>
Subject: Re: [PATCH net-next v2 1/2] net: phy: micrel: lan8814 led errata
Date: Fri, 1 Mar 2024 09:17:41 +0100	[thread overview]
Message-ID: <4a0e5f42-ec5a-48d2-8887-d14a019a054a@intel.com> (raw)
In-Reply-To: <20240229195220.2673049-2-horatiu.vultur@microchip.com>



On 29.02.2024 20:52, Horatiu Vultur wrote:
> Lan8814 phy led behavior is not correct. It was noticed that the led
> still remains ON when the cable is unplugged while there was traffic
> passing at that time.
> 
> The fix consists in clearing bit 10 of register 0x38, in this way the
> led behaviour is correct and gets OFF when there is no link.
> 
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---

Thank you!
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>

>  drivers/net/phy/micrel.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> index 9b69735819896..88cc03982bb78 100644
> --- a/drivers/net/phy/micrel.c
> +++ b/drivers/net/phy/micrel.c
> @@ -114,6 +114,9 @@
>  #define LAN8814_INTR_CTRL_REG_POLARITY		BIT(1)
>  #define LAN8814_INTR_CTRL_REG_INTR_ENABLE	BIT(0)
>  
> +#define LAN8814_EEE_STATE			0x38
> +#define LAN8814_EEE_STATE_MASK2P5P		BIT(10)
> +
>  /* Represents 1ppm adjustment in 2^32 format with
>   * each nsec contains 4 clock cycles.
>   * The value is calculated as following: (1/1000000)/((2^-32)/4)
> @@ -3288,6 +3291,19 @@ static int lan8814_release_coma_mode(struct phy_device *phydev)
>  	return 0;
>  }
>  
> +static void lan8814_clear_2psp_bit(struct phy_device *phydev)
> +{
> +	u16 val;
> +
> +	/* It was noticed that when traffic is passing through the PHY and the
> +	 * cable is removed then the LED was still one even though there is no
> +	 * link
> +	 */
> +	val = lanphy_read_page_reg(phydev, 2, LAN8814_EEE_STATE);
> +	val &= ~LAN8814_EEE_STATE_MASK2P5P;
> +	lanphy_write_page_reg(phydev, 2, LAN8814_EEE_STATE, val);
> +}
> +
>  static int lan8814_probe(struct phy_device *phydev)
>  {
>  	const struct kszphy_type *type = phydev->drv->driver_data;
> @@ -3324,6 +3340,9 @@ static int lan8814_probe(struct phy_device *phydev)
>  
>  	lan8814_ptp_init(phydev);
>  
> +	/* Errata workarounds */
> +	lan8814_clear_2psp_bit(phydev);
> +
>  	return 0;
>  }
>  

  reply	other threads:[~2024-03-01  8:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 19:52 [PATCH net-next v2 0/2] net: phy: micrel: lan8814 erratas Horatiu Vultur
2024-02-29 19:52 ` [PATCH net-next v2 1/2] net: phy: micrel: lan8814 led errata Horatiu Vultur
2024-03-01  8:17   ` Wojciech Drewek [this message]
2024-02-29 19:52 ` [PATCH net-next v2 2/2] net: phy: micrel: lan8814 cable improvement errata Horatiu Vultur
2024-03-01  3:27   ` Arun.Ramadoss
2024-03-01  7:27     ` Horatiu Vultur - M31836
2024-03-03  3:40       ` Jakub Kicinski
2024-03-04  8:48         ` Horatiu Vultur - M31836
2024-03-01  8:18   ` Wojciech Drewek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4a0e5f42-ec5a-48d2-8887-d14a019a054a@intel.com \
    --to=wojciech.drewek@intel.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®