diff mbox series

ptp_qoriq: add initialization message

Message ID 20200211045053.8088-1-yangbo.lu@nxp.com
State Rejected
Delegated to: David Miller
Headers show
Series ptp_qoriq: add initialization message | expand

Commit Message

Yangbo Lu Feb. 11, 2020, 4:50 a.m. UTC
It is necessary to print the initialization result.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
 drivers/ptp/ptp_qoriq.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

David Miller Feb. 12, 2020, 1:06 a.m. UTC | #1
From: Yangbo Lu <yangbo.lu@nxp.com>
Date: Tue, 11 Feb 2020 12:50:53 +0800

> It is necessary to print the initialization result.

No, it is not.
Yangbo Lu Feb. 12, 2020, 10:24 a.m. UTC | #2
> -----Original Message-----
> From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org> On
> Behalf Of David Miller
> Sent: Wednesday, February 12, 2020 9:07 AM
> To: Y.b. Lu <yangbo.lu@nxp.com>
> Cc: netdev@vger.kernel.org; richardcochran@gmail.com
> Subject: Re: [PATCH] ptp_qoriq: add initialization message
> 
> From: Yangbo Lu <yangbo.lu@nxp.com>
> Date: Tue, 11 Feb 2020 12:50:53 +0800
> 
> > It is necessary to print the initialization result.
> 
> No, it is not.

Sorry, I should have added my reasons into commit message.
I sent out v2. Do you think if it makes sense?

" Current ptp_qoriq driver prints only warning or error messages.
It may be loaded successfully without any messages.
Although this is fine, it would be convenient to have an oneline
initialization log showing success and PTP clock index.
The goods are,
- The ptp_qoriq driver users may know whether this driver is loaded
  successfully, or not, or not loaded from the booting log.
- The ptp_qoriq driver users don't have to install an ethtool to
  check the PTP clock index for using. Or don't have to check which
  /sys/class/ptp/ptpX is PTP QorIQ clock."

Thanks.
Vladimir Oltean Feb. 12, 2020, 10:34 a.m. UTC | #3
Hi Yangbo,

On Wed, 12 Feb 2020 at 12:25, Y.b. Lu <yangbo.lu@nxp.com> wrote:
>
> > -----Original Message-----
> > From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org> On
> > Behalf Of David Miller
> > Sent: Wednesday, February 12, 2020 9:07 AM
> > To: Y.b. Lu <yangbo.lu@nxp.com>
> > Cc: netdev@vger.kernel.org; richardcochran@gmail.com
> > Subject: Re: [PATCH] ptp_qoriq: add initialization message
> >
> > From: Yangbo Lu <yangbo.lu@nxp.com>
> > Date: Tue, 11 Feb 2020 12:50:53 +0800
> >
> > > It is necessary to print the initialization result.
> >
> > No, it is not.
>
> Sorry, I should have added my reasons into commit message.
> I sent out v2. Do you think if it makes sense?
>
> " Current ptp_qoriq driver prints only warning or error messages.
> It may be loaded successfully without any messages.
> Although this is fine, it would be convenient to have an oneline
> initialization log showing success and PTP clock index.
> The goods are,
> - The ptp_qoriq driver users may know whether this driver is loaded
>   successfully, or not, or not loaded from the booting log.
> - The ptp_qoriq driver users don't have to install an ethtool to
>   check the PTP clock index for using. Or don't have to check which
>   /sys/class/ptp/ptpX is PTP QorIQ clock."
>
> Thanks.

How about this message which is already there?
[    2.603163] pps pps0: new PPS source ptp0

Thanks,
-Vladimir
Yangbo Lu Feb. 12, 2020, 10:39 a.m. UTC | #4
> -----Original Message-----
> From: Vladimir Oltean <olteanv@gmail.com>
> Sent: Wednesday, February 12, 2020 6:34 PM
> To: Y.b. Lu <yangbo.lu@nxp.com>
> Cc: David Miller <davem@davemloft.net>; netdev@vger.kernel.org;
> richardcochran@gmail.com
> Subject: Re: [PATCH] ptp_qoriq: add initialization message
> 
> Hi Yangbo,
> 
> On Wed, 12 Feb 2020 at 12:25, Y.b. Lu <yangbo.lu@nxp.com> wrote:
> >
> > > -----Original Message-----
> > > From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org> On
> > > Behalf Of David Miller
> > > Sent: Wednesday, February 12, 2020 9:07 AM
> > > To: Y.b. Lu <yangbo.lu@nxp.com>
> > > Cc: netdev@vger.kernel.org; richardcochran@gmail.com
> > > Subject: Re: [PATCH] ptp_qoriq: add initialization message
> > >
> > > From: Yangbo Lu <yangbo.lu@nxp.com>
> > > Date: Tue, 11 Feb 2020 12:50:53 +0800
> > >
> > > > It is necessary to print the initialization result.
> > >
> > > No, it is not.
> >
> > Sorry, I should have added my reasons into commit message.
> > I sent out v2. Do you think if it makes sense?
> >
> > " Current ptp_qoriq driver prints only warning or error messages.
> > It may be loaded successfully without any messages.
> > Although this is fine, it would be convenient to have an oneline
> > initialization log showing success and PTP clock index.
> > The goods are,
> > - The ptp_qoriq driver users may know whether this driver is loaded
> >   successfully, or not, or not loaded from the booting log.
> > - The ptp_qoriq driver users don't have to install an ethtool to
> >   check the PTP clock index for using. Or don't have to check which
> >   /sys/class/ptp/ptpX is PTP QorIQ clock."
> >
> > Thanks.
> 
> How about this message which is already there?
> [    2.603163] pps pps0: new PPS source ptp0

This message is from pps subsystem. We don't know what PTP clock is registered as ptp0.
And if the PTP clock doesn't support pps capability, even this log won't be showed.

Thanks.

> 
> Thanks,
> -Vladimir
Vladimir Oltean Feb. 12, 2020, 10:45 a.m. UTC | #5
Hi Yangbo,

On Wed, 12 Feb 2020 at 12:39, Y.b. Lu <yangbo.lu@nxp.com> wrote:
>
> > -----Original Message-----
> > From: Vladimir Oltean <olteanv@gmail.com>
> > Sent: Wednesday, February 12, 2020 6:34 PM
> > To: Y.b. Lu <yangbo.lu@nxp.com>
> > Cc: David Miller <davem@davemloft.net>; netdev@vger.kernel.org;
> > richardcochran@gmail.com
> > Subject: Re: [PATCH] ptp_qoriq: add initialization message
> >
> > Hi Yangbo,
> >
> > On Wed, 12 Feb 2020 at 12:25, Y.b. Lu <yangbo.lu@nxp.com> wrote:
> > >
> > > > -----Original Message-----
> > > > From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org> On
> > > > Behalf Of David Miller
> > > > Sent: Wednesday, February 12, 2020 9:07 AM
> > > > To: Y.b. Lu <yangbo.lu@nxp.com>
> > > > Cc: netdev@vger.kernel.org; richardcochran@gmail.com
> > > > Subject: Re: [PATCH] ptp_qoriq: add initialization message
> > > >
> > > > From: Yangbo Lu <yangbo.lu@nxp.com>
> > > > Date: Tue, 11 Feb 2020 12:50:53 +0800
> > > >
> > > > > It is necessary to print the initialization result.
> > > >
> > > > No, it is not.
> > >
> > > Sorry, I should have added my reasons into commit message.
> > > I sent out v2. Do you think if it makes sense?
> > >
> > > " Current ptp_qoriq driver prints only warning or error messages.
> > > It may be loaded successfully without any messages.
> > > Although this is fine, it would be convenient to have an oneline
> > > initialization log showing success and PTP clock index.
> > > The goods are,
> > > - The ptp_qoriq driver users may know whether this driver is loaded
> > >   successfully, or not, or not loaded from the booting log.
> > > - The ptp_qoriq driver users don't have to install an ethtool to
> > >   check the PTP clock index for using. Or don't have to check which
> > >   /sys/class/ptp/ptpX is PTP QorIQ clock."
> > >
> > > Thanks.
> >
> > How about this message which is already there?
> > [    2.603163] pps pps0: new PPS source ptp0
>
> This message is from pps subsystem. We don't know what PTP clock is registered as ptp0.
> And if the PTP clock doesn't support pps capability, even this log won't be showed.
>
> Thanks.
>
> >
> > Thanks,
> > -Vladimir

Yes but this is ptp_qoriq, which specifically _does_ support PPS, so
the message will be printed. Am I missing something?

Regards,
-Vladimir
Yangbo Lu Feb. 12, 2020, 10:59 a.m. UTC | #6
> -----Original Message-----
> From: Vladimir Oltean <olteanv@gmail.com>
> Sent: Wednesday, February 12, 2020 6:46 PM
> To: Y.b. Lu <yangbo.lu@nxp.com>
> Cc: David Miller <davem@davemloft.net>; netdev@vger.kernel.org;
> richardcochran@gmail.com
> Subject: Re: [PATCH] ptp_qoriq: add initialization message
> 
> Hi Yangbo,
> 
> On Wed, 12 Feb 2020 at 12:39, Y.b. Lu <yangbo.lu@nxp.com> wrote:
> >
> > > -----Original Message-----
> > > From: Vladimir Oltean <olteanv@gmail.com>
> > > Sent: Wednesday, February 12, 2020 6:34 PM
> > > To: Y.b. Lu <yangbo.lu@nxp.com>
> > > Cc: David Miller <davem@davemloft.net>; netdev@vger.kernel.org;
> > > richardcochran@gmail.com
> > > Subject: Re: [PATCH] ptp_qoriq: add initialization message
> > >
> > > Hi Yangbo,
> > >
> > > On Wed, 12 Feb 2020 at 12:25, Y.b. Lu <yangbo.lu@nxp.com> wrote:
> > > >
> > > > > -----Original Message-----
> > > > > From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org>
> On
> > > > > Behalf Of David Miller
> > > > > Sent: Wednesday, February 12, 2020 9:07 AM
> > > > > To: Y.b. Lu <yangbo.lu@nxp.com>
> > > > > Cc: netdev@vger.kernel.org; richardcochran@gmail.com
> > > > > Subject: Re: [PATCH] ptp_qoriq: add initialization message
> > > > >
> > > > > From: Yangbo Lu <yangbo.lu@nxp.com>
> > > > > Date: Tue, 11 Feb 2020 12:50:53 +0800
> > > > >
> > > > > > It is necessary to print the initialization result.
> > > > >
> > > > > No, it is not.
> > > >
> > > > Sorry, I should have added my reasons into commit message.
> > > > I sent out v2. Do you think if it makes sense?
> > > >
> > > > " Current ptp_qoriq driver prints only warning or error messages.
> > > > It may be loaded successfully without any messages.
> > > > Although this is fine, it would be convenient to have an oneline
> > > > initialization log showing success and PTP clock index.
> > > > The goods are,
> > > > - The ptp_qoriq driver users may know whether this driver is loaded
> > > >   successfully, or not, or not loaded from the booting log.
> > > > - The ptp_qoriq driver users don't have to install an ethtool to
> > > >   check the PTP clock index for using. Or don't have to check which
> > > >   /sys/class/ptp/ptpX is PTP QorIQ clock."
> > > >
> > > > Thanks.
> > >
> > > How about this message which is already there?
> > > [    2.603163] pps pps0: new PPS source ptp0
> >
> > This message is from pps subsystem. We don't know what PTP clock is
> registered as ptp0.
> > And if the PTP clock doesn't support pps capability, even this log won't be
> showed.
> >
> > Thanks.
> >
> > >
> > > Thanks,
> > > -Vladimir
> 
> Yes but this is ptp_qoriq, which specifically _does_ support PPS, so
> the message will be printed. Am I missing something?

The ptp_qoriq driver is a common driver. It could be reused for any Ethernet controller's with such PTP timer, such as enetc_ptp.c, dpaa2_ptp.c.
It has possibility that they had different capabilities. And there may be such case that a new driver reused ptp_qoriq may want to support part features not including pps first.

So this message you mentioned couldn’t bring the two goods I described.
Thanks.

> 
> Regards,
> -Vladimir
diff mbox series

Patch

diff --git a/drivers/ptp/ptp_qoriq.c b/drivers/ptp/ptp_qoriq.c
index b27c46e..66e7d57 100644
--- a/drivers/ptp/ptp_qoriq.c
+++ b/drivers/ptp/ptp_qoriq.c
@@ -541,6 +541,8 @@  int ptp_qoriq_init(struct ptp_qoriq *ptp_qoriq, void __iomem *base,
 
 	ptp_qoriq->phc_index = ptp_clock_index(ptp_qoriq->clock);
 	ptp_qoriq_create_debugfs(ptp_qoriq);
+
+	pr_info("new PTP clock ptp%d\n", ptp_qoriq->phc_index);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(ptp_qoriq_init);