diff mbox series

[net-next,4/6] enetc_ptp: support ptp virtual clock

Message ID 20210507085756.20427-5-yangbo.lu@nxp.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series ptp: support virtual clocks for multiple domains | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit fail Errors and warnings before: 116 this patch: 110
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 23 lines checked
netdev/build_allmodconfig_warn fail Errors and warnings before: 95 this patch: 98
netdev/header_inline success Link

Commit Message

Yangbo Lu May 7, 2021, 8:57 a.m. UTC
Add support for ptp virtual clock.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
 drivers/net/ethernet/freescale/enetc/enetc_ptp.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Claudiu Manoil May 7, 2021, 7:58 p.m. UTC | #1
On 07.05.2021 11:57, Yangbo Lu wrote:
> Add support for ptp virtual clock.
> 
> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> ---
>   drivers/net/ethernet/freescale/enetc/enetc_ptp.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c
> index bc594892507a..52de736df800 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c
> @@ -10,6 +10,16 @@
>   int enetc_phc_index = -1;
>   EXPORT_SYMBOL(enetc_phc_index);
>   
> +struct ptp_vclock_cc ptp_qoriq_vclock_cc = {
^ static

> +	.cc.read		= ptp_qoriq_clock_read,
> +	.cc.mask		= CYCLECOUNTER_MASK(64),
> +	.cc.shift		= 28,
> +	.cc.mult		= (1 << 28),
> +	.refresh_interval	= (HZ * 60),
> +	.mult_num		= (1 << 6),
> +	.mult_dem		= 15625,
> +};
> +
kernel test robot May 7, 2021, 8:50 p.m. UTC | #2
Hi Yangbo,

I love your patch! Yet something to improve:

[auto build test ERROR on 9d31d2338950293ec19d9b095fbaa9030899dcb4]

url:    https://github.com/0day-ci/linux/commits/Yangbo-Lu/ptp-support-virtual-clocks-for-multiple-domains/20210507-164927
base:   9d31d2338950293ec19d9b095fbaa9030899dcb4
config: mips-allyesconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/2df0961abd74b90986d36beeaf4116ed699f232e
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yangbo-Lu/ptp-support-virtual-clocks-for-multiple-domains/20210507-164927
        git checkout 2df0961abd74b90986d36beeaf4116ed699f232e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/fsl/ptp_qoriq.h:11,
                    from drivers/net/ethernet/freescale/enetc/enetc_ptp.c:6:
   include/linux/ptp_clock_kernel.h:71:22: error: field 'cc' has incomplete type
      71 |  struct cyclecounter cc;
         |                      ^~
>> drivers/net/ethernet/freescale/enetc/enetc_ptp.c:14:2: error: field name not in record or union initializer
      14 |  .cc.read  = ptp_qoriq_clock_read,
         |  ^
   drivers/net/ethernet/freescale/enetc/enetc_ptp.c:14:2: note: (near initialization for 'ptp_qoriq_vclock_cc')
   drivers/net/ethernet/freescale/enetc/enetc_ptp.c:15:2: error: field name not in record or union initializer
      15 |  .cc.mask  = CYCLECOUNTER_MASK(64),
         |  ^
   drivers/net/ethernet/freescale/enetc/enetc_ptp.c:15:2: note: (near initialization for 'ptp_qoriq_vclock_cc')
>> drivers/net/ethernet/freescale/enetc/enetc_ptp.c:15:14: error: implicit declaration of function 'CYCLECOUNTER_MASK' [-Werror=implicit-function-declaration]
      15 |  .cc.mask  = CYCLECOUNTER_MASK(64),
         |              ^~~~~~~~~~~~~~~~~
   drivers/net/ethernet/freescale/enetc/enetc_ptp.c:16:2: error: field name not in record or union initializer
      16 |  .cc.shift  = 28,
         |  ^
   drivers/net/ethernet/freescale/enetc/enetc_ptp.c:16:2: note: (near initialization for 'ptp_qoriq_vclock_cc')
   drivers/net/ethernet/freescale/enetc/enetc_ptp.c:17:2: error: field name not in record or union initializer
      17 |  .cc.mult  = (1 << 28),
         |  ^
   drivers/net/ethernet/freescale/enetc/enetc_ptp.c:17:2: note: (near initialization for 'ptp_qoriq_vclock_cc')
   cc1: some warnings being treated as errors


vim +14 drivers/net/ethernet/freescale/enetc/enetc_ptp.c

    12	
    13	struct ptp_vclock_cc ptp_qoriq_vclock_cc = {
  > 14		.cc.read		= ptp_qoriq_clock_read,
  > 15		.cc.mask		= CYCLECOUNTER_MASK(64),
    16		.cc.shift		= 28,
    17		.cc.mult		= (1 << 28),
    18		.refresh_interval	= (HZ * 60),
    19		.mult_num		= (1 << 6),
    20		.mult_dem		= 15625,
    21	};
    22	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c
index bc594892507a..52de736df800 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c
@@ -10,6 +10,16 @@ 
 int enetc_phc_index = -1;
 EXPORT_SYMBOL(enetc_phc_index);
 
+struct ptp_vclock_cc ptp_qoriq_vclock_cc = {
+	.cc.read		= ptp_qoriq_clock_read,
+	.cc.mask		= CYCLECOUNTER_MASK(64),
+	.cc.shift		= 28,
+	.cc.mult		= (1 << 28),
+	.refresh_interval	= (HZ * 60),
+	.mult_num		= (1 << 6),
+	.mult_dem		= 15625,
+};
+
 static struct ptp_clock_info enetc_ptp_caps = {
 	.owner		= THIS_MODULE,
 	.name		= "ENETC PTP clock",
@@ -24,6 +34,7 @@  static struct ptp_clock_info enetc_ptp_caps = {
 	.gettime64	= ptp_qoriq_gettime,
 	.settime64	= ptp_qoriq_settime,
 	.enable		= ptp_qoriq_enable,
+	.vclock_cc	= &ptp_qoriq_vclock_cc,
 };
 
 static int enetc_ptp_probe(struct pci_dev *pdev,