aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1364-drivers-net-amd-Convert-timers-to-use-timer_setup.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1364-drivers-net-amd-Convert-timers-to-use-timer_setup.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1364-drivers-net-amd-Convert-timers-to-use-timer_setup.patch71
1 files changed, 71 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1364-drivers-net-amd-Convert-timers-to-use-timer_setup.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1364-drivers-net-amd-Convert-timers-to-use-timer_setup.patch
new file mode 100644
index 00000000..3c2ed30e
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1364-drivers-net-amd-Convert-timers-to-use-timer_setup.patch
@@ -0,0 +1,71 @@
+From a726db2370ef7c7f37bb65a5d13d02de986eafe0 Mon Sep 17 00:00:00 2001
+From: Kees Cook <keescook@chromium.org>
+Date: Thu, 26 Oct 2017 22:54:38 -0700
+Subject: [PATCH 1364/4131] drivers/net: amd: Convert timers to use
+ timer_setup()
+
+In preparation for unconditionally passing the struct timer_list pointer to
+all timer callbacks, switch to using the new timer_setup() and from_timer()
+to pass the timer pointer explicitly.
+
+Cc: Tom Lendacky <thomas.lendacky@amd.com>
+Cc: "David S. Miller" <davem@davemloft.net>
+Cc: Allen Pais <allen.lkml@gmail.com>
+Cc: netdev@vger.kernel.org
+Signed-off-by: Kees Cook <keescook@chromium.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sudheesh Mavila <sudheesh.mavila@amd.com>
+---
+ drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 14 ++++++--------
+ 1 file changed, 6 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+index 75c4455..d3e0186 100644
+--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
++++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+@@ -642,9 +642,9 @@ static irqreturn_t xgbe_dma_isr(int irq, void *data)
+ return IRQ_HANDLED;
+ }
+
+-static void xgbe_tx_timer(unsigned long data)
++static void xgbe_tx_timer(struct timer_list *t)
+ {
+- struct xgbe_channel *channel = (struct xgbe_channel *)data;
++ struct xgbe_channel *channel = from_timer(channel, t, tx_timer);
+ struct xgbe_prv_data *pdata = channel->pdata;
+ struct napi_struct *napi;
+
+@@ -680,9 +680,9 @@ static void xgbe_service(struct work_struct *work)
+ pdata->phy_if.phy_status(pdata);
+ }
+
+-static void xgbe_service_timer(unsigned long data)
++static void xgbe_service_timer(struct timer_list *t)
+ {
+- struct xgbe_prv_data *pdata = (struct xgbe_prv_data *)data;
++ struct xgbe_prv_data *pdata = from_timer(pdata, t, service_timer);
+
+ queue_work(pdata->dev_workqueue, &pdata->service_work);
+
+@@ -694,16 +694,14 @@ static void xgbe_init_timers(struct xgbe_prv_data *pdata)
+ struct xgbe_channel *channel;
+ unsigned int i;
+
+- setup_timer(&pdata->service_timer, xgbe_service_timer,
+- (unsigned long)pdata);
++ timer_setup(&pdata->service_timer, xgbe_service_timer, 0);
+
+ for (i = 0; i < pdata->channel_count; i++) {
+ channel = pdata->channel[i];
+ if (!channel->tx_ring)
+ break;
+
+- setup_timer(&channel->tx_timer, xgbe_tx_timer,
+- (unsigned long)channel);
++ timer_setup(&channel->tx_timer, xgbe_tx_timer, 0);
+ }
+ }
+
+--
+2.7.4
+