devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Tristram.Ha@microchip.com, olteanv@gmail.com
Cc: Woojung.Huh@microchip.com, andrew@lunn.ch, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org,
	maxime.chevallier@bootlin.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	marex@denx.de, UNGLinuxDriver@microchip.com,
	devicetree@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3 7/7] net: dsa: microchip: Disable PTP function of KSZ8463
Date: Thu, 10 Jul 2025 02:08:39 +0100	[thread overview]
Message-ID: <b34eff8d-0c14-4085-bff1-f01ff3349637@linux.dev> (raw)
In-Reply-To: <LV3PR11MB874269079536CDB53183760DEC49A@LV3PR11MB8742.namprd11.prod.outlook.com>

On 09/07/2025 23:59, Tristram.Ha@microchip.com wrote:
>> On Tue, Jul 08, 2025 at 05:32:33PM -0700, Tristram.Ha@microchip.com wrote:
>>> From: Tristram Ha <tristram.ha@microchip.com>
>>>
>>> The PTP function of KSZ8463 is on by default.  However, its proprietary
>>> way of storing timestamp directly in a reserved field inside the PTP
>>> message header is not suitable for use with the current Linux PTP stack
>>> implementation.  It is necessary to disable the PTP function to not
>>> interfere the normal operation of the MAC.
>>>
>>> Signed-off-by: Tristram Ha <tristram.ha@microchip.com>
>>> ---
>>>   drivers/net/dsa/microchip/ksz8.c | 11 +++++++++++
>>>   1 file changed, 11 insertions(+)
>>>
>>> diff --git a/drivers/net/dsa/microchip/ksz8.c b/drivers/net/dsa/microchip/ksz8.c
>>> index ddbd05c44ce5..fd4a000487d6 100644
>>> --- a/drivers/net/dsa/microchip/ksz8.c
>>> +++ b/drivers/net/dsa/microchip/ksz8.c
>>> @@ -1761,6 +1761,17 @@ void ksz8_config_cpu_port(struct dsa_switch *ds)
>>>                                           reg16(dev, KSZ8463_REG_DSP_CTRL_6),
>>>                                           COPPER_RECEIVE_ADJUSTMENT, 0);
>>>                }
>>> +
>>> +             /* Turn off PTP function as the switch's proprietary way of
>>> +              * handling timestamp is not supported in current Linux PTP
>>> +              * stack implementation.
>>> +              */
>>> +             regmap_update_bits(ksz_regmap_16(dev),
>>> +                                reg16(dev, KSZ8463_PTP_MSG_CONF1),
>>> +                                PTP_ENABLE, 0);
>>> +             regmap_update_bits(ksz_regmap_16(dev),
>>> +                                reg16(dev, KSZ8463_PTP_CLK_CTRL),
>>> +                                PTP_CLK_ENABLE, 0);
>>>        }
>>>   }
>>>
>>> --
>>> 2.34.1
>>>
>>
>> What prevents the user from later enabling this through
>> ksz_set_hwtstamp_config(HWTSTAMP_TX_ONESTEP_P2P)?
> 
> The PTP engine in KSZ8463 is first generation.  The DSA PTP driver used
> by KSZ9477 and LAN937X is for second generation, which uses tail tag to
> pass along receive/transmit timestamp and port information.
> 
> It is not likely the PTP driver will be updated to support KSZ8463.
> Currently that driver code is not activated except for KSZ9477 and
> LAN937X.

I believe Vladimir was asking about software options and the answer is
that this switch is added with .ptp_capable = false in the patch 2.


  reply	other threads:[~2025-07-10  1:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-09  0:32 [PATCH net-next 0/7 v3] net: dsa: microchip: Add KSZ8463 switch support Tristram.Ha
2025-07-09  0:32 ` [PATCH net-next v3 1/7] dt-bindings: " Tristram.Ha
2025-07-09  0:32 ` [PATCH net-next v3 2/7] net: dsa: microchip: Add KSZ8463 switch support to KSZ DSA driver Tristram.Ha
2025-07-09  0:32 ` [PATCH net-next v3 3/7] net: dsa: microchip: Transform register for use with KSZ8463 Tristram.Ha
2025-07-09  0:32 ` [PATCH net-next v3 4/7] net: dsa: microchip: Use different registers for KSZ8463 Tristram.Ha
2025-07-09  0:32 ` [PATCH net-next v3 5/7] net: dsa: microchip: Write switch MAC address differently " Tristram.Ha
2025-07-09  0:32 ` [PATCH net-next v3 6/7] net: dsa: microchip: Setup fiber ports " Tristram.Ha
2025-07-09  0:32 ` [PATCH net-next v3 7/7] net: dsa: microchip: Disable PTP function of KSZ8463 Tristram.Ha
2025-07-09  7:35   ` Vladimir Oltean
2025-07-09 22:59     ` Tristram.Ha
2025-07-10  1:08       ` Vadim Fedorenko [this message]
2025-07-09 13:33   ` Vadim Fedorenko
2025-07-09 22:54     ` Tristram.Ha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b34eff8d-0c14-4085-bff1-f01ff3349637@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=Tristram.Ha@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).