linux-ppp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup()
@ 2020-08-17  8:58 Allen Pais
  2020-08-17  8:58 ` [PATCH 1/2] net: arcnet: convert tasklets to use new tasklet_setup() API Allen Pais
                   ` (12 more replies)
  0 siblings, 13 replies; 15+ messages in thread
From: Allen Pais @ 2020-08-17  8:58 UTC (permalink / raw)
  To: m.grzeschik, davem, paulus, oliver, woojung.huh, petkan
  Cc: keescook, netdev, linux-ppp, linux-kernel, linux-usb, Allen Pais

From: Allen Pais <allen.lkml@gmail.com>

Commit 12cc923f1ccc ("tasklet: Introduce new initialization API")'
introduced a new tasklet initialization API. This series converts 
all the net/* drivers to use the new tasklet_setup() API

Allen Pais (8):
  net: dccp: convert tasklets to use new tasklet_setup() API
  net: ipv4: convert tasklets to use new tasklet_setup() API
  net: mac80211: convert tasklets to use new tasklet_setup() API
  net: mac802154: convert tasklets to use new tasklet_setup() API
  net: rds: convert tasklets to use new tasklet_setup() API
  net: sched: convert tasklets to use new tasklet_setup() API
  net: smc: convert tasklets to use new tasklet_setup() API
  net: xfrm: convert tasklets to use new tasklet_setup() API

 net/dccp/timer.c           | 10 +++++-----
 net/ipv4/tcp_output.c      |  8 +++-----
 net/mac80211/ieee80211_i.h |  4 ++--
 net/mac80211/main.c        | 14 +++++---------
 net/mac80211/tx.c          |  5 +++--
 net/mac80211/util.c        |  5 +++--
 net/mac802154/main.c       |  8 +++-----
 net/rds/ib_cm.c            | 14 ++++++--------
 net/sched/sch_atm.c        |  9 +++++----
 net/smc/smc_cdc.c          |  6 +++---
 net/smc/smc_wr.c           | 14 ++++++--------
 net/xfrm/xfrm_input.c      |  7 +++----
 12 files changed, 47 insertions(+), 57 deletions(-)

-- 
2.17.1

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

* [PATCH 1/2] net: arcnet: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:58 [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup() Allen Pais
@ 2020-08-17  8:58 ` Allen Pais
  2020-08-17  8:58 ` [PATCH 1/9] net: ifb: " Allen Pais
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Allen Pais @ 2020-08-17  8:58 UTC (permalink / raw)
  To: m.grzeschik, davem, paulus, oliver, woojung.huh, petkan
  Cc: keescook, netdev, linux-ppp, linux-kernel, linux-usb, Allen Pais,
	Romain Perier

From: Allen Pais <allen.lkml@gmail.com>

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/arcnet/arcnet.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c
index e04efc0a5c97..69d8920e394b 100644
--- a/drivers/net/arcnet/arcnet.c
+++ b/drivers/net/arcnet/arcnet.c
@@ -393,9 +393,9 @@ static void arcnet_timer(struct timer_list *t)
 	}
 }
 
-static void arcnet_reply_tasklet(unsigned long data)
+static void arcnet_reply_tasklet(struct tasklet_struct *t)
 {
-	struct arcnet_local *lp = (struct arcnet_local *)data;
+	struct arcnet_local *lp = from_tasklet(lp, t, reply_tasklet);
 
 	struct sk_buff *ackskb, *skb;
 	struct sock_exterr_skb *serr;
@@ -483,8 +483,7 @@ int arcnet_open(struct net_device *dev)
 		arc_cont(D_PROTO, "\n");
 	}
 
-	tasklet_init(&lp->reply_tasklet, arcnet_reply_tasklet,
-		     (unsigned long)lp);
+	tasklet_setup(&lp->reply_tasklet, arcnet_reply_tasklet);
 
 	arc_printk(D_INIT, dev, "arcnet_open: resetting card.\n");
 
-- 
2.17.1

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

* [PATCH 1/9] net: ifb: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:58 [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup() Allen Pais
  2020-08-17  8:58 ` [PATCH 1/2] net: arcnet: convert tasklets to use new tasklet_setup() API Allen Pais
@ 2020-08-17  8:58 ` Allen Pais
  2020-08-17  8:58 ` [PATCH] net: mvpp2: Prepare to use the new tasklet API Allen Pais
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Allen Pais @ 2020-08-17  8:58 UTC (permalink / raw)
  To: m.grzeschik, davem, paulus, oliver, woojung.huh, petkan
  Cc: keescook, netdev, linux-ppp, linux-kernel, linux-usb, Allen Pais,
	Romain Perier

From: Allen Pais <allen.lkml@gmail.com>

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ifb.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index 7fe306e76281..a2d6027362d2 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -59,9 +59,9 @@ static netdev_tx_t ifb_xmit(struct sk_buff *skb, struct net_device *dev);
 static int ifb_open(struct net_device *dev);
 static int ifb_close(struct net_device *dev);
 
-static void ifb_ri_tasklet(unsigned long _txp)
+static void ifb_ri_tasklet(struct tasklet_struct *t)
 {
-	struct ifb_q_private *txp = (struct ifb_q_private *)_txp;
+	struct ifb_q_private *txp = from_tasklet(txp, t, ifb_tasklet);
 	struct netdev_queue *txq;
 	struct sk_buff *skb;
 
@@ -170,8 +170,7 @@ static int ifb_dev_init(struct net_device *dev)
 		__skb_queue_head_init(&txp->tq);
 		u64_stats_init(&txp->rsync);
 		u64_stats_init(&txp->tsync);
-		tasklet_init(&txp->ifb_tasklet, ifb_ri_tasklet,
-			     (unsigned long)txp);
+		tasklet_setup(&txp->ifb_tasklet, ifb_ri_tasklet);
 		netif_tx_start_queue(netdev_get_tx_queue(dev, i));
 	}
 	return 0;
-- 
2.17.1

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

* [PATCH] net: mvpp2: Prepare to use the new tasklet API
  2020-08-17  8:58 [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup() Allen Pais
  2020-08-17  8:58 ` [PATCH 1/2] net: arcnet: convert tasklets to use new tasklet_setup() API Allen Pais
  2020-08-17  8:58 ` [PATCH 1/9] net: ifb: " Allen Pais
@ 2020-08-17  8:58 ` Allen Pais
  2020-08-17  8:58 ` [PATCH 2/2] net: caif: convert tasklets to use new tasklet_setup() API Allen Pais
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Allen Pais @ 2020-08-17  8:58 UTC (permalink / raw)
  To: m.grzeschik, davem, paulus, oliver, woojung.huh, petkan
  Cc: keescook, netdev, linux-ppp, linux-kernel, linux-usb,
	Romain Perier, Romain Perier, Allen Pais

From: Romain Perier <romain.perier@viveris.fr>

The future tasklet API will no longer allow to pass an arbitrary
"unsigned long" data parameter. The tasklet data structure will need to
be embedded into a data structure that will be retrieved from the tasklet
handler. Currently, there are no ways to retrieve the "struct mvpp2_port
*" from a given "struct mvpp2_port_pcpu *". This commit adds a new field
to get the address of the main port for each pcpu context.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2.h      | 1 +
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
index 32753cc771bf..198860a4527d 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
@@ -861,6 +861,7 @@ struct mvpp2_port_pcpu {
 	struct hrtimer tx_done_timer;
 	struct net_device *dev;
 	bool timer_scheduled;
+	struct mvpp2_port *port;
 };
 
 struct mvpp2_queue_vector {
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index 2a8a5842eaef..fb45f86dcb12 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -6025,6 +6025,7 @@ static int mvpp2_port_probe(struct platform_device *pdev,
 		err = -ENOMEM;
 		goto err_free_txq_pcpu;
 	}
+	port->pcpu->port = port;
 
 	if (!port->has_tx_irqs) {
 		for (thread = 0; thread < priv->nthreads; thread++) {
-- 
2.17.1

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

* [PATCH 2/2] net: caif: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:58 [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (2 preceding siblings ...)
  2020-08-17  8:58 ` [PATCH] net: mvpp2: Prepare to use the new tasklet API Allen Pais
@ 2020-08-17  8:58 ` Allen Pais
  2020-08-17  8:58 ` [PATCH 2/9] net: ppp: " Allen Pais
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Allen Pais @ 2020-08-17  8:58 UTC (permalink / raw)
  To: m.grzeschik, davem, paulus, oliver, woojung.huh, petkan
  Cc: keescook, netdev, linux-ppp, linux-kernel, linux-usb, Allen Pais,
	Romain Perier

From: Allen Pais <allen.lkml@gmail.com>

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/caif/caif_virtio.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/caif/caif_virtio.c b/drivers/net/caif/caif_virtio.c
index 80ea2e913c2b..23c2eb8ceeec 100644
--- a/drivers/net/caif/caif_virtio.c
+++ b/drivers/net/caif/caif_virtio.c
@@ -598,9 +598,9 @@ static netdev_tx_t cfv_netdev_tx(struct sk_buff *skb, struct net_device *netdev)
 	return NETDEV_TX_OK;
 }
 
-static void cfv_tx_release_tasklet(unsigned long drv)
+static void cfv_tx_release_tasklet(struct tasklet_struct *t)
 {
-	struct cfv_info *cfv = (struct cfv_info *)drv;
+	struct cfv_info *cfv = from_tasklet(cfv, t, tx_release_tasklet);
 	cfv_release_used_buf(cfv->vq_tx);
 }
 
@@ -716,9 +716,7 @@ static int cfv_probe(struct virtio_device *vdev)
 	cfv->ctx.head = USHRT_MAX;
 	netif_napi_add(netdev, &cfv->napi, cfv_rx_poll, CFV_DEFAULT_QUOTA);
 
-	tasklet_init(&cfv->tx_release_tasklet,
-		     cfv_tx_release_tasklet,
-		     (unsigned long)cfv);
+	tasklet_setup(&cfv->tx_release_tasklet, cfv_tx_release_tasklet);
 
 	/* Carrier is off until netdevice is opened */
 	netif_carrier_off(netdev);
-- 
2.17.1

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

* [PATCH 2/9] net: ppp: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:58 [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (3 preceding siblings ...)
  2020-08-17  8:58 ` [PATCH 2/2] net: caif: convert tasklets to use new tasklet_setup() API Allen Pais
@ 2020-08-17  8:58 ` Allen Pais
  2020-08-17  8:58 ` [PATCH 3/9] net: cdc_ncm: " Allen Pais
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Allen Pais @ 2020-08-17  8:58 UTC (permalink / raw)
  To: m.grzeschik, davem, paulus, oliver, woojung.huh, petkan
  Cc: keescook, netdev, linux-ppp, linux-kernel, linux-usb, Allen Pais,
	Romain Perier

From: Allen Pais <allen.lkml@gmail.com>

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/ppp/ppp_async.c   | 8 ++++----
 drivers/net/ppp/ppp_synctty.c | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ppp/ppp_async.c b/drivers/net/ppp/ppp_async.c
index 29a0917a81e6..2b66cf301b0e 100644
--- a/drivers/net/ppp/ppp_async.c
+++ b/drivers/net/ppp/ppp_async.c
@@ -101,7 +101,7 @@ static void ppp_async_input(struct asyncppp *ap, const unsigned char *buf,
 			    char *flags, int count);
 static int ppp_async_ioctl(struct ppp_channel *chan, unsigned int cmd,
 			   unsigned long arg);
-static void ppp_async_process(unsigned long arg);
+static void ppp_async_process(struct tasklet_struct *t);
 
 static void async_lcp_peek(struct asyncppp *ap, unsigned char *data,
 			   int len, int inbound);
@@ -179,7 +179,7 @@ ppp_asynctty_open(struct tty_struct *tty)
 	ap->lcp_fcs = -1;
 
 	skb_queue_head_init(&ap->rqueue);
-	tasklet_init(&ap->tsk, ppp_async_process, (unsigned long) ap);
+	tasklet_setup(&ap->tsk, ppp_async_process);
 
 	refcount_set(&ap->refcnt, 1);
 	init_completion(&ap->dead);
@@ -488,9 +488,9 @@ ppp_async_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
  * to the ppp_generic code, and to tell the ppp_generic code
  * if we can accept more output now.
  */
-static void ppp_async_process(unsigned long arg)
+static void ppp_async_process(struct tasklet_struct *t)
 {
-	struct asyncppp *ap = (struct asyncppp *) arg;
+	struct asyncppp *ap = from_tasklet(ap, t, tsk);
 	struct sk_buff *skb;
 
 	/* process received packets */
diff --git a/drivers/net/ppp/ppp_synctty.c b/drivers/net/ppp/ppp_synctty.c
index 0f338752c38b..86ee5149f4f2 100644
--- a/drivers/net/ppp/ppp_synctty.c
+++ b/drivers/net/ppp/ppp_synctty.c
@@ -90,7 +90,7 @@ static struct sk_buff* ppp_sync_txmunge(struct syncppp *ap, struct sk_buff *);
 static int ppp_sync_send(struct ppp_channel *chan, struct sk_buff *skb);
 static int ppp_sync_ioctl(struct ppp_channel *chan, unsigned int cmd,
 			  unsigned long arg);
-static void ppp_sync_process(unsigned long arg);
+static void ppp_sync_process(struct tasklet_struct *t);
 static int ppp_sync_push(struct syncppp *ap);
 static void ppp_sync_flush_output(struct syncppp *ap);
 static void ppp_sync_input(struct syncppp *ap, const unsigned char *buf,
@@ -177,7 +177,7 @@ ppp_sync_open(struct tty_struct *tty)
 	ap->raccm = ~0U;
 
 	skb_queue_head_init(&ap->rqueue);
-	tasklet_init(&ap->tsk, ppp_sync_process, (unsigned long) ap);
+	tasklet_setup(&ap->tsk, ppp_sync_process);
 
 	refcount_set(&ap->refcnt, 1);
 	init_completion(&ap->dead_cmp);
@@ -480,9 +480,9 @@ ppp_sync_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
  * to the ppp_generic code, and to tell the ppp_generic code
  * if we can accept more output now.
  */
-static void ppp_sync_process(unsigned long arg)
+static void ppp_sync_process(struct tasklet_struct *t)
 {
-	struct syncppp *ap = (struct syncppp *) arg;
+	struct syncppp *ap = from_tasklet(ap, t, tsk);
 	struct sk_buff *skb;
 
 	/* process received packets */
-- 
2.17.1

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

* [PATCH 3/9] net: cdc_ncm: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:58 [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (4 preceding siblings ...)
  2020-08-17  8:58 ` [PATCH 2/9] net: ppp: " Allen Pais
@ 2020-08-17  8:58 ` Allen Pais
  2020-08-17  8:58 ` [PATCH 4/9] net: hso: " Allen Pais
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Allen Pais @ 2020-08-17  8:58 UTC (permalink / raw)
  To: m.grzeschik, davem, paulus, oliver, woojung.huh, petkan
  Cc: keescook, netdev, linux-ppp, linux-kernel, linux-usb, Allen Pais,
	Romain Perier

From: Allen Pais <allen.lkml@gmail.com>

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/usb/cdc_ncm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index e04f588538cc..57a95ef90385 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -61,7 +61,7 @@ static bool prefer_mbim;
 module_param(prefer_mbim, bool, 0644);
 MODULE_PARM_DESC(prefer_mbim, "Prefer MBIM setting on dual NCM/MBIM functions");
 
-static void cdc_ncm_txpath_bh(unsigned long param);
+static void cdc_ncm_txpath_bh(struct tasklet_struct *t);
 static void cdc_ncm_tx_timeout_start(struct cdc_ncm_ctx *ctx);
 static enum hrtimer_restart cdc_ncm_tx_timer_cb(struct hrtimer *hr_timer);
 static struct usb_driver cdc_ncm_driver;
@@ -815,7 +815,7 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_
 
 	hrtimer_init(&ctx->tx_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 	ctx->tx_timer.function = &cdc_ncm_tx_timer_cb;
-	tasklet_init(&ctx->bh, cdc_ncm_txpath_bh, (unsigned long)dev);
+	tasklet_setup(&ctx->bh, cdc_ncm_txpath_bh);
 	atomic_set(&ctx->stop, 0);
 	spin_lock_init(&ctx->mtx);
 
@@ -1468,9 +1468,9 @@ static enum hrtimer_restart cdc_ncm_tx_timer_cb(struct hrtimer *timer)
 	return HRTIMER_NORESTART;
 }
 
-static void cdc_ncm_txpath_bh(unsigned long param)
+static void cdc_ncm_txpath_bh(struct tasklet_struct *t)
 {
-	struct usbnet *dev = (struct usbnet *)param;
+	struct usbnet *dev = from_tasklet(dev, t, bh);
 	struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0];
 
 	spin_lock_bh(&ctx->mtx);
-- 
2.17.1

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

* [PATCH 4/9] net: hso: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:58 [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (5 preceding siblings ...)
  2020-08-17  8:58 ` [PATCH 3/9] net: cdc_ncm: " Allen Pais
@ 2020-08-17  8:58 ` Allen Pais
  2020-08-17  8:58 ` [PATCH 5/9] net: lan78xx: " Allen Pais
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Allen Pais @ 2020-08-17  8:58 UTC (permalink / raw)
  To: m.grzeschik, davem, paulus, oliver, woojung.huh, petkan
  Cc: keescook, netdev, linux-ppp, linux-kernel, linux-usb, Allen Pais,
	Romain Perier

From: Allen Pais <allen.lkml@gmail.com>

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/usb/hso.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 2bb28db89432..56b3b6395831 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -1213,9 +1213,10 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb)
  * This needs to be a tasklet otherwise we will
  * end up recursively calling this function.
  */
-static void hso_unthrottle_tasklet(unsigned long data)
+static void hso_unthrottle_tasklet(struct tasklet_struct *t)
 {
-	struct hso_serial *serial = (struct hso_serial *)data;
+	struct hso_serial *serial = from_tasklet(serial, t,
+						 unthrottle_tasklet);
 	unsigned long flags;
 
 	spin_lock_irqsave(&serial->serial_lock, flags);
@@ -1264,9 +1265,8 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp)
 		serial->rx_state = RX_IDLE;
 		/* Force default termio settings */
 		_hso_serial_set_termios(tty, NULL);
-		tasklet_init(&serial->unthrottle_tasklet,
-			     hso_unthrottle_tasklet,
-			     (unsigned long)serial);
+		tasklet_setup(&serial->unthrottle_tasklet,
+			     hso_unthrottle_tasklet);
 		result = hso_start_serial_device(serial->parent, GFP_KERNEL);
 		if (result) {
 			hso_stop_serial_device(serial->parent);
-- 
2.17.1

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

* [PATCH 5/9] net: lan78xx: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:58 [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (6 preceding siblings ...)
  2020-08-17  8:58 ` [PATCH 4/9] net: hso: " Allen Pais
@ 2020-08-17  8:58 ` Allen Pais
  2020-08-17  8:58 ` [PATCH 6/9] net: pegasus: " Allen Pais
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Allen Pais @ 2020-08-17  8:58 UTC (permalink / raw)
  To: m.grzeschik, davem, paulus, oliver, woojung.huh, petkan
  Cc: keescook, netdev, linux-ppp, linux-kernel, linux-usb, Allen Pais,
	Romain Perier

From: Allen Pais <allen.lkml@gmail.com>

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/usb/lan78xx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index 442507f25aad..557999a94ef9 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -3386,9 +3386,9 @@ static void lan78xx_rx_bh(struct lan78xx_net *dev)
 		netif_wake_queue(dev->net);
 }
 
-static void lan78xx_bh(unsigned long param)
+static void lan78xx_bh(struct tasklet_struct *t)
 {
-	struct lan78xx_net *dev = (struct lan78xx_net *)param;
+	struct lan78xx_net *dev = from_tasklet(dev, t, bh);
 	struct sk_buff *skb;
 	struct skb_data *entry;
 
@@ -3666,7 +3666,7 @@ static int lan78xx_probe(struct usb_interface *intf,
 	skb_queue_head_init(&dev->txq_pend);
 	mutex_init(&dev->phy_mutex);
 
-	tasklet_init(&dev->bh, lan78xx_bh, (unsigned long)dev);
+	tasklet_setup(&dev->bh, lan78xx_bh);
 	INIT_DELAYED_WORK(&dev->wq, lan78xx_delayedwork);
 	init_usb_anchor(&dev->deferred);
 
-- 
2.17.1

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

* [PATCH 6/9] net: pegasus: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:58 [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (7 preceding siblings ...)
  2020-08-17  8:58 ` [PATCH 5/9] net: lan78xx: " Allen Pais
@ 2020-08-17  8:58 ` Allen Pais
  2020-08-17  8:58 ` [PATCH 7/9] net: r8152: " Allen Pais
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Allen Pais @ 2020-08-17  8:58 UTC (permalink / raw)
  To: m.grzeschik, davem, paulus, oliver, woojung.huh, petkan
  Cc: keescook, netdev, linux-ppp, linux-kernel, linux-usb, Allen Pais,
	Romain Perier

From: Allen Pais <allen.lkml@gmail.com>

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/usb/pegasus.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
index 0ef7e1f443e3..addf904e7c65 100644
--- a/drivers/net/usb/pegasus.c
+++ b/drivers/net/usb/pegasus.c
@@ -565,12 +565,12 @@ static void read_bulk_callback(struct urb *urb)
 	tasklet_schedule(&pegasus->rx_tl);
 }
 
-static void rx_fixup(unsigned long data)
+static void rx_fixup(struct tasklet_struct *t)
 {
 	pegasus_t *pegasus;
 	int status;
 
-	pegasus = (pegasus_t *) data;
+	pegasus = from_tasklet(pegasus, t, rx_tl);
 	if (pegasus->flags & PEGASUS_UNPLUG)
 		return;
 
@@ -1141,7 +1141,7 @@ static int pegasus_probe(struct usb_interface *intf,
 		goto out1;
 	}
 
-	tasklet_init(&pegasus->rx_tl, rx_fixup, (unsigned long) pegasus);
+	tasklet_setup(&pegasus->rx_tl, rx_fixup);
 
 	INIT_DELAYED_WORK(&pegasus->carrier_check, check_carrier);
 
-- 
2.17.1

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

* [PATCH 7/9] net: r8152: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:58 [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (8 preceding siblings ...)
  2020-08-17  8:58 ` [PATCH 6/9] net: pegasus: " Allen Pais
@ 2020-08-17  8:58 ` Allen Pais
  2020-08-17  8:58 ` [PATCH 8/9] net: rtl8150: " Allen Pais
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Allen Pais @ 2020-08-17  8:58 UTC (permalink / raw)
  To: m.grzeschik, davem, paulus, oliver, woojung.huh, petkan
  Cc: keescook, netdev, linux-ppp, linux-kernel, linux-usb, Allen Pais,
	Romain Perier

From: Allen Pais <allen.lkml@gmail.com>

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/usb/r8152.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 2b02fefd094d..6805686abfe7 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -2410,11 +2410,9 @@ static void tx_bottom(struct r8152 *tp)
 	} while (res = 0);
 }
 
-static void bottom_half(unsigned long data)
+static void bottom_half(struct tasklet_struct *t)
 {
-	struct r8152 *tp;
-
-	tp = (struct r8152 *)data;
+	struct r8152 *tp = from_tasklet(tp, t, tx_tl);
 
 	if (test_bit(RTL8152_UNPLUG, &tp->flags))
 		return;
@@ -6730,7 +6728,7 @@ static int rtl8152_probe(struct usb_interface *intf,
 	mutex_init(&tp->control);
 	INIT_DELAYED_WORK(&tp->schedule, rtl_work_func_t);
 	INIT_DELAYED_WORK(&tp->hw_phy_work, rtl_hw_phy_work_func_t);
-	tasklet_init(&tp->tx_tl, bottom_half, (unsigned long)tp);
+	tasklet_setup(&tp->tx_tl, bottom_half);
 	tasklet_disable(&tp->tx_tl);
 
 	netdev->netdev_ops = &rtl8152_netdev_ops;
-- 
2.17.1

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

* [PATCH 8/9] net: rtl8150: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:58 [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (9 preceding siblings ...)
  2020-08-17  8:58 ` [PATCH 7/9] net: r8152: " Allen Pais
@ 2020-08-17  8:58 ` Allen Pais
  2020-08-17  8:58 ` [PATCH 9/9] net: usbnet: " Allen Pais
  2020-09-11  5:57 ` [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup() Allen
  12 siblings, 0 replies; 15+ messages in thread
From: Allen Pais @ 2020-08-17  8:58 UTC (permalink / raw)
  To: m.grzeschik, davem, paulus, oliver, woojung.huh, petkan
  Cc: keescook, netdev, linux-ppp, linux-kernel, linux-usb, Allen Pais,
	Romain Perier

From: Allen Pais <allen.lkml@gmail.com>

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/usb/rtl8150.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
index e7c630d37589..b6d70716321c 100644
--- a/drivers/net/usb/rtl8150.c
+++ b/drivers/net/usb/rtl8150.c
@@ -589,9 +589,9 @@ static void free_skb_pool(rtl8150_t *dev)
 		dev_kfree_skb(dev->rx_skb_pool[i]);
 }
 
-static void rx_fixup(unsigned long data)
+static void rx_fixup(struct tasklet_struct *t)
 {
-	struct rtl8150 *dev = (struct rtl8150 *)data;
+	struct rtl8150 *dev = from_tasklet(dev, t, tl);
 	struct sk_buff *skb;
 	int status;
 
@@ -890,7 +890,7 @@ static int rtl8150_probe(struct usb_interface *intf,
 		return -ENOMEM;
 	}
 
-	tasklet_init(&dev->tl, rx_fixup, (unsigned long)dev);
+	tasklet_setup(&dev->tl, rx_fixup);
 	spin_lock_init(&dev->rx_pool_lock);
 
 	dev->udev = udev;
-- 
2.17.1

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

* [PATCH 9/9] net: usbnet: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:58 [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (10 preceding siblings ...)
  2020-08-17  8:58 ` [PATCH 8/9] net: rtl8150: " Allen Pais
@ 2020-08-17  8:58 ` Allen Pais
  2020-09-11  5:57 ` [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup() Allen
  12 siblings, 0 replies; 15+ messages in thread
From: Allen Pais @ 2020-08-17  8:58 UTC (permalink / raw)
  To: m.grzeschik, davem, paulus, oliver, woojung.huh, petkan
  Cc: keescook, netdev, linux-ppp, linux-kernel, linux-usb, Allen Pais,
	Romain Perier

From: Allen Pais <allen.lkml@gmail.com>

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly
and remove the .data field.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/net/usb/usbnet.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index e45935a5856a..45bf0814939d 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1708,8 +1708,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
 	skb_queue_head_init (&dev->txq);
 	skb_queue_head_init (&dev->done);
 	skb_queue_head_init(&dev->rxq_pause);
-	dev->bh.func = usbnet_bh_tasklet;
-	dev->bh.data = (unsigned long)&dev->delay;
+	dev->bh.func = (void(*) (unsigned long))usbnet_bh_tasklet;
 	INIT_WORK (&dev->kevent, usbnet_deferred_kevent);
 	init_usb_anchor(&dev->deferred);
 	timer_setup(&dev->delay, usbnet_bh, 0);
-- 
2.17.1

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

* Re: [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup()
  2020-08-17  8:58 [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (11 preceding siblings ...)
  2020-08-17  8:58 ` [PATCH 9/9] net: usbnet: " Allen Pais
@ 2020-09-11  5:57 ` Allen
  2020-09-11 20:19   ` David Miller
  12 siblings, 1 reply; 15+ messages in thread
From: Allen @ 2020-09-11  5:57 UTC (permalink / raw)
  To: David Miller
  Cc: m.grzeschik, paulus, oliver, woojung.huh, petkan, Kees Cook,
	netdev, linux-ppp, Linux Kernel Mailing List, linux-usb

David,
>
> Commit 12cc923f1ccc ("tasklet: Introduce new initialization API")'
> introduced a new tasklet initialization API. This series converts
> all the net/* drivers to use the new tasklet_setup() API
>
> Allen Pais (8):
>   net: dccp: convert tasklets to use new tasklet_setup() API
>   net: ipv4: convert tasklets to use new tasklet_setup() API
>   net: mac80211: convert tasklets to use new tasklet_setup() API
>   net: mac802154: convert tasklets to use new tasklet_setup() API
>   net: rds: convert tasklets to use new tasklet_setup() API
>   net: sched: convert tasklets to use new tasklet_setup() API
>   net: smc: convert tasklets to use new tasklet_setup() API
>   net: xfrm: convert tasklets to use new tasklet_setup() API
>
>  net/dccp/timer.c           | 10 +++++-----
>  net/ipv4/tcp_output.c      |  8 +++-----
>  net/mac80211/ieee80211_i.h |  4 ++--
>  net/mac80211/main.c        | 14 +++++---------
>  net/mac80211/tx.c          |  5 +++--
>  net/mac80211/util.c        |  5 +++--
>  net/mac802154/main.c       |  8 +++-----
>  net/rds/ib_cm.c            | 14 ++++++--------
>  net/sched/sch_atm.c        |  9 +++++----
>  net/smc/smc_cdc.c          |  6 +++---
>  net/smc/smc_wr.c           | 14 ++++++--------
>  net/xfrm/xfrm_input.c      |  7 +++----
>  12 files changed, 47 insertions(+), 57 deletions(-)
>
> --
> 2.17.1
>

Will you pick these up or should I send these out again when I
have fixed the two patches on the other thread.

Thanks,


-- 
       - Allen

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

* Re: [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup()
  2020-09-11  5:57 ` [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup() Allen
@ 2020-09-11 20:19   ` David Miller
  0 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2020-09-11 20:19 UTC (permalink / raw)
  To: allen.lkml
  Cc: m.grzeschik, paulus, oliver, woojung.huh, petkan, keescook,
	netdev, linux-ppp, linux-kernel, linux-usb

From: Allen <allen.lkml@gmail.com>
Date: Fri, 11 Sep 2020 11:26:52 +0530

> Will you pick these up or should I send these out again when I
> have fixed the two patches on the other thread.

Always resend.

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

end of thread, other threads:[~2020-09-11 20:19 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-17  8:58 [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup() Allen Pais
2020-08-17  8:58 ` [PATCH 1/2] net: arcnet: convert tasklets to use new tasklet_setup() API Allen Pais
2020-08-17  8:58 ` [PATCH 1/9] net: ifb: " Allen Pais
2020-08-17  8:58 ` [PATCH] net: mvpp2: Prepare to use the new tasklet API Allen Pais
2020-08-17  8:58 ` [PATCH 2/2] net: caif: convert tasklets to use new tasklet_setup() API Allen Pais
2020-08-17  8:58 ` [PATCH 2/9] net: ppp: " Allen Pais
2020-08-17  8:58 ` [PATCH 3/9] net: cdc_ncm: " Allen Pais
2020-08-17  8:58 ` [PATCH 4/9] net: hso: " Allen Pais
2020-08-17  8:58 ` [PATCH 5/9] net: lan78xx: " Allen Pais
2020-08-17  8:58 ` [PATCH 6/9] net: pegasus: " Allen Pais
2020-08-17  8:58 ` [PATCH 7/9] net: r8152: " Allen Pais
2020-08-17  8:58 ` [PATCH 8/9] net: rtl8150: " Allen Pais
2020-08-17  8:58 ` [PATCH 9/9] net: usbnet: " Allen Pais
2020-09-11  5:57 ` [PATCH 0/8] drivers: net: convert tasklets to use new tasklet_setup() Allen
2020-09-11 20:19   ` David Miller

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).