linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Katakam, Harini" <harini.katakam@amd.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: "nicolas.ferre@microchip.com" <nicolas.ferre@microchip.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"richardcochran@gmail.com" <richardcochran@gmail.com>,
	"claudiu.beznea@microchip.com" <claudiu.beznea@microchip.com>,
	"andrei.pistirica@microchip.com" <andrei.pistirica@microchip.com>,
	"edumazet@google.com" <edumazet@google.com>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Simek, Michal" <michal.simek@amd.com>,
	"harinikatakamlinux@gmail.com" <harinikatakamlinux@gmail.com>
Subject: RE: [PATCH net-next v2 1/2] net: macb: Enable PTP unicast
Date: Thu, 23 Mar 2023 07:01:37 +0000	[thread overview]
Message-ID: <BYAPR12MB4773239308DD06E4B80E14BC9E879@BYAPR12MB4773.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20230322222403.39191060@kernel.org>

Hi Jakub,

> -----Original Message-----
> From: Jakub Kicinski <kuba@kernel.org>
> Sent: Thursday, March 23, 2023 10:54 AM
> To: Katakam, Harini <harini.katakam@amd.com>
> Cc: nicolas.ferre@microchip.com; davem@davemloft.net;
> richardcochran@gmail.com; claudiu.beznea@microchip.com;
> andrei.pistirica@microchip.com; edumazet@google.com;
> pabeni@redhat.com; netdev@vger.kernel.org; linux-kernel@vger.kernel.org;
> Simek, Michal <michal.simek@amd.com>; harinikatakamlinux@gmail.com
> Subject: Re: [PATCH net-next v2 1/2] net: macb: Enable PTP unicast
> 
> On Tue, 21 Mar 2023 18:10:04 +0530 Harini Katakam wrote:
> > +#ifdef CONFIG_MACB_USE_HWSTAMP
> > +	if (gem_has_ptp(bp)) {
> > +		gem_writel(bp, RXPTPUNI, bottom);
> > +		gem_writel(bp, TXPTPUNI, bottom);
> > +	}
> > +#endif
> 
> You can use the same IS_ENABLED() trick here as you used in the if ()
> below, to avoid the direct preprocessor use. In fact why not just
> add the IS_ENABLED(CONFIG_MACB_USE_HWSTAMP) to the condition inside
> gem_has_ptp() ? It looks like all callers want that extra check.

Thanks for the suggestion.
I believe gem_has_ptp was originally defined for checking device
capability (Atmel/SiFive/AMD) and CONFIG_MACB_USE_HWSTAMP for the
kernel selection but I agree that there is currently no usecase for a 
scenario where gem_has_ptp is TRUE and MACB_USE_HWSTAMP is false. If
hear are no objections, I'll include this check inside gem_has_ptp and send v3.

Regards,
Harini


  reply	other threads:[~2023-03-23  7:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21 12:40 [PATCH net-next v2 0/2] Macb PTP minor updates Harini Katakam
2023-03-21 12:40 ` [PATCH net-next v2 1/2] net: macb: Enable PTP unicast Harini Katakam
2023-03-23  5:24   ` Jakub Kicinski
2023-03-23  7:01     ` Katakam, Harini [this message]
2023-03-21 12:40 ` [PATCH net-next v2 2/2] net: macb: Optimize reading HW timestamp Harini Katakam
  -- strict thread matches above, loose matches on Subject: below --
2023-03-21 12:38 [PATCH net-next v2 0/2] Macb PTP minor updates Harini Katakam
2023-03-21 12:38 ` [PATCH net-next v2 1/2] net: macb: Enable PTP unicast Harini Katakam

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=BYAPR12MB4773239308DD06E4B80E14BC9E879@BYAPR12MB4773.namprd12.prod.outlook.com \
    --to=harini.katakam@amd.com \
    --cc=andrei.pistirica@microchip.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=harinikatakamlinux@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=pabeni@redhat.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 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).