提交 519d118d 编写于 作者: C coolsnowwolf

kernel update

上级 daac324b
......@@ -3,14 +3,14 @@
LINUX_RELEASE?=1
LINUX_VERSION-3.18 = .71
LINUX_VERSION-4.4 = .111
LINUX_VERSION-4.9 = .76
LINUX_VERSION-4.14 = .13
LINUX_VERSION-4.4 = .112
LINUX_VERSION-4.9 = .77
LINUX_VERSION-4.14 = .14
LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
LINUX_KERNEL_HASH-4.4.111 = a201282e8eaf62b4f51edb2241e98ff805fe2d1b04a72a2328c5a6e2d77ec008
LINUX_KERNEL_HASH-4.9.76 = b82b94332cffaaeade74495264c989dafb96d4748503f87a5b7c436f5de887de
LINUX_KERNEL_HASH-4.14.13 = 4ab46d1b5a0f8ef83b80760f89ae4f5c88431b19b3cf79ffa0c66d6b33e45772
LINUX_KERNEL_HASH-4.4.112 = 544b42cbeed022896115c76a18fc97b4507d5b41d7ac0ce1dce9afd6ffd11ecd
LINUX_KERNEL_HASH-4.9.77 = 7c29bc3fb96f1e23d98f664e786dddd53a1599f56431b9b7fdfba402a4b3705c
LINUX_KERNEL_HASH-4.14.14 = 8b96362eb55ae152555980e7193fe2585b487176fb936cc69b8947d7dd32044a
ifdef KERNEL_PATCHVER
LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))
......
......@@ -310,7 +310,7 @@
if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK)
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1409,7 +1409,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
@@ -1410,7 +1410,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
dsfield = ipv6_get_dsfield(ipv6h);
if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS)
......
From b7c6d2675899cfff0180412c63fc9cbd5bacdb4d Mon Sep 17 00:00:00 2001
From: Eric Dumazet <edumazet@google.com>
Date: Wed, 19 Apr 2017 09:59:21 -0700
Subject: [PATCH] smsc75xx: use skb_cow_head() to deal with cloned skbs
We need to ensure there is enough headroom to push extra header,
but we also need to check if we are allowed to change headers.
skb_cow_head() is the proper helper to deal with this.
Fixes: d0cad871703b ("smsc75xx: SMSC LAN75xx USB gigabit ethernet adapter driver")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: James Hughes <james.hughes@raspberrypi.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/usb/smsc75xx.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -2205,13 +2205,9 @@ static struct sk_buff *smsc75xx_tx_fixup
{
u32 tx_cmd_a, tx_cmd_b;
- if (skb_headroom(skb) < SMSC75XX_TX_OVERHEAD) {
- struct sk_buff *skb2 =
- skb_copy_expand(skb, SMSC75XX_TX_OVERHEAD, 0, flags);
+ if (skb_cow_head(skb, SMSC75XX_TX_OVERHEAD)) {
dev_kfree_skb_any(skb);
- skb = skb2;
- if (!skb)
- return NULL;
+ return NULL;
}
tx_cmd_a = (u32)(skb->len & TX_CMD_A_LEN) | TX_CMD_A_FCS;
From a9e840a2081ed28c2b7caa6a9a0041c950b3c37d Mon Sep 17 00:00:00 2001
From: Eric Dumazet <edumazet@google.com>
Date: Wed, 19 Apr 2017 09:59:22 -0700
Subject: [PATCH] cx82310_eth: use skb_cow_head() to deal with cloned skbs
We need to ensure there is enough headroom to push extra header,
but we also need to check if we are allowed to change headers.
skb_cow_head() is the proper helper to deal with this.
Fixes: cc28a20e77b2 ("introduce cx82310_eth: Conexant CX82310-based ADSL router USB ethernet driver")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: James Hughes <james.hughes@raspberrypi.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/usb/cx82310_eth.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
--- a/drivers/net/usb/cx82310_eth.c
+++ b/drivers/net/usb/cx82310_eth.c
@@ -293,12 +293,9 @@ static struct sk_buff *cx82310_tx_fixup(
{
int len = skb->len;
- if (skb_headroom(skb) < 2) {
- struct sk_buff *skb2 = skb_copy_expand(skb, 2, 0, flags);
+ if (skb_cow_head(skb, 2)) {
dev_kfree_skb_any(skb);
- skb = skb2;
- if (!skb)
- return NULL;
+ return NULL;
}
skb_push(skb, 2);
From d532c1082f68176363ed766d09bf187616e282fe Mon Sep 17 00:00:00 2001
From: Eric Dumazet <edumazet@google.com>
Date: Wed, 19 Apr 2017 09:59:23 -0700
Subject: [PATCH] sr9700: use skb_cow_head() to deal with cloned skbs
We need to ensure there is enough headroom to push extra header,
but we also need to check if we are allowed to change headers.
skb_cow_head() is the proper helper to deal with this.
Fixes: c9b37458e956 ("USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: James Hughes <james.hughes@raspberrypi.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/usb/sr9700.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
--- a/drivers/net/usb/sr9700.c
+++ b/drivers/net/usb/sr9700.c
@@ -456,14 +456,9 @@ static struct sk_buff *sr9700_tx_fixup(s
len = skb->len;
- if (skb_headroom(skb) < SR_TX_OVERHEAD) {
- struct sk_buff *skb2;
-
- skb2 = skb_copy_expand(skb, SR_TX_OVERHEAD, 0, flags);
+ if (skb_cow_head(skb, SR_TX_OVERHEAD)) {
dev_kfree_skb_any(skb);
- skb = skb2;
- if (!skb)
- return NULL;
+ return NULL;
}
__skb_push(skb, SR_TX_OVERHEAD);
From d4ca73591916b760478d2b04334d5dcadc028e9c Mon Sep 17 00:00:00 2001
From: Eric Dumazet <edumazet@google.com>
Date: Wed, 19 Apr 2017 09:59:24 -0700
Subject: [PATCH] lan78xx: use skb_cow_head() to deal with cloned skbs
We need to ensure there is enough headroom to push extra header,
but we also need to check if we are allowed to change headers.
skb_cow_head() is the proper helper to deal with this.
Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: James Hughes <james.hughes@raspberrypi.org>
Cc: Woojung Huh <woojung.huh@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/usb/lan78xx.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -2419,14 +2419,9 @@ static struct sk_buff *lan78xx_tx_prep(s
{
u32 tx_cmd_a, tx_cmd_b;
- if (skb_headroom(skb) < TX_OVERHEAD) {
- struct sk_buff *skb2;
-
- skb2 = skb_copy_expand(skb, TX_OVERHEAD, 0, flags);
+ if (skb_cow_head(skb, TX_OVERHEAD)) {
dev_kfree_skb_any(skb);
- skb = skb2;
- if (!skb)
- return NULL;
+ return NULL;
}
if (lan78xx_linearize(skb) < 0)
From a4077ce5871304f8a78f80b74b18b6052a410f1a Mon Sep 17 00:00:00 2001
From: "Andrey Jr. Melnikov" <temnota.am@gmail.com>
Date: Thu, 8 Dec 2016 19:57:08 +0300
Subject: [PATCH] mtd: nand: Add Winbond manufacturer id
Add WINBOND manufacturer id.
Signed-off-by: Andrey Jr. Melnikov <temnota.am@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
---
drivers/mtd/nand/nand_ids.c | 1 +
include/linux/mtd/nand.h | 1 +
2 files changed, 2 insertions(+)
--- a/drivers/mtd/nand/nand_ids.c
+++ b/drivers/mtd/nand/nand_ids.c
@@ -182,6 +182,7 @@ struct nand_manufacturers nand_manuf_ids
{NAND_MFR_SANDISK, "SanDisk"},
{NAND_MFR_INTEL, "Intel"},
{NAND_MFR_ATO, "ATO"},
+ {NAND_MFR_WINBOND, "Winbond"},
{0x0, "Unknown"}
};
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -928,6 +928,7 @@ static inline void nand_set_controller_d
#define NAND_MFR_SANDISK 0x45
#define NAND_MFR_INTEL 0x89
#define NAND_MFR_ATO 0x9b
+#define NAND_MFR_WINBOND 0xef
/* The maximum expected count of bytes in the NAND ID sequence */
#define NAND_MAX_ID_LEN 8
......@@ -1095,7 +1095,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
dma_intr_ena = smsc9420_reg_read(pd, DMAC_INTR_ENA);
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2678,7 +2678,7 @@ static int stmmac_poll(struct napi_struc
@@ -2684,7 +2684,7 @@ static int stmmac_poll(struct napi_struc
work_done = stmmac_rx(priv, budget);
if (work_done < budget) {
......
......@@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -243,7 +243,7 @@ config SOC_BUS
@@ -246,7 +246,7 @@ config SOC_BUS
source "drivers/base/regmap/Kconfig"
config DMA_SHARED_BUFFER
......
......@@ -137,7 +137,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
add_taint_module(mod, TAINT_CRAP, LOCKDEP_STILL_OK);
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1964,7 +1964,9 @@ static void read_symbols(char *modname)
@@ -1965,7 +1965,9 @@ static void read_symbols(char *modname)
symname = remove_dot(info.strtab + sym->st_name);
handle_modversions(mod, &info, sym, symname);
......@@ -147,7 +147,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
if (!is_vmlinux(modname) ||
(is_vmlinux(modname) && vmlinux_section_warnings))
@@ -2108,7 +2110,9 @@ static void add_header(struct buffer *b,
@@ -2109,7 +2111,9 @@ static void add_header(struct buffer *b,
buf_printf(b, "#include <linux/vermagic.h>\n");
buf_printf(b, "#include <linux/compiler.h>\n");
buf_printf(b, "\n");
......@@ -157,7 +157,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
buf_printf(b, "\n");
buf_printf(b, "__visible struct module __this_module\n");
buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n");
@@ -2125,16 +2129,20 @@ static void add_header(struct buffer *b,
@@ -2126,16 +2130,20 @@ static void add_header(struct buffer *b,
static void add_intree_flag(struct buffer *b, int is_intree)
{
......@@ -178,7 +178,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
/* In kernel, this size is defined in linux/module.h;
@@ -2238,11 +2246,13 @@ static void add_depends(struct buffer *b
@@ -2239,11 +2247,13 @@ static void add_depends(struct buffer *b
static void add_srcversion(struct buffer *b, struct module *mod)
{
......@@ -192,7 +192,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
static void write_if_changed(struct buffer *b, const char *fname)
@@ -2476,7 +2486,9 @@ int main(int argc, char **argv)
@@ -2477,7 +2487,9 @@ int main(int argc, char **argv)
add_staging_flag(&buf, mod->name);
err |= add_versions(&buf, mod);
add_depends(&buf, mod, modules);
......
......@@ -50,7 +50,7 @@
phy_device_free(phydev);
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -859,6 +859,23 @@ void mdio_bus_exit(void);
@@ -870,6 +870,23 @@ void mdio_bus_exit(void);
extern struct bus_type mdio_bus_type;
......
......@@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -241,7 +241,7 @@ config SOC_BUS
@@ -244,7 +244,7 @@ config SOC_BUS
source "drivers/base/regmap/Kconfig"
config DMA_SHARED_BUFFER
......
......@@ -300,7 +300,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
/**
* ip6_tnl_addr_conflict - compare packet addresses to tunnel's own
* @t: the outgoing tunnel device
@@ -1295,6 +1435,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
@@ -1296,6 +1436,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
{
struct ip6_tnl *t = netdev_priv(dev);
struct ipv6hdr *ipv6h = ipv6_hdr(skb);
......@@ -308,7 +308,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
int encap_limit = -1;
__u16 offset;
struct flowi6 fl6;
@@ -1357,6 +1498,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
@@ -1358,6 +1499,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
fl6.flowi6_uid = sock_net_uid(dev_net(dev), NULL);
......@@ -327,7 +327,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6))
return -1;
@@ -1485,6 +1638,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
@@ -1486,6 +1639,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
t->parms.link = p->link;
t->parms.proto = p->proto;
t->parms.fwmark = p->fwmark;
......@@ -342,7 +342,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
dst_cache_reset(&t->dst_cache);
ip6_tnl_link_config(t);
return 0;
@@ -1523,6 +1684,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
@@ -1524,6 +1685,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
p->flowinfo = u->flowinfo;
p->link = u->link;
p->proto = u->proto;
......@@ -350,7 +350,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
memcpy(p->name, u->name, sizeof(u->name));
}
@@ -1904,6 +2066,15 @@ static int ip6_tnl_validate(struct nlatt
@@ -1905,6 +2067,15 @@ static int ip6_tnl_validate(struct nlatt
return 0;
}
......@@ -366,7 +366,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
static void ip6_tnl_netlink_parms(struct nlattr *data[],
struct __ip6_tnl_parm *parms)
{
@@ -1941,6 +2112,46 @@ static void ip6_tnl_netlink_parms(struct
@@ -1942,6 +2113,46 @@ static void ip6_tnl_netlink_parms(struct
if (data[IFLA_IPTUN_FWMARK])
parms->fwmark = nla_get_u32(data[IFLA_IPTUN_FWMARK]);
......@@ -413,7 +413,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
}
static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[],
@@ -2052,6 +2263,12 @@ static void ip6_tnl_dellink(struct net_d
@@ -2053,6 +2264,12 @@ static void ip6_tnl_dellink(struct net_d
static size_t ip6_tnl_get_size(const struct net_device *dev)
{
......@@ -426,7 +426,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
return
/* IFLA_IPTUN_LINK */
nla_total_size(4) +
@@ -2081,6 +2298,24 @@ static size_t ip6_tnl_get_size(const str
@@ -2082,6 +2299,24 @@ static size_t ip6_tnl_get_size(const str
nla_total_size(0) +
/* IFLA_IPTUN_FWMARK */
nla_total_size(4) +
......@@ -451,7 +451,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
0;
}
@@ -2088,6 +2323,9 @@ static int ip6_tnl_fill_info(struct sk_b
@@ -2089,6 +2324,9 @@ static int ip6_tnl_fill_info(struct sk_b
{
struct ip6_tnl *tunnel = netdev_priv(dev);
struct __ip6_tnl_parm *parm = &tunnel->parms;
......@@ -461,7 +461,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) ||
nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) ||
@@ -2097,9 +2335,27 @@ static int ip6_tnl_fill_info(struct sk_b
@@ -2098,9 +2336,27 @@ static int ip6_tnl_fill_info(struct sk_b
nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) ||
nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) ||
nla_put_u8(skb, IFLA_IPTUN_PROTO, parm->proto) ||
......@@ -490,7 +490,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) ||
nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) ||
nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) ||
@@ -2139,6 +2395,7 @@ static const struct nla_policy ip6_tnl_p
@@ -2140,6 +2396,7 @@ static const struct nla_policy ip6_tnl_p
[IFLA_IPTUN_ENCAP_DPORT] = { .type = NLA_U16 },
[IFLA_IPTUN_COLLECT_METADATA] = { .type = NLA_FLAG },
[IFLA_IPTUN_FWMARK] = { .type = NLA_U32 },
......
From b7c6d2675899cfff0180412c63fc9cbd5bacdb4d Mon Sep 17 00:00:00 2001
From: Eric Dumazet <edumazet@google.com>
Date: Wed, 19 Apr 2017 09:59:21 -0700
Subject: [PATCH] smsc75xx: use skb_cow_head() to deal with cloned skbs
We need to ensure there is enough headroom to push extra header,
but we also need to check if we are allowed to change headers.
skb_cow_head() is the proper helper to deal with this.
Fixes: d0cad871703b ("smsc75xx: SMSC LAN75xx USB gigabit ethernet adapter driver")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: James Hughes <james.hughes@raspberrypi.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/usb/smsc75xx.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -2193,13 +2193,9 @@ static struct sk_buff *smsc75xx_tx_fixup
{
u32 tx_cmd_a, tx_cmd_b;
- if (skb_headroom(skb) < SMSC75XX_TX_OVERHEAD) {
- struct sk_buff *skb2 =
- skb_copy_expand(skb, SMSC75XX_TX_OVERHEAD, 0, flags);
+ if (skb_cow_head(skb, SMSC75XX_TX_OVERHEAD)) {
dev_kfree_skb_any(skb);
- skb = skb2;
- if (!skb)
- return NULL;
+ return NULL;
}
tx_cmd_a = (u32)(skb->len & TX_CMD_A_LEN) | TX_CMD_A_FCS;
From a9e840a2081ed28c2b7caa6a9a0041c950b3c37d Mon Sep 17 00:00:00 2001
From: Eric Dumazet <edumazet@google.com>
Date: Wed, 19 Apr 2017 09:59:22 -0700
Subject: [PATCH] cx82310_eth: use skb_cow_head() to deal with cloned skbs
We need to ensure there is enough headroom to push extra header,
but we also need to check if we are allowed to change headers.
skb_cow_head() is the proper helper to deal with this.
Fixes: cc28a20e77b2 ("introduce cx82310_eth: Conexant CX82310-based ADSL router USB ethernet driver")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: James Hughes <james.hughes@raspberrypi.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/usb/cx82310_eth.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
--- a/drivers/net/usb/cx82310_eth.c
+++ b/drivers/net/usb/cx82310_eth.c
@@ -293,12 +293,9 @@ static struct sk_buff *cx82310_tx_fixup(
{
int len = skb->len;
- if (skb_headroom(skb) < 2) {
- struct sk_buff *skb2 = skb_copy_expand(skb, 2, 0, flags);
+ if (skb_cow_head(skb, 2)) {
dev_kfree_skb_any(skb);
- skb = skb2;
- if (!skb)
- return NULL;
+ return NULL;
}
skb_push(skb, 2);
From d532c1082f68176363ed766d09bf187616e282fe Mon Sep 17 00:00:00 2001
From: Eric Dumazet <edumazet@google.com>
Date: Wed, 19 Apr 2017 09:59:23 -0700
Subject: [PATCH] sr9700: use skb_cow_head() to deal with cloned skbs
We need to ensure there is enough headroom to push extra header,
but we also need to check if we are allowed to change headers.
skb_cow_head() is the proper helper to deal with this.
Fixes: c9b37458e956 ("USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: James Hughes <james.hughes@raspberrypi.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/usb/sr9700.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
--- a/drivers/net/usb/sr9700.c
+++ b/drivers/net/usb/sr9700.c
@@ -456,14 +456,9 @@ static struct sk_buff *sr9700_tx_fixup(s
len = skb->len;
- if (skb_headroom(skb) < SR_TX_OVERHEAD) {
- struct sk_buff *skb2;
-
- skb2 = skb_copy_expand(skb, SR_TX_OVERHEAD, 0, flags);
+ if (skb_cow_head(skb, SR_TX_OVERHEAD)) {
dev_kfree_skb_any(skb);
- skb = skb2;
- if (!skb)
- return NULL;
+ return NULL;
}
__skb_push(skb, SR_TX_OVERHEAD);
From d4ca73591916b760478d2b04334d5dcadc028e9c Mon Sep 17 00:00:00 2001
From: Eric Dumazet <edumazet@google.com>
Date: Wed, 19 Apr 2017 09:59:24 -0700
Subject: [PATCH] lan78xx: use skb_cow_head() to deal with cloned skbs
We need to ensure there is enough headroom to push extra header,
but we also need to check if we are allowed to change headers.
skb_cow_head() is the proper helper to deal with this.
Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: James Hughes <james.hughes@raspberrypi.org>
Cc: Woojung Huh <woojung.huh@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/usb/lan78xx.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -2050,14 +2050,9 @@ static struct sk_buff *lan78xx_tx_prep(s
{
u32 tx_cmd_a, tx_cmd_b;
- if (skb_headroom(skb) < TX_OVERHEAD) {
- struct sk_buff *skb2;
-
- skb2 = skb_copy_expand(skb, TX_OVERHEAD, 0, flags);
+ if (skb_cow_head(skb, TX_OVERHEAD)) {
dev_kfree_skb_any(skb);
- skb = skb2;
- if (!skb)
- return NULL;
+ return NULL;
}
if (lan78xx_linearize(skb) < 0)
From a4077ce5871304f8a78f80b74b18b6052a410f1a Mon Sep 17 00:00:00 2001
From: "Andrey Jr. Melnikov" <temnota.am@gmail.com>
Date: Thu, 8 Dec 2016 19:57:08 +0300
Subject: [PATCH] mtd: nand: Add Winbond manufacturer id
Add WINBOND manufacturer id.
Signed-off-by: Andrey Jr. Melnikov <temnota.am@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
---
drivers/mtd/nand/nand_ids.c | 1 +
include/linux/mtd/nand.h | 1 +
2 files changed, 2 insertions(+)
--- a/drivers/mtd/nand/nand_ids.c
+++ b/drivers/mtd/nand/nand_ids.c
@@ -181,6 +181,7 @@ struct nand_manufacturers nand_manuf_ids
{NAND_MFR_SANDISK, "SanDisk"},
{NAND_MFR_INTEL, "Intel"},
{NAND_MFR_ATO, "ATO"},
+ {NAND_MFR_WINBOND, "Winbond"},
{0x0, "Unknown"}
};
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -736,6 +736,7 @@ struct nand_chip {
#define NAND_MFR_SANDISK 0x45
#define NAND_MFR_INTEL 0x89
#define NAND_MFR_ATO 0x9b
+#define NAND_MFR_WINBOND 0xef
/* The maximum expected count of bytes in the NAND ID sequence */
#define NAND_MAX_ID_LEN 8
......@@ -5,7 +5,7 @@
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -863,6 +863,7 @@ struct platform_nand_chip {
@@ -864,6 +864,7 @@ struct platform_nand_chip {
unsigned int options;
unsigned int bbt_options;
const char **part_probe_types;
......
......@@ -296,7 +296,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
__skb_tunnel_rx(skb, t->dev, t->net);
@@ -1247,6 +1384,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
@@ -1248,6 +1385,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
__u32 mtu;
u8 tproto;
int err;
......@@ -304,7 +304,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
tproto = ACCESS_ONCE(t->parms.proto);
if ((tproto != IPPROTO_IPV6 && tproto != 0) ||
@@ -1277,6 +1415,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
@@ -1278,6 +1416,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK)
fl6.flowi6_mark = skb->mark;
......@@ -323,7 +323,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
err = ip6_tnl_xmit2(skb, dev, dsfield, &fl6, encap_limit, &mtu);
if (err != 0) {
if (err == -EMSGSIZE)
@@ -1391,6 +1541,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
@@ -1392,6 +1542,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
t->parms.flowinfo = p->flowinfo;
t->parms.link = p->link;
t->parms.proto = p->proto;
......@@ -338,7 +338,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
ip6_tnl_dst_reset(t);
ip6_tnl_link_config(t);
return 0;
@@ -1429,6 +1587,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
@@ -1430,6 +1588,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
p->flowinfo = u->flowinfo;
p->link = u->link;
p->proto = u->proto;
......@@ -346,7 +346,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
memcpy(p->name, u->name, sizeof(u->name));
}
@@ -1724,6 +1883,15 @@ static int ip6_tnl_validate(struct nlatt
@@ -1725,6 +1884,15 @@ static int ip6_tnl_validate(struct nlatt
return 0;
}
......@@ -362,7 +362,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
static void ip6_tnl_netlink_parms(struct nlattr *data[],
struct __ip6_tnl_parm *parms)
{
@@ -1755,6 +1923,46 @@ static void ip6_tnl_netlink_parms(struct
@@ -1756,6 +1924,46 @@ static void ip6_tnl_netlink_parms(struct
if (data[IFLA_IPTUN_PROTO])
parms->proto = nla_get_u8(data[IFLA_IPTUN_PROTO]);
......@@ -409,7 +409,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
}
static int ip6_tnl_newlink(struct net *src_net, struct net_device *dev,
@@ -1807,6 +2015,12 @@ static void ip6_tnl_dellink(struct net_d
@@ -1808,6 +2016,12 @@ static void ip6_tnl_dellink(struct net_d
static size_t ip6_tnl_get_size(const struct net_device *dev)
{
......@@ -422,7 +422,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
return
/* IFLA_IPTUN_LINK */
nla_total_size(4) +
@@ -1824,6 +2038,24 @@ static size_t ip6_tnl_get_size(const str
@@ -1825,6 +2039,24 @@ static size_t ip6_tnl_get_size(const str
nla_total_size(4) +
/* IFLA_IPTUN_PROTO */
nla_total_size(1) +
......@@ -447,7 +447,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
0;
}
@@ -1831,6 +2063,9 @@ static int ip6_tnl_fill_info(struct sk_b
@@ -1832,6 +2064,9 @@ static int ip6_tnl_fill_info(struct sk_b
{
struct ip6_tnl *tunnel = netdev_priv(dev);
struct __ip6_tnl_parm *parm = &tunnel->parms;
......@@ -457,7 +457,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) ||
nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) ||
@@ -1839,8 +2074,27 @@ static int ip6_tnl_fill_info(struct sk_b
@@ -1840,8 +2075,27 @@ static int ip6_tnl_fill_info(struct sk_b
nla_put_u8(skb, IFLA_IPTUN_ENCAP_LIMIT, parm->encap_limit) ||
nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) ||
nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) ||
......@@ -486,7 +486,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
return 0;
nla_put_failure:
@@ -1864,6 +2118,7 @@ static const struct nla_policy ip6_tnl_p
@@ -1865,6 +2119,7 @@ static const struct nla_policy ip6_tnl_p
[IFLA_IPTUN_FLOWINFO] = { .type = NLA_U32 },
[IFLA_IPTUN_FLAGS] = { .type = NLA_U32 },
[IFLA_IPTUN_PROTO] = { .type = NLA_U8 },
......
......@@ -53,7 +53,7 @@
* @phydev: the phy_device struct
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -796,6 +796,7 @@ void phy_start_machine(struct phy_device
@@ -807,6 +807,7 @@ void phy_start_machine(struct phy_device
void phy_stop_machine(struct phy_device *phydev);
int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
......
......@@ -46,7 +46,7 @@
phy_device_free(phydev);
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -835,6 +835,23 @@ void mdio_bus_exit(void);
@@ -846,6 +846,23 @@ void mdio_bus_exit(void);
extern struct bus_type mdio_bus_type;
......
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -2712,6 +2712,8 @@ static const struct file_operations proc
@@ -2716,6 +2716,8 @@ static const struct file_operations proc
static int __init proc_locks_init(void)
{
......
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -229,7 +229,7 @@ config SOC_BUS
@@ -232,7 +232,7 @@ config SOC_BUS
source "drivers/base/regmap/Kconfig"
config DMA_SHARED_BUFFER
......
......@@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
depends on ARCH_AT91 || (ARM && COMPILE_TEST)
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1640,10 +1640,12 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1642,10 +1642,12 @@ int spi_nor_scan(struct spi_nor *nor, co
#ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
/* prefer "small sector" erase if possible */
......
......@@ -300,7 +300,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
/**
* ip6_tnl_addr_conflict - compare packet addresses to tunnel's own
* @t: the outgoing tunnel device
@@ -1286,6 +1426,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
@@ -1287,6 +1427,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
{
struct ip6_tnl *t = netdev_priv(dev);
struct ipv6hdr *ipv6h = ipv6_hdr(skb);
......@@ -308,7 +308,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
int encap_limit = -1;
__u16 offset;
struct flowi6 fl6;
@@ -1344,6 +1485,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
@@ -1345,6 +1486,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
fl6.flowi6_mark = skb->mark;
}
......@@ -327,7 +327,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6))
return -1;
@@ -1471,6 +1624,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
@@ -1472,6 +1625,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
t->parms.flowinfo = p->flowinfo;
t->parms.link = p->link;
t->parms.proto = p->proto;
......@@ -342,7 +342,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
dst_cache_reset(&t->dst_cache);
ip6_tnl_link_config(t);
return 0;
@@ -1509,6 +1670,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
@@ -1510,6 +1671,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
p->flowinfo = u->flowinfo;
p->link = u->link;
p->proto = u->proto;
......@@ -350,7 +350,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
memcpy(p->name, u->name, sizeof(u->name));
}
@@ -1886,6 +2048,15 @@ static int ip6_tnl_validate(struct nlatt
@@ -1887,6 +2049,15 @@ static int ip6_tnl_validate(struct nlatt
return 0;
}
......@@ -366,7 +366,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
static void ip6_tnl_netlink_parms(struct nlattr *data[],
struct __ip6_tnl_parm *parms)
{
@@ -1920,6 +2091,46 @@ static void ip6_tnl_netlink_parms(struct
@@ -1921,6 +2092,46 @@ static void ip6_tnl_netlink_parms(struct
if (data[IFLA_IPTUN_COLLECT_METADATA])
parms->collect_md = true;
......@@ -413,7 +413,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
}
static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[],
@@ -2029,6 +2240,12 @@ static void ip6_tnl_dellink(struct net_d
@@ -2030,6 +2241,12 @@ static void ip6_tnl_dellink(struct net_d
static size_t ip6_tnl_get_size(const struct net_device *dev)
{
......@@ -426,7 +426,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
return
/* IFLA_IPTUN_LINK */
nla_total_size(4) +
@@ -2056,6 +2273,24 @@ static size_t ip6_tnl_get_size(const str
@@ -2057,6 +2274,24 @@ static size_t ip6_tnl_get_size(const str
nla_total_size(2) +
/* IFLA_IPTUN_COLLECT_METADATA */
nla_total_size(0) +
......@@ -451,7 +451,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
0;
}
@@ -2063,6 +2298,9 @@ static int ip6_tnl_fill_info(struct sk_b
@@ -2064,6 +2299,9 @@ static int ip6_tnl_fill_info(struct sk_b
{
struct ip6_tnl *tunnel = netdev_priv(dev);
struct __ip6_tnl_parm *parm = &tunnel->parms;
......@@ -461,7 +461,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) ||
nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) ||
@@ -2071,9 +2309,27 @@ static int ip6_tnl_fill_info(struct sk_b
@@ -2072,9 +2310,27 @@ static int ip6_tnl_fill_info(struct sk_b
nla_put_u8(skb, IFLA_IPTUN_ENCAP_LIMIT, parm->encap_limit) ||
nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) ||
nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) ||
......@@ -490,7 +490,7 @@ Signed-off-by: Steven Barth <cyrus@openwrt.org>
if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) ||
nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) ||
nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) ||
@@ -2111,6 +2367,7 @@ static const struct nla_policy ip6_tnl_p
@@ -2112,6 +2368,7 @@ static const struct nla_policy ip6_tnl_p
[IFLA_IPTUN_ENCAP_SPORT] = { .type = NLA_U16 },
[IFLA_IPTUN_ENCAP_DPORT] = { .type = NLA_U16 },
[IFLA_IPTUN_COLLECT_METADATA] = { .type = NLA_FLAG },
......
......@@ -62,7 +62,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
* @phydev: the phy_device struct
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -816,6 +816,7 @@ int phy_ethtool_ksettings_get(struct phy
@@ -827,6 +827,7 @@ int phy_ethtool_ksettings_get(struct phy
struct ethtool_link_ksettings *cmd);
int phy_ethtool_ksettings_set(struct phy_device *phydev,
const struct ethtool_link_ksettings *cmd);
......
......@@ -5,10 +5,10 @@ Subject: [PATCH 32/69] phy: add qcom dwc3 phy
Signed-off-by: Andy Gross <agross@codeaurora.org>
---
drivers/phy/Kconfig | 12 ++
drivers/phy/Kconfig | 12 +
drivers/phy/Makefile | 1 +
drivers/phy/phy-qcom-dwc3.c | 484 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 497 insertions(+)
drivers/phy/phy-qcom-dwc3.c | 575 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 588 insertions(+)
create mode 100644 drivers/phy/phy-qcom-dwc3.c
--- a/drivers/phy/Kconfig
......@@ -39,7 +39,7 @@ Signed-off-by: Andy Gross <agross@codeaurora.org>
+obj-$(CONFIG_PHY_QCOM_DWC3) += phy-qcom-dwc3.o
--- /dev/null
+++ b/drivers/phy/phy-qcom-dwc3.c
@@ -0,0 +1,492 @@
@@ -0,0 +1,575 @@
+/* Copyright (c) 2014-2015, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
......@@ -99,7 +99,7 @@ Signed-off-by: Andy Gross <agross@codeaurora.org>
+
+/* PHY_CTRL_REG */
+#define SSUSB_CTRL_REF_USE_PAD BIT(28)
+#define SSUSB_CTRL_TEST_POWERDOWN BIT(26)
+#define SSUSB_CTRL_TEST_POWERDOWN BIT(27)
+#define SSUSB_CTRL_LANE0_PWR_PRESENT BIT(24)
+#define SSUSB_CTRL_SS_PHY_EN BIT(8)
+#define SSUSB_CTRL_SS_PHY_RESET BIT(7)
......@@ -108,6 +108,33 @@ Signed-off-by: Andy Gross <agross@codeaurora.org>
+#define SSPHY_CTRL_RX_OVRD_IN_HI(lane) (0x1006 + 0x100 * lane)
+#define SSPHY_CTRL_TX_OVRD_DRV_LO(lane) (0x1002 + 0x100 * lane)
+
+/* SSPHY SoC version specific values */
+#define SSPHY_RX_EQ_VALUE 4 /* Override value for rx_eq */
+#define SSPHY_TX_DEEMPH_3_5DB 23 /* Override value for transmit
+ preemphasis */
+#define SSPHY_MPLL_VALUE 0 /* Override value for mpll */
+
+/* QSCRATCH PHY_PARAM_CTRL1 fields */
+#define PHY_PARAM_CTRL1_TX_FULL_SWING_MASK 0x07f00000u
+#define PHY_PARAM_CTRL1_TX_DEEMPH_6DB_MASK 0x000fc000u
+#define PHY_PARAM_CTRL1_TX_DEEMPH_3_5DB_MASK 0x00003f00u
+#define PHY_PARAM_CTRL1_LOS_BIAS_MASK 0x000000f8u
+
+#define PHY_PARAM_CTRL1_MASK \
+ (PHY_PARAM_CTRL1_TX_FULL_SWING_MASK | \
+ PHY_PARAM_CTRL1_TX_DEEMPH_6DB_MASK | \
+ PHY_PARAM_CTRL1_TX_DEEMPH_3_5DB_MASK | \
+ PHY_PARAM_CTRL1_LOS_BIAS_MASK)
+
+#define PHY_PARAM_CTRL1_TX_FULL_SWING(x) \
+ (((x) << 20) & PHY_PARAM_CTRL1_TX_FULL_SWING_MASK)
+#define PHY_PARAM_CTRL1_TX_DEEMPH_6DB(x) \
+ (((x) << 14) & PHY_PARAM_CTRL1_TX_DEEMPH_6DB_MASK)
+#define PHY_PARAM_CTRL1_TX_DEEMPH_3_5DB(x) \
+ (((x) << 8) & PHY_PARAM_CTRL1_TX_DEEMPH_3_5DB_MASK)
+#define PHY_PARAM_CTRL1_LOS_BIAS(x) \
+ (((x) << 3) & PHY_PARAM_CTRL1_LOS_BIAS_MASK)
+
+/* RX OVRD IN HI bits */
+#define RX_OVRD_IN_HI_RX_RESET_OVRD BIT(13)
+#define RX_OVRD_IN_HI_RX_RX_RESET BIT(12)
......@@ -138,6 +165,9 @@ Signed-off-by: Andy Gross <agross@codeaurora.org>
+ struct device *dev;
+ struct clk *xo_clk;
+ struct clk *ref_clk;
+ u32 rx_eq;
+ u32 tx_deamp_3_5db;
+ u32 mpll;
+};
+
+struct qcom_dwc3_phy_drvdata {
......@@ -269,36 +299,21 @@ Signed-off-by: Andy Gross <agross@codeaurora.org>
+ return ret;
+}
+
+static int qcom_dwc3_phy_power_on(struct phy *phy)
+static int qcom_dwc3_hs_phy_init(struct phy *phy)
+{
+ int ret;
+ struct qcom_dwc3_usb_phy *phy_dwc3 = phy_get_drvdata(phy);
+ int ret;
+ u32 val;
+
+ ret = clk_prepare_enable(phy_dwc3->xo_clk);
+ if (ret)
+ return ret;
+
+ ret = clk_prepare_enable(phy_dwc3->ref_clk);
+ if (ret)
+ if (ret) {
+ clk_disable_unprepare(phy_dwc3->xo_clk);
+
+ return ret;
+}
+
+static int qcom_dwc3_phy_power_off(struct phy *phy)
+{
+ struct qcom_dwc3_usb_phy *phy_dwc3 = phy_get_drvdata(phy);
+
+ clk_disable_unprepare(phy_dwc3->ref_clk);
+ clk_disable_unprepare(phy_dwc3->xo_clk);
+
+ return 0;
+}
+
+static int qcom_dwc3_hs_phy_init(struct phy *phy)
+{
+ struct qcom_dwc3_usb_phy *phy_dwc3 = phy_get_drvdata(phy);
+ u32 val;
+ }
+
+ /*
+ * HSPHY Initialization: Enable UTMI clock, select 19.2MHz fsel
......@@ -323,22 +338,34 @@ Signed-off-by: Andy Gross <agross@codeaurora.org>
+ return 0;
+}
+
+static int qcom_dwc3_hs_phy_exit(struct phy *phy)
+{
+ struct qcom_dwc3_usb_phy *phy_dwc3 = phy_get_drvdata(phy);
+
+ clk_disable_unprepare(phy_dwc3->ref_clk);
+ clk_disable_unprepare(phy_dwc3->xo_clk);
+
+ return 0;
+}
+
+static int qcom_dwc3_ss_phy_init(struct phy *phy)
+{
+ struct qcom_dwc3_usb_phy *phy_dwc3 = phy_get_drvdata(phy);
+ int ret;
+ u32 data = 0;
+
+ /* reset phy */
+ data = readl(phy_dwc3->base + SSUSB_PHY_CTRL_REG);
+ ret = clk_prepare_enable(phy_dwc3->xo_clk);
+ if (ret)
+ return ret;
+
+ /* Test and clear SSUSB_CTRL_TEST_POWERDOWN */
+ if (data & SSUSB_CTRL_TEST_POWERDOWN) {
+ qcom_dwc3_phy_write_readback(phy_dwc3, SSUSB_PHY_CTRL_REG,
+ SSUSB_CTRL_TEST_POWERDOWN, 0x0);
+ data = readl(phy_dwc3->base + SSUSB_PHY_CTRL_REG);
+ ret = clk_prepare_enable(phy_dwc3->ref_clk);
+ if (ret) {
+ clk_disable_unprepare(phy_dwc3->xo_clk);
+ return ret;
+ }
+
+ /* reset phy */
+ data = readl(phy_dwc3->base + SSUSB_PHY_CTRL_REG);
+ writel(data | SSUSB_CTRL_SS_PHY_RESET,
+ phy_dwc3->base + SSUSB_PHY_CTRL_REG);
+ usleep_range(2000, 2200);
......@@ -359,10 +386,34 @@ Signed-off-by: Andy Gross <agross@codeaurora.org>
+ writel(data, phy_dwc3->base + SSUSB_PHY_CTRL_REG);
+
+ /*
+ * WORKAROUND: There is SSPHY suspend bug due to which USB enumerates
+ * in HS mode instead of SS mode. Workaround it by asserting
+ * LANE0.TX_ALT_BLOCK.EN_ALT_BUS to enable TX to use alt bus mode
+ */
+ ret = qcom_dwc3_ss_read_phycreg(phy_dwc3->base, 0x102D, &data);
+ if (ret)
+ goto err_phy_trans;
+
+ data |= (1 << 7);
+ ret = qcom_dwc3_ss_write_phycreg(phy_dwc3, 0x102D, data);
+ if (ret)
+ goto err_phy_trans;
+
+ ret = qcom_dwc3_ss_read_phycreg(phy_dwc3->base, 0x1010, &data);
+ if (ret)
+ goto err_phy_trans;
+
+ data &= ~0xff0;
+ data |= 0x20;
+ ret = qcom_dwc3_ss_write_phycreg(phy_dwc3, 0x1010, data);
+ if (ret)
+ goto err_phy_trans;
+
+ /*
+ * Fix RX Equalization setting as follows
+ * LANE0.RX_OVRD_IN_HI. RX_EQ_EN set to 0
+ * LANE0.RX_OVRD_IN_HI.RX_EQ_EN_OVRD set to 1
+ * LANE0.RX_OVRD_IN_HI.RX_EQ set to 3
+ * LANE0.RX_OVRD_IN_HI.RX_EQ set based on SoC version
+ * LANE0.RX_OVRD_IN_HI.RX_EQ_OVRD set to 1
+ */
+ ret = qcom_dwc3_ss_read_phycreg(phy_dwc3->base,
......@@ -373,7 +424,7 @@ Signed-off-by: Andy Gross <agross@codeaurora.org>
+ data &= ~RX_OVRD_IN_HI_RX_EQ_EN;
+ data |= RX_OVRD_IN_HI_RX_EQ_EN_OVRD;
+ data &= ~RX_OVRD_IN_HI_RX_EQ_MASK;
+ data |= 0x3 << RX_OVRD_IN_HI_RX_EQ_SHIFT;
+ data |= phy_dwc3->rx_eq << RX_OVRD_IN_HI_RX_EQ_SHIFT;
+ data |= RX_OVRD_IN_HI_RX_EQ_OVRD;
+ ret = qcom_dwc3_ss_write_phycreg(phy_dwc3,
+ SSPHY_CTRL_RX_OVRD_IN_HI(0), data);
......@@ -382,8 +433,8 @@ Signed-off-by: Andy Gross <agross@codeaurora.org>
+
+ /*
+ * Set EQ and TX launch amplitudes as follows
+ * LANE0.TX_OVRD_DRV_LO.PREEMPH set to 22
+ * LANE0.TX_OVRD_DRV_LO.AMPLITUDE set to 127
+ * LANE0.TX_OVRD_DRV_LO.PREEMPH set based on SoC version
+ * LANE0.TX_OVRD_DRV_LO.AMPLITUDE set to 110
+ * LANE0.TX_OVRD_DRV_LO.EN set to 1.
+ */
+ ret = qcom_dwc3_ss_read_phycreg(phy_dwc3->base,
......@@ -392,23 +443,35 @@ Signed-off-by: Andy Gross <agross@codeaurora.org>
+ goto err_phy_trans;
+
+ data &= ~TX_OVRD_DRV_LO_PREEMPH_MASK;
+ data |= 0x16 << TX_OVRD_DRV_LO_PREEMPH_SHIFT;
+ data |= phy_dwc3->tx_deamp_3_5db << TX_OVRD_DRV_LO_PREEMPH_SHIFT;
+ data &= ~TX_OVRD_DRV_LO_AMPLITUDE_MASK;
+ data |= 0x7f;
+ data |= 0x6E;
+ data |= TX_OVRD_DRV_LO_EN;
+ ret = qcom_dwc3_ss_write_phycreg(phy_dwc3,
+ SSPHY_CTRL_TX_OVRD_DRV_LO(0), data);
+ if (ret)
+ goto err_phy_trans;
+
+ qcom_dwc3_ss_write_phycreg(phy_dwc3, 0x30, phy_dwc3->mpll);
+
+ /*
+ * Set the QSCRATCH PHY_PARAM_CTRL1 parameters as follows
+ * TX_FULL_SWING [26:20] amplitude to 127
+ * TX_DEEMPH_3_5DB [13:8] to 22
+ * LOS_BIAS [2:0] to 0x5
+ * TX_FULL_SWING [26:20] amplitude to 110
+ * TX_DEEMPH_6DB [19:14] to 32
+ * TX_DEEMPH_3_5DB [13:8] set based on SoC version
+ * LOS_BIAS [7:3] to 9
+ */
+ data = readl(phy_dwc3->base + SSUSB_PHY_PARAM_CTRL_1);
+
+ data &= ~PHY_PARAM_CTRL1_MASK;
+
+ data |= PHY_PARAM_CTRL1_TX_FULL_SWING(0x6e) |
+ PHY_PARAM_CTRL1_TX_DEEMPH_6DB(0x20) |
+ PHY_PARAM_CTRL1_TX_DEEMPH_3_5DB(phy_dwc3->tx_deamp_3_5db) |
+ PHY_PARAM_CTRL1_LOS_BIAS(0x9);
+
+ qcom_dwc3_phy_write_readback(phy_dwc3, SSUSB_PHY_PARAM_CTRL_1,
+ 0x07f03f07, 0x07f01605);
+ PHY_PARAM_CTRL1_MASK, data);
+
+err_phy_trans:
+ return ret;
......@@ -428,7 +491,10 @@ Signed-off-by: Andy Gross <agross@codeaurora.org>
+ qcom_dwc3_phy_write_readback(phy_dwc3, SSUSB_PHY_CTRL_REG,
+ SSUSB_CTRL_REF_USE_PAD, 0x0);
+ qcom_dwc3_phy_write_readback(phy_dwc3, SSUSB_PHY_CTRL_REG,
+ SSUSB_CTRL_TEST_POWERDOWN, SSUSB_CTRL_TEST_POWERDOWN);
+ SSUSB_CTRL_TEST_POWERDOWN, 0x0);
+
+ clk_disable_unprepare(phy_dwc3->ref_clk);
+ clk_disable_unprepare(phy_dwc3->xo_clk);
+
+ return 0;
+}
......@@ -436,8 +502,7 @@ Signed-off-by: Andy Gross <agross@codeaurora.org>
+static const struct qcom_dwc3_phy_drvdata qcom_dwc3_hs_drvdata = {
+ .ops = {
+ .init = qcom_dwc3_hs_phy_init,
+ .power_on = qcom_dwc3_phy_power_on,
+ .power_off = qcom_dwc3_phy_power_off,
+ .exit = qcom_dwc3_hs_phy_exit,
+ .owner = THIS_MODULE,
+ },
+ .clk_rate = 60000000,
......@@ -447,8 +512,6 @@ Signed-off-by: Andy Gross <agross@codeaurora.org>
+ .ops = {
+ .init = qcom_dwc3_ss_phy_init,
+ .exit = qcom_dwc3_ss_phy_exit,
+ .power_on = qcom_dwc3_phy_power_on,
+ .power_off = qcom_dwc3_phy_power_off,
+ .owner = THIS_MODULE,
+ },
+ .clk_rate = 125000000,
......@@ -469,6 +532,7 @@ Signed-off-by: Andy Gross <agross@codeaurora.org>
+ struct resource *res;
+ const struct of_device_id *match;
+ const struct qcom_dwc3_phy_drvdata *data;
+ struct device_node *np;
+
+ phy_dwc3 = devm_kzalloc(&pdev->dev, sizeof(*phy_dwc3), GFP_KERNEL);
+ if (!phy_dwc3)
......@@ -498,6 +562,25 @@ Signed-off-by: Andy Gross <agross@codeaurora.org>
+ phy_dwc3->xo_clk = NULL;
+ }
+
+ /* Parse device node to probe HSIO settings */
+ np = of_node_get(pdev->dev.of_node);
+ if (!of_compat_cmp(match->compatible, "qcom,dwc3-ss-usb-phy",
+ strlen(match->compatible))) {
+
+ if (of_property_read_u32(np, "rx_eq", &phy_dwc3->rx_eq) ||
+ of_property_read_u32(np, "tx_deamp_3_5db",
+ &phy_dwc3->tx_deamp_3_5db) ||
+ of_property_read_u32(np, "mpll", &phy_dwc3->mpll)) {
+
+ dev_err(phy_dwc3->dev, "cannot get HSIO settings from device node, using default values\n");
+
+ /* Default HSIO settings */
+ phy_dwc3->rx_eq = SSPHY_RX_EQ_VALUE;
+ phy_dwc3->tx_deamp_3_5db = SSPHY_TX_DEEMPH_3_5DB;
+ phy_dwc3->mpll = SSPHY_MPLL_VALUE;
+ }
+ }
+
+ generic_phy = devm_phy_create(phy_dwc3->dev, pdev->dev.of_node,
+ &data->ops);
+
......
From a86bda9f8a7965f0cedd347a9c04800eb9f41ea3 Mon Sep 17 00:00:00 2001
From: Vasudevan Murugesan <vmuruges@codeaurora.org>
Date: Tue, 21 Jul 2015 10:22:38 +0530
Subject: ipq806x: usb: Control USB master reset
During removal of the glue layer(dwc3-of-simple),
USB master reset is set to active and during insertion
it is de-activated.
Change-Id: I537dc810f6cb2a46664ee674840145066432b957
Signed-off-by: Vasudevan Murugesan <vmuruges@codeaurora.org>
(cherry picked from commit 4611e13580a216812f85f0801b95442d02eeb836)
---
drivers/usb/dwc3/dwc3-of-simple.c | 22 ++++++++++++++++++++++
1 file changed, 12 insertions(+)
(limited to 'drivers/usb/dwc3/dwc3-of-simple.c')
--- a/drivers/usb/dwc3/dwc3-of-simple.c
+++ b/drivers/usb/dwc3/dwc3-of-simple.c
@@ -26,6 +26,7 @@
#include <linux/dma-mapping.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
+#include <linux/reset.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/pm_runtime.h>
@@ -34,6 +35,8 @@ struct dwc3_of_simple {
struct device *dev;
struct clk **clks;
int num_clocks;
+ struct reset_control *mstr_rst_30_0;
+ struct reset_control *mstr_rst_30_1;
};
static int dwc3_of_simple_clk_init(struct dwc3_of_simple *simple, int count)
@@ -100,6 +103,20 @@ static int dwc3_of_simple_probe(struct p
if (ret)
return ret;
+ simple->mstr_rst_30_0 = devm_reset_control_get(dev, "usb30_0_mstr_rst");
+
+ if (!IS_ERR(simple->mstr_rst_30_0))
+ reset_control_deassert(simple->mstr_rst_30_0);
+ else
+ dev_dbg(simple->dev, "cannot get handle for USB PHY 0 master reset control\n");
+
+ simple->mstr_rst_30_1 = devm_reset_control_get(dev, "usb30_1_mstr_rst");
+
+ if (!IS_ERR(simple->mstr_rst_30_1))
+ reset_control_deassert(simple->mstr_rst_30_1);
+ else
+ dev_dbg(simple->dev, "cannot get handle for USB PHY 1 master reset control\n");
+
ret = of_platform_populate(np, NULL, NULL, dev);
if (ret) {
for (i = 0; i < simple->num_clocks; i++) {
@@ -128,6 +145,12 @@ static int dwc3_of_simple_remove(struct
clk_put(simple->clks[i]);
}
+ if (!IS_ERR(simple->mstr_rst_30_0))
+ reset_control_assert(simple->mstr_rst_30_0);
+
+ if (!IS_ERR(simple->mstr_rst_30_1))
+ reset_control_assert(simple->mstr_rst_30_1);
+
of_platform_depopulate(dev);
pm_runtime_put_sync(dev);
......@@ -15,7 +15,7 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
--- a/drivers/usb/dwc3/dwc3-of-simple.c
+++ b/drivers/usb/dwc3/dwc3-of-simple.c
@@ -174,6 +174,7 @@ static const struct dev_pm_ops dwc3_of_s
@@ -197,6 +197,7 @@ static const struct dev_pm_ops dwc3_of_s
static const struct of_device_id of_dwc3_simple_match[] = {
{ .compatible = "qcom,dwc3" },
......
......@@ -41,7 +41,7 @@ Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
parts[i].name = partname;
if (of_get_property(pp, "read-only", &len))
@@ -213,6 +222,18 @@ static int __init ofpart_parser_init(voi
@@ -220,6 +229,18 @@ static int __init ofpart_parser_init(voi
return 0;
}
......
......@@ -45,7 +45,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -237,6 +237,7 @@ config GENERIC_CPU_AUTOPROBE
@@ -240,6 +240,7 @@ config GENERIC_CPU_VULNERABILITIES
config SOC_BUS
bool
......
......@@ -856,7 +856,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
static int set_quad_mode(struct spi_nor *nor, const struct flash_info *info)
{
int status;
@@ -1604,9 +1693,25 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1605,9 +1694,25 @@ int spi_nor_scan(struct spi_nor *nor, co
write_sr(nor, 0);
spi_nor_wait_till_ready(nor);
}
......@@ -882,7 +882,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
mtd->priv = nor;
mtd->type = MTD_NORFLASH;
mtd->writesize = 1;
@@ -1639,6 +1744,8 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1641,6 +1746,8 @@ int spi_nor_scan(struct spi_nor *nor, co
nor->flags |= SNOR_F_USE_FSR;
if (info->flags & SPI_NOR_HAS_TB)
nor->flags |= SNOR_F_HAS_SR_TB;
......@@ -891,7 +891,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
#ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
/* prefer "small sector" erase if possible */
@@ -1678,9 +1785,15 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1680,9 +1787,15 @@ int spi_nor_scan(struct spi_nor *nor, co
/* Some devices cannot do fast-read, no matter what DT tells us */
if (info->flags & SPI_NOR_NO_FR)
nor->flash_read = SPI_NOR_NORMAL;
......@@ -910,7 +910,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
ret = set_quad_mode(nor, info);
if (ret) {
dev_err(dev, "quad mode not supported\n");
@@ -1693,6 +1806,9 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1695,6 +1808,9 @@ int spi_nor_scan(struct spi_nor *nor, co
/* Default commands */
switch (nor->flash_read) {
......
......@@ -1741,7 +1741,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
PHY_INTERFACE_MODE_MAX,
} phy_interface_t;
@@ -780,6 +781,9 @@ int phy_stop_interrupts(struct phy_devic
@@ -791,6 +792,9 @@ int phy_stop_interrupts(struct phy_devic
static inline int phy_read_status(struct phy_device *phydev)
{
......
......@@ -34,7 +34,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
case PHY_##_state: \
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -812,6 +812,7 @@ int phy_ethtool_gset(struct phy_device *
@@ -823,6 +823,7 @@ int phy_ethtool_gset(struct phy_device *
int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr);
int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd);
int phy_start_interrupts(struct phy_device *phydev);
......
......@@ -39,7 +39,7 @@ Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
parts[i].name = partname;
if (of_get_property(pp, "read-only", &len))
@@ -213,6 +220,18 @@ static int __init ofpart_parser_init(voi
@@ -220,6 +227,18 @@ static int __init ofpart_parser_init(voi
return 0;
}
......
......@@ -272,7 +272,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
/**
* phy_read_mmd_indirect - reads data from the MMD registers
@@ -727,16 +720,7 @@ static inline bool phy_is_pseudo_fixed_l
@@ -738,16 +731,7 @@ static inline bool phy_is_pseudo_fixed_l
*
* Same rules as for phy_write();
*/
......
......@@ -295,7 +295,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
}
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -806,6 +806,8 @@ static inline const char *phydev_name(co
@@ -817,6 +817,8 @@ static inline const char *phydev_name(co
void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)
__printf(2, 3);
void phy_attached_info(struct phy_device *phydev);
......@@ -304,7 +304,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
int genphy_config_init(struct phy_device *phydev);
int genphy_setup_forced(struct phy_device *phydev);
int genphy_restart_aneg(struct phy_device *phydev);
@@ -820,6 +822,16 @@ static inline int genphy_no_soft_reset(s
@@ -831,6 +833,16 @@ static inline int genphy_no_soft_reset(s
{
return 0;
}
......
......@@ -18,7 +18,7 @@ Signed-off-by: Abhimanyu Vishwakarma <Abhimanyu.Vishwakarma@imgtec.com>
int ret;
int i;
@@ -1605,7 +1606,12 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1606,7 +1607,12 @@ int spi_nor_scan(struct spi_nor *nor, co
spi_nor_wait_till_ready(nor);
}
......
......@@ -173,7 +173,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_WRITE);
return ret;
}
@@ -1717,8 +1789,10 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1719,8 +1791,10 @@ int spi_nor_scan(struct spi_nor *nor, co
else if (mtd->size > 0x1000000) {
/* enable 4-byte addressing if the device exceeds 16MiB */
nor->addr_width = 4;
......
......@@ -68,7 +68,7 @@
static int macronix_quad_enable(struct spi_nor *nor)
{
int ret, val;
@@ -1702,10 +1763,12 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1704,10 +1765,12 @@ int spi_nor_scan(struct spi_nor *nor, co
}
/* sst nor chips use AAI word program */
......@@ -83,7 +83,7 @@
if (info->flags & USE_FSR)
nor->flags |= SNOR_F_USE_FSR;
@@ -1737,11 +1800,20 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -1739,11 +1802,20 @@ int spi_nor_scan(struct spi_nor *nor, co
mtd->writebufsize = nor->page_size;
if (np) {
......
......@@ -1460,7 +1460,7 @@
}
/**
@@ -415,7 +412,7 @@ static void stmmac_get_rx_hwtstamp(struc
@@ -421,7 +418,7 @@ static void stmmac_get_rx_hwtstamp(struc
/**
* stmmac_hwtstamp_ioctl - control hardware timestamping.
* @dev: device pointer.
......@@ -1469,7 +1469,7 @@
* a proprietary structure used to pass information to the driver.
* Description:
* This function configures the MAC to enable/disable both outgoing(TX)
@@ -606,7 +603,7 @@ static int stmmac_hwtstamp_ioctl(struct
@@ -612,7 +609,7 @@ static int stmmac_hwtstamp_ioctl(struct
/* program Sub Second Increment reg */
sec_inc = priv->hw->ptp->config_sub_second_increment(
......@@ -1478,7 +1478,7 @@
priv->plat->has_gmac4);
temp = div_u64(1000000000ULL, sec_inc);
@@ -616,7 +613,7 @@ static int stmmac_hwtstamp_ioctl(struct
@@ -622,7 +619,7 @@ static int stmmac_hwtstamp_ioctl(struct
* where, freq_div_ratio = 1e9ns/sec_inc
*/
temp = (u64)(temp << 32);
......@@ -1487,7 +1487,7 @@
priv->hw->ptp->config_addend(priv->ptpaddr,
priv->default_addend);
@@ -644,18 +641,6 @@ static int stmmac_init_ptp(struct stmmac
@@ -650,18 +647,6 @@ static int stmmac_init_ptp(struct stmmac
if (!(priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp))
return -EOPNOTSUPP;
......@@ -1506,7 +1506,7 @@
priv->adv_ts = 0;
/* Check if adv_ts can be enabled for dwmac 4.x core */
if (priv->plat->has_gmac4 && priv->dma_cap.atime_stamp)
@@ -682,8 +667,8 @@ static int stmmac_init_ptp(struct stmmac
@@ -688,8 +673,8 @@ static int stmmac_init_ptp(struct stmmac
static void stmmac_release_ptp(struct stmmac_priv *priv)
{
......@@ -1517,7 +1517,7 @@
stmmac_ptp_unregister(priv);
}
@@ -704,7 +689,7 @@ static void stmmac_adjust_link(struct ne
@@ -710,7 +695,7 @@ static void stmmac_adjust_link(struct ne
int new_state = 0;
unsigned int fc = priv->flow_ctrl, pause_time = priv->pause;
......@@ -1526,7 +1526,7 @@
return;
spin_lock_irqsave(&priv->lock, flags);
@@ -731,33 +716,36 @@ static void stmmac_adjust_link(struct ne
@@ -737,33 +722,36 @@ static void stmmac_adjust_link(struct ne
new_state = 1;
switch (phydev->speed) {
case 1000:
......@@ -1577,7 +1577,7 @@
priv->speed = phydev->speed;
}
@@ -770,8 +758,8 @@ static void stmmac_adjust_link(struct ne
@@ -776,8 +764,8 @@ static void stmmac_adjust_link(struct ne
} else if (priv->oldlink) {
new_state = 1;
priv->oldlink = 0;
......@@ -1588,7 +1588,7 @@
}
if (new_state && netif_msg_link(priv))
@@ -833,8 +821,8 @@ static int stmmac_init_phy(struct net_de
@@ -839,8 +827,8 @@ static int stmmac_init_phy(struct net_de
int interface = priv->plat->interface;
int max_speed = priv->plat->max_speed;
priv->oldlink = 0;
......@@ -1599,7 +1599,7 @@
if (priv->plat->phy_node) {
phydev = of_phy_connect(dev, priv->plat->phy_node,
@@ -886,9 +874,7 @@ static int stmmac_init_phy(struct net_de
@@ -892,9 +880,7 @@ static int stmmac_init_phy(struct net_de
if (phydev->is_pseudo_fixed_link)
phydev->irq = PHY_POLL;
......@@ -1610,7 +1610,7 @@
return 0;
}
@@ -1014,7 +1000,7 @@ static void stmmac_free_rx_buffers(struc
@@ -1020,7 +1006,7 @@ static void stmmac_free_rx_buffers(struc
* @dev: net device structure
* @flags: gfp flag.
* Description: this function initializes the DMA RX/TX descriptors
......@@ -1619,7 +1619,7 @@
* modes.
*/
static int init_dma_desc_rings(struct net_device *dev, gfp_t flags)
@@ -1127,13 +1113,6 @@ static void dma_free_tx_skbufs(struct st
@@ -1133,13 +1119,6 @@ static void dma_free_tx_skbufs(struct st
int i;
for (i = 0; i < DMA_TX_SIZE; i++) {
......@@ -1633,7 +1633,7 @@
if (priv->tx_skbuff_dma[i].buf) {
if (priv->tx_skbuff_dma[i].map_as_page)
dma_unmap_page(priv->device,
@@ -1147,7 +1126,7 @@ static void dma_free_tx_skbufs(struct st
@@ -1153,7 +1132,7 @@ static void dma_free_tx_skbufs(struct st
DMA_TO_DEVICE);
}
......@@ -1642,7 +1642,7 @@
dev_kfree_skb_any(priv->tx_skbuff[i]);
priv->tx_skbuff[i] = NULL;
priv->tx_skbuff_dma[i].buf = 0;
@@ -1271,6 +1250,28 @@ static void free_dma_desc_resources(stru
@@ -1277,6 +1256,28 @@ static void free_dma_desc_resources(stru
}
/**
......@@ -1671,7 +1671,7 @@
* stmmac_dma_operation_mode - HW DMA operation mode
* @priv: driver private structure
* Description: it is used for configuring the DMA operation mode register in
@@ -1671,10 +1672,6 @@ static int stmmac_hw_setup(struct net_de
@@ -1677,10 +1678,6 @@ static int stmmac_hw_setup(struct net_de
/* Copy the MAC addr into the HW */
priv->hw->mac->set_umac_addr(priv->hw, dev->dev_addr, 0);
......@@ -1682,7 +1682,7 @@
/* PS and related bits will be programmed according to the speed */
if (priv->hw->pcs) {
int speed = priv->plat->mac_port_sel_speed;
@@ -1691,6 +1688,10 @@ static int stmmac_hw_setup(struct net_de
@@ -1697,6 +1694,10 @@ static int stmmac_hw_setup(struct net_de
/* Initialize the MAC Core */
priv->hw->mac->core_init(priv->hw, dev->mtu);
......@@ -1693,7 +1693,7 @@
ret = priv->hw->mac->rx_ipc(priv->hw);
if (!ret) {
netdev_warn(priv->dev, "RX IPC Checksum Offload disabled\n");
@@ -1711,8 +1712,10 @@ static int stmmac_hw_setup(struct net_de
@@ -1717,8 +1718,10 @@ static int stmmac_hw_setup(struct net_de
if (init_ptp) {
ret = stmmac_init_ptp(priv);
......@@ -1706,7 +1706,7 @@
}
#ifdef CONFIG_DEBUG_FS
@@ -1726,11 +1729,6 @@ static int stmmac_hw_setup(struct net_de
@@ -1732,11 +1735,6 @@ static int stmmac_hw_setup(struct net_de
priv->hw->dma->start_tx(priv->ioaddr);
priv->hw->dma->start_rx(priv->ioaddr);
......@@ -1718,7 +1718,7 @@
priv->tx_lpi_timer = STMMAC_DEFAULT_TWT_LS;
if ((priv->use_riwt) && (priv->hw->dma->rx_watchdog)) {
@@ -2520,7 +2518,7 @@ static int stmmac_rx(struct stmmac_priv
@@ -2526,7 +2524,7 @@ static int stmmac_rx(struct stmmac_priv
if (unlikely(status == discard_frame)) {
priv->dev->stats.rx_errors++;
if (priv->hwts_rx_en && !priv->extend_desc) {
......@@ -1727,7 +1727,7 @@
* with timestamp value, hence reinitialize
* them in stmmac_rx_refill() function so that
* device can reuse it.
@@ -2543,7 +2541,7 @@ static int stmmac_rx(struct stmmac_priv
@@ -2549,7 +2547,7 @@ static int stmmac_rx(struct stmmac_priv
frame_len = priv->hw->desc->get_rx_frame_len(p, coe);
......@@ -1736,7 +1736,7 @@
* (preallocated during init) then the packet is
* ignored
*/
@@ -2763,7 +2761,7 @@ static netdev_features_t stmmac_fix_feat
@@ -2769,7 +2767,7 @@ static netdev_features_t stmmac_fix_feat
/* Some GMAC devices have a bugged Jumbo frame support that
* needs to have the Tx COE disabled for oversized frames
* (due to limited buffer sizes). In this case we disable
......@@ -1745,7 +1745,7 @@
*/
if (priv->plat->bugged_jumbo && (dev->mtu > ETH_DATA_LEN))
features &= ~NETIF_F_CSUM_MASK;
@@ -2909,9 +2907,7 @@ static void sysfs_display_ring(void *hea
@@ -2915,9 +2913,7 @@ static void sysfs_display_ring(void *hea
struct dma_desc *p = (struct dma_desc *)head;
for (i = 0; i < size; i++) {
......@@ -1755,7 +1755,7 @@
seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
i, (unsigned int)virt_to_phys(ep),
le32_to_cpu(ep->basic.des0),
@@ -2920,7 +2916,6 @@ static void sysfs_display_ring(void *hea
@@ -2926,7 +2922,6 @@ static void sysfs_display_ring(void *hea
le32_to_cpu(ep->basic.des3));
ep++;
} else {
......@@ -1763,7 +1763,7 @@
seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
i, (unsigned int)virt_to_phys(ep),
le32_to_cpu(p->des0), le32_to_cpu(p->des1),
@@ -2990,7 +2985,7 @@ static int stmmac_sysfs_dma_cap_read(str
@@ -2996,7 +2991,7 @@ static int stmmac_sysfs_dma_cap_read(str
(priv->dma_cap.hash_filter) ? "Y" : "N");
seq_printf(seq, "\tMultiple MAC address registers: %s\n",
(priv->dma_cap.multi_addr) ? "Y" : "N");
......@@ -1772,7 +1772,7 @@
(priv->dma_cap.pcs) ? "Y" : "N");
seq_printf(seq, "\tSMA (MDIO) Interface: %s\n",
(priv->dma_cap.sma_mdio) ? "Y" : "N");
@@ -3266,44 +3261,8 @@ int stmmac_dvr_probe(struct device *devi
@@ -3272,44 +3267,8 @@ int stmmac_dvr_probe(struct device *devi
if ((phyaddr >= 0) && (phyaddr <= 31))
priv->plat->phy_addr = phyaddr;
......@@ -1819,7 +1819,7 @@
/* Init MAC and get the capabilities */
ret = stmmac_hw_init(priv);
@@ -3389,10 +3348,6 @@ error_netdev_register:
@@ -3395,10 +3354,6 @@ error_netdev_register:
error_mdio_register:
netif_napi_del(&priv->napi);
error_hw_init:
......@@ -1830,7 +1830,7 @@
free_netdev(ndev);
return ret;
@@ -3418,10 +3373,10 @@ int stmmac_dvr_remove(struct device *dev
@@ -3424,10 +3379,10 @@ int stmmac_dvr_remove(struct device *dev
stmmac_set_mac(priv->ioaddr, false);
netif_carrier_off(ndev);
unregister_netdev(ndev);
......@@ -1845,7 +1845,7 @@
if (priv->hw->pcs != STMMAC_PCS_RGMII &&
priv->hw->pcs != STMMAC_PCS_TBI &&
priv->hw->pcs != STMMAC_PCS_RTBI)
@@ -3470,14 +3425,14 @@ int stmmac_suspend(struct device *dev)
@@ -3476,14 +3431,14 @@ int stmmac_suspend(struct device *dev)
stmmac_set_mac(priv->ioaddr, false);
pinctrl_pm_select_sleep_state(priv->device);
/* Disable clock in case of PWM is off */
......@@ -1864,7 +1864,7 @@
return 0;
}
EXPORT_SYMBOL_GPL(stmmac_suspend);
@@ -3510,9 +3465,9 @@ int stmmac_resume(struct device *dev)
@@ -3516,9 +3471,9 @@ int stmmac_resume(struct device *dev)
priv->irq_wake = 0;
} else {
pinctrl_pm_select_default_state(priv->device);
......
......@@ -1347,7 +1347,7 @@
}
static void print_pkt(unsigned char *buf, int len)
@@ -783,7 +794,7 @@ static void stmmac_adjust_link(struct ne
@@ -789,7 +800,7 @@ static void stmmac_adjust_link(struct ne
struct stmmac_priv *priv = netdev_priv(dev);
struct phy_device *phydev = dev->phydev;
unsigned long flags;
......@@ -1356,7 +1356,7 @@
if (!phydev)
return;
@@ -796,8 +807,8 @@ static void stmmac_adjust_link(struct ne
@@ -802,8 +813,8 @@ static void stmmac_adjust_link(struct ne
/* Now we make sure that we can be in full duplex mode.
* If not, we operate in half-duplex mode. */
if (phydev->duplex != priv->oldduplex) {
......@@ -1367,7 +1367,7 @@
ctrl &= ~priv->hw->link.duplex;
else
ctrl |= priv->hw->link.duplex;
@@ -808,30 +819,17 @@ static void stmmac_adjust_link(struct ne
@@ -814,30 +825,17 @@ static void stmmac_adjust_link(struct ne
stmmac_mac_flow_ctrl(priv, phydev->duplex);
if (phydev->speed != priv->speed) {
......@@ -1406,7 +1406,7 @@
break;
default:
netif_warn(priv, link, priv->dev,
@@ -847,12 +845,12 @@ static void stmmac_adjust_link(struct ne
@@ -853,12 +851,12 @@ static void stmmac_adjust_link(struct ne
writel(ctrl, priv->ioaddr + MAC_CTRL_REG);
if (!priv->oldlink) {
......@@ -1423,7 +1423,7 @@
priv->speed = SPEED_UNKNOWN;
priv->oldduplex = DUPLEX_UNKNOWN;
}
@@ -915,7 +913,7 @@ static int stmmac_init_phy(struct net_de
@@ -921,7 +919,7 @@ static int stmmac_init_phy(struct net_de
char bus_id[MII_BUS_ID_SIZE];
int interface = priv->plat->interface;
int max_speed = priv->plat->max_speed;
......@@ -1432,7 +1432,7 @@
priv->speed = SPEED_UNKNOWN;
priv->oldduplex = DUPLEX_UNKNOWN;
@@ -1450,7 +1448,7 @@ static void free_dma_rx_desc_resources(s
@@ -1456,7 +1454,7 @@ static void free_dma_rx_desc_resources(s
static void free_dma_tx_desc_resources(struct stmmac_priv *priv)
{
u32 tx_count = priv->plat->tx_queues_to_use;
......@@ -1441,7 +1441,7 @@
/* Free TX queue resources */
for (queue = 0; queue < tx_count; queue++) {
@@ -1499,7 +1497,7 @@ static int alloc_dma_rx_desc_resources(s
@@ -1505,7 +1503,7 @@ static int alloc_dma_rx_desc_resources(s
sizeof(dma_addr_t),
GFP_KERNEL);
if (!rx_q->rx_skbuff_dma)
......@@ -1450,7 +1450,7 @@
rx_q->rx_skbuff = kmalloc_array(DMA_RX_SIZE,
sizeof(struct sk_buff *),
@@ -1562,13 +1560,13 @@ static int alloc_dma_tx_desc_resources(s
@@ -1568,13 +1566,13 @@ static int alloc_dma_tx_desc_resources(s
sizeof(*tx_q->tx_skbuff_dma),
GFP_KERNEL);
if (!tx_q->tx_skbuff_dma)
......@@ -1466,7 +1466,7 @@
if (priv->extend_desc) {
tx_q->dma_etx = dma_zalloc_coherent(priv->device,
@@ -1578,7 +1576,7 @@ static int alloc_dma_tx_desc_resources(s
@@ -1584,7 +1582,7 @@ static int alloc_dma_tx_desc_resources(s
&tx_q->dma_tx_phy,
GFP_KERNEL);
if (!tx_q->dma_etx)
......@@ -1475,7 +1475,7 @@
} else {
tx_q->dma_tx = dma_zalloc_coherent(priv->device,
DMA_TX_SIZE *
@@ -1587,13 +1585,13 @@ static int alloc_dma_tx_desc_resources(s
@@ -1593,13 +1591,13 @@ static int alloc_dma_tx_desc_resources(s
&tx_q->dma_tx_phy,
GFP_KERNEL);
if (!tx_q->dma_tx)
......@@ -1491,7 +1491,7 @@
free_dma_tx_desc_resources(priv);
return ret;
@@ -2896,8 +2894,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
@@ -2902,8 +2900,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
priv->xstats.tx_set_ic_bit++;
}
......@@ -1501,7 +1501,7 @@
if (unlikely((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) &&
priv->hwts_tx_en)) {
@@ -2975,7 +2972,7 @@ static netdev_tx_t stmmac_xmit(struct sk
@@ -2981,7 +2978,7 @@ static netdev_tx_t stmmac_xmit(struct sk
/* Manage oversized TCP frames for GMAC4 device */
if (skb_is_gso(skb) && priv->tso) {
......@@ -1510,7 +1510,7 @@
return stmmac_tso_xmit(skb, dev);
}
@@ -3106,8 +3103,7 @@ static netdev_tx_t stmmac_xmit(struct sk
@@ -3112,8 +3109,7 @@ static netdev_tx_t stmmac_xmit(struct sk
priv->xstats.tx_set_ic_bit++;
}
......@@ -1520,7 +1520,7 @@
/* Ready to fill the first descriptor and set the OWN bit w/o any
* problems because all the descriptors are actually ready to be
@@ -3984,7 +3980,9 @@ static int stmmac_hw_init(struct stmmac_
@@ -3990,7 +3986,9 @@ static int stmmac_hw_init(struct stmmac_
struct mac_device_info *mac;
/* Identify the MAC HW device */
......@@ -1531,7 +1531,7 @@
priv->dev->priv_flags |= IFF_UNICAST_FLT;
mac = dwmac1000_setup(priv->ioaddr,
priv->plat->multicast_filter_bins,
@@ -4004,6 +4002,10 @@ static int stmmac_hw_init(struct stmmac_
@@ -4010,6 +4008,10 @@ static int stmmac_hw_init(struct stmmac_
priv->hw = mac;
......@@ -1542,7 +1542,7 @@
/* To use the chained or ring mode */
if (priv->synopsys_id >= DWMAC_CORE_4_00) {
priv->hw->mode = &dwmac4_ring_mode_ops;
@@ -4132,8 +4134,15 @@ int stmmac_dvr_probe(struct device *devi
@@ -4138,8 +4140,15 @@ int stmmac_dvr_probe(struct device *devi
if ((phyaddr >= 0) && (phyaddr <= 31))
priv->plat->phy_addr = phyaddr;
......@@ -1559,7 +1559,7 @@
/* Init MAC and get the capabilities */
ret = stmmac_hw_init(priv);
@@ -4150,7 +4159,7 @@ int stmmac_dvr_probe(struct device *devi
@@ -4156,7 +4165,7 @@ int stmmac_dvr_probe(struct device *devi
NETIF_F_RXCSUM;
if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) {
......@@ -1568,7 +1568,7 @@
priv->tso = true;
dev_info(priv->device, "TSO feature enabled\n");
}
@@ -4312,7 +4321,7 @@ int stmmac_suspend(struct device *dev)
@@ -4318,7 +4327,7 @@ int stmmac_suspend(struct device *dev)
}
spin_unlock_irqrestore(&priv->lock, flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册