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

2020-06-22 Thread Antoine Tenart
Hi Quentin, Quoting Quentin Schulz (2020-06-21 19:35:20) > 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(>phc_lock); > >

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

2020-06-22 Thread Antoine Tenart
Hi Andrew, Quoting Andrew Lunn (2020-06-20 17:21:42) > > + /* 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 > >

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

2020-06-22 Thread Antoine Tenart
Hi Andrew, Quoting Andrew Lunn (2020-06-20 17:40:08) > On Fri, Jun 19, 2020 at 02:22:58PM +0200, Antoine Tenart wrote: > > To get and set the PHC time, a GPIO has to be used and changes are only > > retrieved or committed when on a rising edge. The same GPIO is shared by > > all PHYs, so the

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

2020-06-22 Thread Antoine Tenart
Hello Richard, Quoting Richard Cochran (2020-06-20 17:00:45) > On Fri, Jun 19, 2020 at 02:22:58PM +0200, Antoine Tenart wrote: > > > +static void vsc85xx_dequeue_skb(struct vsc85xx_ptp *ptp) > > +{ > > + struct skb_shared_hwtstamps shhwtstamps; > > + struct vsc85xx_ts_fifo fifo; > > +

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

2020-06-21 Thread Quentin Schulz
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(>phc_lock); mutex_init(>ts_lock); + /* Retrieve the shared load/save

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

2020-06-20 Thread Andrew Lunn
On Fri, Jun 19, 2020 at 02:22:58PM +0200, Antoine Tenart wrote: > To get and set the PHC time, a GPIO has to be used and changes are only > retrieved or committed when on a rising edge. The same GPIO is shared by > all PHYs, so the granularity of the lock protecting it has to be > different from

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

2020-06-20 Thread Andrew Lunn
> + /* 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 > + * between all PHYs). > + */ > +

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

2020-06-20 Thread Andrew Lunn
> + /* 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 This Andrew

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

2020-06-20 Thread Richard Cochran
On Fri, Jun 19, 2020 at 02:22:58PM +0200, Antoine Tenart wrote: > +static void vsc85xx_dequeue_skb(struct vsc85xx_ptp *ptp) > +{ > + struct skb_shared_hwtstamps shhwtstamps; > + struct vsc85xx_ts_fifo fifo; > + struct sk_buff *skb; > + u8 skb_sig[16], *p; > + int i, len; > +

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

2020-06-19 Thread Antoine Tenart
This patch adds support for PHC and timestamping operations for the MSCC PHY. PTP 1-step and 2-step modes are supported, over Ethernet and UDP. To get and set the PHC time, a GPIO has to be used and changes are only retrieved or committed when on a rising edge. The same GPIO is shared by all