mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller:
1) Lots more phydev and probe error path leaks in various drivers by
Johan Hovold.
2) Fix race in packet_set_ring(), from Philip Pettersson.
3) Use after free in dccp_invalid_packet(), from Eric Dumazet.
4) Signnedness overflow in SO_{SND,RCV}BUFFORCE, also from Eric
Dumazet.
5) When tunneling between ipv4 and ipv6 we can be left with the wrong
skb->protocol value as we enter the IPSEC engine and this causes all
kinds of problems. Set it before the output path does any
dst_output() calls, from Eli Cooper.
6) bcmgenet uses wrong device struct pointer in DMA API calls, fix from
Florian Fainelli.
7) Various netfilter nat bug fixes from FLorian Westphal.
8) Fix memory leak in ipvlan_link_new(), from Gao Feng.
9) Locking fixes, particularly wrt. socket lookups, in l2tp from
Guillaume Nault.
10) Avoid invoking rhash teardowns in atomic context by moving netlink
cb->done() dump completion from a worker thread. Fix from Herbert
Xu.
11) Buffer refcount problems in tun and macvtap on errors, from Jason
Wang.
12) We don't set Kconfig symbol DEFAULT_TCP_CONG properly when the user
selects BBR. Fix from Julian Wollrath.
13) Fix deadlock in transmit path on altera TSE driver, from Lino
Sanfilippo.
14) Fix unbalanced reference counting in dsa_switch_tree, from Nikita
Yushchenko.
15) tc_tunnel_key needs to be properly exported to userspace via uapi,
fix from Roi Dayan.
16) rds_tcp_init_net() doesn't unregister notifier in error path, fix
from Sowmini Varadhan.
17) Stale packet header pointer access after pskb_expand_head() in
genenve driver, fix from Sabrina Dubroca.
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (103 commits)
net: avoid signed overflows for SO_{SND|RCV}BUFFORCE
geneve: avoid use-after-free of skb->data
tipc: check minimum bearer MTU
net: renesas: ravb: unintialized return value
sh_eth: remove unchecked interrupts for RZ/A1
net: bcmgenet: Utilize correct struct device for all DMA operations
NET: usb: qmi_wwan: add support for Telit LE922A PID 0x1040
cdc_ether: Fix handling connection notification
ip6_offload: check segs for NULL in ipv6_gso_segment.
RDS: TCP: unregister_netdevice_notifier() in error path of rds_tcp_init_net
Revert: "ip6_tunnel: Update skb->protocol to ETH_P_IPV6 in ip6_tnl_xmit()"
ipv6: Set skb->protocol properly for local output
ipv4: Set skb->protocol properly for local output
packet: fix race condition in packet_set_ring
net: ethernet: altera: TSE: do not use tx queue lock in tx completion handler
net: ethernet: altera: TSE: Remove unneeded dma sync for tx buffers
net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks
net: ethernet: stmmac: platform: fix outdated function header
net: ethernet: stmmac: dwmac-meson8b: fix probe error path
net: ethernet: stmmac: dwmac-generic: fix probe error path
...
This commit is contained in:
commit
8bca927f13
121 files changed
+1065
-451
No files matched your search
@@ -9,10 +9,26 @@ The following properties are common to the Ethernet controllers:
|
||||
- max-speed: number, specifies maximum speed in Mbit/s supported by the device;
|
||||
- max-frame-size: number, maximum transfer unit (IEEE defined MTU), rather than
|
||||
the maximum frame size (there's contradiction in ePAPR).
|
||||
- phy-mode: string, operation mode of the PHY interface; supported values are
|
||||
"mii", "gmii", "sgmii", "qsgmii", "tbi", "rev-mii", "rmii", "rgmii", "rgmii-id",
|
||||
"rgmii-rxid", "rgmii-txid", "rtbi", "smii", "xgmii", "trgmii"; this is now a
|
||||
de-facto standard property;
|
||||
- phy-mode: string, operation mode of the PHY interface. This is now a de-facto
|
||||
standard property; supported values are:
|
||||
* "mii"
|
||||
* "gmii"
|
||||
* "sgmii"
|
||||
* "qsgmii"
|
||||
* "tbi"
|
||||
* "rev-mii"
|
||||
* "rmii"
|
||||
* "rgmii" (RX and TX delays are added by the MAC when required)
|
||||
* "rgmii-id" (RGMII with internal RX and TX delays provided by the PHY, the
|
||||
MAC should not add the RX or TX delays in this case)
|
||||
* "rgmii-rxid" (RGMII with internal RX delay provided by the PHY, the MAC
|
||||
should not add an RX delay in this case)
|
||||
* "rgmii-txid" (RGMII with internal TX delay provided by the PHY, the MAC
|
||||
should not add an TX delay in this case)
|
||||
* "rtbi"
|
||||
* "smii"
|
||||
* "xgmii"
|
||||
* "trgmii"
|
||||
- phy-connection-type: the same as "phy-mode" property but described in ePAPR;
|
||||
- phy-handle: phandle, specifies a reference to a node representing a PHY
|
||||
device; this property is described in ePAPR and so preferred;
|
||||
|
||||
@@ -62,10 +62,13 @@ nf_conntrack_generic_timeout - INTEGER (seconds)
|
||||
protocols.
|
||||
|
||||
nf_conntrack_helper - BOOLEAN
|
||||
0 - disabled
|
||||
not 0 - enabled (default)
|
||||
0 - disabled (default)
|
||||
not 0 - enabled
|
||||
|
||||
Enable automatic conntrack helper assignment.
|
||||
If disabled it is required to set up iptables rules to assign
|
||||
helpers to connections. See the CT target description in the
|
||||
iptables-extensions(8) man page for further information.
|
||||
|
||||
nf_conntrack_icmp_timeout - INTEGER (seconds)
|
||||
default 30
|
||||
|
||||
@@ -43,11 +43,22 @@ struct __packed pucan_command {
|
||||
u16 args[3];
|
||||
};
|
||||
|
||||
#define PUCAN_TSLOW_BRP_BITS 10
|
||||
#define PUCAN_TSLOW_TSGEG1_BITS 8
|
||||
#define PUCAN_TSLOW_TSGEG2_BITS 7
|
||||
#define PUCAN_TSLOW_SJW_BITS 7
|
||||
|
||||
#define PUCAN_TSLOW_BRP_MASK ((1 << PUCAN_TSLOW_BRP_BITS) - 1)
|
||||
#define PUCAN_TSLOW_TSEG1_MASK ((1 << PUCAN_TSLOW_TSGEG1_BITS) - 1)
|
||||
#define PUCAN_TSLOW_TSEG2_MASK ((1 << PUCAN_TSLOW_TSGEG2_BITS) - 1)
|
||||
#define PUCAN_TSLOW_SJW_MASK ((1 << PUCAN_TSLOW_SJW_BITS) - 1)
|
||||
|
||||
/* uCAN TIMING_SLOW command fields */
|
||||
#define PUCAN_TSLOW_SJW_T(s, t) (((s) & 0xf) | ((!!(t)) << 7))
|
||||
#define PUCAN_TSLOW_TSEG2(t) ((t) & 0xf)
|
||||
#define PUCAN_TSLOW_TSEG1(t) ((t) & 0x3f)
|
||||
#define PUCAN_TSLOW_BRP(b) ((b) & 0x3ff)
|
||||
#define PUCAN_TSLOW_SJW_T(s, t) (((s) & PUCAN_TSLOW_SJW_MASK) | \
|
||||
((!!(t)) << 7))
|
||||
#define PUCAN_TSLOW_TSEG2(t) ((t) & PUCAN_TSLOW_TSEG2_MASK)
|
||||
#define PUCAN_TSLOW_TSEG1(t) ((t) & PUCAN_TSLOW_TSEG1_MASK)
|
||||
#define PUCAN_TSLOW_BRP(b) ((b) & PUCAN_TSLOW_BRP_MASK)
|
||||
|
||||
struct __packed pucan_timing_slow {
|
||||
__le16 opcode_channel;
|
||||
@@ -60,11 +71,21 @@ struct __packed pucan_timing_slow {
|
||||
__le16 brp; /* BaudRate Prescaler */
|
||||
};
|
||||
|
||||
#define PUCAN_TFAST_BRP_BITS 10
|
||||
#define PUCAN_TFAST_TSGEG1_BITS 5
|
||||
#define PUCAN_TFAST_TSGEG2_BITS 4
|
||||
#define PUCAN_TFAST_SJW_BITS 4
|
||||
|
||||
#define PUCAN_TFAST_BRP_MASK ((1 << PUCAN_TFAST_BRP_BITS) - 1)
|
||||
#define PUCAN_TFAST_TSEG1_MASK ((1 << PUCAN_TFAST_TSGEG1_BITS) - 1)
|
||||
#define PUCAN_TFAST_TSEG2_MASK ((1 << PUCAN_TFAST_TSGEG2_BITS) - 1)
|
||||
#define PUCAN_TFAST_SJW_MASK ((1 << PUCAN_TFAST_SJW_BITS) - 1)
|
||||
|
||||
/* uCAN TIMING_FAST command fields */
|
||||
#define PUCAN_TFAST_SJW(s) ((s) & 0x3)
|
||||
#define PUCAN_TFAST_TSEG2(t) ((t) & 0x7)
|
||||
#define PUCAN_TFAST_TSEG1(t) ((t) & 0xf)
|
||||
#define PUCAN_TFAST_BRP(b) ((b) & 0x3ff)
|
||||
#define PUCAN_TFAST_SJW(s) ((s) & PUCAN_TFAST_SJW_MASK)
|
||||
#define PUCAN_TFAST_TSEG2(t) ((t) & PUCAN_TFAST_TSEG2_MASK)
|
||||
#define PUCAN_TFAST_TSEG1(t) ((t) & PUCAN_TFAST_TSEG1_MASK)
|
||||
#define PUCAN_TFAST_BRP(b) ((b) & PUCAN_TFAST_BRP_MASK)
|
||||
|
||||
struct __packed pucan_timing_fast {
|
||||
__le16 opcode_channel;
|
||||
|
||||
@@ -39,6 +39,7 @@ static struct usb_device_id peak_usb_table[] = {
|
||||
{USB_DEVICE(PCAN_USB_VENDOR_ID, PCAN_USBPRO_PRODUCT_ID)},
|
||||
{USB_DEVICE(PCAN_USB_VENDOR_ID, PCAN_USBFD_PRODUCT_ID)},
|
||||
{USB_DEVICE(PCAN_USB_VENDOR_ID, PCAN_USBPROFD_PRODUCT_ID)},
|
||||
{USB_DEVICE(PCAN_USB_VENDOR_ID, PCAN_USBX6_PRODUCT_ID)},
|
||||
{} /* Terminating entry */
|
||||
};
|
||||
|
||||
@@ -50,6 +51,7 @@ static const struct peak_usb_adapter *const peak_usb_adapters_list[] = {
|
||||
&pcan_usb_pro,
|
||||
&pcan_usb_fd,
|
||||
&pcan_usb_pro_fd,
|
||||
&pcan_usb_x6,
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#define PCAN_USBPRO_PRODUCT_ID 0x000d
|
||||
#define PCAN_USBPROFD_PRODUCT_ID 0x0011
|
||||
#define PCAN_USBFD_PRODUCT_ID 0x0012
|
||||
#define PCAN_USBX6_PRODUCT_ID 0x0014
|
||||
|
||||
#define PCAN_USB_DRIVER_NAME "peak_usb"
|
||||
|
||||
@@ -90,6 +91,7 @@ extern const struct peak_usb_adapter pcan_usb;
|
||||
extern const struct peak_usb_adapter pcan_usb_pro;
|
||||
extern const struct peak_usb_adapter pcan_usb_fd;
|
||||
extern const struct peak_usb_adapter pcan_usb_pro_fd;
|
||||
extern const struct peak_usb_adapter pcan_usb_x6;
|
||||
|
||||
struct peak_time_ref {
|
||||
struct timeval tv_host_0, tv_host;
|
||||
|
||||
@@ -993,24 +993,24 @@ static void pcan_usb_fd_free(struct peak_usb_device *dev)
|
||||
static const struct can_bittiming_const pcan_usb_fd_const = {
|
||||
.name = "pcan_usb_fd",
|
||||
.tseg1_min = 1,
|
||||
.tseg1_max = 64,
|
||||
.tseg1_max = (1 << PUCAN_TSLOW_TSGEG1_BITS),
|
||||
.tseg2_min = 1,
|
||||
.tseg2_max = 16,
|
||||
.sjw_max = 16,
|
||||
.tseg2_max = (1 << PUCAN_TSLOW_TSGEG2_BITS),
|
||||
.sjw_max = (1 << PUCAN_TSLOW_SJW_BITS),
|
||||
.brp_min = 1,
|
||||
.brp_max = 1024,
|
||||
.brp_max = (1 << PUCAN_TSLOW_BRP_BITS),
|
||||
.brp_inc = 1,
|
||||
};
|
||||
|
||||
static const struct can_bittiming_const pcan_usb_fd_data_const = {
|
||||
.name = "pcan_usb_fd",
|
||||
.tseg1_min = 1,
|
||||
.tseg1_max = 16,
|
||||
.tseg1_max = (1 << PUCAN_TFAST_TSGEG1_BITS),
|
||||
.tseg2_min = 1,
|
||||
.tseg2_max = 8,
|
||||
.sjw_max = 4,
|
||||
.tseg2_max = (1 << PUCAN_TFAST_TSGEG2_BITS),
|
||||
.sjw_max = (1 << PUCAN_TFAST_SJW_BITS),
|
||||
.brp_min = 1,
|
||||
.brp_max = 1024,
|
||||
.brp_max = (1 << PUCAN_TFAST_BRP_BITS),
|
||||
.brp_inc = 1,
|
||||
};
|
||||
|
||||
@@ -1065,24 +1065,24 @@ const struct peak_usb_adapter pcan_usb_fd = {
|
||||
static const struct can_bittiming_const pcan_usb_pro_fd_const = {
|
||||
.name = "pcan_usb_pro_fd",
|
||||
.tseg1_min = 1,
|
||||
.tseg1_max = 64,
|
||||
.tseg1_max = (1 << PUCAN_TSLOW_TSGEG1_BITS),
|
||||
.tseg2_min = 1,
|
||||
.tseg2_max = 16,
|
||||
.sjw_max = 16,
|
||||
.tseg2_max = (1 << PUCAN_TSLOW_TSGEG2_BITS),
|
||||
.sjw_max = (1 << PUCAN_TSLOW_SJW_BITS),
|
||||
.brp_min = 1,
|
||||
.brp_max = 1024,
|
||||
.brp_max = (1 << PUCAN_TSLOW_BRP_BITS),
|
||||
.brp_inc = 1,
|
||||
};
|
||||
|
||||
static const struct can_bittiming_const pcan_usb_pro_fd_data_const = {
|
||||
.name = "pcan_usb_pro_fd",
|
||||
.tseg1_min = 1,
|
||||
.tseg1_max = 16,
|
||||
.tseg1_max = (1 << PUCAN_TFAST_TSGEG1_BITS),
|
||||
.tseg2_min = 1,
|
||||
.tseg2_max = 8,
|
||||
.sjw_max = 4,
|
||||
.tseg2_max = (1 << PUCAN_TFAST_TSGEG2_BITS),
|
||||
.sjw_max = (1 << PUCAN_TFAST_SJW_BITS),
|
||||
.brp_min = 1,
|
||||
.brp_max = 1024,
|
||||
.brp_max = (1 << PUCAN_TFAST_BRP_BITS),
|
||||
.brp_inc = 1,
|
||||
};
|
||||
|
||||
@@ -1132,3 +1132,75 @@ const struct peak_usb_adapter pcan_usb_pro_fd = {
|
||||
|
||||
.do_get_berr_counter = pcan_usb_fd_get_berr_counter,
|
||||
};
|
||||
|
||||
/* describes the PCAN-USB X6 adapter */
|
||||
static const struct can_bittiming_const pcan_usb_x6_const = {
|
||||
.name = "pcan_usb_x6",
|
||||
.tseg1_min = 1,
|
||||
.tseg1_max = (1 << PUCAN_TSLOW_TSGEG1_BITS),
|
||||
.tseg2_min = 1,
|
||||
.tseg2_max = (1 << PUCAN_TSLOW_TSGEG2_BITS),
|
||||
.sjw_max = (1 << PUCAN_TSLOW_SJW_BITS),
|
||||
.brp_min = 1,
|
||||
.brp_max = (1 << PUCAN_TSLOW_BRP_BITS),
|
||||
.brp_inc = 1,
|
||||
};
|
||||
|
||||
static const struct can_bittiming_const pcan_usb_x6_data_const = {
|
||||
.name = "pcan_usb_x6",
|
||||
.tseg1_min = 1,
|
||||
.tseg1_max = (1 << PUCAN_TFAST_TSGEG1_BITS),
|
||||
.tseg2_min = 1,
|
||||
.tseg2_max = (1 << PUCAN_TFAST_TSGEG2_BITS),
|
||||
.sjw_max = (1 << PUCAN_TFAST_SJW_BITS),
|
||||
.brp_min = 1,
|
||||
.brp_max = (1 << PUCAN_TFAST_BRP_BITS),
|
||||
.brp_inc = 1,
|
||||
};
|
||||
|
||||
const struct peak_usb_adapter pcan_usb_x6 = {
|
||||
.name = "PCAN-USB X6",
|
||||
.device_id = PCAN_USBX6_PRODUCT_ID,
|
||||
.ctrl_count = PCAN_USBPROFD_CHANNEL_COUNT,
|
||||
.ctrlmode_supported = CAN_CTRLMODE_FD |
|
||||
CAN_CTRLMODE_3_SAMPLES | CAN_CTRLMODE_LISTENONLY,
|
||||
.clock = {
|
||||
.freq = PCAN_UFD_CRYSTAL_HZ,
|
||||
},
|
||||
.bittiming_const = &pcan_usb_x6_const,
|
||||
.data_bittiming_const = &pcan_usb_x6_data_const,
|
||||
|
||||
/* size of device private data */
|
||||
.sizeof_dev_private = sizeof(struct pcan_usb_fd_device),
|
||||
|
||||
/* timestamps usage */
|
||||
.ts_used_bits = 32,
|
||||
.ts_period = 1000000, /* calibration period in ts. */
|
||||
.us_per_ts_scale = 1, /* us = (ts * scale) >> shift */
|
||||
.us_per_ts_shift = 0,
|
||||
|
||||
/* give here messages in/out endpoints */
|
||||
.ep_msg_in = PCAN_USBPRO_EP_MSGIN,
|
||||
.ep_msg_out = {PCAN_USBPRO_EP_MSGOUT_0, PCAN_USBPRO_EP_MSGOUT_1},
|
||||
|
||||
/* size of rx/tx usb buffers */
|
||||
.rx_buffer_size = PCAN_UFD_RX_BUFFER_SIZE,
|
||||
.tx_buffer_size = PCAN_UFD_TX_BUFFER_SIZE,
|
||||
|
||||
/* device callbacks */
|
||||
.intf_probe = pcan_usb_pro_probe, /* same as PCAN-USB Pro */
|
||||
.dev_init = pcan_usb_fd_init,
|
||||
|
||||
.dev_exit = pcan_usb_fd_exit,
|
||||
.dev_free = pcan_usb_fd_free,
|
||||
.dev_set_bus = pcan_usb_fd_set_bus,
|
||||
.dev_set_bittiming = pcan_usb_fd_set_bittiming_slow,
|
||||
.dev_set_data_bittiming = pcan_usb_fd_set_bittiming_fast,
|
||||
.dev_decode_buf = pcan_usb_fd_decode_buf,
|
||||
.dev_start = pcan_usb_fd_start,
|
||||
.dev_stop = pcan_usb_fd_stop,
|
||||
.dev_restart_async = pcan_usb_fd_restart_async,
|
||||
.dev_encode_msg = pcan_usb_fd_encode_msg,
|
||||
|
||||
.do_get_berr_counter = pcan_usb_fd_get_berr_counter,
|
||||
};
|
||||
@@ -400,12 +400,6 @@ static int tse_rx(struct altera_tse_private *priv, int limit)
|
||||
|
||||
skb_put(skb, pktlength);
|
||||
|
||||
/* make cache consistent with receive packet buffer */
|
||||
dma_sync_single_for_cpu(priv->device,
|
||||
priv->rx_ring[entry].dma_addr,
|
||||
priv->rx_ring[entry].len,
|
||||
DMA_FROM_DEVICE);
|
||||
|
||||
dma_unmap_single(priv->device, priv->rx_ring[entry].dma_addr,
|
||||
priv->rx_ring[entry].len, DMA_FROM_DEVICE);
|
||||
|
||||
@@ -469,7 +463,6 @@ static int tse_tx_complete(struct altera_tse_private *priv)
|
||||
|
||||
if (unlikely(netif_queue_stopped(priv->dev) &&
|
||||
tse_tx_avail(priv) > TSE_TX_THRESH(priv))) {
|
||||
netif_tx_lock(priv->dev);
|
||||
if (netif_queue_stopped(priv->dev) &&
|
||||
tse_tx_avail(priv) > TSE_TX_THRESH(priv)) {
|
||||
if (netif_msg_tx_done(priv))
|
||||
@@ -477,7 +470,6 @@ static int tse_tx_complete(struct altera_tse_private *priv)
|
||||
__func__);
|
||||
netif_wake_queue(priv->dev);
|
||||
}
|
||||
netif_tx_unlock(priv->dev);
|
||||
}
|
||||
|
||||
spin_unlock(&priv->tx_lock);
|
||||
@@ -592,10 +584,6 @@ static int tse_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
buffer->dma_addr = dma_addr;
|
||||
buffer->len = nopaged_len;
|
||||
|
||||
/* Push data out of the cache hierarchy into main memory */
|
||||
dma_sync_single_for_device(priv->device, buffer->dma_addr,
|
||||
buffer->len, DMA_TO_DEVICE);
|
||||
|
||||
priv->dmaops->tx_buffer(priv, buffer);
|
||||
|
||||
skb_tx_timestamp(skb);
|
||||
@@ -819,6 +807,8 @@ static int init_phy(struct net_device *dev)
|
||||
|
||||
if (!phydev) {
|
||||
netdev_err(dev, "Could not find the PHY\n");
|
||||
if (fixed_link)
|
||||
of_phy_deregister_fixed_link(priv->device->of_node);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
@@ -1545,10 +1535,15 @@ err_free_netdev:
|
||||
static int altera_tse_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct net_device *ndev = platform_get_drvdata(pdev);
|
||||
struct altera_tse_private *priv = netdev_priv(ndev);
|
||||
|
||||
if (ndev->phydev)
|
||||
if (ndev->phydev) {
|
||||
phy_disconnect(ndev->phydev);
|
||||
|
||||
if (of_phy_is_fixed_link(priv->device->of_node))
|
||||
of_phy_deregister_fixed_link(priv->device->of_node);
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
altera_tse_mdio_destroy(ndev);
|
||||
unregister_netdev(ndev);
|
||||
|
||||
@@ -829,7 +829,7 @@ static int xgbe_remove(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int xgbe_suspend(struct device *dev)
|
||||
{
|
||||
struct net_device *netdev = dev_get_drvdata(dev);
|
||||
@@ -874,7 +874,7 @@ static int xgbe_resume(struct device *dev)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_PM */
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
#ifdef CONFIG_ACPI
|
||||
static const struct acpi_device_id xgbe_acpi_match[] = {
|
||||
|
||||
@@ -1466,12 +1466,12 @@ static int nb8800_probe(struct platform_device *pdev)
|
||||
|
||||
ret = nb8800_hw_init(dev);
|
||||
if (ret)
|
||||
goto err_free_bus;
|
||||
goto err_deregister_fixed_link;
|
||||
|
||||
if (ops && ops->init) {
|
||||
ret = ops->init(dev);
|
||||
if (ret)
|
||||
goto err_free_bus;
|
||||
goto err_deregister_fixed_link;
|
||||
}
|
||||
|
||||
dev->netdev_ops = &nb8800_netdev_ops;
|
||||
@@ -1504,6 +1504,9 @@ static int nb8800_probe(struct platform_device *pdev)
|
||||
|
||||
err_free_dma:
|
||||
nb8800_dma_free(dev);
|
||||
err_deregister_fixed_link:
|
||||
if (of_phy_is_fixed_link(pdev->dev.of_node))
|
||||
of_phy_deregister_fixed_link(pdev->dev.of_node);
|
||||
err_free_bus:
|
||||
of_node_put(priv->phy_node);
|
||||
mdiobus_unregister(bus);
|
||||
@@ -1521,6 +1524,8 @@ static int nb8800_remove(struct platform_device *pdev)
|
||||
struct nb8800_priv *priv = netdev_priv(ndev);
|
||||
|
||||
unregister_netdev(ndev);
|
||||
if (of_phy_is_fixed_link(pdev->dev.of_node))
|
||||
of_phy_deregister_fixed_link(pdev->dev.of_node);
|
||||
of_node_put(priv->phy_node);
|
||||
|
||||
mdiobus_unregister(priv->mii_bus);
|
||||
|
||||
@@ -1755,13 +1755,13 @@ static int bcm_sysport_probe(struct platform_device *pdev)
|
||||
if (priv->irq0 <= 0 || priv->irq1 <= 0) {
|
||||
dev_err(&pdev->dev, "invalid interrupts\n");
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
goto err_free_netdev;
|
||||
}
|
||||
|
||||
priv->base = devm_ioremap_resource(&pdev->dev, r);
|
||||
if (IS_ERR(priv->base)) {
|
||||
ret = PTR_ERR(priv->base);
|
||||
goto err;
|
||||
goto err_free_netdev;
|
||||
}
|
||||
|
||||
priv->netdev = dev;
|
||||
@@ -1779,7 +1779,7 @@ static int bcm_sysport_probe(struct platform_device *pdev)
|
||||
ret = of_phy_register_fixed_link(dn);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to register fixed PHY\n");
|
||||
goto err;
|
||||
goto err_free_netdev;
|
||||
}
|
||||
|
||||
priv->phy_dn = dn;
|
||||
@@ -1821,7 +1821,7 @@ static int bcm_sysport_probe(struct platform_device *pdev)
|
||||
ret = register_netdev(dev);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to register net_device\n");
|
||||
goto err;
|
||||
goto err_deregister_fixed_link;
|
||||
}
|
||||
|
||||
priv->rev = topctrl_readl(priv, REV_CNTL) & REV_MASK;
|
||||
@@ -1832,7 +1832,11 @@ static int bcm_sysport_probe(struct platform_device *pdev)
|
||||
priv->base, priv->irq0, priv->irq1, txq, rxq);
|
||||
|
||||
return 0;
|
||||
err:
|
||||
|
||||
err_deregister_fixed_link:
|
||||
if (of_phy_is_fixed_link(dn))
|
||||
of_phy_deregister_fixed_link(dn);
|
||||
err_free_netdev:
|
||||
free_netdev(dev);
|
||||
return ret;
|
||||
}
|
||||
@@ -1840,11 +1844,14 @@ err:
|
||||
static int bcm_sysport_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct net_device *dev = dev_get_drvdata(&pdev->dev);
|
||||
struct device_node *dn = pdev->dev.of_node;
|
||||
|
||||
/* Not much to do, ndo_close has been called
|
||||
* and we use managed allocations
|
||||
*/
|
||||
unregister_netdev(dev);
|
||||
if (of_phy_is_fixed_link(dn))
|
||||
of_phy_deregister_fixed_link(dn);
|
||||
free_netdev(dev);
|
||||
dev_set_drvdata(&pdev->dev, NULL);
|
||||
|
||||
|
||||
@@ -1172,6 +1172,7 @@ static unsigned int __bcmgenet_tx_reclaim(struct net_device *dev,
|
||||
struct bcmgenet_tx_ring *ring)
|
||||
{
|
||||
struct bcmgenet_priv *priv = netdev_priv(dev);
|
||||
struct device *kdev = &priv->pdev->dev;
|
||||
struct enet_cb *tx_cb_ptr;
|
||||
struct netdev_queue *txq;
|
||||
unsigned int pkts_compl = 0;
|
||||
@@ -1199,13 +1200,13 @@ static unsigned int __bcmgenet_tx_reclaim(struct net_device *dev,
|
||||
if (tx_cb_ptr->skb) {
|
||||
pkts_compl++;
|
||||
bytes_compl += GENET_CB(tx_cb_ptr->skb)->bytes_sent;
|
||||
dma_unmap_single(&dev->dev,
|
||||
dma_unmap_single(kdev,
|
||||
dma_unmap_addr(tx_cb_ptr, dma_addr),
|
||||
dma_unmap_len(tx_cb_ptr, dma_len),
|
||||
DMA_TO_DEVICE);
|
||||
bcmgenet_free_cb(tx_cb_ptr);
|
||||
} else if (dma_unmap_addr(tx_cb_ptr, dma_addr)) {
|
||||
dma_unmap_page(&dev->dev,
|
||||
dma_unmap_page(kdev,
|
||||
dma_unmap_addr(tx_cb_ptr, dma_addr),
|
||||
dma_unmap_len(tx_cb_ptr, dma_len),
|
||||
DMA_TO_DEVICE);
|
||||
@@ -1775,6 +1776,7 @@ static int bcmgenet_alloc_rx_buffers(struct bcmgenet_priv *priv,
|
||||
|
||||
static void bcmgenet_free_rx_buffers(struct bcmgenet_priv *priv)
|
||||
{
|
||||
struct device *kdev = &priv->pdev->dev;
|
||||
struct enet_cb *cb;
|
||||
int i;
|
||||
|
||||
@@ -1782,7 +1784,7 @@ static void bcmgenet_free_rx_buffers(struct bcmgenet_priv *priv)
|
||||
cb = &priv->rx_cbs[i];
|
||||
|
||||
if (dma_unmap_addr(cb, dma_addr)) {
|
||||
dma_unmap_single(&priv->dev->dev,
|
||||
dma_unmap_single(kdev,
|
||||
dma_unmap_addr(cb, dma_addr),
|
||||
priv->rx_buf_len, DMA_FROM_DEVICE);
|
||||
dma_unmap_addr_set(cb, dma_addr, 0);
|
||||
|
||||
@@ -542,8 +542,10 @@ static int bcmgenet_mii_of_init(struct bcmgenet_priv *priv)
|
||||
/* Make sure we initialize MoCA PHYs with a link down */
|
||||
if (phy_mode == PHY_INTERFACE_MODE_MOCA) {
|
||||
phydev = of_phy_find_device(dn);
|
||||
if (phydev)
|
||||
if (phydev) {
|
||||
phydev->link = 0;
|
||||
put_device(&phydev->mdio.dev);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -625,6 +627,7 @@ static int bcmgenet_mii_bus_init(struct bcmgenet_priv *priv)
|
||||
int bcmgenet_mii_init(struct net_device *dev)
|
||||
{
|
||||
struct bcmgenet_priv *priv = netdev_priv(dev);
|
||||
struct device_node *dn = priv->pdev->dev.of_node;
|
||||
int ret;
|
||||
|
||||
ret = bcmgenet_mii_alloc(priv);
|
||||
@@ -638,6 +641,8 @@ int bcmgenet_mii_init(struct net_device *dev)
|
||||
return 0;
|
||||
|
||||
out:
|
||||
if (of_phy_is_fixed_link(dn))
|
||||
of_phy_deregister_fixed_link(dn);
|
||||
of_node_put(priv->phy_dn);
|
||||
mdiobus_unregister(priv->mii_bus);
|
||||
mdiobus_free(priv->mii_bus);
|
||||
@@ -647,7 +652,10 @@ out:
|
||||
void bcmgenet_mii_exit(struct net_device *dev)
|
||||
{
|
||||
struct bcmgenet_priv *priv = netdev_priv(dev);
|
||||
struct device_node *dn = priv->pdev->dev.of_node;
|
||||
|
||||
if (of_phy_is_fixed_link(dn))
|
||||
of_phy_deregister_fixed_link(dn);
|
||||
of_node_put(priv->phy_dn);
|
||||
mdiobus_unregister(priv->mii_bus);
|
||||
mdiobus_free(priv->mii_bus);
|
||||
|
||||
@@ -975,6 +975,7 @@ static inline void macb_init_rx_ring(struct macb *bp)
|
||||
addr += bp->rx_buffer_size;
|
||||
}
|
||||
bp->rx_ring[RX_RING_SIZE - 1].addr |= MACB_BIT(RX_WRAP);
|
||||
bp->rx_tail = 0;
|
||||
}
|
||||
|
||||
static int macb_rx(struct macb *bp, int budget)
|
||||
@@ -1156,6 +1157,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
|
||||
if (status & MACB_BIT(RXUBR)) {
|
||||
ctrl = macb_readl(bp, NCR);
|
||||
macb_writel(bp, NCR, ctrl & ~MACB_BIT(RE));
|
||||
wmb();
|
||||
macb_writel(bp, NCR, ctrl | MACB_BIT(RE));
|
||||
|
||||
if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
|
||||
@@ -1616,8 +1618,6 @@ static void macb_init_rings(struct macb *bp)
|
||||
bp->queues[0].tx_head = 0;
|
||||
bp->queues[0].tx_tail = 0;
|
||||
bp->queues[0].tx_ring[TX_RING_SIZE - 1].ctrl |= MACB_BIT(TX_WRAP);
|
||||
|
||||
bp->rx_tail = 0;
|
||||
}
|
||||
|
||||
static void macb_reset_hw(struct macb *bp)
|
||||
@@ -2770,6 +2770,7 @@ static irqreturn_t at91ether_interrupt(int irq, void *dev_id)
|
||||
if (intstatus & MACB_BIT(RXUBR)) {
|
||||
ctl = macb_readl(lp, NCR);
|
||||
macb_writel(lp, NCR, ctl & ~MACB_BIT(RE));
|
||||
wmb();
|
||||
macb_writel(lp, NCR, ctl | MACB_BIT(RE));
|
||||
}
|
||||
|
||||
|
||||
@@ -168,6 +168,7 @@ CH_PCI_DEVICE_ID_TABLE_DEFINE_BEGIN
|
||||
CH_PCI_ID_TABLE_FENTRY(0x509a), /* Custom T520-CR */
|
||||
CH_PCI_ID_TABLE_FENTRY(0x509b), /* Custom T540-CR LOM */
|
||||
CH_PCI_ID_TABLE_FENTRY(0x509c), /* Custom T520-CR*/
|
||||
CH_PCI_ID_TABLE_FENTRY(0x509d), /* Custom T540-CR*/
|
||||
|
||||
/* T6 adapters:
|
||||
*/
|
||||
|
||||
@@ -574,6 +574,8 @@ struct fec_enet_private {
|
||||
unsigned int reload_period;
|
||||
int pps_enable;
|
||||
unsigned int next_counter;
|
||||
|
||||
u64 ethtool_stats[0];
|
||||
};
|
||||
|
||||
void fec_ptp_init(struct platform_device *pdev);
|
||||
|
||||
@@ -2313,14 +2313,24 @@ static const struct fec_stat {
|
||||
{ "IEEE_rx_octets_ok", IEEE_R_OCTETS_OK },
|
||||
};
|
||||
|
||||
static void fec_enet_get_ethtool_stats(struct net_device *dev,
|
||||
struct ethtool_stats *stats, u64 *data)
|
||||
static void fec_enet_update_ethtool_stats(struct net_device *dev)
|
||||
{
|
||||
struct fec_enet_private *fep = netdev_priv(dev);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(fec_stats); i++)
|
||||
data[i] = readl(fep->hwp + fec_stats[i].offset);
|
||||
fep->ethtool_stats[i] = readl(fep->hwp + fec_stats[i].offset);
|
||||
}
|
||||
|
||||
static void fec_enet_get_ethtool_stats(struct net_device *dev,
|
||||
struct ethtool_stats *stats, u64 *data)
|
||||
{
|
||||
struct fec_enet_private *fep = netdev_priv(dev);
|
||||
|
||||
if (netif_running(dev))
|
||||
fec_enet_update_ethtool_stats(dev);
|
||||
|
||||
memcpy(data, fep->ethtool_stats, ARRAY_SIZE(fec_stats) * sizeof(u64));
|
||||
}
|
||||
|
||||
static void fec_enet_get_strings(struct net_device *netdev,
|
||||
@@ -2874,6 +2884,8 @@ fec_enet_close(struct net_device *ndev)
|
||||
if (fep->quirks & FEC_QUIRK_ERR006687)
|
||||
imx6q_cpuidle_fec_irqs_unused();
|
||||
|
||||
fec_enet_update_ethtool_stats(ndev);
|
||||
|
||||
fec_enet_clk_enable(ndev, false);
|
||||
pinctrl_pm_select_sleep_state(&fep->pdev->dev);
|
||||
pm_runtime_mark_last_busy(&fep->pdev->dev);
|
||||
@@ -3180,6 +3192,8 @@ static int fec_enet_init(struct net_device *ndev)
|
||||
|
||||
fec_restart(ndev);
|
||||
|
||||
fec_enet_update_ethtool_stats(ndev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3278,7 +3292,8 @@ fec_probe(struct platform_device *pdev)
|
||||
fec_enet_get_queue_num(pdev, &num_tx_qs, &num_rx_qs);
|
||||
|
||||
/* Init network device */
|
||||
ndev = alloc_etherdev_mqs(sizeof(struct fec_enet_private),
|
||||
ndev = alloc_etherdev_mqs(sizeof(struct fec_enet_private) +
|
||||
ARRAY_SIZE(fec_stats) * sizeof(u64),
|
||||
num_tx_qs, num_rx_qs);
|
||||
if (!ndev)
|
||||
return -ENOMEM;
|
||||
@@ -3475,6 +3490,8 @@ failed_regulator:
|
||||
failed_clk_ipg:
|
||||
fec_enet_clk_enable(ndev, false);
|
||||
failed_clk:
|
||||
if (of_phy_is_fixed_link(np))
|
||||
of_phy_deregister_fixed_link(np);
|
||||
failed_phy:
|
||||
of_node_put(phy_node);
|
||||
failed_ioremap:
|
||||
@@ -3488,6 +3505,7 @@ fec_drv_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct net_device *ndev = platform_get_drvdata(pdev);
|
||||
struct fec_enet_private *fep = netdev_priv(ndev);
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
|
||||
cancel_work_sync(&fep->tx_timeout_work);
|
||||
fec_ptp_stop(pdev);
|
||||
@@ -3495,6 +3513,8 @@ fec_drv_remove(struct platform_device *pdev)
|
||||
fec_enet_mii_remove(fep);
|
||||
if (fep->reg_phy)
|
||||
regulator_disable(fep->reg_phy);
|
||||
if (of_phy_is_fixed_link(np))
|
||||
of_phy_deregister_fixed_link(np);
|
||||
of_node_put(fep->phy_node);
|
||||
free_netdev(ndev);
|
||||
|
||||
|
||||
@@ -1107,6 +1107,9 @@ int memac_free(struct fman_mac *memac)
|
||||
{
|
||||
free_init_resources(memac);
|
||||
|
||||
if (memac->pcsphy)
|
||||
put_device(&memac->pcsphy->mdio.dev);
|
||||
|
||||
kfree(memac->memac_drv_param);
|
||||
kfree(memac);
|
||||
|
||||
|
||||
@@ -892,6 +892,8 @@ static int mac_probe(struct platform_device *_of_dev)
|
||||
priv->fixed_link->duplex = phy->duplex;
|
||||
priv->fixed_link->pause = phy->pause;
|
||||
priv->fixed_link->asym_pause = phy->asym_pause;
|
||||
|
||||
put_device(&phy->mdio.dev);
|
||||
}
|
||||
|
||||
err = mac_dev->init(mac_dev);
|
||||
|
||||
@@ -980,7 +980,7 @@ static int fs_enet_probe(struct platform_device *ofdev)
|
||||
err = clk_prepare_enable(clk);
|
||||
if (err) {
|
||||
ret = err;
|
||||
goto out_free_fpi;
|
||||
goto out_deregister_fixed_link;
|
||||
}
|
||||
fpi->clk_per = clk;
|
||||
}
|
||||
@@ -1061,6 +1061,9 @@ out_put:
|
||||
of_node_put(fpi->phy_node);
|
||||
if (fpi->clk_per)
|
||||
clk_disable_unprepare(fpi->clk_per);
|
||||
out_deregister_fixed_link:
|
||||
if (of_phy_is_fixed_link(ofdev->dev.of_node))
|
||||
of_phy_deregister_fixed_link(ofdev->dev.of_node);
|
||||
out_free_fpi:
|
||||
kfree(fpi);
|
||||
return ret;
|
||||
@@ -1079,6 +1082,8 @@ static int fs_enet_remove(struct platform_device *ofdev)
|
||||
of_node_put(fep->fpi->phy_node);
|
||||
if (fep->fpi->clk_per)
|
||||
clk_disable_unprepare(fep->fpi->clk_per);
|
||||
if (of_phy_is_fixed_link(ofdev->dev.of_node))
|
||||
of_phy_deregister_fixed_link(ofdev->dev.of_node);
|
||||
free_netdev(ndev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1312,6 +1312,7 @@ static void gfar_init_addr_hash_table(struct gfar_private *priv)
|
||||
*/
|
||||
static int gfar_probe(struct platform_device *ofdev)
|
||||
{
|
||||
struct device_node *np = ofdev->dev.of_node;
|
||||
struct net_device *dev = NULL;
|
||||
struct gfar_private *priv = NULL;
|
||||
int err = 0, i;
|
||||
@@ -1462,6 +1463,8 @@ static int gfar_probe(struct platform_device *ofdev)
|
||||
return 0;
|
||||
|
||||
register_fail:
|
||||
if (of_phy_is_fixed_link(np))
|
||||
of_phy_deregister_fixed_link(np);
|
||||
unmap_group_regs(priv);
|
||||
gfar_free_rx_queues(priv);
|
||||
gfar_free_tx_queues(priv);
|
||||
@@ -1474,11 +1477,16 @@ register_fail:
|
||||
static int gfar_remove(struct platform_device *ofdev)
|
||||
{
|
||||
struct gfar_private *priv = platform_get_drvdata(ofdev);
|
||||
struct device_node *np = ofdev->dev.of_node;
|
||||
|
||||
of_node_put(priv->phy_node);
|
||||
of_node_put(priv->tbi_node);
|
||||
|
||||
unregister_netdev(priv->ndev);
|
||||
|
||||
if (of_phy_is_fixed_link(np))
|
||||
of_phy_deregister_fixed_link(np);
|
||||
|
||||
unmap_group_regs(priv);
|
||||
gfar_free_rx_queues(priv);
|
||||
gfar_free_tx_queues(priv);
|
||||
|
||||
Loaded 20 of 121 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user