backports.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] backports: Update to version 5.6.5
@ 2020-04-19 17:10 Hauke Mehrtens
  2020-04-19 17:10 ` [PATCH 1/8] backports: add linux/units.h Hauke Mehrtens
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2020-04-19 17:10 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

This adds the missing changes to make backports work with kernel 5.6.5

1   3.12.74             [  OK  ]
2   3.13.11             [  LINK  ]
3   3.14.79             [  LINK  ]
4   3.16.82             [  OK  ]
5   3.18.140            [  OK  ]
6   4.0.9               [  LINK  ]
7   4.1.52              [  OK  ]
8   4.2.8               [  LINK  ]
9   4.3.6               [  LINK  ]
10  4.4.219             [  OK  ]
11  4.5.7               [  OK  ]
12  4.6.7               [  OK  ]
13  4.7.10              [  OK  ]
14  4.8.17              [  OK  ]
15  4.9.219             [  OK  ]
16  4.10.17             [  OK  ]
17  4.11.12             [  OK  ]
18  4.12.14             [  OK  ]
19  4.13.16             [  OK  ]
20  4.14.176            [  OK  ]
21  4.15.18             [  OK  ]
22  4.16.18             [  OK  ]
23  4.17.19             [  OK  ]
24  4.18.20             [  OK  ]
25  4.19.116            [  OK  ]
26  4.20.17             [  OK  ]
27  5.0.21              [  OK  ]
28  5.1.21              [  OK  ]
29  5.2.21              [  OK  ]
30  5.3.18              [  OK  ]
31  5.4.28              [  OK  ]
32  5.5.18              [  OK  ]
33  5.6.5               [  OK  ]


Hauke Mehrtens (5):
  backports: patches: Refresh on kernel 5.6.5
  backports: patches: handle txqueue parameter in ndo_tx_timeout
  backports: rcupdate: Add rcu_replace_pointer
  backports: fs: Adapt struct proc_ops
  patches: patches: Restrict MTU changes to struct net_device

Johannes Berg (3):
  backports: add linux/units.h
  backports: skbuff: add skb_list_walk_safe() and skb_mark_not_on_list()
  backports: netlink: fix nla_validate_nested()

 backport/backport-include/linux/fs.h          |  9 ++++++
 backport/backport-include/linux/rcupdate.h    | 20 +++++++++++++
 backport/backport-include/linux/skbuff.h      | 13 +++++++++
 backport/backport-include/net/netlink.h       | 12 ++++----
 copy-list                                     |  1 +
 ...2-disable-dump-adjust-on-old-kernels.patch |  4 +--
 .../net_wireless_nl80211.patch                |  2 +-
 patches/0073-netdevice-mtu-range.cocci        |  6 ++--
 patches/0074-netdevice-mtu-range-ifdefs.cocci |  4 +--
 patches/0079-netdev-destructor/brcmfmac.patch |  2 +-
 patches/0090-remove-GRO_CONSUMED.patch        |  2 +-
 patches/0092-listified-rx/iwlwifi.patch       |  2 +-
 patches/0093-nl80211-vlan.patch               | 12 --------
 patches/0094-ndo-tx-timeout.cocci             | 28 +++++++++++++++++++
 patches/0094-ndo-tx-timeout/orinoco.patch     | 10 +++++++
 patches/0094-ndo-tx-timeout/prism54.patch     | 23 +++++++++++++++
 patches/0094-ndo-tx-timeout/usbnet.patch      | 10 +++++++
 17 files changed, 131 insertions(+), 29 deletions(-)
 delete mode 100644 patches/0093-nl80211-vlan.patch
 create mode 100644 patches/0094-ndo-tx-timeout.cocci
 create mode 100644 patches/0094-ndo-tx-timeout/orinoco.patch
 create mode 100644 patches/0094-ndo-tx-timeout/prism54.patch
 create mode 100644 patches/0094-ndo-tx-timeout/usbnet.patch

-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/8] backports: add linux/units.h
  2020-04-19 17:10 [PATCH 0/8] backports: Update to version 5.6.5 Hauke Mehrtens
@ 2020-04-19 17:10 ` Hauke Mehrtens
  2020-04-19 17:10 ` [PATCH 2/8] backports: skbuff: add skb_list_walk_safe() and skb_mark_not_on_list() Hauke Mehrtens
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2020-04-19 17:10 UTC (permalink / raw)
  To: backports; +Cc: johannes, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

We can just copy this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 copy-list | 1 +
 1 file changed, 1 insertion(+)

diff --git a/copy-list b/copy-list
index 328e92d0..ba10a0bf 100644
--- a/copy-list
+++ b/copy-list
@@ -23,6 +23,7 @@ include/linux/crc32poly.h
 include/linux/bitfield.h
 include/linux/average.h
 include/linux/overflow.h
+include/linux/units.h
 
 # crypto_memneq
 crypto/memneq.c -> compat/memneq.c
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/8] backports: skbuff: add skb_list_walk_safe() and skb_mark_not_on_list()
  2020-04-19 17:10 [PATCH 0/8] backports: Update to version 5.6.5 Hauke Mehrtens
  2020-04-19 17:10 ` [PATCH 1/8] backports: add linux/units.h Hauke Mehrtens
@ 2020-04-19 17:10 ` Hauke Mehrtens
  2020-04-19 17:10 ` [PATCH 3/8] backports: netlink: fix nla_validate_nested() Hauke Mehrtens
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2020-04-19 17:10 UTC (permalink / raw)
  To: backports; +Cc: johannes, Johannes Berg, Hauke Mehrtens

From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[Do not add skb_mark_not_on_list() on kernel > 4.19.10]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/skbuff.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index 42b048ad..3ed990d0 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -378,6 +378,13 @@ static inline struct sk_buff *__skb_peek(const struct sk_buff_head *list_)
 {
 	return list_->next;
 }
+
+#if !LINUX_VERSION_IN_RANGE(4,19,10, 4,20,0)
+static inline void skb_mark_not_on_list(struct sk_buff *skb)
+{
+	skb->next = NULL;
+}
+#endif /* 4.19.10 <= x < 4.20 */
 #endif
 
 #if LINUX_VERSION_IS_LESS(4,11,0)
@@ -406,4 +413,10 @@ static inline void nf_reset_ct(struct sk_buff *skb)
 }
 #endif
 
+#ifndef skb_list_walk_safe
+#define skb_list_walk_safe(first, skb, next_skb)				\
+	for ((skb) = (first), (next_skb) = (skb) ? (skb)->next : NULL; (skb); 	\
+	     (skb) = (next_skb), (next_skb) = (skb) ? (skb)->next : NULL)
+#endif
+
 #endif /* __BACKPORT_SKBUFF_H */
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/8] backports: netlink: fix nla_validate_nested()
  2020-04-19 17:10 [PATCH 0/8] backports: Update to version 5.6.5 Hauke Mehrtens
  2020-04-19 17:10 ` [PATCH 1/8] backports: add linux/units.h Hauke Mehrtens
  2020-04-19 17:10 ` [PATCH 2/8] backports: skbuff: add skb_list_walk_safe() and skb_mark_not_on_list() Hauke Mehrtens
@ 2020-04-19 17:10 ` Hauke Mehrtens
  2020-04-19 17:10 ` [PATCH 4/8] backports: patches: Refresh on kernel 5.6.5 Hauke Mehrtens
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2020-04-19 17:10 UTC (permalink / raw)
  To: backports; +Cc: johannes, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

I had accidentally named this nl80211_validate_nested(),
and it got renamed in 5.6.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/net/netlink.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/backport/backport-include/net/netlink.h b/backport/backport-include/net/netlink.h
index b2045e44..082ac4d0 100644
--- a/backport/backport-include/net/netlink.h
+++ b/backport/backport-include/net/netlink.h
@@ -266,17 +266,17 @@ nla_validate_nested_deprecated(const struct nlattr *start, int maxtype,
 }
 #endif /* < 5.2 */
 
-#if LINUX_VERSION_IS_LESS(5,3,0)
-#define nl80211_validate_nested LINUX_BACKPORT(nl80211_validate_nested)
+#if LINUX_VERSION_IS_LESS(5,6,0)
+#define nla_validate_nested LINUX_BACKPORT(nla_validate_nested)
 static inline int
-nl80211_validate_nested(const struct nlattr *start, int maxtype,
-			const struct nla_policy *policy,
-			struct netlink_ext_ack *extack)
+nla_validate_nested(const struct nlattr *start, int maxtype,
+		    const struct nla_policy *policy,
+		    struct netlink_ext_ack *extack)
 {
 	return __nla_validate_nested(start, maxtype, policy,
 				     NL_VALIDATE_STRICT, extack);
 }
-#endif /* < 5.3 */
+#endif /* < 5.6 */
 
 #if LINUX_VERSION_IS_LESS(5,1,0)
 #undef NLA_POLICY_NESTED
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/8] backports: patches: Refresh on kernel 5.6.5
  2020-04-19 17:10 [PATCH 0/8] backports: Update to version 5.6.5 Hauke Mehrtens
                   ` (2 preceding siblings ...)
  2020-04-19 17:10 ` [PATCH 3/8] backports: netlink: fix nla_validate_nested() Hauke Mehrtens
@ 2020-04-19 17:10 ` Hauke Mehrtens
  2020-04-19 17:10 ` [PATCH 5/8] backports: patches: handle txqueue parameter in ndo_tx_timeout Hauke Mehrtens
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2020-04-19 17:10 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

The patch patches/0093-nl80211-vlan.patch was applied upstream.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 .../0002-disable-dump-adjust-on-old-kernels.patch    |  4 ++--
 patches/0014-netlink_seq/net_wireless_nl80211.patch  |  2 +-
 patches/0079-netdev-destructor/brcmfmac.patch        |  2 +-
 patches/0090-remove-GRO_CONSUMED.patch               |  2 +-
 patches/0092-listified-rx/iwlwifi.patch              |  2 +-
 patches/0093-nl80211-vlan.patch                      | 12 ------------
 6 files changed, 6 insertions(+), 18 deletions(-)
 delete mode 100644 patches/0093-nl80211-vlan.patch

diff --git a/patches/0002-disable-dump-adjust-on-old-kernels.patch b/patches/0002-disable-dump-adjust-on-old-kernels.patch
index 3d752359..5a41edfb 100644
--- a/patches/0002-disable-dump-adjust-on-old-kernels.patch
+++ b/patches/0002-disable-dump-adjust-on-old-kernels.patch
@@ -28,7 +28,7 @@ Date:   Fri Mar 1 14:03:49 2013 +0100
 
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -2549,6 +2549,7 @@ static int nl80211_dump_wiphy(struct sk_
+@@ -2550,6 +2550,7 @@ static int nl80211_dump_wiphy(struct sk_
  						 cb->nlh->nlmsg_seq,
  						 NLM_F_MULTI, state);
  			if (ret < 0) {
@@ -36,7 +36,7 @@ Date:   Fri Mar 1 14:03:49 2013 +0100
  				/*
  				 * If sending the wiphy data didn't fit (ENOBUFS
  				 * or EMSGSIZE returned), this SKB is still
-@@ -2570,6 +2571,7 @@ static int nl80211_dump_wiphy(struct sk_
+@@ -2571,6 +2572,7 @@ static int nl80211_dump_wiphy(struct sk_
  					rtnl_unlock();
  					return 1;
  				}
diff --git a/patches/0014-netlink_seq/net_wireless_nl80211.patch b/patches/0014-netlink_seq/net_wireless_nl80211.patch
index 28416330..c9442de4 100644
--- a/patches/0014-netlink_seq/net_wireless_nl80211.patch
+++ b/patches/0014-netlink_seq/net_wireless_nl80211.patch
@@ -1,6 +1,6 @@
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -8780,7 +8780,9 @@ static int nl80211_dump_scan(struct sk_b
+@@ -8781,7 +8781,9 @@ static int nl80211_dump_scan(struct sk_b
  	if (start == 0)
  		cfg80211_bss_expire(rdev);
  
diff --git a/patches/0079-netdev-destructor/brcmfmac.patch b/patches/0079-netdev-destructor/brcmfmac.patch
index 3ee6da62..6dc59043 100644
--- a/patches/0079-netdev-destructor/brcmfmac.patch
+++ b/patches/0079-netdev-destructor/brcmfmac.patch
@@ -24,7 +24,7 @@
  int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked)
  {
  	struct brcmf_pub *drvr = ifp->drvr;
-@@ -802,7 +819,11 @@ struct brcmf_if *brcmf_add_if(struct brc
+@@ -870,7 +887,11 @@ struct brcmf_if *brcmf_add_if(struct brc
  		if (!ndev)
  			return ERR_PTR(-ENOMEM);
  
diff --git a/patches/0090-remove-GRO_CONSUMED.patch b/patches/0090-remove-GRO_CONSUMED.patch
index ea0e1ea7..5ba92ae6 100644
--- a/patches/0090-remove-GRO_CONSUMED.patch
+++ b/patches/0090-remove-GRO_CONSUMED.patch
@@ -4,7 +4,7 @@ older kernel versions.
 
 --- a/drivers/net/wireless/ath/wil6210/txrx.c
 +++ b/drivers/net/wireless/ath/wil6210/txrx.c
-@@ -913,7 +913,9 @@ void wil_netif_rx(struct sk_buff *skb, s
+@@ -914,7 +914,9 @@ void wil_netif_rx(struct sk_buff *skb, s
  		[GRO_HELD]		= "GRO_HELD",
  		[GRO_NORMAL]		= "GRO_NORMAL",
  		[GRO_DROP]		= "GRO_DROP",
diff --git a/patches/0092-listified-rx/iwlwifi.patch b/patches/0092-listified-rx/iwlwifi.patch
index 925010fd..4d3e25cc 100644
--- a/patches/0092-listified-rx/iwlwifi.patch
+++ b/patches/0092-listified-rx/iwlwifi.patch
@@ -3,7 +3,7 @@ commit 323ebb61e32b ("net: use listified RX for handling GRO_NORMAL skbs")
 
 --- a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
 +++ b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
-@@ -1531,11 +1531,13 @@ out:
+@@ -1581,11 +1581,13 @@ out:
  	if (napi->poll) {
  		napi_gro_flush(napi, false);
  
diff --git a/patches/0093-nl80211-vlan.patch b/patches/0093-nl80211-vlan.patch
deleted file mode 100644
index c1f8dac1..00000000
--- a/patches/0093-nl80211-vlan.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
-index ae8e3d9575d3..15c0e3c5c979 100644
---- a/net/wireless/nl80211.c
-+++ b/net/wireless/nl80211.c
-@@ -20,6 +20,7 @@
- #include <linux/netlink.h>
- #include <linux/nospec.h>
- #include <linux/etherdevice.h>
-+#include <linux/if_vlan.h>
- #include <net/net_namespace.h>
- #include <net/genetlink.h>
- #include <net/cfg80211.h>
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/8] backports: patches: handle txqueue parameter in ndo_tx_timeout
  2020-04-19 17:10 [PATCH 0/8] backports: Update to version 5.6.5 Hauke Mehrtens
                   ` (3 preceding siblings ...)
  2020-04-19 17:10 ` [PATCH 4/8] backports: patches: Refresh on kernel 5.6.5 Hauke Mehrtens
@ 2020-04-19 17:10 ` Hauke Mehrtens
  2020-04-19 17:10 ` [PATCH 6/8] backports: rcupdate: Add rcu_replace_pointer Hauke Mehrtens
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2020-04-19 17:10 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

In upstream commit 0290bd291cc0 ("netdev: pass the stuck queue to the
timeout handler") the ndo_tx_timeout callback in the net_device_ops
structure got a new parameter txqueue.

This patch changes the code to also work with the older interface where
no txqueue was provided. The functions are sometimes used by other
modules so add an EXPORT_SYMBOL_GPL to the spatch.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0094-ndo-tx-timeout.cocci         | 28 +++++++++++++++++++++++
 patches/0094-ndo-tx-timeout/orinoco.patch | 10 ++++++++
 patches/0094-ndo-tx-timeout/prism54.patch | 23 +++++++++++++++++++
 patches/0094-ndo-tx-timeout/usbnet.patch  | 10 ++++++++
 4 files changed, 71 insertions(+)
 create mode 100644 patches/0094-ndo-tx-timeout.cocci
 create mode 100644 patches/0094-ndo-tx-timeout/orinoco.patch
 create mode 100644 patches/0094-ndo-tx-timeout/prism54.patch
 create mode 100644 patches/0094-ndo-tx-timeout/usbnet.patch

diff --git a/patches/0094-ndo-tx-timeout.cocci b/patches/0094-ndo-tx-timeout.cocci
new file mode 100644
index 00000000..34904994
--- /dev/null
+++ b/patches/0094-ndo-tx-timeout.cocci
@@ -0,0 +1,28 @@
+@r@
+identifier OPS;
+identifier tx_timeout_fn;
+fresh identifier tx_timeout_fn_wrap = "bp_" ## tx_timeout_fn;
+position p;
+@@
+struct net_device_ops OPS@p = {
++#if LINUX_VERSION_IS_GEQ(5,6,0)
+	.ndo_tx_timeout = tx_timeout_fn,
++#else
++	.ndo_tx_timeout = tx_timeout_fn_wrap,
++#endif
+};
+
+@@
+identifier r.tx_timeout_fn_wrap;
+identifier r.tx_timeout_fn;
+@@
+void tx_timeout_fn(...) {...}
++#if LINUX_VERSION_IS_LESS(5,6,0)
++/* Just declare it here to keep sparse happy */
++void tx_timeout_fn_wrap(struct net_device *dev);
++void tx_timeout_fn_wrap(struct net_device *dev)
++{
++	tx_timeout_fn(dev, 0);
++}
++EXPORT_SYMBOL_GPL(tx_timeout_fn_wrap);
++#endif
diff --git a/patches/0094-ndo-tx-timeout/orinoco.patch b/patches/0094-ndo-tx-timeout/orinoco.patch
new file mode 100644
index 00000000..bda0a6da
--- /dev/null
+++ b/patches/0094-ndo-tx-timeout/orinoco.patch
@@ -0,0 +1,10 @@
+--- a/drivers/net/wireless/intersil/orinoco/orinoco.h
++++ b/drivers/net/wireless/intersil/orinoco/orinoco.h
+@@ -208,6 +208,7 @@ int orinoco_stop(struct net_device *dev)
+ void orinoco_set_multicast_list(struct net_device *dev);
+ int orinoco_change_mtu(struct net_device *dev, int new_mtu);
+ void orinoco_tx_timeout(struct net_device *dev, unsigned int txqueue);
++void bp_orinoco_tx_timeout(struct net_device *dev);
+ 
+ /********************************************************************/
+ /* Locking and synchronization functions                            */
diff --git a/patches/0094-ndo-tx-timeout/prism54.patch b/patches/0094-ndo-tx-timeout/prism54.patch
new file mode 100644
index 00000000..d61d3402
--- /dev/null
+++ b/patches/0094-ndo-tx-timeout/prism54.patch
@@ -0,0 +1,23 @@
+--- a/drivers/net/wireless/intersil/prism54/islpci_eth.h
++++ b/drivers/net/wireless/intersil/prism54/islpci_eth.h
+@@ -54,6 +54,7 @@ void islpci_eth_cleanup_transmit(islpci_
+ netdev_tx_t islpci_eth_transmit(struct sk_buff *, struct net_device *);
+ int islpci_eth_receive(islpci_private *);
+ void islpci_eth_tx_timeout(struct net_device *, unsigned int txqueue);
++void bp_islpci_eth_tx_timeout(struct net_device *);
+ void islpci_do_reset_and_wake(struct work_struct *);
+ 
+ #endif				/* _ISL_GEN_H */
+--- a/drivers/net/wireless/intersil/prism54/islpci_eth.c
++++ b/drivers/net/wireless/intersil/prism54/islpci_eth.c
+@@ -491,3 +491,10 @@ islpci_eth_tx_timeout(struct net_device
+ 			"%s: tx_timeout, waiting for reset", ndev->name);
+ 	}
+ }
++
++#if LINUX_VERSION_IS_LESS(5,6,0)
++void bp_islpci_eth_tx_timeout(struct net_device *dev) {
++	islpci_eth_tx_timeout(dev, 0);
++}
++EXPORT_SYMBOL_GPL(bp_islpci_eth_tx_timeout);
++#endif
diff --git a/patches/0094-ndo-tx-timeout/usbnet.patch b/patches/0094-ndo-tx-timeout/usbnet.patch
new file mode 100644
index 00000000..3bd1facd
--- /dev/null
+++ b/patches/0094-ndo-tx-timeout/usbnet.patch
@@ -0,0 +1,10 @@
+--- a/include/linux/usb/usbnet.h
++++ b/include/linux/usb/usbnet.h
+@@ -254,6 +254,7 @@ extern int usbnet_stop(struct net_device
+ extern netdev_tx_t usbnet_start_xmit(struct sk_buff *skb,
+ 				     struct net_device *net);
+ extern void usbnet_tx_timeout(struct net_device *net, unsigned int txqueue);
++extern void bp_usbnet_tx_timeout(struct net_device *net);
+ extern int usbnet_change_mtu(struct net_device *net, int new_mtu);
+ 
+ extern int usbnet_get_endpoints(struct usbnet *, struct usb_interface *);
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/8] backports: rcupdate: Add rcu_replace_pointer
  2020-04-19 17:10 [PATCH 0/8] backports: Update to version 5.6.5 Hauke Mehrtens
                   ` (4 preceding siblings ...)
  2020-04-19 17:10 ` [PATCH 5/8] backports: patches: handle txqueue parameter in ndo_tx_timeout Hauke Mehrtens
@ 2020-04-19 17:10 ` Hauke Mehrtens
  2020-04-19 17:10 ` [PATCH 7/8] backports: fs: Adapt struct proc_ops Hauke Mehrtens
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2020-04-19 17:10 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

rcu_replace_pointer() was added in upstream commit a63fc6b75cca ("rcu:
Upgrade rcu_swap_protected() to rcu_replace_pointer()") and is now used
by the mt76 driver.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/rcupdate.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/backport/backport-include/linux/rcupdate.h b/backport/backport-include/linux/rcupdate.h
index db501007..0bbfd615 100644
--- a/backport/backport-include/linux/rcupdate.h
+++ b/backport/backport-include/linux/rcupdate.h
@@ -77,4 +77,24 @@ rcu_head_after_call_rcu(struct rcu_head *rhp, rcu_callback_t f)
 } while (0)
 #endif
 
+#ifndef rcu_replace_pointer
+/**
+ * rcu_replace_pointer() - replace an RCU pointer, returning its old value
+ * @rcu_ptr: RCU pointer, whose old value is returned
+ * @ptr: regular pointer
+ * @c: the lockdep conditions under which the dereference will take place
+ *
+ * Perform a replacement, where @rcu_ptr is an RCU-annotated
+ * pointer and @c is the lockdep argument that is passed to the
+ * rcu_dereference_protected() call used to read that pointer.  The old
+ * value of @rcu_ptr is returned, and @rcu_ptr is set to @ptr.
+ */
+#define rcu_replace_pointer(rcu_ptr, ptr, c)				\
+({									\
+	typeof(ptr) __tmp = rcu_dereference_protected((rcu_ptr), (c));	\
+	rcu_assign_pointer((rcu_ptr), (ptr));				\
+	__tmp;								\
+})
+#endif
+
 #endif /* __BACKPORT_LINUX_RCUPDATE_H */
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 7/8] backports: fs: Adapt struct proc_ops
  2020-04-19 17:10 [PATCH 0/8] backports: Update to version 5.6.5 Hauke Mehrtens
                   ` (5 preceding siblings ...)
  2020-04-19 17:10 ` [PATCH 6/8] backports: rcupdate: Add rcu_replace_pointer Hauke Mehrtens
@ 2020-04-19 17:10 ` Hauke Mehrtens
  2020-04-19 17:10 ` [PATCH 8/8] patches: patches: Restrict MTU changes to struct net_device Hauke Mehrtens
  2020-04-20  7:50 ` [PATCH 0/8] backports: Update to version 5.6.5 Johannes Berg
  8 siblings, 0 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2020-04-19 17:10 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

Since upstream commit 97a32539b956 ("proc: convert everything to "struct
proc_ops"") the drivers ate not using struct file_operations for proc
files any more, but the new struct proc_ops. This replaces the new names
with the old ones to make the driver still work on older kernel
versions.

The kernel commit also removed the .owner attribute which is not added
by this change again.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/fs.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/backport/backport-include/linux/fs.h b/backport/backport-include/linux/fs.h
index 9854290a..4e03adf6 100644
--- a/backport/backport-include/linux/fs.h
+++ b/backport/backport-include/linux/fs.h
@@ -59,4 +59,13 @@ extern long compat_ptr_ioctl(struct file *file, unsigned int cmd,
 #endif
 #endif /* < 5.5 */
 
+#if LINUX_VERSION_IS_LESS(5,6,0)
+#define proc_ops file_operations
+#define proc_open open
+#define proc_read read
+#define proc_lseek llseek
+#define proc_release release
+#define proc_write write
+#endif /* < 5.6 */
+
 #endif	/* _COMPAT_LINUX_FS_H */
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 8/8] patches: patches: Restrict MTU changes to struct net_device
  2020-04-19 17:10 [PATCH 0/8] backports: Update to version 5.6.5 Hauke Mehrtens
                   ` (6 preceding siblings ...)
  2020-04-19 17:10 ` [PATCH 7/8] backports: fs: Adapt struct proc_ops Hauke Mehrtens
@ 2020-04-19 17:10 ` Hauke Mehrtens
  2020-04-20  7:50 ` [PATCH 0/8] backports: Update to version 5.6.5 Johannes Berg
  8 siblings, 0 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2020-04-19 17:10 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

The struct ieee80211_hw got a max_mtu element, but no min_mtu element.
This spatch was also applied to this structure accidentally.

This adds the type to make sure this spatch is only applied to mtu_min
and mtu_max attributes on the net_device structure.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0073-netdevice-mtu-range.cocci        | 6 +++---
 patches/0074-netdevice-mtu-range-ifdefs.cocci | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/patches/0073-netdevice-mtu-range.cocci b/patches/0073-netdevice-mtu-range.cocci
index 7a4b6532..7afe900e 100644
--- a/patches/0073-netdevice-mtu-range.cocci
+++ b/patches/0073-netdevice-mtu-range.cocci
@@ -4,7 +4,7 @@
 first_ops = 0
 
 @both@
-expression ndevexp;
+struct net_device *ndevexp;
 constant e1, e2;
 identifier func;
 position p;
@@ -17,7 +17,7 @@ func(...) {
 }
 
 @@
-expression ndevexp;
+struct net_device *ndevexp;
 constant MAX;
 identifier func;
 position p != both.p;
@@ -58,7 +58,7 @@ if not(first_ops == ln):
   cocci.include_match(False)
 
 @r1 exists@
-expression ndevexp;
+struct net_device *ndevexp;
 constant e1, e2;
 identifier func;
 @@
diff --git a/patches/0074-netdevice-mtu-range-ifdefs.cocci b/patches/0074-netdevice-mtu-range-ifdefs.cocci
index 5689f438..bb1ca95c 100644
--- a/patches/0074-netdevice-mtu-range-ifdefs.cocci
+++ b/patches/0074-netdevice-mtu-range-ifdefs.cocci
@@ -1,5 +1,5 @@
 @@
-expression ndevexp;
+struct net_device *ndevexp;
 expression E;
 identifier func;
 @@
@@ -12,7 +12,7 @@ func(...) {
 }
 
 @@
-expression ndevexp;
+struct net_device *ndevexp;
 expression E;
 identifier func;
 @@
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/8] backports: Update to version 5.6.5
  2020-04-19 17:10 [PATCH 0/8] backports: Update to version 5.6.5 Hauke Mehrtens
                   ` (7 preceding siblings ...)
  2020-04-19 17:10 ` [PATCH 8/8] patches: patches: Restrict MTU changes to struct net_device Hauke Mehrtens
@ 2020-04-20  7:50 ` Johannes Berg
  8 siblings, 0 replies; 10+ messages in thread
From: Johannes Berg @ 2020-04-20  7:50 UTC (permalink / raw)
  To: Hauke Mehrtens, backports

On Sun, 2020-04-19 at 19:10 +0200, Hauke Mehrtens wrote:
> This adds the missing changes to make backports work with kernel 5.6.5
> 

Looks good to me, thanks!

johannes

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-04-20  7:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-19 17:10 [PATCH 0/8] backports: Update to version 5.6.5 Hauke Mehrtens
2020-04-19 17:10 ` [PATCH 1/8] backports: add linux/units.h Hauke Mehrtens
2020-04-19 17:10 ` [PATCH 2/8] backports: skbuff: add skb_list_walk_safe() and skb_mark_not_on_list() Hauke Mehrtens
2020-04-19 17:10 ` [PATCH 3/8] backports: netlink: fix nla_validate_nested() Hauke Mehrtens
2020-04-19 17:10 ` [PATCH 4/8] backports: patches: Refresh on kernel 5.6.5 Hauke Mehrtens
2020-04-19 17:10 ` [PATCH 5/8] backports: patches: handle txqueue parameter in ndo_tx_timeout Hauke Mehrtens
2020-04-19 17:10 ` [PATCH 6/8] backports: rcupdate: Add rcu_replace_pointer Hauke Mehrtens
2020-04-19 17:10 ` [PATCH 7/8] backports: fs: Adapt struct proc_ops Hauke Mehrtens
2020-04-19 17:10 ` [PATCH 8/8] patches: patches: Restrict MTU changes to struct net_device Hauke Mehrtens
2020-04-20  7:50 ` [PATCH 0/8] backports: Update to version 5.6.5 Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).