linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] usb: convert tasklets to use new tasklet_setup()
@ 2020-08-17  9:02 Allen Pais
  2020-08-17  9:02 ` [PATCH 1/7] usb: atm: convert tasklets to use new tasklet_setup() API Allen Pais
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Allen Pais @ 2020-08-17  9:02 UTC (permalink / raw)
  To: duncan.sands, gregkh, jacmet, balbi, leoyang.li, johan
  Cc: keescook, linux-usb, linux-kernel, linuxppc-dev, 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 usb drivers to use the new tasklet_setup() API

Allen Pais (7):
  usb: atm: convert tasklets to use new tasklet_setup() API
  usb: c67x00: convert tasklets to use new tasklet_setup() API
  usb: hcd: convert tasklets to use new tasklet_setup() API
  usb/gadget: f_midi: convert tasklets to use new tasklet_setup() API
  usb/gadget: fsl_qe_udc: convert tasklets to use new tasklet_setup()
    API
  usb: xhci: convert tasklets to use new tasklet_setup() API
  usb: mos7720: convert tasklets to use new tasklet_setup() API

 drivers/usb/atm/usbatm.c             | 14 ++++++++------
 drivers/usb/c67x00/c67x00-sched.c    |  7 +++----
 drivers/usb/core/hcd.c               |  6 +++---
 drivers/usb/gadget/function/f_midi.c |  6 +++---
 drivers/usb/gadget/udc/fsl_qe_udc.c  |  7 +++----
 drivers/usb/host/xhci-dbgtty.c       |  6 +++---
 drivers/usb/serial/mos7720.c         |  8 ++++----
 7 files changed, 27 insertions(+), 27 deletions(-)

-- 
2.17.1


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

* [PATCH 1/7] usb: atm: convert tasklets to use new tasklet_setup() API
  2020-08-17  9:02 [PATCH 0/7] usb: convert tasklets to use new tasklet_setup() Allen Pais
@ 2020-08-17  9:02 ` Allen Pais
  2020-08-17  9:02 ` [PATCH 2/7] usb: c67x00: " Allen Pais
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Allen Pais @ 2020-08-17  9:02 UTC (permalink / raw)
  To: duncan.sands, gregkh, jacmet, balbi, leoyang.li, johan
  Cc: keescook, linux-usb, linux-kernel, linuxppc-dev, 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/usb/atm/usbatm.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
index 4e12a32ca392..56fe30d247da 100644
--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
@@ -511,9 +511,10 @@ static unsigned int usbatm_write_cells(struct usbatm_data *instance,
 **  receive  **
 **************/
 
-static void usbatm_rx_process(unsigned long data)
+static void usbatm_rx_process(struct tasklet_struct *t)
 {
-	struct usbatm_data *instance = (struct usbatm_data *)data;
+	struct usbatm_data *instance = from_tasklet(instance, t,
+						    rx_channel.tasklet);
 	struct urb *urb;
 
 	while ((urb = usbatm_pop_urb(&instance->rx_channel))) {
@@ -564,9 +565,10 @@ static void usbatm_rx_process(unsigned long data)
 **  send  **
 ***********/
 
-static void usbatm_tx_process(unsigned long data)
+static void usbatm_tx_process(struct tasklet_struct *t)
 {
-	struct usbatm_data *instance = (struct usbatm_data *)data;
+	struct usbatm_data *instance = from_tasklet(instance, t,
+						    tx_channel.tasklet);
 	struct sk_buff *skb = instance->current_skb;
 	struct urb *urb = NULL;
 	const unsigned int buf_size = instance->tx_channel.buf_size;
@@ -1069,8 +1071,8 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id,
 
 	usbatm_init_channel(&instance->rx_channel);
 	usbatm_init_channel(&instance->tx_channel);
-	tasklet_init(&instance->rx_channel.tasklet, usbatm_rx_process, (unsigned long)instance);
-	tasklet_init(&instance->tx_channel.tasklet, usbatm_tx_process, (unsigned long)instance);
+	tasklet_setup(&instance->rx_channel.tasklet, usbatm_rx_process);
+	tasklet_setup(&instance->tx_channel.tasklet, usbatm_tx_process);
 	instance->rx_channel.stride = ATM_CELL_SIZE + driver->rx_padding;
 	instance->tx_channel.stride = ATM_CELL_SIZE + driver->tx_padding;
 	instance->rx_channel.usbatm = instance->tx_channel.usbatm = instance;
-- 
2.17.1


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

* [PATCH 2/7] usb: c67x00: convert tasklets to use new tasklet_setup() API
  2020-08-17  9:02 [PATCH 0/7] usb: convert tasklets to use new tasklet_setup() Allen Pais
  2020-08-17  9:02 ` [PATCH 1/7] usb: atm: convert tasklets to use new tasklet_setup() API Allen Pais
@ 2020-08-17  9:02 ` Allen Pais
  2020-08-17  9:02 ` [PATCH 3/7] usb: hcd: " Allen Pais
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Allen Pais @ 2020-08-17  9:02 UTC (permalink / raw)
  To: duncan.sands, gregkh, jacmet, balbi, leoyang.li, johan
  Cc: keescook, linux-usb, linux-kernel, linuxppc-dev, 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/usb/c67x00/c67x00-sched.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/c67x00/c67x00-sched.c b/drivers/usb/c67x00/c67x00-sched.c
index f7f6229082ca..6275cb77a15b 100644
--- a/drivers/usb/c67x00/c67x00-sched.c
+++ b/drivers/usb/c67x00/c67x00-sched.c
@@ -1122,9 +1122,9 @@ static void c67x00_do_work(struct c67x00_hcd *c67x00)
 
 /* -------------------------------------------------------------------------- */
 
-static void c67x00_sched_tasklet(unsigned long __c67x00)
+static void c67x00_sched_tasklet(struct tasklet_struct *t)
 {
-	struct c67x00_hcd *c67x00 = (struct c67x00_hcd *)__c67x00;
+	struct c67x00_hcd *c67x00 = from_tasklet(c67x00, t, tasklet);
 	c67x00_do_work(c67x00);
 }
 
@@ -1135,8 +1135,7 @@ void c67x00_sched_kick(struct c67x00_hcd *c67x00)
 
 int c67x00_sched_start_scheduler(struct c67x00_hcd *c67x00)
 {
-	tasklet_init(&c67x00->tasklet, c67x00_sched_tasklet,
-		     (unsigned long)c67x00);
+	tasklet_setup(&c67x00->tasklet, c67x00_sched_tasklet);
 	return 0;
 }
 
-- 
2.17.1


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

* [PATCH 3/7] usb: hcd: convert tasklets to use new tasklet_setup() API
  2020-08-17  9:02 [PATCH 0/7] usb: convert tasklets to use new tasklet_setup() Allen Pais
  2020-08-17  9:02 ` [PATCH 1/7] usb: atm: convert tasklets to use new tasklet_setup() API Allen Pais
  2020-08-17  9:02 ` [PATCH 2/7] usb: c67x00: " Allen Pais
@ 2020-08-17  9:02 ` Allen Pais
  2020-08-17  9:02 ` [PATCH 4/7] usb/gadget: f_midi: " Allen Pais
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Allen Pais @ 2020-08-17  9:02 UTC (permalink / raw)
  To: duncan.sands, gregkh, jacmet, balbi, leoyang.li, johan
  Cc: keescook, linux-usb, linux-kernel, linuxppc-dev, 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/usb/core/hcd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index a33b849e8beb..2c6b9578a7d3 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1657,9 +1657,9 @@ static void __usb_hcd_giveback_urb(struct urb *urb)
 	usb_put_urb(urb);
 }
 
-static void usb_giveback_urb_bh(unsigned long param)
+static void usb_giveback_urb_bh(struct tasklet_struct *t)
 {
-	struct giveback_urb_bh *bh = (struct giveback_urb_bh *)param;
+	struct giveback_urb_bh *bh = from_tasklet(bh, t, bh);
 	struct list_head local_list;
 
 	spin_lock_irq(&bh->lock);
@@ -2403,7 +2403,7 @@ static void init_giveback_urb_bh(struct giveback_urb_bh *bh)
 
 	spin_lock_init(&bh->lock);
 	INIT_LIST_HEAD(&bh->head);
-	tasklet_init(&bh->bh, usb_giveback_urb_bh, (unsigned long)bh);
+	tasklet_setup(&bh->bh, usb_giveback_urb_bh);
 }
 
 struct usb_hcd *__usb_create_hcd(const struct hc_driver *driver,
-- 
2.17.1


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

* [PATCH 4/7] usb/gadget: f_midi: convert tasklets to use new tasklet_setup() API
  2020-08-17  9:02 [PATCH 0/7] usb: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (2 preceding siblings ...)
  2020-08-17  9:02 ` [PATCH 3/7] usb: hcd: " Allen Pais
@ 2020-08-17  9:02 ` Allen Pais
  2020-08-17  9:02 ` [PATCH 5/7] usb/gadget: fsl_qe_udc: " Allen Pais
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Allen Pais @ 2020-08-17  9:02 UTC (permalink / raw)
  To: duncan.sands, gregkh, jacmet, balbi, leoyang.li, johan
  Cc: keescook, linux-usb, linux-kernel, linuxppc-dev, 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/usb/gadget/function/f_midi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c
index 46af0aa07e2e..85cb15734aa8 100644
--- a/drivers/usb/gadget/function/f_midi.c
+++ b/drivers/usb/gadget/function/f_midi.c
@@ -698,9 +698,9 @@ static void f_midi_transmit(struct f_midi *midi)
 	f_midi_drop_out_substreams(midi);
 }
 
-static void f_midi_in_tasklet(unsigned long data)
+static void f_midi_in_tasklet(struct tasklet_struct *t)
 {
-	struct f_midi *midi = (struct f_midi *) data;
+	struct f_midi *midi = from_tasklet(midi, t, tasklet);
 	f_midi_transmit(midi);
 }
 
@@ -875,7 +875,7 @@ static int f_midi_bind(struct usb_configuration *c, struct usb_function *f)
 	int status, n, jack = 1, i = 0, endpoint_descriptor_index = 0;
 
 	midi->gadget = cdev->gadget;
-	tasklet_init(&midi->tasklet, f_midi_in_tasklet, (unsigned long) midi);
+	tasklet_setup(&midi->tasklet, f_midi_in_tasklet);
 	status = f_midi_register_card(midi);
 	if (status < 0)
 		goto fail_register;
-- 
2.17.1


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

* [PATCH 5/7] usb/gadget: fsl_qe_udc: convert tasklets to use new tasklet_setup() API
  2020-08-17  9:02 [PATCH 0/7] usb: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (3 preceding siblings ...)
  2020-08-17  9:02 ` [PATCH 4/7] usb/gadget: f_midi: " Allen Pais
@ 2020-08-17  9:02 ` Allen Pais
  2020-08-17  9:02 ` [PATCH 6/7] usb: xhci: " Allen Pais
  2020-08-17  9:02 ` [PATCH 7/7] usb: mos7720: " Allen Pais
  6 siblings, 0 replies; 8+ messages in thread
From: Allen Pais @ 2020-08-17  9:02 UTC (permalink / raw)
  To: duncan.sands, gregkh, jacmet, balbi, leoyang.li, johan
  Cc: keescook, linux-usb, linux-kernel, linuxppc-dev, 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/usb/gadget/udc/fsl_qe_udc.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c b/drivers/usb/gadget/udc/fsl_qe_udc.c
index 2707be628298..fa66449b3907 100644
--- a/drivers/usb/gadget/udc/fsl_qe_udc.c
+++ b/drivers/usb/gadget/udc/fsl_qe_udc.c
@@ -923,9 +923,9 @@ static int qe_ep_rxframe_handle(struct qe_ep *ep)
 	return 0;
 }
 
-static void ep_rx_tasklet(unsigned long data)
+static void ep_rx_tasklet(struct tasklet_struct *t)
 {
-	struct qe_udc *udc = (struct qe_udc *)data;
+	struct qe_udc *udc = from_tasklet(udc, t, rx_tasklet);
 	struct qe_ep *ep;
 	struct qe_frame *pframe;
 	struct qe_bd __iomem *bd;
@@ -2553,8 +2553,7 @@ static int qe_udc_probe(struct platform_device *ofdev)
 					DMA_TO_DEVICE);
 	}
 
-	tasklet_init(&udc->rx_tasklet, ep_rx_tasklet,
-			(unsigned long)udc);
+	tasklet_setup(&udc->rx_tasklet, ep_rx_tasklet);
 	/* request irq and disable DR  */
 	udc->usb_irq = irq_of_parse_and_map(np, 0);
 	if (!udc->usb_irq) {
-- 
2.17.1


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

* [PATCH 6/7] usb: xhci: convert tasklets to use new tasklet_setup() API
  2020-08-17  9:02 [PATCH 0/7] usb: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (4 preceding siblings ...)
  2020-08-17  9:02 ` [PATCH 5/7] usb/gadget: fsl_qe_udc: " Allen Pais
@ 2020-08-17  9:02 ` Allen Pais
  2020-08-17  9:02 ` [PATCH 7/7] usb: mos7720: " Allen Pais
  6 siblings, 0 replies; 8+ messages in thread
From: Allen Pais @ 2020-08-17  9:02 UTC (permalink / raw)
  To: duncan.sands, gregkh, jacmet, balbi, leoyang.li, johan
  Cc: keescook, linux-usb, linux-kernel, linuxppc-dev, 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/usb/host/xhci-dbgtty.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/xhci-dbgtty.c b/drivers/usb/host/xhci-dbgtty.c
index b8918f73a432..ae4e4ab638b5 100644
--- a/drivers/usb/host/xhci-dbgtty.c
+++ b/drivers/usb/host/xhci-dbgtty.c
@@ -288,14 +288,14 @@ static const struct tty_operations dbc_tty_ops = {
 	.unthrottle		= dbc_tty_unthrottle,
 };
 
-static void dbc_rx_push(unsigned long _port)
+static void dbc_rx_push(struct tasklet_struct *t)
 {
 	struct dbc_request	*req;
 	struct tty_struct	*tty;
 	unsigned long		flags;
 	bool			do_push = false;
 	bool			disconnect = false;
-	struct dbc_port		*port = (void *)_port;
+	struct dbc_port		*port = from_tasklet(port, t, push);
 	struct list_head	*queue = &port->read_queue;
 
 	spin_lock_irqsave(&port->port_lock, flags);
@@ -382,7 +382,7 @@ xhci_dbc_tty_init_port(struct xhci_dbc *dbc, struct dbc_port *port)
 {
 	tty_port_init(&port->port);
 	spin_lock_init(&port->port_lock);
-	tasklet_init(&port->push, dbc_rx_push, (unsigned long)port);
+	tasklet_setup(&port->push, dbc_rx_push);
 	INIT_LIST_HEAD(&port->read_pool);
 	INIT_LIST_HEAD(&port->read_queue);
 	INIT_LIST_HEAD(&port->write_pool);
-- 
2.17.1


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

* [PATCH 7/7] usb: mos7720: convert tasklets to use new tasklet_setup() API
  2020-08-17  9:02 [PATCH 0/7] usb: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (5 preceding siblings ...)
  2020-08-17  9:02 ` [PATCH 6/7] usb: xhci: " Allen Pais
@ 2020-08-17  9:02 ` Allen Pais
  6 siblings, 0 replies; 8+ messages in thread
From: Allen Pais @ 2020-08-17  9:02 UTC (permalink / raw)
  To: duncan.sands, gregkh, jacmet, balbi, leoyang.li, johan
  Cc: keescook, linux-usb, linux-kernel, linuxppc-dev, 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/usb/serial/mos7720.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 2ec4eeacebc7..5eed1078fac8 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -282,11 +282,12 @@ static void destroy_urbtracker(struct kref *kref)
  * port callback had to be deferred because the disconnect mutex could not be
  * obtained at the time.
  */
-static void send_deferred_urbs(unsigned long _mos_parport)
+static void send_deferred_urbs(struct tasklet_struct *t)
 {
 	int ret_val;
 	unsigned long flags;
-	struct mos7715_parport *mos_parport = (void *)_mos_parport;
+	struct mos7715_parport *mos_parport = from_tasklet(mos_parport, t,
+							   urb_tasklet);
 	struct urbtracker *urbtrack, *tmp;
 	struct list_head *cursor, *next;
 	struct device *dev;
@@ -716,8 +717,7 @@ static int mos7715_parport_init(struct usb_serial *serial)
 	INIT_LIST_HEAD(&mos_parport->deferred_urbs);
 	usb_set_serial_data(serial, mos_parport); /* hijack private pointer */
 	mos_parport->serial = serial;
-	tasklet_init(&mos_parport->urb_tasklet, send_deferred_urbs,
-		     (unsigned long) mos_parport);
+	tasklet_setup(&mos_parport->urb_tasklet, send_deferred_urbs);
 	init_completion(&mos_parport->syncmsg_compl);
 
 	/* cycle parallel port reset bit */
-- 
2.17.1


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

end of thread, other threads:[~2020-08-17  9:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-17  9:02 [PATCH 0/7] usb: convert tasklets to use new tasklet_setup() Allen Pais
2020-08-17  9:02 ` [PATCH 1/7] usb: atm: convert tasklets to use new tasklet_setup() API Allen Pais
2020-08-17  9:02 ` [PATCH 2/7] usb: c67x00: " Allen Pais
2020-08-17  9:02 ` [PATCH 3/7] usb: hcd: " Allen Pais
2020-08-17  9:02 ` [PATCH 4/7] usb/gadget: f_midi: " Allen Pais
2020-08-17  9:02 ` [PATCH 5/7] usb/gadget: fsl_qe_udc: " Allen Pais
2020-08-17  9:02 ` [PATCH 6/7] usb: xhci: " Allen Pais
2020-08-17  9:02 ` [PATCH 7/7] usb: mos7720: " Allen Pais

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