Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4870601ybi; Tue, 30 Jul 2019 09:33:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5nini+r2p+ztoLQeFiZhFph1sllN445DyvdYWKTIaHKjToNA3f95njbTDYOuMwyzL2QQH X-Received: by 2002:a62:e910:: with SMTP id j16mr43904195pfh.123.1564504407168; Tue, 30 Jul 2019 09:33:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564504407; cv=none; d=google.com; s=arc-20160816; b=HQCH3xTFAjZcNnwhfEg9Vqihp/zZqvnQIxmtNlBklsiDNp3iWH86Gy85CQG/ZV1Xca 3CVtGuISPLTOWwZ2dTNlWN53tqfusVPpMDveW1Bw3iupXjyQzp0ttHUFXXwntl1xf/76 zHT9MkUteTqMFeS+olRa9jObDGG5Pe9D4msKotnBwAg8l+Q+Y2Gj2AcJhFIkeeSoPjl/ Gc9tV5f99x9B/NNNQfmdUR2zHwGlE4psmArI5lTGLN3UyssIlt66nIMFPX1djvWm4gyw 7q2jI+DvsQkTecQyhuyz7PKrrDj0mk3opHMMtQUjRalsypoceqB0rKCUy9LLFo0z5x2u gltg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=SwbAuGYNR738vPMX2wZZ770KkNXn/jj+ytesRumbdT8=; b=qr0osuZHuxoCD7qn5cKPFPTXt8wq4Dwmr5mjnpasFJEoXdrp1QuKjx1IXsbg5de/9A eeKH/C16b+E1+DiDEmZWmbzjL/AZcKuFHtBBFc+5kA0EWTLtwSLxNal8+b/gDcAgCS2P 0h5+9Uu+Xz8c0zMSfwdCJTmagjRWHEDE5naD3rAFgp9AdoOYVAsXddhd8LVkm7bEkjzA XMRLu6K29EjYyFPzwhWKnbb+XODEuTlm9lNZSfOglQ3BHo67ovOJWkGZ1HvijnWz7+M3 C6Qq8nn/EPYOlJt8mFmA9tkrpk7UwfvPuy0qIUr3Ve2SyRT5IuVIwc37Uw0Vubu88Msx arxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b="6CZpF/kc"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u126si18634712pgc.418.2019.07.30.09.33.12; Tue, 30 Jul 2019 09:33:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b="6CZpF/kc"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729177AbfG3OAM (ORCPT + 99 others); Tue, 30 Jul 2019 10:00:12 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:47814 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726351AbfG3OAM (ORCPT ); Tue, 30 Jul 2019 10:00:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=SwbAuGYNR738vPMX2wZZ770KkNXn/jj+ytesRumbdT8=; b=6CZpF/kcIpVApWLtxS1muDtDSi riqNwSSmZlOIBoHBRiKrs82NVgKFOOR+NQj1nEN7qOTLoZ+Ae4e4YQjkF7xNM3CTHSpD6nDZoCZvJ nG4KecaIEE1aoQU77ebwgXiM3bntFivJbXDkhxOmGC3nJEHeMls51HPxmivp0rCFY1Ks=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1hsSfh-000805-L0; Tue, 30 Jul 2019 16:00:09 +0200 Date: Tue, 30 Jul 2019 16:00:09 +0200 From: Andrew Lunn To: Hubert Feurstein Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Vivien Didelot , Florian Fainelli , "David S. Miller" , richardcochran@gmail.com Subject: Re: [PATCH] net: dsa: mv88e6xxx: extend PTP gettime function to read system clock Message-ID: <20190730140009.GJ28552@lunn.ch> References: <20190730101007.344-1-h.feurstein@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190730101007.344-1-h.feurstein@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 30, 2019 at 12:10:07PM +0200, Hubert Feurstein wrote: > This adds support for the PTP_SYS_OFFSET_EXTENDED ioctl. > > Signed-off-by: Hubert Feurstein Please include the PTP maintainer for patches like this. Richard also wrote this PTP code. Andrew > --- > drivers/net/dsa/mv88e6xxx/ptp.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/dsa/mv88e6xxx/ptp.c b/drivers/net/dsa/mv88e6xxx/ptp.c > index 51cdf4712517..1ff983376f95 100644 > --- a/drivers/net/dsa/mv88e6xxx/ptp.c > +++ b/drivers/net/dsa/mv88e6xxx/ptp.c > @@ -230,14 +230,17 @@ static int mv88e6xxx_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta) > return 0; > } > > -static int mv88e6xxx_ptp_gettime(struct ptp_clock_info *ptp, > - struct timespec64 *ts) > +static int mv88e6xxx_ptp_gettimex(struct ptp_clock_info *ptp, > + struct timespec64 *ts, > + struct ptp_system_timestamp *sts) > { > struct mv88e6xxx_chip *chip = ptp_to_chip(ptp); > u64 ns; > > mv88e6xxx_reg_lock(chip); > + ptp_read_system_prets(sts); > ns = timecounter_read(&chip->tstamp_tc); > + ptp_read_system_postts(sts); > mv88e6xxx_reg_unlock(chip); > > *ts = ns_to_timespec64(ns); > @@ -386,7 +389,7 @@ static void mv88e6xxx_ptp_overflow_check(struct work_struct *work) > struct mv88e6xxx_chip *chip = dw_overflow_to_chip(dw); > struct timespec64 ts; > > - mv88e6xxx_ptp_gettime(&chip->ptp_clock_info, &ts); > + mv88e6xxx_ptp_gettimex(&chip->ptp_clock_info, &ts, NULL); > > schedule_delayed_work(&chip->overflow_work, > MV88E6XXX_TAI_OVERFLOW_PERIOD); > @@ -444,7 +447,7 @@ int mv88e6xxx_ptp_setup(struct mv88e6xxx_chip *chip) > chip->ptp_clock_info.max_adj = MV88E6XXX_MAX_ADJ_PPB; > chip->ptp_clock_info.adjfine = mv88e6xxx_ptp_adjfine; > chip->ptp_clock_info.adjtime = mv88e6xxx_ptp_adjtime; > - chip->ptp_clock_info.gettime64 = mv88e6xxx_ptp_gettime; > + chip->ptp_clock_info.gettimex64 = mv88e6xxx_ptp_gettimex; > chip->ptp_clock_info.settime64 = mv88e6xxx_ptp_settime; > chip->ptp_clock_info.enable = ptp_ops->ptp_enable; > chip->ptp_clock_info.verify = ptp_ops->ptp_verify; > -- > 2.22.0 >