Skip to content

Commit

Permalink
Merge branch 'dpaa2-eth-Move-DPAA2-Ethernet-driver'
Browse files Browse the repository at this point in the history
Ioana Radulescu says:

====================
dpaa2-eth: Move DPAA2 Ethernet driver

The Freescale/NXP DPAA2 Ethernet driver was first included in
drivers/staging, due to its dependencies on two components located
there at the time of its initial submission:
* the fsl-mc bus driver, which was moved to drivers/bus in kernel 4.17
* the dpio driver, which was moved to drivers/soc/fsl in kernel 4.18

More information on the DPAA2 architecture and the interactions
between the fsl-mc bus and the objects present on it can be found in:
Documentation/networking/dpaa2/overview.rst

For easier review, the patch is generated without the -M option,
although the driver files are moved without any code changes.

changes since v1[1]:
* remove RFC label, since dependencies have been merged on net-next
* add patch fixing a possible race at probe (reported by Andrew Lunn)

[1] https://lore.kernel.org/patchwork/patch/971333/
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Sep 2, 2018
2 parents 459479d + 34ff684 commit 531778d
Show file tree
Hide file tree
Showing 17 changed files with 45 additions and 68 deletions.
1 change: 1 addition & 0 deletions Documentation/networking/dpaa2/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ DPAA2 Documentation

overview
dpio-driver
ethernet-driver
4 changes: 2 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -4527,9 +4527,9 @@ F: drivers/soc/fsl/dpio

DPAA2 ETHERNET DRIVER
M: Ioana Radulescu <ruxandra.radulescu@nxp.com>
L: linux-kernel@vger.kernel.org
L: netdev@vger.kernel.org
S: Maintained
F: drivers/staging/fsl-dpaa2/ethernet
F: drivers/net/ethernet/freescale/dpaa2

DPAA2 ETHERNET SWITCH DRIVER
M: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Expand Down
8 changes: 8 additions & 0 deletions drivers/net/ethernet/freescale/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,12 @@ config GIANFAR

source "drivers/net/ethernet/freescale/dpaa/Kconfig"

config FSL_DPAA2_ETH
tristate "Freescale DPAA2 Ethernet"
depends on FSL_MC_BUS && FSL_MC_DPIO
depends on NETDEVICES && ETHERNET
---help---
Ethernet driver for Freescale DPAA2 SoCs, using the
Freescale MC bus driver

endif # NET_VENDOR_FREESCALE
2 changes: 2 additions & 0 deletions drivers/net/ethernet/freescale/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ ucc_geth_driver-objs := ucc_geth.o ucc_geth_ethtool.o

obj-$(CONFIG_FSL_FMAN) += fman/
obj-$(CONFIG_FSL_DPAA_ETH) += dpaa/

obj-$(CONFIG_FSL_DPAA2_ETH) += dpaa2/
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -1143,34 +1143,6 @@ static int dpaa2_eth_stop(struct net_device *net_dev)
return 0;
}

static int dpaa2_eth_init(struct net_device *net_dev)
{
u64 supported = 0;
u64 not_supported = 0;
struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
u32 options = priv->dpni_attrs.options;

/* Capabilities listing */
supported |= IFF_LIVE_ADDR_CHANGE;

if (options & DPNI_OPT_NO_MAC_FILTER)
not_supported |= IFF_UNICAST_FLT;
else
supported |= IFF_UNICAST_FLT;

net_dev->priv_flags |= supported;
net_dev->priv_flags &= ~not_supported;

/* Features */
net_dev->features = NETIF_F_RXCSUM |
NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
NETIF_F_SG | NETIF_F_HIGHDMA |
NETIF_F_LLTX;
net_dev->hw_features = net_dev->features;

return 0;
}

static int dpaa2_eth_set_addr(struct net_device *net_dev, void *addr)
{
struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
Expand Down Expand Up @@ -1418,7 +1390,6 @@ static const struct net_device_ops dpaa2_eth_ops = {
.ndo_open = dpaa2_eth_open,
.ndo_start_xmit = dpaa2_eth_tx,
.ndo_stop = dpaa2_eth_stop,
.ndo_init = dpaa2_eth_init,
.ndo_set_mac_address = dpaa2_eth_set_addr,
.ndo_get_stats64 = dpaa2_eth_get_stats,
.ndo_set_rx_mode = dpaa2_eth_set_rx_mode,
Expand Down Expand Up @@ -2316,11 +2287,14 @@ static int netdev_init(struct net_device *net_dev)
{
struct device *dev = net_dev->dev.parent;
struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
u32 options = priv->dpni_attrs.options;
u64 supported = 0, not_supported = 0;
u8 bcast_addr[ETH_ALEN];
u8 num_queues;
int err;

net_dev->netdev_ops = &dpaa2_eth_ops;
net_dev->ethtool_ops = &dpaa2_ethtool_ops;

err = set_mac_addr(priv);
if (err)
Expand Down Expand Up @@ -2356,12 +2330,23 @@ static int netdev_init(struct net_device *net_dev)
return err;
}

/* Our .ndo_init will be called herein */
err = register_netdev(net_dev);
if (err < 0) {
dev_err(dev, "register_netdev() failed\n");
return err;
}
/* Capabilities listing */
supported |= IFF_LIVE_ADDR_CHANGE;

if (options & DPNI_OPT_NO_MAC_FILTER)
not_supported |= IFF_UNICAST_FLT;
else
supported |= IFF_UNICAST_FLT;

net_dev->priv_flags |= supported;
net_dev->priv_flags &= ~not_supported;

/* Features */
net_dev->features = NETIF_F_RXCSUM |
NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
NETIF_F_SG | NETIF_F_HIGHDMA |
NETIF_F_LLTX;
net_dev->hw_features = net_dev->features;

return 0;
}
Expand Down Expand Up @@ -2561,28 +2546,36 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
if (err)
goto err_alloc_rings;

net_dev->ethtool_ops = &dpaa2_ethtool_ops;

err = setup_irqs(dpni_dev);
if (err) {
netdev_warn(net_dev, "Failed to set link interrupt, fall back to polling\n");
priv->poll_thread = kthread_run(poll_link_state, priv,
"%s_poll_link", net_dev->name);
if (IS_ERR(priv->poll_thread)) {
netdev_err(net_dev, "Error starting polling thread\n");
dev_err(dev, "Error starting polling thread\n");
goto err_poll_thread;
}
priv->do_link_poll = true;
}

err = register_netdev(net_dev);
if (err < 0) {
dev_err(dev, "register_netdev() failed\n");
goto err_netdev_reg;
}

dev_info(dev, "Probed interface %s\n", net_dev->name);
return 0;

err_netdev_reg:
if (priv->do_link_poll)
kthread_stop(priv->poll_thread);
else
fsl_mc_free_irqs(dpni_dev);
err_poll_thread:
free_rings(priv);
err_alloc_rings:
err_csum:
unregister_netdev(net_dev);
err_netdev_init:
free_percpu(priv->percpu_extras);
err_alloc_percpu_extras:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 0 additions & 8 deletions drivers/staging/fsl-dpaa2/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ config FSL_DPAA2
Build drivers for Freescale DataPath Acceleration
Architecture (DPAA2) family of SoCs.

config FSL_DPAA2_ETH
tristate "Freescale DPAA2 Ethernet"
depends on FSL_DPAA2 && FSL_MC_DPIO
depends on NETDEVICES && ETHERNET
---help---
Ethernet driver for Freescale DPAA2 SoCs, using the
Freescale MC bus driver

config FSL_DPAA2_ETHSW
tristate "Freescale DPAA2 Ethernet Switch"
depends on FSL_DPAA2
Expand Down
1 change: 0 additions & 1 deletion drivers/staging/fsl-dpaa2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
# Freescale DataPath Acceleration Architecture Gen2 (DPAA2) drivers
#

obj-$(CONFIG_FSL_DPAA2_ETH) += ethernet/
obj-$(CONFIG_FSL_DPAA2_ETHSW) += ethsw/
obj-$(CONFIG_FSL_DPAA2_PTP_CLOCK) += rtc/
18 changes: 0 additions & 18 deletions drivers/staging/fsl-dpaa2/ethernet/TODO

This file was deleted.

0 comments on commit 531778d

Please sign in to comment.