2018-05-17 20:10:50

by Florian Fainelli

[permalink] [raw]
Subject: [PATCH net-next v3 0/3] net: Allow more drivers with COMPILE_TEST

Hi David,

This patch series includes more drivers to be build tested with COMPILE_TEST
enabled. This helps cover some of the issues I just ran into with missing
a driver *sigh*.

Chanves in v3:

- drop the TI Keystone NETCP driver from the COMPILE_TEST additions

Changes in v2:

- allow FEC to build outside of CONFIG_ARM/ARM64 by defining a layout of
registers, this is not meant to run, so this is not a real issue if we
are not matching the correct register layout


Florian Fainelli (3):
net: ethernet: ti: Allow most drivers with COMPILE_TEST
net: ethernet: freescale: Allow FEC with COMPILE_TEST
net: phy: Allow MDIO_MOXART and MDIO_SUN4I with COMPILE_TEST

drivers/net/ethernet/freescale/Kconfig | 2 +-
drivers/net/ethernet/freescale/fec.h | 2 +-
drivers/net/ethernet/freescale/fec_main.c | 2 +-
drivers/net/ethernet/ti/Kconfig | 12 ++++++------
drivers/net/phy/Kconfig | 4 ++--
5 files changed, 11 insertions(+), 11 deletions(-)

--
2.14.1



2018-05-17 20:08:23

by Florian Fainelli

[permalink] [raw]
Subject: [PATCH net-next v3 3/3] net: phy: Allow MDIO_MOXART and MDIO_SUN4I with COMPILE_TEST

Those drivers build just fine with COMPILE_TEST, so make that possible.

Signed-off-by: Florian Fainelli <[email protected]>
---
drivers/net/phy/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 0e2305ccc91f..343989f9f9d9 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -118,7 +118,7 @@ config MDIO_I2C

config MDIO_MOXART
tristate "MOXA ART MDIO interface support"
- depends on ARCH_MOXART
+ depends on ARCH_MOXART || COMPILE_TEST
help
This driver supports the MDIO interface found in the network
interface units of the MOXA ART SoC
@@ -142,7 +142,7 @@ config MDIO_OCTEON

config MDIO_SUN4I
tristate "Allwinner sun4i MDIO interface support"
- depends on ARCH_SUNXI
+ depends on ARCH_SUNXI || COMPILE_TEST
help
This driver supports the MDIO interface found in the network
interface units of the Allwinner SoC that have an EMAC (A10,
--
2.14.1


2018-05-17 20:08:48

by Florian Fainelli

[permalink] [raw]
Subject: [PATCH net-next v3 1/3] net: ethernet: ti: Allow most drivers with COMPILE_TEST

Most of the TI drivers build just fine with COMPILE_TEST, cpmac (AR7) is
the exception because it uses a header file from
arch/mips/include/asm/mach-ar7/ar7.h and keystone netcp which requires
help from drivers/soc/ti/ for queue management helpers.

Signed-off-by: Florian Fainelli <[email protected]>
---
drivers/net/ethernet/ti/Kconfig | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
index 48a541eb0af2..9263d638bd6d 100644
--- a/drivers/net/ethernet/ti/Kconfig
+++ b/drivers/net/ethernet/ti/Kconfig
@@ -18,7 +18,7 @@ if NET_VENDOR_TI

config TI_DAVINCI_EMAC
tristate "TI DaVinci EMAC Support"
- depends on ARM && ( ARCH_DAVINCI || ARCH_OMAP3 )
+ depends on ARM && ( ARCH_DAVINCI || ARCH_OMAP3 ) || COMPILE_TEST
select TI_DAVINCI_MDIO
select TI_DAVINCI_CPDMA
select PHYLIB
@@ -30,7 +30,7 @@ config TI_DAVINCI_EMAC

config TI_DAVINCI_MDIO
tristate "TI DaVinci MDIO Support"
- depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || ARCH_KEYSTONE
+ depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || ARCH_KEYSTONE || COMPILE_TEST
select PHYLIB
---help---
This driver supports TI's DaVinci MDIO module.
@@ -40,7 +40,7 @@ config TI_DAVINCI_MDIO

config TI_DAVINCI_CPDMA
tristate "TI DaVinci CPDMA Support"
- depends on ARCH_DAVINCI || ARCH_OMAP2PLUS
+ depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || COMPILE_TEST
---help---
This driver supports TI's DaVinci CPDMA dma engine.

@@ -60,7 +60,7 @@ config TI_CPSW_ALE

config TI_CPSW
tristate "TI CPSW Switch Support"
- depends on ARCH_DAVINCI || ARCH_OMAP2PLUS
+ depends on ARCH_DAVINCI || ARCH_OMAP2PLUS || COMPILE_TEST
select TI_DAVINCI_CPDMA
select TI_DAVINCI_MDIO
select TI_CPSW_PHY_SEL
@@ -75,7 +75,7 @@ config TI_CPSW

config TI_CPTS
bool "TI Common Platform Time Sync (CPTS) Support"
- depends on TI_CPSW || TI_KEYSTONE_NETCP
+ depends on TI_CPSW || TI_KEYSTONE_NETCP || COMPILE_TEST
depends on POSIX_TIMERS
---help---
This driver supports the Common Platform Time Sync unit of
--
2.14.1


2018-05-17 20:09:15

by Florian Fainelli

[permalink] [raw]
Subject: [PATCH net-next v3 2/3] net: ethernet: freescale: Allow FEC with COMPILE_TEST

The Freescale FEC driver builds fine with COMPILE_TEST, so make that
possible.

Signed-off-by: Florian Fainelli <[email protected]>
---
drivers/net/ethernet/freescale/Kconfig | 2 +-
drivers/net/ethernet/freescale/fec.h | 2 +-
drivers/net/ethernet/freescale/fec_main.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig
index 6e490fd2345d..a580a3dcbe59 100644
--- a/drivers/net/ethernet/freescale/Kconfig
+++ b/drivers/net/ethernet/freescale/Kconfig
@@ -22,7 +22,7 @@ if NET_VENDOR_FREESCALE
config FEC
tristate "FEC ethernet controller (of ColdFire and some i.MX CPUs)"
depends on (M523x || M527x || M5272 || M528x || M520x || M532x || \
- ARCH_MXC || SOC_IMX28)
+ ARCH_MXC || SOC_IMX28 || COMPILE_TEST)
default ARCH_MXC || SOC_IMX28 if ARM
select PHYLIB
imply PTP_1588_CLOCK
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index e7381f8ef89d..4778b663653e 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -21,7 +21,7 @@

#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARM) || \
- defined(CONFIG_ARM64)
+ defined(CONFIG_ARM64) || defined(CONFIG_COMPILE_TEST)
/*
* Just figures, Motorola would have to change the offsets for
* registers in the same peripheral device on different models
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index f3e43db0d6cb..4358f586e28f 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2107,7 +2107,7 @@ static int fec_enet_get_regs_len(struct net_device *ndev)
/* List of registers that can be safety be read to dump them with ethtool */
#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARM) || \
- defined(CONFIG_ARM64)
+ defined(CONFIG_ARM64) || defined(CONFIG_COMPILE_TEST)
static u32 fec_enet_register_offset[] = {
FEC_IEVENT, FEC_IMASK, FEC_R_DES_ACTIVE_0, FEC_X_DES_ACTIVE_0,
FEC_ECNTRL, FEC_MII_DATA, FEC_MII_SPEED, FEC_MIB_CTRLSTAT, FEC_R_CNTRL,
--
2.14.1


2018-05-17 21:14:33

by David Miller

[permalink] [raw]
Subject: Re: [PATCH net-next v3 0/3] net: Allow more drivers with COMPILE_TEST

From: Florian Fainelli <[email protected]>
Date: Thu, 17 May 2018 13:07:42 -0700

> Hi David,
>
> This patch series includes more drivers to be build tested with COMPILE_TEST
> enabled. This helps cover some of the issues I just ran into with missing
> a driver *sigh*.
>
> Chanves in v3:
>
> - drop the TI Keystone NETCP driver from the COMPILE_TEST additions
>
> Changes in v2:
>
> - allow FEC to build outside of CONFIG_ARM/ARM64 by defining a layout of
> registers, this is not meant to run, so this is not a real issue if we
> are not matching the correct register layout

Ok, series applied.

Just some printf format string warnings to clear up on 64-bit in TI
driver files davinci_cpdma.c, cpsw.c, and cpts.c.

In file included from ./arch/x86/include/asm/bug.h:83:0,
from ./include/linux/bug.h:5,
from ./include/linux/thread_info.h:12,
from ./arch/x86/include/asm/preempt.h:7,
from ./include/linux/preempt.h:81,
from ./include/linux/spinlock.h:51,
from drivers/net/ethernet/ti/davinci_cpdma.c:16:
drivers/net/ethernet/ti/davinci_cpdma.c: In function ?cpdma_desc_pool_destroy?:
drivers/net/ethernet/ti/davinci_cpdma.c:194:7: warning: format ?%d? expects argument of type ?int?, but argument 2 has type ?size_t {aka long unsigned int}? [-Wformat=]
"cpdma_desc_pool size %d != avail %d",
^
gen_pool_size(pool->gen_pool),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bug.h:98:50: note: in definition of macro ?__WARN_printf?
#define __WARN_printf(arg...) do { __warn_printk(arg); __WARN(); } while (0)
^~~
drivers/net/ethernet/ti/davinci_cpdma.c:193:2: note: in expansion of macro ?WARN?
WARN(gen_pool_size(pool->gen_pool) != gen_pool_avail(pool->gen_pool),
^~~~
drivers/net/ethernet/ti/davinci_cpdma.c:194:7: warning: format ?%d? expects argument of type ?int?, but argument 3 has type ?size_t {aka long unsigned int}? [-Wformat=]
"cpdma_desc_pool size %d != avail %d",
^
drivers/net/ethernet/ti/davinci_cpdma.c:196:7:
gen_pool_avail(pool->gen_pool));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bug.h:98:50: note: in definition of macro ?__WARN_printf?
#define __WARN_printf(arg...) do { __warn_printk(arg); __WARN(); } while (0)
^~~
drivers/net/ethernet/ti/davinci_cpdma.c:193:2: note: in expansion of macro ?WARN?
WARN(gen_pool_size(pool->gen_pool) != gen_pool_avail(pool->gen_pool),
^~~~
In file included from ./arch/x86/include/asm/realmode.h:15:0,
from ./arch/x86/include/asm/acpi.h:33,
from ./arch/x86/include/asm/fixmap.h:19,
from ./arch/x86/include/asm/apic.h:10,
from ./arch/x86/include/asm/smp.h:13,
from ./arch/x86/include/asm/mmzone_64.h:11,
from ./arch/x86/include/asm/mmzone.h:5,
from ./include/linux/mmzone.h:911,
from ./include/linux/gfp.h:6,
from ./include/linux/idr.h:16,
from ./include/linux/kernfs.h:14,
from ./include/linux/sysfs.h:16,
from ./include/linux/kobject.h:20,
from ./include/linux/device.h:16,
from drivers/net/ethernet/ti/davinci_cpdma.c:17:
drivers/net/ethernet/ti/davinci_cpdma.c: In function ?cpdma_chan_submit?:
drivers/net/ethernet/ti/davinci_cpdma.c:1083:17: warning: passing argument 1 of ?__writel? makes integer from pointer without a cast [-Wint-conversion]
writel_relaxed(token, &desc->sw_token);
^
./arch/x86/include/asm/io.h:88:39: note: in definition of macro ?writel_relaxed?
#define writel_relaxed(v, a) __writel(v, a)
^
./arch/x86/include/asm/io.h:71:18: note: expected ?unsigned int? but argument is of type ?void *?
build_mmio_write(__writel, "l", unsigned int, "r", )
^
./arch/x86/include/asm/io.h:53:20: note: in definition of macro ?build_mmio_write?
static inline void name(type val, volatile void __iomem *addr) \
^~~~
drivers/net/ethernet/ti/davinci_cpdma.c: In function ?__cpdma_chan_free?:
drivers/net/ethernet/ti/davinci_cpdma.c:1126:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
token = (void *)desc_read(desc, sw_token);
^
In file included from ./include/linux/kernel.h:14:0,
from ./include/linux/uio.h:12,
from ./include/linux/socket.h:8,
from ./include/uapi/linux/if.h:25,
from drivers/net/ethernet/ti/cpts.c:21:
drivers/net/ethernet/ti/cpts.c: In function ?cpts_overflow_check?:
drivers/net/ethernet/ti/cpts.c:297:11: warning: format ?%lld? expects argument of type ?long long int?, but argument 3 has type ?__kernel_time_t {aka long int}? [-Wformat=]
pr_debug("cpts overflow check at %lld.%09lu\n", ts.tv_sec, ts.tv_nsec);
^
./include/linux/printk.h:288:21: note: in definition of macro ?pr_fmt?
#define pr_fmt(fmt) fmt
^~~
./include/linux/printk.h:336:2: note: in expansion of macro ?dynamic_pr_debug?
dynamic_pr_debug(fmt, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~
drivers/net/ethernet/ti/cpts.c:297:2: note: in expansion of macro ?pr_debug?
pr_debug("cpts overflow check at %lld.%09lu\n", ts.tv_sec, ts.tv_nsec);
^~~~~~~~
drivers/net/ethernet/ti/davinci_emac.c: In function ?davinci_emac_probe?:
drivers/net/ethernet/ti/davinci_emac.c:1934:7: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
(void *)priv->emac_base_phys, ndev->irq);
^
drivers/net/ethernet/ti/cpsw.c: In function ?cpsw_add_ch_strings?:
drivers/net/ethernet/ti/cpsw.c:1284:19: warning: format ?%d? expects argument of type ?int?, but argument 5 has type ?long unsigned int? [-Wformat=]
"%s DMA chan %d: %s", rx_dir ? "Rx" : "Tx",
~^
%ld

2018-05-18 01:23:22

by Andy Duan

[permalink] [raw]
Subject: RE: [PATCH net-next v3 2/3] net: ethernet: freescale: Allow FEC with COMPILE_TEST

From: Florian Fainelli <[email protected]> Sent: 2018??5??18?? 4:08
> The Freescale FEC driver builds fine with COMPILE_TEST, so make that
> possible.
>
> Signed-off-by: Florian Fainelli <[email protected]>

Acked-by: Fugang Duan <[email protected]>

> ---
> drivers/net/ethernet/freescale/Kconfig | 2 +-
> drivers/net/ethernet/freescale/fec.h | 2 +-
> drivers/net/ethernet/freescale/fec_main.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/Kconfig
> b/drivers/net/ethernet/freescale/Kconfig
> index 6e490fd2345d..a580a3dcbe59 100644
> --- a/drivers/net/ethernet/freescale/Kconfig
> +++ b/drivers/net/ethernet/freescale/Kconfig
> @@ -22,7 +22,7 @@ if NET_VENDOR_FREESCALE config FEC
> tristate "FEC ethernet controller (of ColdFire and some i.MX CPUs)"
> depends on (M523x || M527x || M5272 || M528x || M520x ||
> M532x || \
> - ARCH_MXC || SOC_IMX28)
> + ARCH_MXC || SOC_IMX28 || COMPILE_TEST)
> default ARCH_MXC || SOC_IMX28 if ARM
> select PHYLIB
> imply PTP_1588_CLOCK
> diff --git a/drivers/net/ethernet/freescale/fec.h
> b/drivers/net/ethernet/freescale/fec.h
> index e7381f8ef89d..4778b663653e 100644
> --- a/drivers/net/ethernet/freescale/fec.h
> +++ b/drivers/net/ethernet/freescale/fec.h
> @@ -21,7 +21,7 @@
>
> #if defined(CONFIG_M523x) || defined(CONFIG_M527x) ||
> defined(CONFIG_M528x) || \
> defined(CONFIG_M520x) || defined(CONFIG_M532x) ||
> defined(CONFIG_ARM) || \
> - defined(CONFIG_ARM64)
> + defined(CONFIG_ARM64) || defined(CONFIG_COMPILE_TEST)
> /*
> * Just figures, Motorola would have to change the offsets for
> * registers in the same peripheral device on different models
> diff --git a/drivers/net/ethernet/freescale/fec_main.c
> b/drivers/net/ethernet/freescale/fec_main.c
> index f3e43db0d6cb..4358f586e28f 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -2107,7 +2107,7 @@ static int fec_enet_get_regs_len(struct
> net_device *ndev)
> /* List of registers that can be safety be read to dump them with ethtool
> */ #if defined(CONFIG_M523x) || defined(CONFIG_M527x) ||
> defined(CONFIG_M528x) || \
> defined(CONFIG_M520x) || defined(CONFIG_M532x) ||
> defined(CONFIG_ARM) || \
> - defined(CONFIG_ARM64)
> + defined(CONFIG_ARM64) || defined(CONFIG_COMPILE_TEST)
> static u32 fec_enet_register_offset[] = {
> FEC_IEVENT, FEC_IMASK, FEC_R_DES_ACTIVE_0,
> FEC_X_DES_ACTIVE_0,
> FEC_ECNTRL, FEC_MII_DATA, FEC_MII_SPEED, FEC_MIB_CTRLSTAT,
> FEC_R_CNTRL,
> --
> 2.14.1