All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Divya Koppera <divya.koppera@microchip.com>
Cc: <andrew@lunn.ch>, <arun.ramadoss@microchip.com>,
	<UNGLinuxDriver@microchip.com>, <hkallweit1@gmail.com>,
	<linux@armlinux.org.uk>, <davem@davemloft.net>,
	<edumazet@google.com>, <pabeni@redhat.com>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<richardcochran@gmail.com>, <vadim.fedorenko@linux.dev>
Subject: Re: [PATCH net-next v7 5/5] net: phy: microchip_t1 : Add initialization of ptp for lan887x
Date: Tue, 17 Dec 2024 19:13:37 -0800	[thread overview]
Message-ID: <20241217191337.717be46a@kernel.org> (raw)
In-Reply-To: <20241213121403.29687-6-divya.koppera@microchip.com>

On Fri, 13 Dec 2024 17:44:03 +0530 Divya Koppera wrote:
>  static int lan887x_phy_init(struct phy_device *phydev)
>  {
> +	struct lan887x_priv *priv = phydev->priv;
>  	int ret;
>  
> +	if (!priv->init_done && phy_interrupt_is_valid(phydev)) {
> +		priv->clock = mchp_rds_ptp_probe(phydev, MDIO_MMD_VEND1,
> +						 MCHP_RDS_PTP_LTC_BASE_ADDR,
> +						 MCHP_RDS_PTP_PORT_BASE_ADDR);
> +		if (IS_ERR(priv->clock))
> +			return PTR_ERR(priv->clock);
> +
> +		priv->init_done = true;
> +	}

If this only has to happen once, why not call mchp_rds_ptp_probe() from
lan887x_probe() ? If there is some inherent reason the function needs 
to be protected from multiple calls maybe it's better to let
mchp_rds_ptp_probe() handle that case ?

  parent reply	other threads:[~2024-12-18  3:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-13 12:13 [PATCH net-next v7 0/5] Add rds ptp library for Microchip phys Divya Koppera
2024-12-13 12:13 ` [PATCH net-next v7 1/5] net: phy: microchip_rds_ptp: Add header file for Microchip rds ptp library Divya Koppera
2024-12-17 15:05   ` Andrew Lunn
2024-12-13 12:14 ` [PATCH net-next v7 2/5] net: phy: microchip_rds_ptp : Add rds ptp library for Microchip phys Divya Koppera
2024-12-18  3:22   ` Jakub Kicinski
2024-12-18  3:47     ` Richard Cochran
2024-12-18  3:57       ` Jakub Kicinski
2024-12-18  4:41         ` Richard Cochran
2024-12-18 10:52         ` Divya.Koppera
2024-12-18  3:25   ` Jakub Kicinski
2024-12-13 12:14 ` [PATCH net-next v7 3/5] net: phy: Kconfig: Add rds ptp library support and 1588 optional flag in " Divya Koppera
2024-12-17 15:06   ` Andrew Lunn
2024-12-18  3:14   ` Jakub Kicinski
2024-12-13 12:14 ` [PATCH net-next v7 4/5] net: phy: Makefile: Add makefile support for rds ptp " Divya Koppera
2024-12-17 15:09   ` Andrew Lunn
2024-12-13 12:14 ` [PATCH net-next v7 5/5] net: phy: microchip_t1 : Add initialization of ptp for lan887x Divya Koppera
2024-12-17 15:11   ` Andrew Lunn
2024-12-18  3:13   ` Jakub Kicinski [this message]
2024-12-18 12:03     ` Divya.Koppera

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=20241217191337.717be46a@kernel.org \
    --to=kuba@kernel.org \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=arun.ramadoss@microchip.com \
    --cc=davem@davemloft.net \
    --cc=divya.koppera@microchip.com \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=vadim.fedorenko@linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.