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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 8 Oct 2017 08:07:39 -0400
From:   Richard Cochran <richardcochran@...il.com>
To:     Brandon Streiff <brandon.streiff@...com>
Cc:     Andrew Lunn <andrew@...n.ch>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Florian Fainelli <f.fainelli@...il.com>,
        Vivien Didelot <vivien.didelot@...oirfairelinux.com>,
        Erik Hons <erik.hons@...com>
Subject: Re: [PATCH net-next RFC 2/9] net: dsa: mv88e6xxx: expose switch time
 as a PTP hardware clock

On Fri, Sep 29, 2017 at 03:17:02PM +0000, Brandon Streiff wrote:
>  
> Although now that I'm looking it over again, I'm also not certain of
> the need. Even if we're called more frequently than we expect, that
> doesn't seem to be harmful with regard to timekeeping. Hmm.

Just keep it simple and drop the extra logic.  It doesn't hurt to
over-sample the clock.  Here is what I did:

/* Covers both a 100 or a 125 MHz input clock. */
#define MV88E635X_OVERFLOW_PERIOD (HZ * 16)

static void mv88e635x_overflow_check(struct work_struct *ws)
{
	struct timespec64 ts;
	struct mv88e6xxx_chip *ps =
		container_of(ws, struct mv88e6xxx_chip, oflow_work.work);

	mv88e635x_ptp_gettime(&ps->ptp_info, &ts);
	pr_debug("mv88e635x overflow check at %lld.%09lu\n",
		 ts.tv_sec, ts.tv_nsec);
	schedule_delayed_work(&ps->oflow_work, MV88E635X_OVERFLOW_PERIOD);
}

Thanks,
Richard

Powered by blists - more mailing lists