linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] tty: convert tasklets to use new tasklet_setup()
@ 2020-08-17  8:59 Allen Pais
  2020-08-17  8:59 ` [PATCH 1/4] tty: ipwireless: convert tasklets to use new tasklet_setup() API Allen Pais
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Allen Pais @ 2020-08-17  8:59 UTC (permalink / raw)
  To: richard.genoud, gregkh
  Cc: linux-arm-kernel, Allen Pais, keescook, linux-serial, linux-kernel

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 tty drivers to use the new tasklet_setup() API

Allen Pais (4):
  tty: ipwireless: convert tasklets to use new tasklet_setup() API
  tty: atmel_serial: convert tasklets to use new tasklet_setup() API
  tty: ifx6x60: convert tasklets to use new tasklet_setup() API
  tty: timbuart: convert tasklets to use new tasklet_setup() API

 drivers/tty/ipwireless/hardware.c |  6 +++---
 drivers/tty/serial/atmel_serial.c | 20 ++++++++++----------
 drivers/tty/serial/ifx6x60.c      |  8 ++++----
 drivers/tty/serial/timbuart.c     |  6 +++---
 4 files changed, 20 insertions(+), 20 deletions(-)

-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/4] tty: ipwireless: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:59 [PATCH 0/4] tty: convert tasklets to use new tasklet_setup() Allen Pais
@ 2020-08-17  8:59 ` Allen Pais
  2020-08-17  8:59 ` [PATCH 2/4] tty: atmel_serial: " Allen Pais
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Allen Pais @ 2020-08-17  8:59 UTC (permalink / raw)
  To: richard.genoud, gregkh
  Cc: keescook, Allen Pais, linux-kernel, linux-serial, Romain Perier,
	linux-arm-kernel

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/tty/ipwireless/hardware.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/ipwireless/hardware.c b/drivers/tty/ipwireless/hardware.c
index 6bbf35682d53..f5d3e68f5750 100644
--- a/drivers/tty/ipwireless/hardware.c
+++ b/drivers/tty/ipwireless/hardware.c
@@ -1006,9 +1006,9 @@ static int send_pending_packet(struct ipw_hardware *hw, int priority_limit)
 /*
  * Send and receive all queued packets.
  */
-static void ipwireless_do_tasklet(unsigned long hw_)
+static void ipwireless_do_tasklet(struct tasklet_struct *t)
 {
-	struct ipw_hardware *hw = (struct ipw_hardware *) hw_;
+	struct ipw_hardware *hw = from_tasklet(hw, t, tasklet);
 	unsigned long flags;
 
 	spin_lock_irqsave(&hw->lock, flags);
@@ -1635,7 +1635,7 @@ struct ipw_hardware *ipwireless_hardware_create(void)
 	INIT_LIST_HEAD(&hw->rx_queue);
 	INIT_LIST_HEAD(&hw->rx_pool);
 	spin_lock_init(&hw->lock);
-	tasklet_init(&hw->tasklet, ipwireless_do_tasklet, (unsigned long) hw);
+	tasklet_setup(&hw->tasklet, ipwireless_do_tasklet);
 	INIT_WORK(&hw->work_rx, ipw_receive_data_work);
 	timer_setup(&hw->setup_timer, ipwireless_setup_timer, 0);
 
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/4] tty: atmel_serial: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:59 [PATCH 0/4] tty: convert tasklets to use new tasklet_setup() Allen Pais
  2020-08-17  8:59 ` [PATCH 1/4] tty: ipwireless: convert tasklets to use new tasklet_setup() API Allen Pais
@ 2020-08-17  8:59 ` Allen Pais
  2020-08-26 13:29   ` Richard Genoud
  2020-08-17  8:59 ` [PATCH 3/4] tty: ifx6x60: " Allen Pais
  2020-08-17  8:59 ` [PATCH 4/4] tty: timbuart: " Allen Pais
  3 siblings, 1 reply; 6+ messages in thread
From: Allen Pais @ 2020-08-17  8:59 UTC (permalink / raw)
  To: richard.genoud, gregkh
  Cc: keescook, Allen Pais, linux-kernel, linux-serial, Romain Perier,
	linux-arm-kernel

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/tty/serial/atmel_serial.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index e43471b33710..a9c47f56e994 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1722,10 +1722,11 @@ static int atmel_prepare_rx_pdc(struct uart_port *port)
 /*
  * tasklet handling tty stuff outside the interrupt handler.
  */
-static void atmel_tasklet_rx_func(unsigned long data)
+static void atmel_tasklet_rx_func(struct tasklet_struct *t)
 {
-	struct uart_port *port = (struct uart_port *)data;
-	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
+	struct atmel_uart_port *atmel_port = from_tasklet(atmel_port, t,
+							  tasklet_rx);
+	struct uart_port *port = &atmel_port->uart;
 
 	/* The interrupt handler does not take the lock */
 	spin_lock(&port->lock);
@@ -1733,10 +1734,11 @@ static void atmel_tasklet_rx_func(unsigned long data)
 	spin_unlock(&port->lock);
 }
 
-static void atmel_tasklet_tx_func(unsigned long data)
+static void atmel_tasklet_tx_func(struct tasklet_struct *t)
 {
-	struct uart_port *port = (struct uart_port *)data;
-	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
+	struct atmel_uart_port *atmel_port = from_tasklet(atmel_port, t,
+							  tasklet_tx);
+	struct uart_port *port = &atmel_port->uart;
 
 	/* The interrupt handler does not take the lock */
 	spin_lock(&port->lock);
@@ -1911,10 +1913,8 @@ static int atmel_startup(struct uart_port *port)
 	}
 
 	atomic_set(&atmel_port->tasklet_shutdown, 0);
-	tasklet_init(&atmel_port->tasklet_rx, atmel_tasklet_rx_func,
-			(unsigned long)port);
-	tasklet_init(&atmel_port->tasklet_tx, atmel_tasklet_tx_func,
-			(unsigned long)port);
+	tasklet_setup(&atmel_port->tasklet_rx, atmel_tasklet_rx_func);
+	tasklet_setup(&atmel_port->tasklet_tx, atmel_tasklet_tx_func);
 
 	/*
 	 * Initialize DMA (if necessary)
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 3/4] tty: ifx6x60: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:59 [PATCH 0/4] tty: convert tasklets to use new tasklet_setup() Allen Pais
  2020-08-17  8:59 ` [PATCH 1/4] tty: ipwireless: convert tasklets to use new tasklet_setup() API Allen Pais
  2020-08-17  8:59 ` [PATCH 2/4] tty: atmel_serial: " Allen Pais
@ 2020-08-17  8:59 ` Allen Pais
  2020-08-17  8:59 ` [PATCH 4/4] tty: timbuart: " Allen Pais
  3 siblings, 0 replies; 6+ messages in thread
From: Allen Pais @ 2020-08-17  8:59 UTC (permalink / raw)
  To: richard.genoud, gregkh
  Cc: keescook, Allen Pais, linux-kernel, linux-serial, Romain Perier,
	linux-arm-kernel

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/tty/serial/ifx6x60.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c
index 7d16fe41932f..37d5b8516880 100644
--- a/drivers/tty/serial/ifx6x60.c
+++ b/drivers/tty/serial/ifx6x60.c
@@ -725,10 +725,11 @@ static void ifx_spi_complete(void *ctx)
  *	Queue data for transmission if possible and then kick off the
  *	transfer.
  */
-static void ifx_spi_io(unsigned long data)
+static void ifx_spi_io(struct tasklet_struct *t)
 {
 	int retval;
-	struct ifx_spi_device *ifx_dev = (struct ifx_spi_device *) data;
+	struct ifx_spi_device *ifx_dev = from_tasklet(ifx_dev, t,
+						      io_work_tasklet);
 
 	if (!test_and_set_bit(IFX_SPI_STATE_IO_IN_PROGRESS, &ifx_dev->flags) &&
 		test_bit(IFX_SPI_STATE_IO_AVAILABLE, &ifx_dev->flags)) {
@@ -1067,8 +1068,7 @@ static int ifx_spi_spi_probe(struct spi_device *spi)
 	init_waitqueue_head(&ifx_dev->mdm_reset_wait);
 
 	spi_set_drvdata(spi, ifx_dev);
-	tasklet_init(&ifx_dev->io_work_tasklet, ifx_spi_io,
-						(unsigned long)ifx_dev);
+	tasklet_setup(&ifx_dev->io_work_tasklet, ifx_spi_io);
 
 	set_bit(IFX_SPI_STATE_PRESENT, &ifx_dev->flags);
 
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 4/4] tty: timbuart: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:59 [PATCH 0/4] tty: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (2 preceding siblings ...)
  2020-08-17  8:59 ` [PATCH 3/4] tty: ifx6x60: " Allen Pais
@ 2020-08-17  8:59 ` Allen Pais
  3 siblings, 0 replies; 6+ messages in thread
From: Allen Pais @ 2020-08-17  8:59 UTC (permalink / raw)
  To: richard.genoud, gregkh
  Cc: keescook, Allen Pais, linux-kernel, linux-serial, Romain Perier,
	linux-arm-kernel

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/tty/serial/timbuart.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/timbuart.c b/drivers/tty/serial/timbuart.c
index 19d38b504e27..2126e6e6dfd1 100644
--- a/drivers/tty/serial/timbuart.c
+++ b/drivers/tty/serial/timbuart.c
@@ -172,9 +172,9 @@ static void timbuart_handle_rx_port(struct uart_port *port, u32 isr, u32 *ier)
 	dev_dbg(port->dev, "%s - leaving\n", __func__);
 }
 
-static void timbuart_tasklet(unsigned long arg)
+static void timbuart_tasklet(struct tasklet_struct *t)
 {
-	struct timbuart_port *uart = (struct timbuart_port *)arg;
+	struct timbuart_port *uart = from_tasklet(uart, t, tasklet);
 	u32 isr, ier = 0;
 
 	spin_lock(&uart->port.lock);
@@ -451,7 +451,7 @@ static int timbuart_probe(struct platform_device *dev)
 	}
 	uart->port.irq = irq;
 
-	tasklet_init(&uart->tasklet, timbuart_tasklet, (unsigned long)uart);
+	tasklet_setup(&uart->tasklet, timbuart_tasklet);
 
 	err = uart_register_driver(&timbuart_driver);
 	if (err)
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/4] tty: atmel_serial: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:59 ` [PATCH 2/4] tty: atmel_serial: " Allen Pais
@ 2020-08-26 13:29   ` Richard Genoud
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Genoud @ 2020-08-26 13:29 UTC (permalink / raw)
  To: Allen Pais, gregkh
  Cc: keescook, Allen Pais, linux-kernel, linux-serial, Romain Perier,
	linux-arm-kernel

Le 17/08/2020 à 10:59, Allen Pais a écrit :
> 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>
Acked-by: Richard Genoud <richard.genoud@gmail.com>

> ---
>  drivers/tty/serial/atmel_serial.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index e43471b33710..a9c47f56e994 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -1722,10 +1722,11 @@ static int atmel_prepare_rx_pdc(struct uart_port *port)
>  /*
>   * tasklet handling tty stuff outside the interrupt handler.
>   */
> -static void atmel_tasklet_rx_func(unsigned long data)
> +static void atmel_tasklet_rx_func(struct tasklet_struct *t)
>  {
> -	struct uart_port *port = (struct uart_port *)data;
> -	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
> +	struct atmel_uart_port *atmel_port = from_tasklet(atmel_port, t,
> +							  tasklet_rx);
> +	struct uart_port *port = &atmel_port->uart;
>  
>  	/* The interrupt handler does not take the lock */
>  	spin_lock(&port->lock);
> @@ -1733,10 +1734,11 @@ static void atmel_tasklet_rx_func(unsigned long data)
>  	spin_unlock(&port->lock);
>  }
>  
> -static void atmel_tasklet_tx_func(unsigned long data)
> +static void atmel_tasklet_tx_func(struct tasklet_struct *t)
>  {
> -	struct uart_port *port = (struct uart_port *)data;
> -	struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
> +	struct atmel_uart_port *atmel_port = from_tasklet(atmel_port, t,
> +							  tasklet_tx);
> +	struct uart_port *port = &atmel_port->uart;
>  
>  	/* The interrupt handler does not take the lock */
>  	spin_lock(&port->lock);
> @@ -1911,10 +1913,8 @@ static int atmel_startup(struct uart_port *port)
>  	}
>  
>  	atomic_set(&atmel_port->tasklet_shutdown, 0);
> -	tasklet_init(&atmel_port->tasklet_rx, atmel_tasklet_rx_func,
> -			(unsigned long)port);
> -	tasklet_init(&atmel_port->tasklet_tx, atmel_tasklet_tx_func,
> -			(unsigned long)port);
> +	tasklet_setup(&atmel_port->tasklet_rx, atmel_tasklet_rx_func);
> +	tasklet_setup(&atmel_port->tasklet_tx, atmel_tasklet_tx_func);
>  
>  	/*
>  	 * Initialize DMA (if necessary)
> 

Thanks !

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-08-26 13:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-17  8:59 [PATCH 0/4] tty: convert tasklets to use new tasklet_setup() Allen Pais
2020-08-17  8:59 ` [PATCH 1/4] tty: ipwireless: convert tasklets to use new tasklet_setup() API Allen Pais
2020-08-17  8:59 ` [PATCH 2/4] tty: atmel_serial: " Allen Pais
2020-08-26 13:29   ` Richard Genoud
2020-08-17  8:59 ` [PATCH 3/4] tty: ifx6x60: " Allen Pais
2020-08-17  8:59 ` [PATCH 4/4] tty: timbuart: " 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).