From: Andrei Pistirica <andrei.pistirica@microchip.com>
To: Richard Cochran <richardcochran@gmail.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <davem@davemloft.net>,
<nicolas.ferre@atmel.com>, <harinikatakamlinux@gmail.com>,
<harini.katakam@xilinx.com>, <punnaia@xilinx.com>,
<michals@xilinx.com>, <anirudh@xilinx.com>,
<boris.brezillon@free-electrons.com>,
<alexandre.belloni@free-electrons.com>, <tbultel@pixelsurmer.com>
Subject: Re: [RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM.
Date: Wed, 23 Nov 2016 14:36:55 +0100 [thread overview]
Message-ID: <90432c85-871f-22be-bde2-51e321828c9a@microchip.com> (raw)
In-Reply-To: <20161120193720.GA7874@localhost.localdomain>
On 20.11.2016 20:37, Richard Cochran wrote:
> On Fri, Nov 18, 2016 at 03:21:51PM +0100, Andrei Pistirica wrote:
>> +#ifdef CONFIG_MACB_USE_HWSTAMP
>> +void macb_ptp_init(struct net_device *ndev);
>> +#else
>> +void macb_ptp_init(struct net_device *ndev) { }
>
> static inline ^^^
I can do static inline only when PTP is not enabled (on else branch),
thus the empty function is defined in the header file (since the init
function is defined in macb_ptp and used in macb). To differentiate
between macb versions, I'll add a wrapper.
Would this be ok?
>
>> +#endif
>
>
>> +void macb_ptp_init(struct net_device *ndev)
>> +{
>> + struct macb *bp = netdev_priv(ndev);
>> + struct timespec64 now;
>> + u32 rem = 0;
>> +
>> + if (!(bp->caps | MACB_CAPS_GEM_HAS_PTP)){
>> + netdev_vdbg(bp->dev, "Platform does not support PTP!\n");
>> + return;
>> + }
>
> You would have needed '&' and not '|' here.
Yes. Another stupid mistake... sorry. I will be more careful next time.
>
> Also, using a flag limits the code to your platform. This works for
> you, but it is short sighted. The other MACB PTP blocks have
> different register layouts, and this patch does not lay the ground
> work for the others.
>
> The driver needs to be designed to support the other platforms.
It will support Xilinx.
>
> Thanks,
> Richard
>
Regards,
Andrei
prev parent reply other threads:[~2016-11-23 13:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-18 14:21 Andrei Pistirica
2016-11-18 14:21 ` [RFC PATCH v2 2/2] macb: Enable 1588 support in SAMA5D2 platform Andrei Pistirica
2016-11-20 19:54 ` Richard Cochran
2016-11-23 13:35 ` Andrei Pistirica
2016-11-20 19:18 ` [RFC PATCH v2 1/2] macb: Add 1588 support in Cadence GEM Richard Cochran
2016-11-23 13:34 ` Andrei Pistirica
2016-11-23 21:03 ` Richard Cochran
2016-11-24 9:36 ` Andrei.Pistirica
2016-11-20 19:37 ` Richard Cochran
2016-11-23 13:36 ` Andrei Pistirica [this message]
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=90432c85-871f-22be-bde2-51e321828c9a@microchip.com \
--to=andrei.pistirica@microchip.com \
--cc=alexandre.belloni@free-electrons.com \
--cc=anirudh@xilinx.com \
--cc=boris.brezillon@free-electrons.com \
--cc=davem@davemloft.net \
--cc=harini.katakam@xilinx.com \
--cc=harinikatakamlinux@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michals@xilinx.com \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@atmel.com \
--cc=punnaia@xilinx.com \
--cc=richardcochran@gmail.com \
--cc=tbultel@pixelsurmer.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
all inboxes | Powered by JetHome®