netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Horatiu Vultur <horatiu.vultur@microchip.com>
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 01:54:45 +0100	[thread overview]
Message-ID: <Y/LE1SzlpKcWHAti@lunn.ch> (raw)
In-Reply-To: <20230218123038.2761383-1-horatiu.vultur@microchip.com>

> +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.

    Andrew

  reply	other threads:[~2023-02-20  0:54 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 [this message]
2023-02-20  8:10   ` Horatiu Vultur

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=Y/LE1SzlpKcWHAti@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=horatiu.vultur@microchip.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;
as well as URLs for NNTP newsgroup(s).