Messages in this thread Patch in this message | | | From | Sergey Organov <> | Subject | Re: [PATCH v3 net] net: fec: fix hardware time stamping by external devices | Date | Thu, 16 Jul 2020 23:38:13 +0300 |
| |
Jakub Kicinski <kuba@kernel.org> writes:
> On Tue, 14 Jul 2020 19:28:02 +0300 Sergey Organov wrote: >> Fix support for external PTP-aware devices such as DSA or PTP PHY: >> >> Make sure we never time stamp tx packets when hardware time stamping >> is disabled. >> >> Check for PTP PHY being in use and then pass ioctls related to time >> stamping of Ethernet packets to the PTP PHY rather than handle them >> ourselves. In addition, disable our own hardware time stamping in this >> case. >> >> Fixes: 6605b730c061 ("FEC: Add time stamping code and a PTP hardware >> clock") >> Signed-off-by: Sergey Organov <sorganov@gmail.com> >> Acked-by: Richard Cochran <richardcochran@gmail.com> >> Acked-by: Vladimir Oltean <olteanv@gmail.com> >> --- >> >> v3: >> - Fixed SHA1 length of Fixes: tag >> - Added Acked-by: tags >> >> v2: >> - Extracted from larger patch series >> - Description/comments updated according to discussions >> - Added Fixes: tag > > FWIW in the networking subsystem we like the changelog to be part of the > commit.
Thanks, Jakub, I took a notice for myself!
> > Applied, and added to the stable queue, thanks!
Thanks, and I've also got a no-brainer patch that lets this bug fix compile as-is with older kernels, where there were no phy_has_hwtstamp() function. Dunno how to properly handle this. Here is the patch (on top of v4.9.146), just in case:
--- >8 ---
commit eee1f92bbc83ad59c83935a21f635e088cf7aa02 Author: Sergey Organov <sorganov@gmail.com> Date: Tue Jun 30 17:12:16 2020 +0300
phy: add phy_has_hwtstamp() for compatibility with newer kernels
Signed-off-by: Sergey Organov <sorganov@gmail.com>
diff --git a/include/linux/phy.h b/include/linux/phy.h index 867110c9d707..aa01ed4e8e1f 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -595,6 +595,15 @@ struct phy_driver { #define PHY_ANY_ID "MATCH ANY PHY" #define PHY_ANY_UID 0xffffffff +/** + * phy_has_hwtstamp - Tests whether a PHY supports time stamp configuration. + * @phydev: the phy_device struct + */ +static inline bool phy_has_hwtstamp(struct phy_device *phydev) +{ + return phydev && phydev->drv && phydev->drv->hwtstamp; +} + /* A Structure for boards to register fixups with the PHY Lib */ struct phy_fixup { struct list_head list;
-- Sergey
| |