All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next v2 03/10] amd-xgbe-phy: Provide support for auto-negotiation timeout
Date: Thu, 19 Mar 2015 15:39:33 -0500	[thread overview]
Message-ID: <550B3405.60203@amd.com> (raw)
In-Reply-To: <20150319.161642.52123219885309637.davem@davemloft.net>



On 03/19/2015 03:16 PM, David Miller wrote:
> From: Tom Lendacky <thomas.lendacky@amd.com>
> Date: Thu, 19 Mar 2015 15:08:26 -0500
>
>> @@ -902,8 +906,23 @@ static enum amd_xgbe_phy_an amd_xgbe_an_page_received(struct phy_device *phydev)
>>   {
>>   	struct amd_xgbe_phy_priv *priv = phydev->priv;
>>   	enum amd_xgbe_phy_rx *state;
>> +	struct timespec64 rcv_time, diff_time;
>>   	int ret;
>>
>> +	getnstimeofday64(&rcv_time);
>> +	if (!timespec64_to_ns(&priv->an_start)) {
>> +		priv->an_start = rcv_time;
>> +	} else {
>> +		diff_time = timespec64_sub(rcv_time, priv->an_start);
>> +		if (timespec64_to_ns(&diff_time) > XGBE_AN_NS_TIMEOUT) {
>> +			/* Auto-negotiation timed out, reset state */
>> +			priv->kr_state = AMD_XGBE_RX_BPA;
>> +			priv->kx_state = AMD_XGBE_RX_BPA;
>> +
>> +			priv->an_start = rcv_time;
>> +		}
>> +	}
>> +
>
> timespec is a little bit heavyweight for something like this, you just
> want to snapshot a point in time then later check if a certain number
> of ms have passed or not.
>
> For that, plain 'jiffies' is sufficient.
>

Sounds good, I'll rework it to use jiffies.

Thanks,
Tom

  reply	other threads:[~2015-03-19 20:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 20:08 [PATCH net-next v2 00/10] amd-xgbe: AMD XGBE driver updates 2015-03-19 Tom Lendacky
2015-03-19 20:08 ` [PATCH net-next v2 01/10] amd-xgbe-phy: Use phydev advertising field vs supported Tom Lendacky
2015-03-19 20:08 ` [PATCH net-next v2 02/10] amd-xgbe-phy: Use the phy_driver flags field Tom Lendacky
2015-03-19 20:08 ` [PATCH net-next v2 03/10] amd-xgbe-phy: Provide support for auto-negotiation timeout Tom Lendacky
2015-03-19 20:16   ` David Miller
2015-03-19 20:39     ` Tom Lendacky [this message]
2015-03-19 20:08 ` [PATCH net-next v2 04/10] amd-xgbe: Clarify output message about queues Tom Lendacky
2015-03-19 20:08 ` [PATCH net-next v2 05/10] amd-xgbe: Use the new DMA memory barriers where appropriate Tom Lendacky
2015-03-19 20:08 ` [PATCH net-next v2 06/10] amd-xgbe: Set DMA mask based on hardware register value Tom Lendacky
2015-03-19 20:08 ` [PATCH net-next v2 07/10] amd-xgbe: Remove Tx coalescing Tom Lendacky
2015-03-19 20:08 ` [PATCH net-next v2 08/10] amd-xgbe: Fix Rx coalescing reporting Tom Lendacky
2015-03-19 20:09 ` [PATCH net-next v2 09/10] amd-xgbe: Use napi_alloc_skb when allocating skb in softirq Tom Lendacky
2015-03-19 20:09 ` [PATCH net-next v2 10/10] amd-xgbe: Rework the Rx path SKB allocation Tom Lendacky
2015-03-19 20:20   ` David Miller
2015-03-19 20:54     ` Tom Lendacky
2015-03-19 21:51       ` David Miller
2015-03-19 22:07         ` Tom Lendacky
2015-03-20 13:16           ` Tom Lendacky

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=550B3405.60203@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.