lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230220081030.5bgi5aj4zmeux5bc@soft-dev3-1>
Date:   Mon, 20 Feb 2023 09:10:30 +0100
From:   Horatiu Vultur <horatiu.vultur@...rochip.com>
To:     Andrew Lunn <andrew@...n.ch>
CC:     <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <hkallweit1@...il.com>, <linux@...linux.org.uk>,
        <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
        <pabeni@...hat.com>, <richardcochran@...il.com>
Subject: Re: [PATCH net-next v2] net: phy: micrel: Add support for
 PTP_PF_PEROUT for lan8841

The 02/20/2023 01:54, Andrew Lunn wrote:

Hi Andrew,

> 
> > +static int lan8841_ptp_set_target(struct kszphy_ptp_priv *ptp_priv, u8 event,
> > +                               s64 sec, u32 nsec)
> > +{
> > +     struct phy_device *phydev = ptp_priv->phydev;
> > +     int ret;
> > +
> > +     ret = phy_write_mmd(phydev, 2, LAN8841_PTP_LTC_TARGET_SEC_HI(event),
> > +                         upper_16_bits(sec));
> > +     ret |= phy_write_mmd(phydev, 2, LAN8841_PTP_LTC_TARGET_SEC_LO(event),
> > +                          lower_16_bits(sec));
> > +     ret |= phy_write_mmd(phydev, 2, LAN8841_PTP_LTC_TARGET_NS_HI(event) & 0x3fff,
> > +                          upper_16_bits(nsec));
> > +     ret |= phy_write_mmd(phydev, 2, LAN8841_PTP_LTC_TARGET_NS_LO(event),
> > +                          lower_16_bits(nsec));
> 
> ORing together error codes generally does not work. MDIO transactions
> can sometimes give ETIMEDOUT, or EINVAL. Combine those and i think you
> get ENOKEY, which is going to be interesting to track down.

Good observation. You are right, it would be ENOKEY.
I will fix this in the next version. I will submit the new version once
the net-next gets open again.

> 
>     Andrew

-- 
/Horatiu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ