Backports Archive on lore.kernel.org
 help / color / Atom feed
From: Hauke Mehrtens <hauke@hauke-m.de>
To: backports@vger.kernel.org
Cc: johannes@sipsolutions.net, Hauke Mehrtens <hauke@hauke-m.de>
Subject: [PATCH 5/8] backports: patches: handle txqueue parameter in ndo_tx_timeout
Date: Sun, 19 Apr 2020 19:10:36 +0200
Message-ID: <20200419171039.17268-6-hauke@hauke-m.de> (raw)
In-Reply-To: <20200419171039.17268-1-hauke@hauke-m.de>

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

  parent reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Hauke Mehrtens [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200419171039.17268-6-hauke@hauke-m.de \
    --to=hauke@hauke-m.de \
    --cc=backports@vger.kernel.org \
    --cc=johannes@sipsolutions.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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