lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250825060422.t4psl5rlol4fg2zo@DEN-DL-M31836.microchip.com>
Date: Mon, 25 Aug 2025 08:04:22 +0200
From: Horatiu Vultur - M31836 <Horatiu.Vultur@...rochip.com>
To: Parthiban Veerasooran - I17164 <Parthiban.Veerasooran@...rochip.com>
CC: "andrew@...n.ch" <andrew@...n.ch>, "hkallweit1@...il.com"
	<hkallweit1@...il.com>, "linux@...linux.org.uk" <linux@...linux.org.uk>,
	"davem@...emloft.net" <davem@...emloft.net>, "edumazet@...gle.com"
	<edumazet@...gle.com>, "kuba@...nel.org" <kuba@...nel.org>,
	"pabeni@...hat.com" <pabeni@...hat.com>, "richardcochran@...il.com"
	<richardcochran@...il.com>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next 2/2] net: phy: micrel: Add PTP support for
 lan8842

The 08/22/2025 10:17, Parthiban Veerasooran - I17164 wrote:
> Hi Horatiu,

Hi Parthiban,

> 
> > +static void lan8842_handle_ptp_interrupt(struct phy_device *phydev, u16 status)
> > +{
> > +	struct lan8842_priv *priv = phydev->priv;
> > +	struct kszphy_ptp_priv *ptp_priv = &priv->ptp_priv;
> Please follow reverse Christmas tree style.

That is a goot catch. I will update it in the next version. Thanks.

> 
> Best regards,
> Parthiban V
> > +
> > +	if (status & PTP_TSU_INT_STS_PTP_TX_TS_EN_)
> > +		lan8814_get_tx_ts(ptp_priv);
> > +
> > +	if (status & PTP_TSU_INT_STS_PTP_RX_TS_EN_)
> > +		lan8814_get_rx_ts(ptp_priv);
> > +
> > +	if (status & PTP_TSU_INT_STS_PTP_TX_TS_OVRFL_INT_) {
> > +		lan8814_flush_fifo(phydev, true);
> > +		skb_queue_purge(&ptp_priv->tx_queue);
> > +	}
> > +
> > +	if (status & PTP_TSU_INT_STS_PTP_RX_TS_OVRFL_INT_) {
> > +		lan8814_flush_fifo(phydev, false);
> > +		skb_queue_purge(&ptp_priv->rx_queue);
> > +	}
> > +}
> > +
> >   static irqreturn_t lan8842_handle_interrupt(struct phy_device *phydev)
> >   {
> > +	struct lan8842_priv *priv = phydev->priv;
> >   	int ret = IRQ_NONE;
> >   	int irq_status;
> >   
> > @@ -5912,6 +5983,25 @@ static irqreturn_t lan8842_handle_interrupt(struct phy_device *phydev)
> >   		ret = IRQ_HANDLED;
> >   	}
> >   
> > +	/* Phy revision lan8832 doesn't have support for PTP threrefore there is
> > +	 * not need to check the PTP and GPIO interrupts
> > +	 */
> > +	if (priv->rev == 0x8832)
> > +		goto out;
> > +
> > +	while (true) {
> > +		irq_status = lanphy_read_page_reg(phydev, 5, PTP_TSU_INT_STS);
> > +		if (!irq_status)
> > +			break;
> > +
> > +		lan8842_handle_ptp_interrupt(phydev, irq_status);
> > +		ret = IRQ_HANDLED;
> > +	}
> > +
> > +	if (!lan8814_handle_gpio_interrupt(phydev, irq_status))
> > +		ret = IRQ_HANDLED;
> > +
> > +out:
> >   	return ret;
> >   }
> >   
> 

-- 
/Horatiu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ