[PATCH net-next v4 3/5] net: phy: Kconfig: Add ptp library support and 1588 optional flag in Microchip phys

Divya Koppera posted 5 patches 1 week, 1 day ago
[PATCH net-next v4 3/5] net: phy: Kconfig: Add ptp library support and 1588 optional flag in Microchip phys
Posted by Divya Koppera 1 week, 1 day ago
Add ptp library support in Kconfig
As some of Microchip T1 phys support ptp, add dependency
of 1588 optional flag in Kconfig

Signed-off-by: Divya Koppera <divya.koppera@microchip.com>
---
v1 -> v2 -> v3 -> v4
- No changes
---
 drivers/net/phy/Kconfig | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 15828f4710a9..efa027b2bf69 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -287,8 +287,15 @@ config MICROCHIP_PHY
 
 config MICROCHIP_T1_PHY
 	tristate "Microchip T1 PHYs"
+	select MICROCHIP_PHYPTP if NETWORK_PHY_TIMESTAMPING
+	depends on PTP_1588_CLOCK_OPTIONAL
+	help
+	  Supports the LAN8XXX PHYs.
+
+config MICROCHIP_PHYPTP
+        tristate "Microchip PHY PTP"
 	help
-	  Supports the LAN87XX PHYs.
+	  Currently supports LAN887X T1 PHY
 
 config MICROSEMI_PHY
 	tristate "Microsemi PHYs"
-- 
2.17.1
Re: [PATCH net-next v4 3/5] net: phy: Kconfig: Add ptp library support and 1588 optional flag in Microchip phys
Posted by Jakub Kicinski 1 week ago
On Thu, 14 Nov 2024 17:34:53 +0530 Divya Koppera wrote:
>  config MICROCHIP_T1_PHY
>  	tristate "Microchip T1 PHYs"
> +	select MICROCHIP_PHYPTP if NETWORK_PHY_TIMESTAMPING
> +	depends on PTP_1588_CLOCK_OPTIONAL

I presume the dependency is because select doesn't obey
dependencies, but you only select PHYPTP if NETWORK_PHY_TIMESTAMPING.
Maybe it's possible to create a intermediate meta-symbol which is
NETWORK_PHY_TIMESTAMPING && PTP_1588_CLOCK_OPTIONAL
and use that in the select.. if ... clause?

> +	help
> +	  Supports the LAN8XXX PHYs.
> +
> +config MICROCHIP_PHYPTP
> +        tristate "Microchip PHY PTP"
>  	help

nit: tabs vs spaces

> -	  Supports the LAN87XX PHYs.
> +	  Currently supports LAN887X T1 PHY

This Kconfig is likely unsafe.
You have to make sure PHYPTP is not a module when T1_PHY is built in.
-- 
pw-bot: cr
Re: [PATCH net-next v4 3/5] net: phy: Kconfig: Add ptp library support and 1588 optional flag in Microchip phys
Posted by Vadim Fedorenko 1 week, 1 day ago
On 14/11/2024 12:04, Divya Koppera wrote:
> Add ptp library support in Kconfig
> As some of Microchip T1 phys support ptp, add dependency
> of 1588 optional flag in Kconfig
> 
> Signed-off-by: Divya Koppera <divya.koppera@microchip.com>
> ---
> v1 -> v2 -> v3 -> v4
> - No changes
> ---

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>