Re: [PATCH net-next v3 6/8] net: phy: mscc: timestamping and PHC support

From: Quentin Schulz
Date: Sun Jun 21 2020 - 13:35:47 EST


Hi Antoine,

On 2020-06-19 14:22, Antoine Tenart wrote:
[...]
@@ -999,9 +1553,35 @@ int vsc8584_ptp_probe(struct phy_device *phydev)
if (!vsc8531->ptp)
return -ENOMEM;

+ mutex_init(&vsc8531->phc_lock);
mutex_init(&vsc8531->ts_lock);

+ /* Retrieve the shared load/save GPIO. Request it as non exclusive as
+ * the same GPIO can be requested by all the PHYs of the same package.
+ * Ths GPIO must be used with the phc_lock taken (the lock is shared

Typo + wrong lock named in the comment, instead:

* This GPIO must be used with the gpio_lock taken (the lock is shared

Though technically both are taken when access to the GPIO is requested AFAICT.

Also on another note, maybe we could actually make vsc8531->base_addr be a part
of vsc85xx_shared_private structure.

We would still need to compute it to pass it to devm_phy_package_join but it can
easily be returned by vsc8584_get_base_addr instead of the current void and it'd
put all the things used for all PHYs in the package at the same place.

Thanks,
Quentin