All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Pavan Chebbi <pavan.chebbi@broadcom.com>
Cc: Michael Chan <michael.chan@broadcom.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Richard Cochran <richardcochran@gmail.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next] bnxt_en: support PPS in/out on all pins
Date: Fri, 17 Oct 2025 09:51:07 +0100	[thread overview]
Message-ID: <20f633b9-8a49-4240-8cb8-00309081ab73@linux.dev> (raw)
In-Reply-To: <CALs4sv2gcHTpGRhZOPQqd+JrNnL05xLFYWB3uaznNbcGt=x03A@mail.gmail.com>

On 17.10.2025 04:45, Pavan Chebbi wrote:
> On Fri, Oct 17, 2025 at 3:54 AM Vadim Fedorenko
> <vadim.fedorenko@linux.dev> wrote:
>>
>> n_ext_ts and n_per_out from ptp_clock_caps are checked as a max number
>> of pins rather than max number of active pins.
> 
> I am not 100pc sure. How is n_pins going to be different then?
> https://elixir.bootlin.com/linux/v6.17/source/include/linux/ptp_clock_kernel.h#L69

So in general it's more for the case where HW has pins connected through mux to
the DPLL channels. According to the bnxt_ptp_cfg_pin() bnxt HW has pins
hardwired to channels and NVM has pre-defined configuration of pins' functions.

[host ~]# ./testptp -d /dev/ptp2 -l
name bnxt_pps0 index 0 func 0 chan 0
name bnxt_pps1 index 1 func 0 chan 1
name bnxt_pps2 index 2 func 0 chan 2
name bnxt_pps3 index 3 func 0 chan 3

without the change user cannot configure EXTTS or PEROUT function on pins
1-3 preserving channels 1-3 on them.

The user can actually use channel 0 on every pin because bnxt driver doesn't
care about channels at all, but it's a bit confusing that it sets up different
channels during init phase.

>>
>> supported_extts_flags and supported_perout_flags have to be added as
>> well to make the driver complaint with the latest API.
>>
>> Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
>> ---
>>   drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
>> index db81cf6d5289..c9b7df669415 100644
>> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
>> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
>> @@ -965,10 +965,12 @@ static int bnxt_ptp_pps_init(struct bnxt *bp)
>>          hwrm_req_drop(bp, req);
>>
>>          /* Only 1 each of ext_ts and per_out pins is available in HW */
>> -       ptp_info->n_ext_ts = 1;
>> -       ptp_info->n_per_out = 1;
>> +       ptp_info->n_ext_ts = pps_info->num_pins;
>> +       ptp_info->n_per_out = pps_info->num_pins;
>>          ptp_info->pps = 1;
>>          ptp_info->verify = bnxt_ptp_verify;
>> +       ptp_info->supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS;
>> +       ptp_info->supported_perout_flags = PTP_PEROUT_DUTY_CYCLE;
>>
>>          return 0;
>>   }
>> --
>> 2.47.3
>>


  reply	other threads:[~2025-10-17  8:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-16 22:23 [PATCH net-next] bnxt_en: support PPS in/out on all pins Vadim Fedorenko
2025-10-17  3:45 ` Pavan Chebbi
2025-10-17  8:51   ` Vadim Fedorenko [this message]
2025-10-17  9:15     ` Pavan Chebbi
2025-10-17 10:40       ` Vadim Fedorenko
2025-10-17 14:08         ` Pavan Chebbi
2025-10-17 16:39           ` Vadim Fedorenko

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=20f633b9-8a49-4240-8cb8-00309081ab73@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pavan.chebbi@broadcom.com \
    --cc=richardcochran@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.