Backports Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/8] backports: Update to version 5.5.10
@ 2020-03-20 23:39 Hauke Mehrtens
  2020-03-20 23:39 ` [PATCH 1/8] backports: patches: Refresh against kernel 5.5.10 Hauke Mehrtens
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2020-03-20 23:39 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

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

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.216             [  OK  ]
11  4.5.7               [  OK  ]
12  4.6.7               [  OK  ]
13  4.7.10              [  OK  ]
14  4.8.17              [  OK  ]
15  4.9.216             [  OK  ]
16  4.10.17             [  OK  ]
17  4.11.12             [  OK  ]
18  4.12.14             [  OK  ]
19  4.13.16             [  OK  ]
20  4.14.173            [  OK  ]
21  4.15.18             [  OK  ]
22  4.16.18             [  OK  ]
23  4.17.19             [  OK  ]
24  4.18.20             [  OK  ]
25  4.19.109            [  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.25              [  OK  ]
32  5.5.9               [  OK  ]

My mails were not send to the mailing list, I hope this is fixed now.

Hauke Mehrtens (8):
  backports: patches: Refresh against kernel 5.5.10
  backports: fs.h: Add compat_ptr_ioctl()
  backports: stddef.h: Add sizeof_field()
  backports: Make qtnfmac depend on kernel 5.1 or later
  backports: rcupdate.h: Add rcu_swap_protected()
  backports: netdevice.h: Add return value to napi_complete()
  backports: Do not build BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION on <
    3.13
  backports: page_ref.h: Exclude page_ref_count() on kernel >= 4.4.216

 backport/backport-include/linux/fs.h          | 10 +++++
 backport/backport-include/linux/netdevice.h   |  6 +++
 backport/backport-include/linux/page_ref.h    |  2 +
 backport/backport-include/linux/rcupdate.h    | 18 ++++++++
 backport/backport-include/linux/stddef.h      | 12 +++++-
 backport/compat/Kconfig                       |  1 +
 backport/compat/Makefile                      |  1 +
 backport/compat/backport-5.5.c                | 41 +++++++++++++++++++
 dependencies                                  |  8 +++-
 ...2-disable-dump-adjust-on-old-kernels.patch |  4 +-
 .../include_net_cfg80211.patch                |  2 +-
 .../net_wireless_core.patch                   |  2 +-
 .../0013-fix-makefile-includes/rtw88.patch    | 28 ++++---------
 .../net_wireless_nl80211.patch                |  2 +-
 patches/0022-define-tracing/wil6210.patch     |  2 +-
 patches/0024-led-blink-api/mac80211.patch     |  2 +-
 patches/0025-usb-sg/usbnet.patch              |  2 +-
 patches/0028-select_queue/mwifiex.patch       |  2 +-
 patches/0028-select_queue/rtl8723bs.patch     |  2 +-
 patches/0053-possible_net_t.patch             |  2 +-
 patches/0055-name_assign_type/brcmfmac.patch  |  2 +-
 patches/0069-iwlwifi-pd-string-fix.patch      |  2 +-
 patches/0077-genl-ro-after-init/hwsim.patch   |  2 +-
 patches/0077-genl-ro-after-init/nl80211.patch |  2 +-
 patches/0085-iwlwifi-pci-device-removal.patch |  4 +-
 patches/0090-remove-GRO_CONSUMED.patch        |  2 +-
 patches/lib-refcount.patch                    | 10 ++---
 27 files changed, 128 insertions(+), 45 deletions(-)
 create mode 100644 backport/compat/backport-5.5.c

-- 
2.20.1

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

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

* [PATCH 1/8] backports: patches: Refresh against kernel 5.5.10
  2020-03-20 23:39 [PATCH 0/8] backports: Update to version 5.5.10 Hauke Mehrtens
@ 2020-03-20 23:39 ` Hauke Mehrtens
  2020-03-20 23:39 ` [PATCH 2/8] backports: fs.h: Add compat_ptr_ioctl() Hauke Mehrtens
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2020-03-20 23:39 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 ...2-disable-dump-adjust-on-old-kernels.patch |  4 +--
 .../include_net_cfg80211.patch                |  2 +-
 .../net_wireless_core.patch                   |  2 +-
 .../0013-fix-makefile-includes/rtw88.patch    | 28 ++++++-------------
 .../net_wireless_nl80211.patch                |  2 +-
 patches/0022-define-tracing/wil6210.patch     |  2 +-
 patches/0024-led-blink-api/mac80211.patch     |  2 +-
 patches/0025-usb-sg/usbnet.patch              |  2 +-
 patches/0028-select_queue/mwifiex.patch       |  2 +-
 patches/0028-select_queue/rtl8723bs.patch     |  2 +-
 patches/0053-possible_net_t.patch             |  2 +-
 patches/0055-name_assign_type/brcmfmac.patch  |  2 +-
 patches/0069-iwlwifi-pd-string-fix.patch      |  2 +-
 patches/0077-genl-ro-after-init/hwsim.patch   |  2 +-
 patches/0077-genl-ro-after-init/nl80211.patch |  2 +-
 patches/0085-iwlwifi-pci-device-removal.patch |  4 +--
 patches/0090-remove-GRO_CONSUMED.patch        |  2 +-
 patches/lib-refcount.patch                    | 10 +++----
 18 files changed, 32 insertions(+), 42 deletions(-)

diff --git a/patches/0002-disable-dump-adjust-on-old-kernels.patch b/patches/0002-disable-dump-adjust-on-old-kernels.patch
index 04103f35..3d752359 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
-@@ -2542,6 +2542,7 @@ static int nl80211_dump_wiphy(struct sk_
+@@ -2549,6 +2549,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
-@@ -2563,6 +2564,7 @@ static int nl80211_dump_wiphy(struct sk_
+@@ -2570,6 +2571,7 @@ static int nl80211_dump_wiphy(struct sk_
  					rtnl_unlock();
  					return 1;
  				}
diff --git a/patches/0003-cfg80211-wext-padding/include_net_cfg80211.patch b/patches/0003-cfg80211-wext-padding/include_net_cfg80211.patch
index ab2b79ff..11c50887 100644
--- a/patches/0003-cfg80211-wext-padding/include_net_cfg80211.patch
+++ b/patches/0003-cfg80211-wext-padding/include_net_cfg80211.patch
@@ -1,6 +1,6 @@
 --- a/include/net/cfg80211.h
 +++ b/include/net/cfg80211.h
-@@ -4536,6 +4536,9 @@ struct cfg80211_pmsr_capabilities {
+@@ -4552,6 +4552,9 @@ struct cfg80211_pmsr_capabilities {
  struct wiphy {
  	/* assign these fields before you register the wiphy */
  
diff --git a/patches/0010-add-wext-handlers-to-netdev/net_wireless_core.patch b/patches/0010-add-wext-handlers-to-netdev/net_wireless_core.patch
index c5d8ddf9..6b14d347 100644
--- a/patches/0010-add-wext-handlers-to-netdev/net_wireless_core.patch
+++ b/patches/0010-add-wext-handlers-to-netdev/net_wireless_core.patch
@@ -11,7 +11,7 @@
  	device_initialize(&rdev->wiphy.dev);
  	rdev->wiphy.dev.class = &ieee80211_class;
  	rdev->wiphy.dev.platform_data = rdev;
-@@ -1295,6 +1291,15 @@ static int cfg80211_netdev_notifier_call
+@@ -1296,6 +1292,15 @@ static int cfg80211_netdev_notifier_call
  		}
  		wdev->netdev = dev;
  #ifdef CONFIG_CFG80211_WEXT
diff --git a/patches/0013-fix-makefile-includes/rtw88.patch b/patches/0013-fix-makefile-includes/rtw88.patch
index 10bb1780..4e2ea808 100644
--- a/patches/0013-fix-makefile-includes/rtw88.patch
+++ b/patches/0013-fix-makefile-includes/rtw88.patch
@@ -1,40 +1,30 @@
 --- a/drivers/net/wireless/realtek/rtw88/main.c
 +++ b/drivers/net/wireless/realtek/rtw88/main.c
-@@ -13,6 +13,7 @@
- #include "reg.h"
- #include "efuse.h"
+@@ -15,6 +15,7 @@
+ #include "tx.h"
  #include "debug.h"
+ #include "bf.h"
 +#include <linux/module.h>
  
- static bool rtw_fw_support_lps;
- unsigned int rtw_debug_mask;
+ unsigned int rtw_fw_lps_deep_mode;
+ EXPORT_SYMBOL(rtw_fw_lps_deep_mode);
 --- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
 +++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
-@@ -13,6 +13,7 @@
- #include "mac.h"
+@@ -14,6 +14,7 @@
  #include "reg.h"
  #include "debug.h"
+ #include "bf.h"
 +#include <linux/module.h>
  
  static void rtw8822b_config_trx_mode(struct rtw_dev *rtwdev, u8 tx_path,
  				     u8 rx_path, bool is_tx2_path);
 --- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
 +++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
-@@ -14,6 +14,7 @@
- #include "reg.h"
+@@ -15,6 +15,7 @@
  #include "debug.h"
  #include "util.h"
+ #include "bf.h"
 +#include <linux/module.h>
  
  static void rtw8822c_config_trx_mode(struct rtw_dev *rtwdev, u8 tx_path,
  				     u8 rx_path, bool is_tx2_path);
---- a/drivers/net/wireless/realtek/rtw88/pci.c
-+++ b/drivers/net/wireless/realtek/rtw88/pci.c
-@@ -10,6 +10,7 @@
- #include "rx.h"
- #include "fw.h"
- #include "debug.h"
-+#include <linux/interrupt.h>
- 
- static bool rtw_disable_msi;
- module_param_named(disable_msi, rtw_disable_msi, bool, 0644);
diff --git a/patches/0014-netlink_seq/net_wireless_nl80211.patch b/patches/0014-netlink_seq/net_wireless_nl80211.patch
index 8b7c33b0..28416330 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
-@@ -8765,7 +8765,9 @@ static int nl80211_dump_scan(struct sk_b
+@@ -8780,7 +8780,9 @@ static int nl80211_dump_scan(struct sk_b
  	if (start == 0)
  		cfg80211_bss_expire(rdev);
  
diff --git a/patches/0022-define-tracing/wil6210.patch b/patches/0022-define-tracing/wil6210.patch
index 2e51beb1..a1093d16 100644
--- a/patches/0022-define-tracing/wil6210.patch
+++ b/patches/0022-define-tracing/wil6210.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/wil6210/trace.c
 +++ b/drivers/net/wireless/ath/wil6210/trace.c
-@@ -15,6 +15,9 @@
+@@ -4,6 +4,9 @@
   */
  
  #include <linux/module.h>
diff --git a/patches/0024-led-blink-api/mac80211.patch b/patches/0024-led-blink-api/mac80211.patch
index 39fb6f0c..99b78d0c 100644
--- a/patches/0024-led-blink-api/mac80211.patch
+++ b/patches/0024-led-blink-api/mac80211.patch
@@ -1,6 +1,6 @@
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -1306,6 +1306,7 @@ struct ieee80211_local {
+@@ -1310,6 +1310,7 @@ struct ieee80211_local {
  	struct mutex chanctx_mtx;
  
  #ifdef CONFIG_MAC80211_LEDS
diff --git a/patches/0025-usb-sg/usbnet.patch b/patches/0025-usb-sg/usbnet.patch
index 30cce14f..47f49b5c 100644
--- a/patches/0025-usb-sg/usbnet.patch
+++ b/patches/0025-usb-sg/usbnet.patch
@@ -61,7 +61,7 @@
  			/* fall through */
  		case rx_cleanup:
  			usb_free_urb (entry->urb);
-@@ -1896,7 +1914,9 @@ int usbnet_resume (struct usb_interface
+@@ -1903,7 +1921,9 @@ int usbnet_resume (struct usb_interface
  			retval = usb_submit_urb(res, GFP_ATOMIC);
  			if (retval < 0) {
  				dev_kfree_skb_any(skb);
diff --git a/patches/0028-select_queue/mwifiex.patch b/patches/0028-select_queue/mwifiex.patch
index 0b4e9838..ffcb4cbb 100644
--- a/patches/0028-select_queue/mwifiex.patch
+++ b/patches/0028-select_queue/mwifiex.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/marvell/mwifiex/main.c
 +++ b/drivers/net/wireless/marvell/mwifiex/main.c
-@@ -1276,9 +1276,28 @@ static struct net_device_stats *mwifiex_
+@@ -1277,9 +1277,28 @@ static struct net_device_stats *mwifiex_
  	return &priv->stats;
  }
  
diff --git a/patches/0028-select_queue/rtl8723bs.patch b/patches/0028-select_queue/rtl8723bs.patch
index 94524bc0..962c0cc9 100644
--- a/patches/0028-select_queue/rtl8723bs.patch
+++ b/patches/0028-select_queue/rtl8723bs.patch
@@ -1,6 +1,6 @@
 --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
 +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
-@@ -395,8 +395,18 @@ static unsigned int rtw_classify8021d(st
+@@ -375,8 +375,18 @@ static unsigned int rtw_classify8021d(st
  }
  
  
diff --git a/patches/0053-possible_net_t.patch b/patches/0053-possible_net_t.patch
index 85e6c24c..596aa90d 100644
--- a/patches/0053-possible_net_t.patch
+++ b/patches/0053-possible_net_t.patch
@@ -2,7 +2,7 @@ diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
 index 04e5785..a251da1 100644
 --- a/include/net/cfg80211.h
 +++ b/include/net/cfg80211.h
-@@ -4685,12 +4685,12 @@ struct wiphy {
+@@ -4701,12 +4701,12 @@ struct wiphy {
  
  static inline struct net *wiphy_net(struct wiphy *wiphy)
  {
diff --git a/patches/0055-name_assign_type/brcmfmac.patch b/patches/0055-name_assign_type/brcmfmac.patch
index c242a44a..c9619b1c 100644
--- a/patches/0055-name_assign_type/brcmfmac.patch
+++ b/patches/0055-name_assign_type/brcmfmac.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
-@@ -2219,7 +2219,9 @@ struct wireless_dev *brcmf_p2p_add_vif(s
+@@ -2220,7 +2220,9 @@ struct wireless_dev *brcmf_p2p_add_vif(s
  	}
  
  	strncpy(ifp->ndev->name, name, sizeof(ifp->ndev->name) - 1);
diff --git a/patches/0069-iwlwifi-pd-string-fix.patch b/patches/0069-iwlwifi-pd-string-fix.patch
index 563fcbd7..f4580157 100644
--- a/patches/0069-iwlwifi-pd-string-fix.patch
+++ b/patches/0069-iwlwifi-pd-string-fix.patch
@@ -60,7 +60,7 @@
  						     mvm->debugfs_dir, buf);
 --- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
 +++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
-@@ -2081,6 +2081,12 @@ void iwl_mvm_dbgfs_register(struct iwl_m
+@@ -2085,6 +2085,12 @@ void iwl_mvm_dbgfs_register(struct iwl_m
  	 * Create a symlink with mac80211. It will be removed when mac80211
  	 * exists (before the opmode exists which removes the target.)
  	 */
diff --git a/patches/0077-genl-ro-after-init/hwsim.patch b/patches/0077-genl-ro-after-init/hwsim.patch
index 5a485060..f3f46e5a 100644
--- a/patches/0077-genl-ro-after-init/hwsim.patch
+++ b/patches/0077-genl-ro-after-init/hwsim.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/mac80211_hwsim.c
 +++ b/drivers/net/wireless/mac80211_hwsim.c
-@@ -3765,7 +3765,7 @@ static const struct genl_ops hwsim_ops[]
+@@ -3790,7 +3790,7 @@ static const struct genl_ops hwsim_ops[]
  	},
  };
  
diff --git a/patches/0077-genl-ro-after-init/nl80211.patch b/patches/0077-genl-ro-after-init/nl80211.patch
index eee2ee3c..e4071840 100644
--- a/patches/0077-genl-ro-after-init/nl80211.patch
+++ b/patches/0077-genl-ro-after-init/nl80211.patch
@@ -1,6 +1,6 @@
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -14750,7 +14750,7 @@ static const struct genl_ops nl80211_ops
+@@ -14768,7 +14768,7 @@ static const struct genl_ops nl80211_ops
  	},
  };
  
diff --git a/patches/0085-iwlwifi-pci-device-removal.patch b/patches/0085-iwlwifi-pci-device-removal.patch
index f858fe99..08627746 100644
--- a/patches/0085-iwlwifi-pci-device-removal.patch
+++ b/patches/0085-iwlwifi-pci-device-removal.patch
@@ -2,7 +2,7 @@ diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wirel
 index f74281508197..3b11bd68f261 100644
 --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
 +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
-@@ -1998,6 +1998,9 @@ static void iwl_trans_pcie_removal_wk(st
+@@ -2024,6 +2024,9 @@ static void iwl_trans_pcie_removal_wk(st
  	struct iwl_trans_pcie_removal *removal =
  		container_of(wk, struct iwl_trans_pcie_removal, work);
  	struct pci_dev *pdev = removal->pdev;
@@ -12,7 +12,7 @@ index f74281508197..3b11bd68f261 100644
  	static char *prop[] = {"EVENT=INACCESSIBLE", NULL};
  
  	dev_err(&pdev->dev, "Device gone - attempting removal\n");
-@@ -2006,6 +2009,7 @@ static void iwl_trans_pcie_removal_wk(st
+@@ -2032,6 +2035,7 @@ static void iwl_trans_pcie_removal_wk(st
  	pci_dev_put(pdev);
  	pci_stop_and_remove_bus_device(pdev);
  	pci_unlock_rescan_remove();
diff --git a/patches/0090-remove-GRO_CONSUMED.patch b/patches/0090-remove-GRO_CONSUMED.patch
index b2abfa96..ea0e1ea7 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
-@@ -924,7 +924,9 @@ void wil_netif_rx(struct sk_buff *skb, s
+@@ -913,7 +913,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/lib-refcount.patch b/patches/lib-refcount.patch
index 0f63ec6a..f375e1a2 100644
--- a/patches/lib-refcount.patch
+++ b/patches/lib-refcount.patch
@@ -2,15 +2,15 @@ diff --git a/compat/lib-refcount.c b/compat/lib-refcount.c
 index 5d0582a..8d108f9 100644
 --- a/compat/lib-refcount.c
 +++ b/compat/lib-refcount.c
-@@ -42,6 +42,7 @@
+@@ -7,6 +7,7 @@
  #include <linux/refcount.h>
  #include <linux/spinlock.h>
  #include <linux/bug.h>
 +#include <linux/export.h>
  
- /**
-  * refcount_add_not_zero_checked - add a value to a refcount unless it is 0
-@@ -153,6 +153,8 @@ bool refcount_dec_and_lock(refcount_t *r, spinlock_t *lock)
+ #define REFCOUNT_WARN(str)	WARN_ONCE(1, "refcount_t: " str ".\n")
+ 
+@@ -152,6 +153,8 @@ bool refcount_dec_and_lock(refcount_t *r
  		return false;
  	}
  
@@ -19,7 +19,7 @@ index 5d0582a..8d108f9 100644
  	return true;
  }
  EXPORT_SYMBOL(refcount_dec_and_lock);
-@@ -182,6 +184,8 @@ bool refcount_dec_and_lock_irqsave(refcount_t *r, spinlock_t *lock,
+@@ -181,6 +184,8 @@ bool refcount_dec_and_lock_irqsave(refco
  		return false;
  	}
  
-- 
2.20.1

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

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

* [PATCH 2/8] backports: fs.h: Add compat_ptr_ioctl()
  2020-03-20 23:39 [PATCH 0/8] backports: Update to version 5.5.10 Hauke Mehrtens
  2020-03-20 23:39 ` [PATCH 1/8] backports: patches: Refresh against kernel 5.5.10 Hauke Mehrtens
@ 2020-03-20 23:39 ` Hauke Mehrtens
  2020-03-20 23:39 ` [PATCH 3/8] backports: stddef.h: Add sizeof_field() Hauke Mehrtens
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2020-03-20 23:39 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

compat_ptr_ioctl() was added in upstream commit 2952db0fd51b
("compat_ioctl: add compat_ptr_ioctl()") and is now used by the cdc-wdm
driver.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/fs.h | 10 +++++++
 backport/compat/Makefile             |  1 +
 backport/compat/backport-5.5.c       | 41 ++++++++++++++++++++++++++++
 3 files changed, 52 insertions(+)
 create mode 100644 backport/compat/backport-5.5.c

diff --git a/backport/backport-include/linux/fs.h b/backport/backport-include/linux/fs.h
index 6e4d4a53..9854290a 100644
--- a/backport/backport-include/linux/fs.h
+++ b/backport/backport-include/linux/fs.h
@@ -49,4 +49,14 @@ static inline struct inode *file_inode(struct file *f)
 extern loff_t no_seek_end_llseek(struct file *, loff_t, int);
 #endif /* < 4.5 && >= 3.2 */
 
+#if LINUX_VERSION_IS_LESS(5,5,0)
+#ifdef CONFIG_COMPAT
+#define compat_ptr_ioctl LINUX_BACKPORT(compat_ptr_ioctl)
+extern long compat_ptr_ioctl(struct file *file, unsigned int cmd,
+					unsigned long arg);
+#else
+#define compat_ptr_ioctl NULL
+#endif
+#endif /* < 5.5 */
+
 #endif	/* _COMPAT_LINUX_FS_H */
diff --git a/backport/compat/Makefile b/backport/compat/Makefile
index e92e3120..6f1b0a89 100644
--- a/backport/compat/Makefile
+++ b/backport/compat/Makefile
@@ -38,6 +38,7 @@ compat-$(CPTCFG_KERNEL_4_8) += backport-4.8.o
 compat-$(CPTCFG_KERNEL_4_10) += backport-4.10.o
 compat-$(CPTCFG_KERNEL_4_18) += backport-4.18.o
 compat-$(CPTCFG_KERNEL_5_2) += backport-5.2.o backport-genetlink.o
+compat-$(CPTCFG_KERNEL_5_5) += backport-5.5.o
 
 compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/verify.o
 compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/pkcs7.asn1.o
diff --git a/backport/compat/backport-5.5.c b/backport/compat/backport-5.5.c
new file mode 100644
index 00000000..6f46be9d
--- /dev/null
+++ b/backport/compat/backport-5.5.c
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/export.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/fs.h>
+#include <linux/compat.h>
+
+#ifdef CONFIG_COMPAT
+/**
+ * compat_ptr_ioctl - generic implementation of .compat_ioctl file operation
+ *
+ * This is not normally called as a function, but instead set in struct
+ * file_operations as
+ *
+ *     .compat_ioctl = compat_ptr_ioctl,
+ *
+ * On most architectures, the compat_ptr_ioctl() just passes all arguments
+ * to the corresponding ->ioctl handler. The exception is arch/s390, where
+ * compat_ptr() clears the top bit of a 32-bit pointer value, so user space
+ * pointers to the second 2GB alias the first 2GB, as is the case for
+ * native 32-bit s390 user space.
+ *
+ * The compat_ptr_ioctl() function must therefore be used only with ioctl
+ * functions that either ignore the argument or pass a pointer to a
+ * compatible data type.
+ *
+ * If any ioctl command handled by fops->unlocked_ioctl passes a plain
+ * integer instead of a pointer, or any of the passed data types
+ * is incompatible between 32-bit and 64-bit architectures, a proper
+ * handler is required instead of compat_ptr_ioctl.
+ */
+long compat_ptr_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+{
+	if (!file->f_op->unlocked_ioctl)
+		return -ENOIOCTLCMD;
+
+	return file->f_op->unlocked_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
+}
+EXPORT_SYMBOL(compat_ptr_ioctl);
+#endif
-- 
2.20.1

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

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

* [PATCH 3/8] backports: stddef.h: Add sizeof_field()
  2020-03-20 23:39 [PATCH 0/8] backports: Update to version 5.5.10 Hauke Mehrtens
  2020-03-20 23:39 ` [PATCH 1/8] backports: patches: Refresh against kernel 5.5.10 Hauke Mehrtens
  2020-03-20 23:39 ` [PATCH 2/8] backports: fs.h: Add compat_ptr_ioctl() Hauke Mehrtens
@ 2020-03-20 23:39 ` Hauke Mehrtens
  2020-03-20 23:39 ` [PATCH 4/8] backports: Make qtnfmac depend on kernel 5.1 or later Hauke Mehrtens
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2020-03-20 23:39 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

This backports sizeof_field() from upstream Linux commit 4229a470175b
("stddef.h: Introduce sizeof_field()"). This is now used by multiple
drivers.

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

diff --git a/backport/backport-include/linux/stddef.h b/backport/backport-include/linux/stddef.h
index 2c836b00..a6cdc67d 100644
--- a/backport/backport-include/linux/stddef.h
+++ b/backport/backport-include/linux/stddef.h
@@ -2,6 +2,16 @@
 #define __BACKPORT_LINUX_STDDEF_H
 #include_next <linux/stddef.h>
 
+#ifndef sizeof_field
+/**
+ * sizeof_field(TYPE, MEMBER)
+ *
+ * @TYPE: The structure containing the field of interest
+ * @MEMBER: The field to return the size of
+ */
+#define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER))
+#endif
+
 #ifndef offsetofend
 /**
  * offsetofend(TYPE, MEMBER)
@@ -10,7 +20,7 @@
  * @MEMBER: The member within the structure to get the end offset of
  */
 #define offsetofend(TYPE, MEMBER) \
-	(offsetof(TYPE, MEMBER)	+ sizeof(((TYPE *)0)->MEMBER))
+	(offsetof(TYPE, MEMBER)	+ sizeof_field(TYPE, MEMBER))
 #endif
 
 #endif /* __BACKPORT_LINUX_STDDEF_H */
-- 
2.20.1

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

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

* [PATCH 4/8] backports: Make qtnfmac depend on kernel 5.1 or later
  2020-03-20 23:39 [PATCH 0/8] backports: Update to version 5.5.10 Hauke Mehrtens
                   ` (2 preceding siblings ...)
  2020-03-20 23:39 ` [PATCH 3/8] backports: stddef.h: Add sizeof_field() Hauke Mehrtens
@ 2020-03-20 23:39 ` Hauke Mehrtens
  2020-03-20 23:39 ` [PATCH 5/8] backports: rcupdate.h: Add rcu_swap_protected() Hauke Mehrtens
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2020-03-20 23:39 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

The qtnfmac driver now uses the .ndo_get_port_parent_id ndo callback
which was added in kernel 5.1. Instead of backporting this part just
make the driver depend on a kernel version which supports this callback.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 dependencies | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dependencies b/dependencies
index 02d46ca3..47558470 100644
--- a/dependencies
+++ b/dependencies
@@ -24,8 +24,9 @@ AIRO_CS 3.9
 # pci_error_handlers->reset_notify is missing
 MWIFIEX_PCIE 3.16
 
-# needs pcie_get_mps()
-QTNFMAC_PCIE 3.13
+# needs .ndo_get_port_parent_id
+QTNFMAC 5.1
+QTNFMAC_PCIE 5.1
 
 # needs pm_system_wakeup() which can't reall be
 # backported properly
-- 
2.20.1

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

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

* [PATCH 5/8] backports: rcupdate.h: Add rcu_swap_protected()
  2020-03-20 23:39 [PATCH 0/8] backports: Update to version 5.5.10 Hauke Mehrtens
                   ` (3 preceding siblings ...)
  2020-03-20 23:39 ` [PATCH 4/8] backports: Make qtnfmac depend on kernel 5.1 or later Hauke Mehrtens
@ 2020-03-20 23:39 ` Hauke Mehrtens
  2020-03-20 23:39 ` [PATCH 6/8] backports: netdevice.h: Add return value to napi_complete() Hauke Mehrtens
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2020-03-20 23:39 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

Backport rcu_swap_protected() from upstream Linux commit 26e3e3cb0560
("scsi: rcu: Introduce rcu_swap_protected()"). This is used by the mt76
driver.

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

diff --git a/backport/backport-include/linux/rcupdate.h b/backport/backport-include/linux/rcupdate.h
index cec4b3e8..db501007 100644
--- a/backport/backport-include/linux/rcupdate.h
+++ b/backport/backport-include/linux/rcupdate.h
@@ -59,4 +59,22 @@ rcu_head_after_call_rcu(struct rcu_head *rhp, rcu_callback_t f)
 }
 #endif /* < 4.20 */
 
+#ifndef rcu_swap_protected
+/**
+ * rcu_swap_protected() - swap an RCU and a regular pointer
+ * @rcu_ptr: RCU pointer
+ * @ptr: regular pointer
+ * @c: the conditions under which the dereference will take place
+ *
+ * Perform swap(@rcu_ptr, @ptr) where @rcu_ptr is an RCU-annotated pointer and
+ * @c is the argument that is passed to the rcu_dereference_protected() call
+ * used to read that pointer.
+ */
+#define rcu_swap_protected(rcu_ptr, ptr, c) do {			\
+	typeof(ptr) __tmp = rcu_dereference_protected((rcu_ptr), (c));	\
+	rcu_assign_pointer((rcu_ptr), (ptr));				\
+	(ptr) = __tmp;							\
+} while (0)
+#endif
+
 #endif /* __BACKPORT_LINUX_RCUPDATE_H */
-- 
2.20.1

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

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

* [PATCH 6/8] backports: netdevice.h: Add return value to napi_complete()
  2020-03-20 23:39 [PATCH 0/8] backports: Update to version 5.5.10 Hauke Mehrtens
                   ` (4 preceding siblings ...)
  2020-03-20 23:39 ` [PATCH 5/8] backports: rcupdate.h: Add rcu_swap_protected() Hauke Mehrtens
@ 2020-03-20 23:39 ` Hauke Mehrtens
  2020-03-20 23:39 ` [PATCH 7/8] backports: Do not build BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION on < 3.13 Hauke Mehrtens
  2020-03-20 23:39 ` [PATCH 8/8] backports: page_ref.h: Exclude page_ref_count() on kernel >= 4.4.216 Hauke Mehrtens
  7 siblings, 0 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2020-03-20 23:39 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

mt76 checks the return value of napi_complete() now, add the same
handling as already done for napi_complete_done().

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

diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 76b57e4d..a71ed590 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -302,7 +302,13 @@ static inline bool backport_napi_complete_done(struct napi_struct *n, int work_d
 #endif /* < 3.19 */
 	return true;
 }
+
+static inline bool backport_napi_complete(struct napi_struct *n)
+{
+	return backport_napi_complete_done(n, 0);
+}
 #define napi_complete_done LINUX_BACKPORT(napi_complete_done)
+#define napi_complete LINUX_BACKPORT(napi_complete)
 #endif /* < 4.10 */
 
 #if LINUX_VERSION_IS_LESS(4,5,0)
-- 
2.20.1

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

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

* [PATCH 7/8] backports: Do not build BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION on < 3.13
  2020-03-20 23:39 [PATCH 0/8] backports: Update to version 5.5.10 Hauke Mehrtens
                   ` (5 preceding siblings ...)
  2020-03-20 23:39 ` [PATCH 6/8] backports: netdevice.h: Add return value to napi_complete() Hauke Mehrtens
@ 2020-03-20 23:39 ` Hauke Mehrtens
  2020-03-20 23:39 ` [PATCH 8/8] backports: page_ref.h: Exclude page_ref_count() on kernel >= 4.4.216 Hauke Mehrtens
  7 siblings, 0 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2020-03-20 23:39 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

SYSTEM_DATA_VERIFICATION now uses hash_algo_name() which was added in
kernel 3.13. Just do not build this on older kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/compat/Kconfig | 1 +
 dependencies            | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/backport/compat/Kconfig b/backport/compat/Kconfig
index 3af729a3..41b50a6b 100644
--- a/backport/compat/Kconfig
+++ b/backport/compat/Kconfig
@@ -150,6 +150,7 @@ config BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION
 	bool
 	default y if BPAUTO_SYSTEM_DATA_VERIFICATION
 	depends on KERNEL_4_7 || !SYSTEM_DATA_VERIFICATION
+	depends on !KERNEL_3_13
 	select BPAUTO_ASN1_DECODER
 	select BPAUTO_PUBLIC_KEY
 	select BPAUTO_PKCS7
diff --git a/dependencies b/dependencies
index 47558470..cb6741c7 100644
--- a/dependencies
+++ b/dependencies
@@ -89,3 +89,6 @@ R8188EU  3.14
 # depends on crypto_sync_skcipher()
 AIRO 4.20
 AIRO_CS 4.20
+
+# needs BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION
+CFG80211_REQUIRE_SIGNED_REGDB 3_13
-- 
2.20.1

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

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

* [PATCH 8/8] backports: page_ref.h: Exclude page_ref_count() on kernel >= 4.4.216
  2020-03-20 23:39 [PATCH 0/8] backports: Update to version 5.5.10 Hauke Mehrtens
                   ` (6 preceding siblings ...)
  2020-03-20 23:39 ` [PATCH 7/8] backports: Do not build BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION on < 3.13 Hauke Mehrtens
@ 2020-03-20 23:39 ` Hauke Mehrtens
  7 siblings, 0 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2020-03-20 23:39 UTC (permalink / raw)
  To: backports; +Cc: johannes, Hauke Mehrtens

page_ref_count() was backported to kernel version 4.4.216, do not add it
in backports for this kernel version any more.

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

diff --git a/backport/backport-include/linux/page_ref.h b/backport/backport-include/linux/page_ref.h
index e45734ec..12fd86c9 100644
--- a/backport/backport-include/linux/page_ref.h
+++ b/backport/backport-include/linux/page_ref.h
@@ -9,10 +9,12 @@ static inline void page_ref_inc(struct page *page)
 	atomic_inc(&page->_count);
 }
 
+#if !LINUX_VERSION_IN_RANGE(4,4,216, 4,5,0)
 static inline int page_ref_count(struct page *page)
 {
 	return atomic_read(&page->_count);
 }
+#endif /* 4.4.216 <= x < 4.5 */
 
 static inline int page_ref_sub_and_test(struct page *page, int nr)
 {
-- 
2.20.1

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

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

end of thread, back to index

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-20 23:39 [PATCH 0/8] backports: Update to version 5.5.10 Hauke Mehrtens
2020-03-20 23:39 ` [PATCH 1/8] backports: patches: Refresh against kernel 5.5.10 Hauke Mehrtens
2020-03-20 23:39 ` [PATCH 2/8] backports: fs.h: Add compat_ptr_ioctl() Hauke Mehrtens
2020-03-20 23:39 ` [PATCH 3/8] backports: stddef.h: Add sizeof_field() Hauke Mehrtens
2020-03-20 23:39 ` [PATCH 4/8] backports: Make qtnfmac depend on kernel 5.1 or later Hauke Mehrtens
2020-03-20 23:39 ` [PATCH 5/8] backports: rcupdate.h: Add rcu_swap_protected() Hauke Mehrtens
2020-03-20 23:39 ` [PATCH 6/8] backports: netdevice.h: Add return value to napi_complete() Hauke Mehrtens
2020-03-20 23:39 ` [PATCH 7/8] backports: Do not build BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION on < 3.13 Hauke Mehrtens
2020-03-20 23:39 ` [PATCH 8/8] backports: page_ref.h: Exclude page_ref_count() on kernel >= 4.4.216 Hauke Mehrtens

Backports Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/backports/0 backports/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 backports backports/ https://lore.kernel.org/backports \
		backports@vger.kernel.org
	public-inbox-index backports

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.backports


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git