diff mbox series

[5/8] backports: patches: handle txqueue parameter in ndo_tx_timeout

Message ID 20200419171039.17268-6-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to version 5.6.5 | expand

Commit Message

Hauke Mehrtens April 19, 2020, 5:10 p.m. UTC
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 mbox series

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 *);