All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Felix Manlunas <felix.manlunas@cavium.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	raghu.vatsavayi@cavium.com, derek.chickles@cavium.com,
	satananda.burla@cavium.com, veerasenareddy.burru@cavium.com
Subject: Re: [PATCH V2 net-next] liquidio: pass date and time info to NIC firmware
Date: Wed, 18 Oct 2017 21:00:47 +0200	[thread overview]
Message-ID: <20171018190047.GG15371@lunn.ch> (raw)
In-Reply-To: <20171018172445.GA14012@felix-thinkpad.cavium.com>

Hi Felix

> +static void lio_sync_octeon_time(struct work_struct *work)
> +{
> +	struct cavium_wk *wk = (struct cavium_wk *)work;
> +	struct lio *lio = (struct lio *)wk->ctxptr;
> +	struct octeon_device *oct = lio->oct_dev;
> +	struct octeon_soft_command *sc;
> +	struct timespec64 ts;
> +	struct lio_time *lt;
> +	int ret;
> +
> +	sc = octeon_alloc_soft_command(oct, sizeof(struct lio_time), 0, 0);
> +	if (!sc) {
> +		dev_err(&oct->pci_dev->dev,
> +			"Failed to sync time to octeon: soft command allocation failed\n");
> +		return;
> +	}
> +
> +	lt = (struct lio_time *)sc->virtdptr;
> +
> +	/* Get time of the day */
> +	getnstimeofday64(&ts);


> @@ -890,11 +894,29 @@ int octeon_download_firmware(struct octeon_device *oct, const u8 *data,
>  			load_addr += size;
>  		}
>  	}
> +
> +	/* Get time of the day */
> +	do_gettimeofday(&time);
> +	time_to_tm(time.tv_sec, (-sys_tz.tz_minuteswest) * 60,  &tm_val);

So here, you correct for the timezone the machine is in. However,
lio_sync_octeon_time() uses getnstimeofday64(), which as far as i
know, does not adjust for the time zone.

Maybe put your machine into Pacific/Kiritimati and see what happens?

      Andrew

      reply	other threads:[~2017-10-18 19:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-18 17:24 [PATCH V2 net-next] liquidio: pass date and time info to NIC firmware Felix Manlunas
2017-10-18 19:00 ` Andrew Lunn [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=20171018190047.GG15371@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=derek.chickles@cavium.com \
    --cc=felix.manlunas@cavium.com \
    --cc=netdev@vger.kernel.org \
    --cc=raghu.vatsavayi@cavium.com \
    --cc=satananda.burla@cavium.com \
    --cc=veerasenareddy.burru@cavium.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 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.