Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp613152pxb; Wed, 18 Nov 2020 12:33:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzYOL83pYrB4pW50DkeRxTp8zi+rVYWu3PDFFgJcHm4trN6eLv2dp8OE0FglFnJH2HjEpml X-Received: by 2002:a17:906:13d6:: with SMTP id g22mr26708901ejc.240.1605731630647; Wed, 18 Nov 2020 12:33:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605731630; cv=none; d=google.com; s=arc-20160816; b=umPJerIdWYC4Nc1OoPhlWJN1ZmB7I4R24J6wCFWvZ+0cahEmle6XpSIA2YRsutvYCd Hj6Yh5xMyk/RqbX9cUsUHzVOZijBu3RBAsucQD1eM5Eepldj8SxCgTDWD72uXHhjyItq jE+PNaBDpUgg6b3AqJwtkRIlARa7m9seD1flFCZHgZh0p1fsbSs1cBKTbC9OJp+mB1If hBWXYBUgoquqVu2F02OeYa7y0/q2Uy3Skvd2OEUIybC9oWc/r2fbAD1g+Tkx05BJHzHX 1CKVfPMNg1aA5rUI/+ZYvRl6Xq5tF7B1aDHqYoNANqGAf46xKAPr//f8o33OMID+A3Dm fkhA== 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=1YEAFOeSPUHcttFwjrIOurx4rjYHgRpTTWWThdQzsMQ=; b=m1xGmgtFCIJyZyUUiKYVAU2UVQwLiMsEz6ZBk/uD/Cv/rDcsqQtScg8M0a8UH1/hKy sPDdWhaCbZWxKWnhWdM1LqlbzIsgHP4amyShllLWxPuULNugQo4HANGbnn8PJRKva21q 58lPxdq9xCr19EyXyAGUeEcbEOPRV9Dr1+5eqQndIKzNzXZdEe1s10LGpPIFYmEoEq70 QZAYTuN8vhWfOS9/nlZs0FrJfcGqC23OI5cfmVmrRF0IH9SmqxxCllOzTd2/Kgov3BgD Bzl8iruwXNhcrdvNIn26mqmvMkwvE/qk7M+cTOt56n9aYABShRese7r4vlt81J/mTN9l 72cA== 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 y25si5346212ejd.556.2020.11.18.12.33.25; Wed, 18 Nov 2020 12:33:50 -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 S1727132AbgKRUbs (ORCPT + 99 others); Wed, 18 Nov 2020 15:31:48 -0500 Received: from mailout06.rmx.de ([94.199.90.92]:33674 "EHLO mailout06.rmx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726812AbgKRUbs (ORCPT ); Wed, 18 Nov 2020 15:31:48 -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 mailout06.rmx.de (Postfix) with ESMTPS id 4Cbvbz313Gz9vqV; Wed, 18 Nov 2020 21:31:43 +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 4Cbvbk5G1Mz2xDw; Wed, 18 Nov 2020 21:31:30 +0100 (CET) Received: from N95HX1G2.wgnetz.xx (192.168.54.25) by mta.arri.de (192.168.100.104) with Microsoft SMTP Server (TLS) id 14.3.487.0; Wed, 18 Nov 2020 21:30:29 +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 v3 00/12] net: dsa: microchip: PTP support for KSZ956x Date: Wed, 18 Nov 2020 21:30:01 +0100 Message-ID: <20201118203013.5077-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.25] X-RMX-ID: 20201118-213130-4Cbvbk5G1Mz2xDw-0@kdin01 X-RMX-SOURCE: 217.111.95.66 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds support for PTP to the KSZ956x and KSZ9477 devices. 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 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")