mbox series

[net-next,v5,0/9] net: dsa: microchip: PTP support for KSZ956x

Message ID 20201203102117.8995-1-ceggers@arri.de
Headers show
Series net: dsa: microchip: PTP support for KSZ956x | expand

Message

Christian Eggers Dec. 3, 2020, 10:21 a.m. UTC
[1]
http://ww1.microchip.com/downloads/en/DeviceDoc/KSZ9563R-Data-Sheet-DS00002419D.pdf

Changes from v4  --> v5
------------------------
[8/9]            -  Fix compile error reported by kernel test robot
                    (NET_DSA_TAG_KSZ must select NET_PTP_CLASSIFY)

Changes from v3  --> v4
------------------------
The first 2 patches of v3 have been applied.

[ 5/12]-->[ 3/9] - Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
[ 6/12]-->[ 4/9] - s/low active/active low/
                 - Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
[ 7/12]-->[ 5/9] - Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
[ 9/12]-->[ 7/9] - Remove useless case statement
                 - Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
[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 <olteanv@gmail.com>
[3/11]           - [Patch removed] (split ksz_common.h)
[4/11]-->[3/12]  - Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
                 - 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")

Comments

Richard Cochran Dec. 3, 2020, 2:12 p.m. UTC | #1
On Thu, Dec 03, 2020 at 11:21:17AM +0100, Christian Eggers wrote:
> The KSZ9563 has a Trigger Output Unit (TOU) which can be used to
> generate periodic signals.
> 
> The pulse length can be altered via a device attribute.

Device tree is the wrong place for that.

Aren't you using PTP_PEROUT_DUTY_CYCLE anyhow?

Thanks,
Richard
Vladimir Oltean Dec. 3, 2020, 3:52 p.m. UTC | #2
On Thu, 3 Dec 2020 at 17:36, Christian Eggers <ceggers@arri.de> wrote:
> Should ptp_sysfs be extended with a "pulse" attribute with calls
> enable() with only PTP_PEROUT_DUTY_CYCLE set?

Use tools/testing/selftests/ptp/testptp.
Christian Eggers Dec. 3, 2020, 4:20 p.m. UTC | #3
On Thursday, 3 December 2020, 16:52:46 CET, Vladimir Oltean wrote:
> On Thu, 3 Dec 2020 at 17:36, Christian Eggers <ceggers@arri.de> wrote:
> > Should ptp_sysfs be extended with a "pulse" attribute with calls
> > enable() with only PTP_PEROUT_DUTY_CYCLE set?
> 
> Use tools/testing/selftests/ptp/testptp.

Thanks for the hint. Last time I looked at it (5.4), it used to have
no "pulse" feature (as the ioctl() interface).

Maybe I should also add support for PTP_PEROUT_PHASE to the KSZ driver.

regards
Christian
Richard Cochran Dec. 4, 2020, 12:45 a.m. UTC | #4
On Thu, Dec 03, 2020 at 04:36:26PM +0100, Christian Eggers wrote:
> Should ptp_sysfs be extended with a "pulse" attribute with calls
> enable() with only PTP_PEROUT_DUTY_CYCLE set?

Yes, that would make sense.  It would bring sysfs back to feature
parity with the ioctls.

Thanks,
Richard
Vladimir Oltean Dec. 4, 2020, 1 a.m. UTC | #5
On Thu, Dec 03, 2020 at 04:45:56PM -0800, Richard Cochran wrote:
> On Thu, Dec 03, 2020 at 04:36:26PM +0100, Christian Eggers wrote:

> > Should ptp_sysfs be extended with a "pulse" attribute with calls

> > enable() with only PTP_PEROUT_DUTY_CYCLE set?

>

> Yes, that would make sense.  It would bring sysfs back to feature

> parity with the ioctls.


Which is a good thing?

Anyway, Christian, if you do decide to do that, here's some context why
I didn't do it when I added the additional knobs for periodic output:
https://www.mail-archive.com/linuxptp-devel@lists.sourceforge.net/msg04150.html
Richard Cochran Dec. 4, 2020, 1:18 a.m. UTC | #6
On Fri, Dec 04, 2020 at 03:00:50AM +0200, Vladimir Oltean wrote:
> On Thu, Dec 03, 2020 at 04:45:56PM -0800, Richard Cochran wrote:
> > Yes, that would make sense.  It would bring sysfs back to feature
> > parity with the ioctls.
> 
> Which is a good thing?

Yes, of course it is.  I'm sorry I didn't insist on it in the first place!
 
> Anyway, Christian, if you do decide to do that, here's some context why
> I didn't do it when I added the additional knobs for periodic output:
> https://www.mail-archive.com/linuxptp-devel@lists.sourceforge.net/msg04150.html

I think Christian is proposing a different sysfs file, not a flag in
the existing ones.  That makes sense to me.

Thanks,
Richard