Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp153786pxu; Tue, 1 Dec 2020 08:10:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZnj4wk6cPM2ahmXgeIS77rqH2YlWA++LDXMe+JUR+CB5GhQBTIwk06acoafXL5P/F4N9B X-Received: by 2002:a05:651c:102e:: with SMTP id w14mr1681899ljm.194.1606839056514; Tue, 01 Dec 2020 08:10:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606839056; cv=none; d=google.com; s=arc-20160816; b=VBJ5vez3/GQ99g+/ivwxYDCPjlFoIaFh2Q5Ke9Nryf2i+hV3qjXIEV2mPZDNbv+/rb 3jYg+6IuaidOKC9kxTePLGMRuX47WdbCfXKMj0RqGTwwysZ822WbDpN+pB2pCL63Yfnd 4EdPnEQGlwlxkhhjmb57r/p0JaPfrEJJUrb5oBK33J60uUonKdB++vdR9wX9IHhSiYVS X5IEpZRapSXXfylwlL6H4iF6cg2Aiq1OQF/AtEgYSO2czjIOPP3L1EGO6nrhYiYu1g5s NR78QS7+XHEy9X6ZMbhlgEsrohB2lgPHw7sEePL+LUTA7dMeGlL2s3DUU2x3UimRfNAb QEfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=H3PXpaBgyeg3czsD4leYEhUnht6A+U86u74ASUFIiHc=; b=p1+q4uTRRtDMrYH47/gWuTkXudTBOB1IZGzAUgKgSD+fNFsGZxBJLbcCy0KZbIJP1A 29fcALlCDHZDULnWbh0IPrCAoBaJ242rF8mFwdbTkq6+QIn+Pg5NNeRC0CEl9RpJtzxL HAW0qjSz/EaG/c2GTtFuZgdVsq2asPMdNCnDOhMbwbwfbDKD2YhdIyzB9eqGGye1HRhc AX4x4TlRHekfmnOCdYlu5YmRNiPbELfEIqcDtZwO2kYcw6dh8v4C7jLvMOPHhw8RIg9/ DOL0Fg8PQ4JEf75axImYVdv4s+KeilK8+dPqLZShKwazcScWkLx64ReKWEy379bM0fnL x7uQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w1si141407edv.594.2020.12.01.08.10.32; Tue, 01 Dec 2020 08:10:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392002AbgLAQIS (ORCPT + 99 others); Tue, 1 Dec 2020 11:08:18 -0500 Received: from mailout09.rmx.de ([94.199.88.74]:34632 "EHLO mailout09.rmx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388182AbgLAQIS (ORCPT ); Tue, 1 Dec 2020 11:08:18 -0500 Received: from kdin01.retarus.com (kdin01.dmz1.retloc [172.19.17.48]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout09.rmx.de (Postfix) with ESMTPS id 4Cln7B2DCHzbgrf; Tue, 1 Dec 2020 17:07:34 +0100 (CET) Received: from mta.arri.de (unknown [217.111.95.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by kdin01.retarus.com (Postfix) with ESMTPS id 4Cln6x4fT1z2xCx; Tue, 1 Dec 2020 17:07:21 +0100 (CET) Received: from N95HX1G2.wgnetz.xx (192.168.54.19) by mta.arri.de (192.168.100.104) with Microsoft SMTP Server (TLS) id 14.3.487.0; Tue, 1 Dec 2020 17:06:20 +0100 From: Christian Eggers To: Vladimir Oltean , Jakub Kicinski , Andrew Lunn , Richard Cochran , "Rob Herring" CC: Vivien Didelot , "David S . Miller" , Kurt Kanzenbach , George McCollister , Marek Vasut , Helmut Grohne , Paul Barker , Codrin Ciubotariu , Tristram Ha , Woojung Huh , Microchip Linux Driver Support , Christian Eggers , , , Subject: [PATCH net-next v4 0/9] net: dsa: microchip: PTP support for KSZ956x Date: Tue, 1 Dec 2020 17:06:02 +0100 Message-ID: <20201201160611.22129-1-ceggers@arri.de> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [192.168.54.19] X-RMX-ID: 20201201-170721-4Cln6x4fT1z2xCx-0@kdin01 X-RMX-SOURCE: 217.111.95.66 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is only little documentation for PTP available on the data sheet [1] (more or less only the register reference). Questions to the Microchip support were seldom answered comprehensively or in reasonable time. So this is more or less the result of reverse engineering. [1] http://ww1.microchip.com/downloads/en/DeviceDoc/KSZ9563R-Data-Sheet-DS00002419D.pdf Changes from v3 --> v4 ------------------------ The first 2 patches of v3 have been applied. [ 5/12]-->[ 3/9] - Reviewed-by: Vladimir Oltean [ 6/12]-->[ 4/9] - s/low active/active low/ - Reviewed-by: Vladimir Oltean [ 7/12]-->[ 5/9] - Reviewed-by: Vladimir Oltean [ 9/12]-->[ 7/9] - Remove useless case statement - Reviewed-by: Vladimir Oltean [10/12]-->[ 8/9] - s/low active/active low/ - 80 chars per line - Use IEEE 802.1AS mode (to suppress forwarding of PDelay messages) - Enable/disable hardware timestaping at runtime (port_hwtstamp_set) - Use mutex in port_hwtstamp_set - Don't use port specific struct hwtstamp_config - removed #ifdefs from tag_ksz.c - Set port's tx_latency and rx_latency to 0 - added include/linux/dsa/ksz_common.h to MAINTAINERS [11/12] - removed Patch 11/12 (PPS support) [12/12]-->[ 9/9] - 80 chars per line - reverse christmas tree - Set default pulse width for perout pulse to 50% (max. 125ms) - reject unsupported flags for perout_request Changes from v2 --> v3 ------------------------ Applied all changes requested by Vladimir Oltean. v3 depends on my other netdev patches from 2020-11-18: - net: ptp: introduce common defines for PTP message types - net: dsa: avoid potential use-after-free error [1/11]-->[1/12] - dts: remove " OR BSD-2-Clause" from SPDX-License-Identifier - dts: add "additionalProperties" - dts: remove quotes [2/11]-->[2/12] - Reviewed-by: Vladimir Oltean [3/11] - [Patch removed] (split ksz_common.h) [4/11]-->[3/12] - Reviewed-by: Vladimir Oltean - fixed summary [5/11]-->[4/12] - Use "interrupts-extended" syntax [6/11]-->[5+6/12] - Split up patch - style fixes - use GENMASK() - IRQF_ONESHOT|IRQF_SHARED [7/11]-->[7/12] - Remove "default n" from Kconfig - use mutex in adjfine() - style fixes [8/11]-->[8/12] - Be more verbose in commit message - Rename helper - provide correction instead of t2 - simplify location of UDP header [9/11]-->[9+10/12] - Split up patch - Update commmit messages - don't use OR operator on irqreturn_t - spin_lock_irqsave() --> spin_lock_bh() - style fixes - remove rx_filter cases for DELAY_REQ - use new PTP_MSGTYPE_* defines - inline ksz9477_ptp_should_tstamp() - ksz9477_tstamp_to_clock() --> ksz9477_tstamp_reconstruct() - use shared data in include/linux/net/dsa/ksz_common.h - wait for tx time stamp (within sleepable context) - use boolean for tx time stamp enable - move t2 from correction to tail tag (again) - ... Changes from RFC --> v2 ------------------------ I think that all open questions regarding the RFC version could be solved. dts: referenced to dsa.yaml dts: changed node name to "switch" in example dts: changed "ports" subnode to "ethernet-ports" ksz_common: support "ethernet-ports" subnode tag_ksz: fix usage of correction field (32 bit ns + 16 bit sub-ns) tag_ksz: use cached PTP header from device's .port_txtstamp function tag_ksz: refactored ksz9477_tstamp_to_clock() tag_ksz: pdelay_req: only subtract 2 bit seconds from the correction field tag_ksz: pdelay_resp: don't move (negative) correction to the egress tail tag ptp_classify: add ptp_onestep_p2p_move_t2_to_correction helper ksz9477_ptp: removed E2E support (as suggested by Vladimir) ksz9477_ptp: removed master/slave sysfs attributes (nacked by Richard) ksz9477_ptp: refactored ksz9477_ptp_port_txtstamp ksz9477_ptp: removed "pulse" attribute kconfig: depend on PTP_1588_CLOCK (instead of "imply")