mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-19 21:58:04 +00:00
kernel: bump 6.6 to 6.6.31
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.31 Removed upstreamed: backport-6.6/600-v6.9-01-net-gro-parse-ipv6-ext-headers-without-frag0-invalid.patch[1] backport-6.6/600-v6.9-02-net-gro-fix-udp-bad-offset-in-socket-lookup-by-addin.patch[2] backport-6.6/600-v6.9-03-net-gro-add-flush-check-in-udp_gro_receive_segment.patch[3] backport-6.6/816-v6.7-0002-nvmem-add-explicit-config-option-to-read-old-syntax-.patch[4] pending-6.6/681-net-bridge-fix-multicast-to-unicast-with-fraglist-GS.patch[5] pending-6.6/682-net-core-reject-skb_copy-_expand-for-fraglist-GSO-sk.patch[6] pending-6.6/684-net-bridge-fix-corrupted-ethernet-header-on-multicas.patch[7] pending-6.6/778-net-l2tp-drop-flow-hash-on-forward.patch[8] pending-6.6/440-mtd-don-t-look-for-OTP-legacy-NVMEM-cells-if-proper-.patch[9a,b] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.31&id=7f7b0ebb37afc5070d122318e3651d7cb8c4f01c 2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.31&id=af276a5ac8e938c8b058e3e124073cc1e322d98b 3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.31&id=78b6092d78341e423e5f6afae4d9f401b561aca7 4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.31&id=26e2fe4cab10e67f116f4a2eecc393824bb294b8 5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.31&id=65fbc7a11d063236e1f1dcebb38eeaa3ccbe2dbc 6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.31&id=cfe34d86ef9765c388f145039006bb79b6c81ac6 7. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.31&id=1ce60741d7e17dcf707e3bdebed4442ae30bdd02 8. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.31&id=23e25d2fc777cd0cc77c2f857f93e9b13ee789b9 9a. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.31&id=cce311f8bbbf9d24eacc39af3228cd104e079396 9b. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/diff/drivers/mtd/mtdcore.c?id=v6.6.31&id2=v6.6.30 Build system: x86/64 Build-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Run-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Signed-off-by: John Audia <therealgraysky@proton.me>
This commit is contained in:
parent
46ce2a36d8
commit
10d77b9bc3
@ -1,2 +1,2 @@
|
|||||||
LINUX_VERSION-6.6 = .30
|
LINUX_VERSION-6.6 = .31
|
||||||
LINUX_KERNEL_HASH-6.6.30 = b66a5b863b0f8669448b74ca83bd641a856f164b29956e539bbcb5fdeeab9cc6
|
LINUX_KERNEL_HASH-6.6.31 = d6ecff966f8c95ec4cb3bb303904f757b7de6a6bcfef0d0771cb852158e61c20
|
||||||
|
@ -1,107 +0,0 @@
|
|||||||
From: Richard Gobert <richardbgobert@gmail.com>
|
|
||||||
Date: Wed, 3 Jan 2024 15:44:21 +0100
|
|
||||||
Subject: [PATCH] net: gro: parse ipv6 ext headers without frag0 invalidation
|
|
||||||
|
|
||||||
The existing code always pulls the IPv6 header and sets the transport
|
|
||||||
offset initially. Then optionally again pulls any extension headers in
|
|
||||||
ipv6_gso_pull_exthdrs and sets the transport offset again on return from
|
|
||||||
that call. skb->data is set at the start of the first extension header
|
|
||||||
before calling ipv6_gso_pull_exthdrs, and must disable the frag0
|
|
||||||
optimization because that function uses pskb_may_pull/pskb_pull instead of
|
|
||||||
skb_gro_ helpers. It sets the GRO offset to the TCP header with
|
|
||||||
skb_gro_pull and sets the transport header. Then returns skb->data to its
|
|
||||||
position before this block.
|
|
||||||
|
|
||||||
This commit introduces a new helper function - ipv6_gro_pull_exthdrs -
|
|
||||||
which is used in ipv6_gro_receive to pull ipv6 ext headers instead of
|
|
||||||
ipv6_gso_pull_exthdrs. Thus, there is no modification of skb->data, all
|
|
||||||
operations use skb_gro_* helpers, and the frag0 fast path can be taken for
|
|
||||||
IPv6 packets with ext headers.
|
|
||||||
|
|
||||||
Signed-off-by: Richard Gobert <richardbgobert@gmail.com>
|
|
||||||
Reviewed-by: Willem de Bruijn <willemb@google.com>
|
|
||||||
Reviewed-by: David Ahern <dsahern@kernel.org>
|
|
||||||
Reviewed-by: Eric Dumazet <edumazet@google.com>
|
|
||||||
Link: https://lore.kernel.org/r/504130f6-b56c-4dcc-882c-97942c59f5b7@gmail.com
|
|
||||||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
||||||
---
|
|
||||||
|
|
||||||
--- a/net/ipv6/ip6_offload.c
|
|
||||||
+++ b/net/ipv6/ip6_offload.c
|
|
||||||
@@ -37,6 +37,40 @@
|
|
||||||
INDIRECT_CALL_L4(cb, f2, f1, head, skb); \
|
|
||||||
})
|
|
||||||
|
|
||||||
+static int ipv6_gro_pull_exthdrs(struct sk_buff *skb, int off, int proto)
|
|
||||||
+{
|
|
||||||
+ const struct net_offload *ops = NULL;
|
|
||||||
+ struct ipv6_opt_hdr *opth;
|
|
||||||
+
|
|
||||||
+ for (;;) {
|
|
||||||
+ int len;
|
|
||||||
+
|
|
||||||
+ ops = rcu_dereference(inet6_offloads[proto]);
|
|
||||||
+
|
|
||||||
+ if (unlikely(!ops))
|
|
||||||
+ break;
|
|
||||||
+
|
|
||||||
+ if (!(ops->flags & INET6_PROTO_GSO_EXTHDR))
|
|
||||||
+ break;
|
|
||||||
+
|
|
||||||
+ opth = skb_gro_header(skb, off + sizeof(*opth), off);
|
|
||||||
+ if (unlikely(!opth))
|
|
||||||
+ break;
|
|
||||||
+
|
|
||||||
+ len = ipv6_optlen(opth);
|
|
||||||
+
|
|
||||||
+ opth = skb_gro_header(skb, off + len, off);
|
|
||||||
+ if (unlikely(!opth))
|
|
||||||
+ break;
|
|
||||||
+ proto = opth->nexthdr;
|
|
||||||
+
|
|
||||||
+ off += len;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ skb_gro_pull(skb, off - skb_network_offset(skb));
|
|
||||||
+ return proto;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto)
|
|
||||||
{
|
|
||||||
const struct net_offload *ops = NULL;
|
|
||||||
@@ -206,28 +240,25 @@ INDIRECT_CALLABLE_SCOPE struct sk_buff *
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
skb_set_network_header(skb, off);
|
|
||||||
- skb_gro_pull(skb, sizeof(*iph));
|
|
||||||
- skb_set_transport_header(skb, skb_gro_offset(skb));
|
|
||||||
|
|
||||||
- flush += ntohs(iph->payload_len) != skb_gro_len(skb);
|
|
||||||
+ flush += ntohs(iph->payload_len) != skb->len - hlen;
|
|
||||||
|
|
||||||
proto = iph->nexthdr;
|
|
||||||
ops = rcu_dereference(inet6_offloads[proto]);
|
|
||||||
if (!ops || !ops->callbacks.gro_receive) {
|
|
||||||
- pskb_pull(skb, skb_gro_offset(skb));
|
|
||||||
- skb_gro_frag0_invalidate(skb);
|
|
||||||
- proto = ipv6_gso_pull_exthdrs(skb, proto);
|
|
||||||
- skb_gro_pull(skb, -skb_transport_offset(skb));
|
|
||||||
- skb_reset_transport_header(skb);
|
|
||||||
- __skb_push(skb, skb_gro_offset(skb));
|
|
||||||
+ proto = ipv6_gro_pull_exthdrs(skb, hlen, proto);
|
|
||||||
|
|
||||||
ops = rcu_dereference(inet6_offloads[proto]);
|
|
||||||
if (!ops || !ops->callbacks.gro_receive)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
- iph = ipv6_hdr(skb);
|
|
||||||
+ iph = skb_gro_network_header(skb);
|
|
||||||
+ } else {
|
|
||||||
+ skb_gro_pull(skb, sizeof(*iph));
|
|
||||||
}
|
|
||||||
|
|
||||||
+ skb_set_transport_header(skb, skb_gro_offset(skb));
|
|
||||||
+
|
|
||||||
NAPI_GRO_CB(skb)->proto = proto;
|
|
||||||
|
|
||||||
flush--;
|
|
@ -1,178 +0,0 @@
|
|||||||
From: Richard Gobert <richardbgobert@gmail.com>
|
|
||||||
Date: Tue, 30 Apr 2024 16:35:54 +0200
|
|
||||||
Subject: [PATCH] net: gro: fix udp bad offset in socket lookup by adding
|
|
||||||
{inner_}network_offset to napi_gro_cb
|
|
||||||
|
|
||||||
Commits a602456 ("udp: Add GRO functions to UDP socket") and 57c67ff ("udp:
|
|
||||||
additional GRO support") introduce incorrect usage of {ip,ipv6}_hdr in the
|
|
||||||
complete phase of gro. The functions always return skb->network_header,
|
|
||||||
which in the case of encapsulated packets at the gro complete phase, is
|
|
||||||
always set to the innermost L3 of the packet. That means that calling
|
|
||||||
{ip,ipv6}_hdr for skbs which completed the GRO receive phase (both in
|
|
||||||
gro_list and *_gro_complete) when parsing an encapsulated packet's _outer_
|
|
||||||
L3/L4 may return an unexpected value.
|
|
||||||
|
|
||||||
This incorrect usage leads to a bug in GRO's UDP socket lookup.
|
|
||||||
udp{4,6}_lib_lookup_skb functions use ip_hdr/ipv6_hdr respectively. These
|
|
||||||
*_hdr functions return network_header which will point to the innermost L3,
|
|
||||||
resulting in the wrong offset being used in __udp{4,6}_lib_lookup with
|
|
||||||
encapsulated packets.
|
|
||||||
|
|
||||||
This patch adds network_offset and inner_network_offset to napi_gro_cb, and
|
|
||||||
makes sure both are set correctly.
|
|
||||||
|
|
||||||
To fix the issue, network_offsets union is used inside napi_gro_cb, in
|
|
||||||
which both the outer and the inner network offsets are saved.
|
|
||||||
|
|
||||||
Reproduction example:
|
|
||||||
|
|
||||||
Endpoint configuration example (fou + local address bind)
|
|
||||||
|
|
||||||
# ip fou add port 6666 ipproto 4
|
|
||||||
# ip link add name tun1 type ipip remote 2.2.2.1 local 2.2.2.2 encap fou encap-dport 5555 encap-sport 6666 mode ipip
|
|
||||||
# ip link set tun1 up
|
|
||||||
# ip a add 1.1.1.2/24 dev tun1
|
|
||||||
|
|
||||||
Netperf TCP_STREAM result on net-next before patch is applied:
|
|
||||||
|
|
||||||
net-next main, GRO enabled:
|
|
||||||
$ netperf -H 1.1.1.2 -t TCP_STREAM -l 5
|
|
||||||
Recv Send Send
|
|
||||||
Socket Socket Message Elapsed
|
|
||||||
Size Size Size Time Throughput
|
|
||||||
bytes bytes bytes secs. 10^6bits/sec
|
|
||||||
|
|
||||||
131072 16384 16384 5.28 2.37
|
|
||||||
|
|
||||||
net-next main, GRO disabled:
|
|
||||||
$ netperf -H 1.1.1.2 -t TCP_STREAM -l 5
|
|
||||||
Recv Send Send
|
|
||||||
Socket Socket Message Elapsed
|
|
||||||
Size Size Size Time Throughput
|
|
||||||
bytes bytes bytes secs. 10^6bits/sec
|
|
||||||
|
|
||||||
131072 16384 16384 5.01 2745.06
|
|
||||||
|
|
||||||
patch applied, GRO enabled:
|
|
||||||
$ netperf -H 1.1.1.2 -t TCP_STREAM -l 5
|
|
||||||
Recv Send Send
|
|
||||||
Socket Socket Message Elapsed
|
|
||||||
Size Size Size Time Throughput
|
|
||||||
bytes bytes bytes secs. 10^6bits/sec
|
|
||||||
|
|
||||||
131072 16384 16384 5.01 2877.38
|
|
||||||
|
|
||||||
Fixes: a6024562ffd7 ("udp: Add GRO functions to UDP socket")
|
|
||||||
Signed-off-by: Richard Gobert <richardbgobert@gmail.com>
|
|
||||||
Reviewed-by: Eric Dumazet <edumazet@google.com>
|
|
||||||
Reviewed-by: Willem de Bruijn <willemb@google.com>
|
|
||||||
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|
||||||
---
|
|
||||||
|
|
||||||
--- a/include/net/gro.h
|
|
||||||
+++ b/include/net/gro.h
|
|
||||||
@@ -86,6 +86,15 @@ struct napi_gro_cb {
|
|
||||||
|
|
||||||
/* used to support CHECKSUM_COMPLETE for tunneling protocols */
|
|
||||||
__wsum csum;
|
|
||||||
+
|
|
||||||
+ /* L3 offsets */
|
|
||||||
+ union {
|
|
||||||
+ struct {
|
|
||||||
+ u16 network_offset;
|
|
||||||
+ u16 inner_network_offset;
|
|
||||||
+ };
|
|
||||||
+ u16 network_offsets[2];
|
|
||||||
+ };
|
|
||||||
};
|
|
||||||
|
|
||||||
#define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb)
|
|
||||||
--- a/net/8021q/vlan_core.c
|
|
||||||
+++ b/net/8021q/vlan_core.c
|
|
||||||
@@ -478,6 +478,8 @@ static struct sk_buff *vlan_gro_receive(
|
|
||||||
if (unlikely(!vhdr))
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
+ NAPI_GRO_CB(skb)->network_offsets[NAPI_GRO_CB(skb)->encap_mark] = hlen;
|
|
||||||
+
|
|
||||||
type = vhdr->h_vlan_encapsulated_proto;
|
|
||||||
|
|
||||||
ptype = gro_find_receive_by_type(type);
|
|
||||||
--- a/net/core/gro.c
|
|
||||||
+++ b/net/core/gro.c
|
|
||||||
@@ -373,6 +373,7 @@ static inline void skb_gro_reset_offset(
|
|
||||||
const struct skb_shared_info *pinfo = skb_shinfo(skb);
|
|
||||||
const skb_frag_t *frag0 = &pinfo->frags[0];
|
|
||||||
|
|
||||||
+ NAPI_GRO_CB(skb)->network_offset = 0;
|
|
||||||
NAPI_GRO_CB(skb)->data_offset = 0;
|
|
||||||
NAPI_GRO_CB(skb)->frag0 = NULL;
|
|
||||||
NAPI_GRO_CB(skb)->frag0_len = 0;
|
|
||||||
--- a/net/ipv4/af_inet.c
|
|
||||||
+++ b/net/ipv4/af_inet.c
|
|
||||||
@@ -1571,6 +1571,7 @@ struct sk_buff *inet_gro_receive(struct
|
|
||||||
/* The above will be needed by the transport layer if there is one
|
|
||||||
* immediately following this IP hdr.
|
|
||||||
*/
|
|
||||||
+ NAPI_GRO_CB(skb)->inner_network_offset = off;
|
|
||||||
|
|
||||||
/* Note : No need to call skb_gro_postpull_rcsum() here,
|
|
||||||
* as we already checked checksum over ipv4 header was 0
|
|
||||||
--- a/net/ipv4/udp.c
|
|
||||||
+++ b/net/ipv4/udp.c
|
|
||||||
@@ -534,7 +534,8 @@ static inline struct sock *__udp4_lib_lo
|
|
||||||
struct sock *udp4_lib_lookup_skb(const struct sk_buff *skb,
|
|
||||||
__be16 sport, __be16 dport)
|
|
||||||
{
|
|
||||||
- const struct iphdr *iph = ip_hdr(skb);
|
|
||||||
+ const u16 offset = NAPI_GRO_CB(skb)->network_offsets[skb->encapsulation];
|
|
||||||
+ const struct iphdr *iph = (struct iphdr *)(skb->data + offset);
|
|
||||||
struct net *net = dev_net(skb->dev);
|
|
||||||
int iif, sdif;
|
|
||||||
|
|
||||||
--- a/net/ipv4/udp_offload.c
|
|
||||||
+++ b/net/ipv4/udp_offload.c
|
|
||||||
@@ -718,7 +718,8 @@ EXPORT_SYMBOL(udp_gro_complete);
|
|
||||||
|
|
||||||
INDIRECT_CALLABLE_SCOPE int udp4_gro_complete(struct sk_buff *skb, int nhoff)
|
|
||||||
{
|
|
||||||
- const struct iphdr *iph = ip_hdr(skb);
|
|
||||||
+ const u16 offset = NAPI_GRO_CB(skb)->network_offsets[skb->encapsulation];
|
|
||||||
+ const struct iphdr *iph = (struct iphdr *)(skb->data + offset);
|
|
||||||
struct udphdr *uh = (struct udphdr *)(skb->data + nhoff);
|
|
||||||
|
|
||||||
/* do fraglist only if there is no outer UDP encap (or we already processed it) */
|
|
||||||
--- a/net/ipv6/ip6_offload.c
|
|
||||||
+++ b/net/ipv6/ip6_offload.c
|
|
||||||
@@ -240,6 +240,7 @@ INDIRECT_CALLABLE_SCOPE struct sk_buff *
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
skb_set_network_header(skb, off);
|
|
||||||
+ NAPI_GRO_CB(skb)->inner_network_offset = off;
|
|
||||||
|
|
||||||
flush += ntohs(iph->payload_len) != skb->len - hlen;
|
|
||||||
|
|
||||||
--- a/net/ipv6/udp.c
|
|
||||||
+++ b/net/ipv6/udp.c
|
|
||||||
@@ -275,7 +275,8 @@ static struct sock *__udp6_lib_lookup_sk
|
|
||||||
struct sock *udp6_lib_lookup_skb(const struct sk_buff *skb,
|
|
||||||
__be16 sport, __be16 dport)
|
|
||||||
{
|
|
||||||
- const struct ipv6hdr *iph = ipv6_hdr(skb);
|
|
||||||
+ const u16 offset = NAPI_GRO_CB(skb)->network_offsets[skb->encapsulation];
|
|
||||||
+ const struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + offset);
|
|
||||||
struct net *net = dev_net(skb->dev);
|
|
||||||
int iif, sdif;
|
|
||||||
|
|
||||||
--- a/net/ipv6/udp_offload.c
|
|
||||||
+++ b/net/ipv6/udp_offload.c
|
|
||||||
@@ -164,7 +164,8 @@ flush:
|
|
||||||
|
|
||||||
INDIRECT_CALLABLE_SCOPE int udp6_gro_complete(struct sk_buff *skb, int nhoff)
|
|
||||||
{
|
|
||||||
- const struct ipv6hdr *ipv6h = ipv6_hdr(skb);
|
|
||||||
+ const u16 offset = NAPI_GRO_CB(skb)->network_offsets[skb->encapsulation];
|
|
||||||
+ const struct ipv6hdr *ipv6h = (struct ipv6hdr *)(skb->data + offset);
|
|
||||||
struct udphdr *uh = (struct udphdr *)(skb->data + nhoff);
|
|
||||||
|
|
||||||
/* do fraglist only if there is no outer UDP encap (or we already processed it) */
|
|
@ -1,48 +0,0 @@
|
|||||||
From: Richard Gobert <richardbgobert@gmail.com>
|
|
||||||
Date: Tue, 30 Apr 2024 16:35:55 +0200
|
|
||||||
Subject: [PATCH] net: gro: add flush check in udp_gro_receive_segment
|
|
||||||
|
|
||||||
GRO-GSO path is supposed to be transparent and as such L3 flush checks are
|
|
||||||
relevant to all UDP flows merging in GRO. This patch uses the same logic
|
|
||||||
and code from tcp_gro_receive, terminating merge if flush is non zero.
|
|
||||||
|
|
||||||
Fixes: e20cf8d3f1f7 ("udp: implement GRO for plain UDP sockets.")
|
|
||||||
Signed-off-by: Richard Gobert <richardbgobert@gmail.com>
|
|
||||||
Reviewed-by: Willem de Bruijn <willemb@google.com>
|
|
||||||
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
|
||||||
---
|
|
||||||
|
|
||||||
--- a/net/ipv4/udp_offload.c
|
|
||||||
+++ b/net/ipv4/udp_offload.c
|
|
||||||
@@ -471,6 +471,7 @@ static struct sk_buff *udp_gro_receive_s
|
|
||||||
struct sk_buff *p;
|
|
||||||
unsigned int ulen;
|
|
||||||
int ret = 0;
|
|
||||||
+ int flush;
|
|
||||||
|
|
||||||
/* requires non zero csum, for symmetry with GSO */
|
|
||||||
if (!uh->check) {
|
|
||||||
@@ -504,13 +505,22 @@ static struct sk_buff *udp_gro_receive_s
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ flush = NAPI_GRO_CB(p)->flush;
|
|
||||||
+
|
|
||||||
+ if (NAPI_GRO_CB(p)->flush_id != 1 ||
|
|
||||||
+ NAPI_GRO_CB(p)->count != 1 ||
|
|
||||||
+ !NAPI_GRO_CB(p)->is_atomic)
|
|
||||||
+ flush |= NAPI_GRO_CB(p)->flush_id;
|
|
||||||
+ else
|
|
||||||
+ NAPI_GRO_CB(p)->is_atomic = false;
|
|
||||||
+
|
|
||||||
/* Terminate the flow on len mismatch or if it grow "too much".
|
|
||||||
* Under small packet flood GRO count could elsewhere grow a lot
|
|
||||||
* leading to excessive truesize values.
|
|
||||||
* On len mismatch merge the first packet shorter than gso_size,
|
|
||||||
* otherwise complete the GRO packet.
|
|
||||||
*/
|
|
||||||
- if (ulen > ntohs(uh2->len)) {
|
|
||||||
+ if (ulen > ntohs(uh2->len) || flush) {
|
|
||||||
pp = p;
|
|
||||||
} else {
|
|
||||||
if (NAPI_GRO_CB(skb)->is_flist) {
|
|
@ -19,7 +19,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|||||||
|
|
||||||
--- a/drivers/nvmem/qfprom.c
|
--- a/drivers/nvmem/qfprom.c
|
||||||
+++ b/drivers/nvmem/qfprom.c
|
+++ b/drivers/nvmem/qfprom.c
|
||||||
@@ -423,12 +423,12 @@ static int qfprom_probe(struct platform_
|
@@ -424,12 +424,12 @@ static int qfprom_probe(struct platform_
|
||||||
if (IS_ERR(priv->vcc))
|
if (IS_ERR(priv->vcc))
|
||||||
return PTR_ERR(priv->vcc);
|
return PTR_ERR(priv->vcc);
|
||||||
|
|
||||||
|
@ -1,330 +0,0 @@
|
|||||||
From 2cc3b37f5b6df8189d55d0e812d9658ce256dfec Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
|
||||||
Date: Fri, 20 Oct 2023 11:55:41 +0100
|
|
||||||
Subject: [PATCH] nvmem: add explicit config option to read old syntax fixed OF
|
|
||||||
cells
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Binding for fixed NVMEM cells defined directly as NVMEM device subnodes
|
|
||||||
has been deprecated. It has been replaced by the "fixed-layout" NVMEM
|
|
||||||
layout binding.
|
|
||||||
|
|
||||||
New syntax is meant to be clearer and should help avoiding imprecise
|
|
||||||
bindings.
|
|
||||||
|
|
||||||
NVMEM subsystem already supports the new binding. It should be a good
|
|
||||||
idea to limit support for old syntax to existing drivers that actually
|
|
||||||
support & use it (we can't break backward compatibility!). That way we
|
|
||||||
additionally encourage new bindings & drivers to ignore deprecated
|
|
||||||
binding.
|
|
||||||
|
|
||||||
It wasn't clear (to me) if rtc and w1 code actually uses old syntax
|
|
||||||
fixed cells. I enabled them to don't risk any breakage.
|
|
||||||
|
|
||||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
|
||||||
[for meson-{efuse,mx-efuse}.c]
|
|
||||||
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
|
|
||||||
[for mtk-efuse.c, nvmem/core.c, nvmem-provider.h]
|
|
||||||
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
|
|
||||||
[MT8192, MT8195 Chromebooks]
|
|
||||||
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
|
|
||||||
[for microchip-otpc.c]
|
|
||||||
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
[SAMA7G5-EK]
|
|
||||||
Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
|
|
||||||
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
|
|
||||||
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
|
|
||||||
Link: https://lore.kernel.org/r/20231020105545.216052-3-srinivas.kandagatla@linaro.org
|
|
||||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
||||||
---
|
|
||||||
drivers/mtd/mtdcore.c | 2 ++
|
|
||||||
drivers/nvmem/apple-efuses.c | 1 +
|
|
||||||
drivers/nvmem/core.c | 8 +++++---
|
|
||||||
drivers/nvmem/imx-ocotp-scu.c | 1 +
|
|
||||||
drivers/nvmem/imx-ocotp.c | 1 +
|
|
||||||
drivers/nvmem/meson-efuse.c | 1 +
|
|
||||||
drivers/nvmem/meson-mx-efuse.c | 1 +
|
|
||||||
drivers/nvmem/microchip-otpc.c | 1 +
|
|
||||||
drivers/nvmem/mtk-efuse.c | 1 +
|
|
||||||
drivers/nvmem/qcom-spmi-sdam.c | 1 +
|
|
||||||
drivers/nvmem/qfprom.c | 1 +
|
|
||||||
drivers/nvmem/rave-sp-eeprom.c | 1 +
|
|
||||||
drivers/nvmem/rockchip-efuse.c | 1 +
|
|
||||||
drivers/nvmem/sc27xx-efuse.c | 1 +
|
|
||||||
drivers/nvmem/sec-qfprom.c | 1 +
|
|
||||||
drivers/nvmem/sprd-efuse.c | 1 +
|
|
||||||
drivers/nvmem/stm32-romem.c | 1 +
|
|
||||||
drivers/nvmem/sunplus-ocotp.c | 1 +
|
|
||||||
drivers/nvmem/sunxi_sid.c | 1 +
|
|
||||||
drivers/nvmem/uniphier-efuse.c | 1 +
|
|
||||||
drivers/nvmem/zynqmp_nvmem.c | 1 +
|
|
||||||
drivers/rtc/nvmem.c | 1 +
|
|
||||||
drivers/w1/slaves/w1_ds250x.c | 1 +
|
|
||||||
include/linux/nvmem-provider.h | 2 ++
|
|
||||||
24 files changed, 30 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
--- a/drivers/mtd/mtdcore.c
|
|
||||||
+++ b/drivers/mtd/mtdcore.c
|
|
||||||
@@ -552,6 +552,7 @@ static int mtd_nvmem_add(struct mtd_info
|
|
||||||
config.dev = &mtd->dev;
|
|
||||||
config.name = dev_name(&mtd->dev);
|
|
||||||
config.owner = THIS_MODULE;
|
|
||||||
+ config.add_legacy_fixed_of_cells = of_device_is_compatible(node, "nvmem-cells");
|
|
||||||
config.reg_read = mtd_nvmem_reg_read;
|
|
||||||
config.size = mtd->size;
|
|
||||||
config.word_size = 1;
|
|
||||||
@@ -898,6 +899,7 @@ static struct nvmem_device *mtd_otp_nvme
|
|
||||||
config.name = compatible;
|
|
||||||
config.id = NVMEM_DEVID_AUTO;
|
|
||||||
config.owner = THIS_MODULE;
|
|
||||||
+ config.add_legacy_fixed_of_cells = true;
|
|
||||||
config.type = NVMEM_TYPE_OTP;
|
|
||||||
config.root_only = true;
|
|
||||||
config.ignore_wp = true;
|
|
||||||
--- a/drivers/nvmem/apple-efuses.c
|
|
||||||
+++ b/drivers/nvmem/apple-efuses.c
|
|
||||||
@@ -36,6 +36,7 @@ static int apple_efuses_probe(struct pla
|
|
||||||
struct resource *res;
|
|
||||||
struct nvmem_config config = {
|
|
||||||
.dev = &pdev->dev,
|
|
||||||
+ .add_legacy_fixed_of_cells = true,
|
|
||||||
.read_only = true,
|
|
||||||
.reg_read = apple_efuses_read,
|
|
||||||
.stride = sizeof(u32),
|
|
||||||
--- a/drivers/nvmem/core.c
|
|
||||||
+++ b/drivers/nvmem/core.c
|
|
||||||
@@ -1003,9 +1003,11 @@ struct nvmem_device *nvmem_register(cons
|
|
||||||
if (rval)
|
|
||||||
goto err_remove_cells;
|
|
||||||
|
|
||||||
- rval = nvmem_add_cells_from_legacy_of(nvmem);
|
|
||||||
- if (rval)
|
|
||||||
- goto err_remove_cells;
|
|
||||||
+ if (config->add_legacy_fixed_of_cells) {
|
|
||||||
+ rval = nvmem_add_cells_from_legacy_of(nvmem);
|
|
||||||
+ if (rval)
|
|
||||||
+ goto err_remove_cells;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
rval = nvmem_add_cells_from_fixed_layout(nvmem);
|
|
||||||
if (rval)
|
|
||||||
--- a/drivers/nvmem/imx-ocotp-scu.c
|
|
||||||
+++ b/drivers/nvmem/imx-ocotp-scu.c
|
|
||||||
@@ -220,6 +220,7 @@ static int imx_scu_ocotp_write(void *con
|
|
||||||
|
|
||||||
static struct nvmem_config imx_scu_ocotp_nvmem_config = {
|
|
||||||
.name = "imx-scu-ocotp",
|
|
||||||
+ .add_legacy_fixed_of_cells = true,
|
|
||||||
.read_only = false,
|
|
||||||
.word_size = 4,
|
|
||||||
.stride = 1,
|
|
||||||
--- a/drivers/nvmem/imx-ocotp.c
|
|
||||||
+++ b/drivers/nvmem/imx-ocotp.c
|
|
||||||
@@ -615,6 +615,7 @@ static int imx_ocotp_probe(struct platfo
|
|
||||||
return PTR_ERR(priv->clk);
|
|
||||||
|
|
||||||
priv->params = of_device_get_match_data(&pdev->dev);
|
|
||||||
+ imx_ocotp_nvmem_config.add_legacy_fixed_of_cells = true;
|
|
||||||
imx_ocotp_nvmem_config.size = 4 * priv->params->nregs;
|
|
||||||
imx_ocotp_nvmem_config.dev = dev;
|
|
||||||
imx_ocotp_nvmem_config.priv = priv;
|
|
||||||
--- a/drivers/nvmem/meson-efuse.c
|
|
||||||
+++ b/drivers/nvmem/meson-efuse.c
|
|
||||||
@@ -74,6 +74,7 @@ static int meson_efuse_probe(struct plat
|
|
||||||
|
|
||||||
econfig->dev = dev;
|
|
||||||
econfig->name = dev_name(dev);
|
|
||||||
+ econfig->add_legacy_fixed_of_cells = true;
|
|
||||||
econfig->stride = 1;
|
|
||||||
econfig->word_size = 1;
|
|
||||||
econfig->reg_read = meson_efuse_read;
|
|
||||||
--- a/drivers/nvmem/meson-mx-efuse.c
|
|
||||||
+++ b/drivers/nvmem/meson-mx-efuse.c
|
|
||||||
@@ -210,6 +210,7 @@ static int meson_mx_efuse_probe(struct p
|
|
||||||
efuse->config.owner = THIS_MODULE;
|
|
||||||
efuse->config.dev = &pdev->dev;
|
|
||||||
efuse->config.priv = efuse;
|
|
||||||
+ efuse->config.add_legacy_fixed_of_cells = true;
|
|
||||||
efuse->config.stride = drvdata->word_size;
|
|
||||||
efuse->config.word_size = drvdata->word_size;
|
|
||||||
efuse->config.size = SZ_512;
|
|
||||||
--- a/drivers/nvmem/microchip-otpc.c
|
|
||||||
+++ b/drivers/nvmem/microchip-otpc.c
|
|
||||||
@@ -261,6 +261,7 @@ static int mchp_otpc_probe(struct platfo
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
mchp_nvmem_config.dev = otpc->dev;
|
|
||||||
+ mchp_nvmem_config.add_legacy_fixed_of_cells = true;
|
|
||||||
mchp_nvmem_config.size = size;
|
|
||||||
mchp_nvmem_config.priv = otpc;
|
|
||||||
nvmem = devm_nvmem_register(&pdev->dev, &mchp_nvmem_config);
|
|
||||||
--- a/drivers/nvmem/mtk-efuse.c
|
|
||||||
+++ b/drivers/nvmem/mtk-efuse.c
|
|
||||||
@@ -83,6 +83,7 @@ static int mtk_efuse_probe(struct platfo
|
|
||||||
return PTR_ERR(priv->base);
|
|
||||||
|
|
||||||
pdata = device_get_match_data(dev);
|
|
||||||
+ econfig.add_legacy_fixed_of_cells = true;
|
|
||||||
econfig.stride = 1;
|
|
||||||
econfig.word_size = 1;
|
|
||||||
econfig.reg_read = mtk_reg_read;
|
|
||||||
--- a/drivers/nvmem/qcom-spmi-sdam.c
|
|
||||||
+++ b/drivers/nvmem/qcom-spmi-sdam.c
|
|
||||||
@@ -142,6 +142,7 @@ static int sdam_probe(struct platform_de
|
|
||||||
sdam->sdam_config.name = "spmi_sdam";
|
|
||||||
sdam->sdam_config.id = NVMEM_DEVID_AUTO;
|
|
||||||
sdam->sdam_config.owner = THIS_MODULE;
|
|
||||||
+ sdam->sdam_config.add_legacy_fixed_of_cells = true;
|
|
||||||
sdam->sdam_config.stride = 1;
|
|
||||||
sdam->sdam_config.word_size = 1;
|
|
||||||
sdam->sdam_config.reg_read = sdam_read;
|
|
||||||
--- a/drivers/nvmem/qfprom.c
|
|
||||||
+++ b/drivers/nvmem/qfprom.c
|
|
||||||
@@ -357,6 +357,7 @@ static int qfprom_probe(struct platform_
|
|
||||||
{
|
|
||||||
struct nvmem_config econfig = {
|
|
||||||
.name = "qfprom",
|
|
||||||
+ .add_legacy_fixed_of_cells = true,
|
|
||||||
.stride = 1,
|
|
||||||
.word_size = 1,
|
|
||||||
.id = NVMEM_DEVID_AUTO,
|
|
||||||
--- a/drivers/nvmem/rave-sp-eeprom.c
|
|
||||||
+++ b/drivers/nvmem/rave-sp-eeprom.c
|
|
||||||
@@ -328,6 +328,7 @@ static int rave_sp_eeprom_probe(struct p
|
|
||||||
of_property_read_string(np, "zii,eeprom-name", &config.name);
|
|
||||||
config.priv = eeprom;
|
|
||||||
config.dev = dev;
|
|
||||||
+ config.add_legacy_fixed_of_cells = true;
|
|
||||||
config.size = size;
|
|
||||||
config.reg_read = rave_sp_eeprom_reg_read;
|
|
||||||
config.reg_write = rave_sp_eeprom_reg_write;
|
|
||||||
--- a/drivers/nvmem/rockchip-efuse.c
|
|
||||||
+++ b/drivers/nvmem/rockchip-efuse.c
|
|
||||||
@@ -205,6 +205,7 @@ static int rockchip_rk3399_efuse_read(vo
|
|
||||||
|
|
||||||
static struct nvmem_config econfig = {
|
|
||||||
.name = "rockchip-efuse",
|
|
||||||
+ .add_legacy_fixed_of_cells = true,
|
|
||||||
.stride = 1,
|
|
||||||
.word_size = 1,
|
|
||||||
.read_only = true,
|
|
||||||
--- a/drivers/nvmem/sc27xx-efuse.c
|
|
||||||
+++ b/drivers/nvmem/sc27xx-efuse.c
|
|
||||||
@@ -247,6 +247,7 @@ static int sc27xx_efuse_probe(struct pla
|
|
||||||
econfig.reg_read = sc27xx_efuse_read;
|
|
||||||
econfig.priv = efuse;
|
|
||||||
econfig.dev = &pdev->dev;
|
|
||||||
+ econfig.add_legacy_fixed_of_cells = true;
|
|
||||||
nvmem = devm_nvmem_register(&pdev->dev, &econfig);
|
|
||||||
if (IS_ERR(nvmem)) {
|
|
||||||
dev_err(&pdev->dev, "failed to register nvmem config\n");
|
|
||||||
--- a/drivers/nvmem/sec-qfprom.c
|
|
||||||
+++ b/drivers/nvmem/sec-qfprom.c
|
|
||||||
@@ -47,6 +47,7 @@ static int sec_qfprom_probe(struct platf
|
|
||||||
{
|
|
||||||
struct nvmem_config econfig = {
|
|
||||||
.name = "sec-qfprom",
|
|
||||||
+ .add_legacy_fixed_of_cells = true,
|
|
||||||
.stride = 1,
|
|
||||||
.word_size = 1,
|
|
||||||
.id = NVMEM_DEVID_AUTO,
|
|
||||||
--- a/drivers/nvmem/sprd-efuse.c
|
|
||||||
+++ b/drivers/nvmem/sprd-efuse.c
|
|
||||||
@@ -408,6 +408,7 @@ static int sprd_efuse_probe(struct platf
|
|
||||||
econfig.read_only = false;
|
|
||||||
econfig.name = "sprd-efuse";
|
|
||||||
econfig.size = efuse->data->blk_nums * SPRD_EFUSE_BLOCK_WIDTH;
|
|
||||||
+ econfig.add_legacy_fixed_of_cells = true;
|
|
||||||
econfig.reg_read = sprd_efuse_read;
|
|
||||||
econfig.reg_write = sprd_efuse_write;
|
|
||||||
econfig.priv = efuse;
|
|
||||||
--- a/drivers/nvmem/stm32-romem.c
|
|
||||||
+++ b/drivers/nvmem/stm32-romem.c
|
|
||||||
@@ -207,6 +207,7 @@ static int stm32_romem_probe(struct plat
|
|
||||||
priv->cfg.priv = priv;
|
|
||||||
priv->cfg.owner = THIS_MODULE;
|
|
||||||
priv->cfg.type = NVMEM_TYPE_OTP;
|
|
||||||
+ priv->cfg.add_legacy_fixed_of_cells = true;
|
|
||||||
|
|
||||||
priv->lower = 0;
|
|
||||||
|
|
||||||
--- a/drivers/nvmem/sunplus-ocotp.c
|
|
||||||
+++ b/drivers/nvmem/sunplus-ocotp.c
|
|
||||||
@@ -145,6 +145,7 @@ disable_clk:
|
|
||||||
|
|
||||||
static struct nvmem_config sp_ocotp_nvmem_config = {
|
|
||||||
.name = "sp-ocotp",
|
|
||||||
+ .add_legacy_fixed_of_cells = true,
|
|
||||||
.read_only = true,
|
|
||||||
.word_size = 1,
|
|
||||||
.size = QAC628_OTP_SIZE,
|
|
||||||
--- a/drivers/nvmem/sunxi_sid.c
|
|
||||||
+++ b/drivers/nvmem/sunxi_sid.c
|
|
||||||
@@ -153,6 +153,7 @@ static int sunxi_sid_probe(struct platfo
|
|
||||||
nvmem_cfg->dev = dev;
|
|
||||||
nvmem_cfg->name = "sunxi-sid";
|
|
||||||
nvmem_cfg->type = NVMEM_TYPE_OTP;
|
|
||||||
+ nvmem_cfg->add_legacy_fixed_of_cells = true;
|
|
||||||
nvmem_cfg->read_only = true;
|
|
||||||
nvmem_cfg->size = cfg->size;
|
|
||||||
nvmem_cfg->word_size = 1;
|
|
||||||
--- a/drivers/nvmem/uniphier-efuse.c
|
|
||||||
+++ b/drivers/nvmem/uniphier-efuse.c
|
|
||||||
@@ -52,6 +52,7 @@ static int uniphier_efuse_probe(struct p
|
|
||||||
econfig.size = resource_size(res);
|
|
||||||
econfig.priv = priv;
|
|
||||||
econfig.dev = dev;
|
|
||||||
+ econfig.add_legacy_fixed_of_cells = true;
|
|
||||||
nvmem = devm_nvmem_register(dev, &econfig);
|
|
||||||
|
|
||||||
return PTR_ERR_OR_ZERO(nvmem);
|
|
||||||
--- a/drivers/nvmem/zynqmp_nvmem.c
|
|
||||||
+++ b/drivers/nvmem/zynqmp_nvmem.c
|
|
||||||
@@ -58,6 +58,7 @@ static int zynqmp_nvmem_probe(struct pla
|
|
||||||
|
|
||||||
priv->dev = dev;
|
|
||||||
econfig.dev = dev;
|
|
||||||
+ econfig.add_legacy_fixed_of_cells = true;
|
|
||||||
econfig.reg_read = zynqmp_nvmem_read;
|
|
||||||
econfig.priv = priv;
|
|
||||||
|
|
||||||
--- a/drivers/rtc/nvmem.c
|
|
||||||
+++ b/drivers/rtc/nvmem.c
|
|
||||||
@@ -21,6 +21,7 @@ int devm_rtc_nvmem_register(struct rtc_d
|
|
||||||
|
|
||||||
nvmem_config->dev = dev;
|
|
||||||
nvmem_config->owner = rtc->owner;
|
|
||||||
+ nvmem_config->add_legacy_fixed_of_cells = true;
|
|
||||||
nvmem = devm_nvmem_register(dev, nvmem_config);
|
|
||||||
if (IS_ERR(nvmem))
|
|
||||||
dev_err(dev, "failed to register nvmem device for RTC\n");
|
|
||||||
--- a/drivers/w1/slaves/w1_ds250x.c
|
|
||||||
+++ b/drivers/w1/slaves/w1_ds250x.c
|
|
||||||
@@ -168,6 +168,7 @@ static int w1_eprom_add_slave(struct w1_
|
|
||||||
struct nvmem_device *nvmem;
|
|
||||||
struct nvmem_config nvmem_cfg = {
|
|
||||||
.dev = &sl->dev,
|
|
||||||
+ .add_legacy_fixed_of_cells = true,
|
|
||||||
.reg_read = w1_nvmem_read,
|
|
||||||
.type = NVMEM_TYPE_OTP,
|
|
||||||
.read_only = true,
|
|
||||||
--- a/include/linux/nvmem-provider.h
|
|
||||||
+++ b/include/linux/nvmem-provider.h
|
|
||||||
@@ -82,6 +82,7 @@ struct nvmem_cell_info {
|
|
||||||
* @owner: Pointer to exporter module. Used for refcounting.
|
|
||||||
* @cells: Optional array of pre-defined NVMEM cells.
|
|
||||||
* @ncells: Number of elements in cells.
|
|
||||||
+ * @add_legacy_fixed_of_cells: Read fixed NVMEM cells from old OF syntax.
|
|
||||||
* @keepout: Optional array of keepout ranges (sorted ascending by start).
|
|
||||||
* @nkeepout: Number of elements in the keepout array.
|
|
||||||
* @type: Type of the nvmem storage
|
|
||||||
@@ -112,6 +113,7 @@ struct nvmem_config {
|
|
||||||
struct module *owner;
|
|
||||||
const struct nvmem_cell_info *cells;
|
|
||||||
int ncells;
|
|
||||||
+ bool add_legacy_fixed_of_cells;
|
|
||||||
const struct nvmem_keepout *keepout;
|
|
||||||
unsigned int nkeepout;
|
|
||||||
enum nvmem_type type;
|
|
@ -137,7 +137,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
#include <linux/err.h>
|
#include <linux/err.h>
|
||||||
#include <linux/property.h>
|
#include <linux/property.h>
|
||||||
@@ -3433,3 +3434,5 @@ static int __init regmap_initcall(void)
|
@@ -3470,3 +3471,5 @@ static int __init regmap_initcall(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
postcore_initcall(regmap_initcall);
|
postcore_initcall(regmap_initcall);
|
||||||
|
@ -9,7 +9,7 @@ Subject: [PATCH] net/dsa/mv88e6xxx: disable ATU violation
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||||
@@ -3353,6 +3353,9 @@ static int mv88e6xxx_setup_port(struct m
|
@@ -3365,6 +3365,9 @@ static int mv88e6xxx_setup_port(struct m
|
||||||
else
|
else
|
||||||
reg = 1 << port;
|
reg = 1 << port;
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|||||||
*/
|
*/
|
||||||
--- a/include/linux/skbuff.h
|
--- a/include/linux/skbuff.h
|
||||||
+++ b/include/linux/skbuff.h
|
+++ b/include/linux/skbuff.h
|
||||||
@@ -3080,6 +3080,10 @@ static inline int pskb_trim(struct sk_bu
|
@@ -3095,6 +3095,10 @@ static inline int pskb_trim(struct sk_bu
|
||||||
return (len < skb->len) ? __pskb_trim(skb, len) : 0;
|
return (len < skb->len) ? __pskb_trim(skb, len) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|||||||
/**
|
/**
|
||||||
* pskb_trim_unique - remove end from a paged unique (not cloned) buffer
|
* pskb_trim_unique - remove end from a paged unique (not cloned) buffer
|
||||||
* @skb: buffer to alter
|
* @skb: buffer to alter
|
||||||
@@ -3245,16 +3249,6 @@ static inline struct sk_buff *dev_alloc_
|
@@ -3260,16 +3264,6 @@ static inline struct sk_buff *dev_alloc_
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
|
||||||
Date: Wed, 27 Mar 2024 23:18:51 +0100
|
|
||||||
Subject: [PATCH] mtd: don't look for OTP legacy NVMEM cells if proper node
|
|
||||||
doesn't exist
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
If node with "user-otp" / "factory-otp" compatible doesn't exist it's
|
|
||||||
important to prevent NVMEM core from looking for legacy NVMEM cells.
|
|
||||||
Otherwise it would look for them in the device node.
|
|
||||||
|
|
||||||
This fixes treating NAND controller attached chips as NVMEM cell.
|
|
||||||
Problem example:
|
|
||||||
[ 0.410107] nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xdc
|
|
||||||
[ 0.416531] nand: Macronix MX30LF4G18AC
|
|
||||||
[ 0.420409] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
|
|
||||||
[ 0.428022] iproc_nand 18028000.nand-controller: detected 512MiB total, 128KiB blocks, 2KiB pages, 16B OOB, 8-bit, BCH-8
|
|
||||||
[ 0.438991] Scanning device for bad blocks
|
|
||||||
(...)
|
|
||||||
[ 2.848418] nvmem user-otp1: nvmem: invalid reg on /nand-controller@18028000/nand@0
|
|
||||||
[ 2.856126] iproc_nand 18028000.nand-controller: error -EINVAL: Failed to register OTP NVMEM device
|
|
||||||
|
|
||||||
This long standing issue was exposed by the support for Macronix OTP.
|
|
||||||
|
|
||||||
Reported-by: Christian Marangi <ansuelsmth@gmail.com>
|
|
||||||
Fixes: 4b361cfa8624 ("mtd: core: add OTP nvmem provider support")
|
|
||||||
Fixes: e87161321a40 ("mtd: rawnand: macronix: OTP access for MX30LFxG18AC")
|
|
||||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
|
||||||
---
|
|
||||||
drivers/mtd/mtdcore.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
--- a/drivers/mtd/mtdcore.c
|
|
||||||
+++ b/drivers/mtd/mtdcore.c
|
|
||||||
@@ -931,7 +931,7 @@ static struct nvmem_device *mtd_otp_nvme
|
|
||||||
config.name = compatible;
|
|
||||||
config.id = NVMEM_DEVID_AUTO;
|
|
||||||
config.owner = THIS_MODULE;
|
|
||||||
- config.add_legacy_fixed_of_cells = true;
|
|
||||||
+ config.add_legacy_fixed_of_cells = !!np;
|
|
||||||
config.type = NVMEM_TYPE_OTP;
|
|
||||||
config.root_only = true;
|
|
||||||
config.ignore_wp = true;
|
|
@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|||||||
|
|
||||||
--- a/include/linux/skbuff.h
|
--- a/include/linux/skbuff.h
|
||||||
+++ b/include/linux/skbuff.h
|
+++ b/include/linux/skbuff.h
|
||||||
@@ -3047,7 +3047,7 @@ static inline int pskb_network_may_pull(
|
@@ -3062,7 +3062,7 @@ static inline int pskb_network_may_pull(
|
||||||
* NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8)
|
* NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8)
|
||||||
*/
|
*/
|
||||||
#ifndef NET_SKB_PAD
|
#ifndef NET_SKB_PAD
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
From: Felix Fietkau <nbd@nbd.name>
|
|
||||||
Date: Sat, 27 Apr 2024 18:54:25 +0200
|
|
||||||
Subject: [PATCH] net: bridge: fix multicast-to-unicast with fraglist GSO
|
|
||||||
|
|
||||||
Calling skb_copy on a SKB_GSO_FRAGLIST skb is not valid, since it returns
|
|
||||||
an invalid linearized skb. This code only needs to change the ethernet
|
|
||||||
header, so pskb_copy is the right function to call here.
|
|
||||||
|
|
||||||
Fixes: 6db6f0eae605 ("bridge: multicast to unicast")
|
|
||||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
||||||
---
|
|
||||||
|
|
||||||
--- a/net/bridge/br_forward.c
|
|
||||||
+++ b/net/bridge/br_forward.c
|
|
||||||
@@ -266,7 +266,7 @@ static void maybe_deliver_addr(struct ne
|
|
||||||
if (skb->dev == p->dev && ether_addr_equal(src, addr))
|
|
||||||
return;
|
|
||||||
|
|
||||||
- skb = skb_copy(skb, GFP_ATOMIC);
|
|
||||||
+ skb = pskb_copy(skb, GFP_ATOMIC);
|
|
||||||
if (!skb) {
|
|
||||||
DEV_STATS_INC(dev, tx_dropped);
|
|
||||||
return;
|
|
@ -1,59 +0,0 @@
|
|||||||
From: Felix Fietkau <nbd@nbd.name>
|
|
||||||
Date: Sat, 27 Apr 2024 19:29:45 +0200
|
|
||||||
Subject: [PATCH] net: core: reject skb_copy(_expand) for fraglist GSO skbs
|
|
||||||
|
|
||||||
SKB_GSO_FRAGLIST skbs must not be linearized, otherwise they become
|
|
||||||
invalid. Return NULL if such an skb is passed to skb_copy or
|
|
||||||
skb_copy_expand, in order to prevent a crash on a potential later
|
|
||||||
call to skb_gso_segment.
|
|
||||||
|
|
||||||
Fixes: 3a1296a38d0c ("net: Support GRO/GSO fraglist chaining.")
|
|
||||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
||||||
---
|
|
||||||
|
|
||||||
--- a/net/core/skbuff.c
|
|
||||||
+++ b/net/core/skbuff.c
|
|
||||||
@@ -1971,11 +1971,17 @@ static inline int skb_alloc_rx_flag(cons
|
|
||||||
|
|
||||||
struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t gfp_mask)
|
|
||||||
{
|
|
||||||
- int headerlen = skb_headroom(skb);
|
|
||||||
- unsigned int size = skb_end_offset(skb) + skb->data_len;
|
|
||||||
- struct sk_buff *n = __alloc_skb(size, gfp_mask,
|
|
||||||
- skb_alloc_rx_flag(skb), NUMA_NO_NODE);
|
|
||||||
+ struct sk_buff *n;
|
|
||||||
+ unsigned int size;
|
|
||||||
+ int headerlen;
|
|
||||||
|
|
||||||
+ if (WARN_ON_ONCE(skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST))
|
|
||||||
+ return NULL;
|
|
||||||
+
|
|
||||||
+ headerlen = skb_headroom(skb);
|
|
||||||
+ size = skb_end_offset(skb) + skb->data_len;
|
|
||||||
+ n = __alloc_skb(size, gfp_mask,
|
|
||||||
+ skb_alloc_rx_flag(skb), NUMA_NO_NODE);
|
|
||||||
if (!n)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
@@ -2303,12 +2309,17 @@ struct sk_buff *skb_copy_expand(const st
|
|
||||||
/*
|
|
||||||
* Allocate the copy buffer
|
|
||||||
*/
|
|
||||||
- struct sk_buff *n = __alloc_skb(newheadroom + skb->len + newtailroom,
|
|
||||||
- gfp_mask, skb_alloc_rx_flag(skb),
|
|
||||||
- NUMA_NO_NODE);
|
|
||||||
- int oldheadroom = skb_headroom(skb);
|
|
||||||
int head_copy_len, head_copy_off;
|
|
||||||
+ struct sk_buff *n;
|
|
||||||
+ int oldheadroom;
|
|
||||||
+
|
|
||||||
+ if (WARN_ON_ONCE(skb_shinfo(skb)->gso_type & SKB_GSO_FRAGLIST))
|
|
||||||
+ return NULL;
|
|
||||||
|
|
||||||
+ oldheadroom = skb_headroom(skb);
|
|
||||||
+ n = __alloc_skb(newheadroom + skb->len + newtailroom,
|
|
||||||
+ gfp_mask, skb_alloc_rx_flag(skb),
|
|
||||||
+ NUMA_NO_NODE);
|
|
||||||
if (!n)
|
|
||||||
return NULL;
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
|||||||
From: Felix Fietkau <nbd@nbd.name>
|
|
||||||
Date: Sun, 5 May 2024 20:36:56 +0200
|
|
||||||
Subject: [PATCH] net: bridge: fix corrupted ethernet header on
|
|
||||||
multicast-to-unicast
|
|
||||||
|
|
||||||
The change from skb_copy to pskb_copy unfortunately changed the data
|
|
||||||
copying to omit the ethernet header, since it was pulled before reaching
|
|
||||||
this point. Fix this by calling __skb_push/pull around pskb_copy.
|
|
||||||
|
|
||||||
Fixes: 59c878cbcdd8 ("net: bridge: fix multicast-to-unicast with fraglist GSO")
|
|
||||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
||||||
---
|
|
||||||
|
|
||||||
--- a/net/bridge/br_forward.c
|
|
||||||
+++ b/net/bridge/br_forward.c
|
|
||||||
@@ -258,6 +258,7 @@ static void maybe_deliver_addr(struct ne
|
|
||||||
{
|
|
||||||
struct net_device *dev = BR_INPUT_SKB_CB(skb)->brdev;
|
|
||||||
const unsigned char *src = eth_hdr(skb)->h_source;
|
|
||||||
+ struct sk_buff *nskb;
|
|
||||||
|
|
||||||
if (!should_deliver(p, skb))
|
|
||||||
return;
|
|
||||||
@@ -266,12 +267,16 @@ static void maybe_deliver_addr(struct ne
|
|
||||||
if (skb->dev == p->dev && ether_addr_equal(src, addr))
|
|
||||||
return;
|
|
||||||
|
|
||||||
- skb = pskb_copy(skb, GFP_ATOMIC);
|
|
||||||
- if (!skb) {
|
|
||||||
+ __skb_push(skb, ETH_HLEN);
|
|
||||||
+ nskb = pskb_copy(skb, GFP_ATOMIC);
|
|
||||||
+ __skb_pull(skb, ETH_HLEN);
|
|
||||||
+ if (!nskb) {
|
|
||||||
DEV_STATS_INC(dev, tx_dropped);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ skb = nskb;
|
|
||||||
+ __skb_pull(skb, ETH_HLEN);
|
|
||||||
if (!is_broadcast_ether_addr(addr))
|
|
||||||
memcpy(eth_hdr(skb)->h_dest, addr, ETH_ALEN);
|
|
||||||
|
|
@ -134,7 +134,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|||||||
return -EMSGSIZE;
|
return -EMSGSIZE;
|
||||||
|
|
||||||
timerval = br_timer_value(&p->message_age_timer);
|
timerval = br_timer_value(&p->message_age_timer);
|
||||||
@@ -901,6 +903,7 @@ static const struct nla_policy br_port_p
|
@@ -902,6 +904,7 @@ static const struct nla_policy br_port_p
|
||||||
[IFLA_BRPORT_MCAST_MAX_GROUPS] = { .type = NLA_U32 },
|
[IFLA_BRPORT_MCAST_MAX_GROUPS] = { .type = NLA_U32 },
|
||||||
[IFLA_BRPORT_NEIGH_VLAN_SUPPRESS] = NLA_POLICY_MAX(NLA_U8, 1),
|
[IFLA_BRPORT_NEIGH_VLAN_SUPPRESS] = NLA_POLICY_MAX(NLA_U8, 1),
|
||||||
[IFLA_BRPORT_BACKUP_NHID] = { .type = NLA_U32 },
|
[IFLA_BRPORT_BACKUP_NHID] = { .type = NLA_U32 },
|
||||||
@ -142,7 +142,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Change the state of the port and notify spanning tree */
|
/* Change the state of the port and notify spanning tree */
|
||||||
@@ -969,6 +972,7 @@ static int br_setport(struct net_bridge_
|
@@ -970,6 +973,7 @@ static int br_setport(struct net_bridge_
|
||||||
br_set_port_flag(p, tb, IFLA_BRPORT_MAB, BR_PORT_MAB);
|
br_set_port_flag(p, tb, IFLA_BRPORT_MAB, BR_PORT_MAB);
|
||||||
br_set_port_flag(p, tb, IFLA_BRPORT_NEIGH_VLAN_SUPPRESS,
|
br_set_port_flag(p, tb, IFLA_BRPORT_NEIGH_VLAN_SUPPRESS,
|
||||||
BR_NEIGH_VLAN_SUPPRESS);
|
BR_NEIGH_VLAN_SUPPRESS);
|
||||||
|
@ -17,7 +17,7 @@ Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||||
@@ -6935,6 +6935,7 @@ static int mv88e6xxx_register_switch(str
|
@@ -6947,6 +6947,7 @@ static int mv88e6xxx_register_switch(str
|
||||||
ds->ops = &mv88e6xxx_switch_ops;
|
ds->ops = &mv88e6xxx_switch_ops;
|
||||||
ds->ageing_time_min = chip->info->age_time_coeff;
|
ds->ageing_time_min = chip->info->age_time_coeff;
|
||||||
ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX;
|
ds->ageing_time_max = chip->info->age_time_coeff * U8_MAX;
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
From 4a44a52f16ccd3d03e0cb5fb437a5eb31a5f9f05 Mon Sep 17 00:00:00 2001
|
|
||||||
From: David Bauer <mail@david-bauer.net>
|
|
||||||
Date: Mon, 26 Feb 2024 21:39:34 +0100
|
|
||||||
Subject: [PATCH] net l2tp: drop flow hash on forward
|
|
||||||
|
|
||||||
Drop the flow-hash of the skb when forwarding to the L2TP netdev.
|
|
||||||
|
|
||||||
This avoids the L2TP qdisc from using the flow-hash from the outer
|
|
||||||
packet, which is identical for every flow within the tunnel.
|
|
||||||
|
|
||||||
This does not affect every platform but is specific for the ethernet
|
|
||||||
driver. It depends on the platform including L4 information in the
|
|
||||||
flow-hash.
|
|
||||||
|
|
||||||
Signed-off-by: David Bauer <mail@david-bauer.net>
|
|
||||||
---
|
|
||||||
net/l2tp/l2tp_eth.c | 3 +++
|
|
||||||
1 file changed, 3 insertions(+)
|
|
||||||
|
|
||||||
--- a/net/l2tp/l2tp_eth.c
|
|
||||||
+++ b/net/l2tp/l2tp_eth.c
|
|
||||||
@@ -136,6 +136,9 @@ static void l2tp_eth_dev_recv(struct l2t
|
|
||||||
/* checksums verified by L2TP */
|
|
||||||
skb->ip_summed = CHECKSUM_NONE;
|
|
||||||
|
|
||||||
+ /* drop outer flow-hash */
|
|
||||||
+ skb_clear_hash(skb);
|
|
||||||
+
|
|
||||||
skb_dst_drop(skb);
|
|
||||||
nf_reset_ct(skb);
|
|
||||||
|
|
@ -93,7 +93,7 @@ Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
|
|||||||
+#endif
|
+#endif
|
||||||
--- a/include/linux/skbuff.h
|
--- a/include/linux/skbuff.h
|
||||||
+++ b/include/linux/skbuff.h
|
+++ b/include/linux/skbuff.h
|
||||||
@@ -4642,6 +4642,9 @@ enum skb_ext_id {
|
@@ -4657,6 +4657,9 @@ enum skb_ext_id {
|
||||||
#if IS_ENABLED(CONFIG_MCTP_FLOWS)
|
#if IS_ENABLED(CONFIG_MCTP_FLOWS)
|
||||||
SKB_EXT_MCTP,
|
SKB_EXT_MCTP,
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user