Netdev List
 help / color / mirror / Atom feed
From: Horatiu Vultur <horatiu.vultur@microchip.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<hkallweit1@gmail.com>, <linux@armlinux.org.uk>,
	<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <richardcochran@gmail.com>
Subject: Re: [PATCH net-next v2] net: phy: micrel: Add support for PTP_PF_PEROUT for lan8841
Date: Mon, 20 Feb 2023 09:10:30 +0100	[thread overview]
Message-ID: <20230220081030.5bgi5aj4zmeux5bc@soft-dev3-1> (raw)
In-Reply-To: <Y/LE1SzlpKcWHAti@lunn.ch>

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

      reply	other threads:[~2023-02-20  8:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-18 12:30 [PATCH net-next v2] net: phy: micrel: Add support for PTP_PF_PEROUT for lan8841 Horatiu Vultur
2023-02-20  0:54 ` Andrew Lunn
2023-02-20  8:10   ` Horatiu Vultur [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230220081030.5bgi5aj4zmeux5bc@soft-dev3-1 \
    --to=horatiu.vultur@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox