Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/10] ALSA: convert tasklets to use new
@ 2020-09-02  4:02 Allen Pais
  2020-09-02  4:02 ` [PATCH v2 01/10] ALSA: core: convert tasklets to use new tasklet_setup() API Allen Pais
                   ` (10 more replies)
  0 siblings, 11 replies; 17+ messages in thread
From: Allen Pais @ 2020-09-02  4:02 UTC (permalink / raw)
  To: perex, tiwai, broonie
  Cc: alsa-devel, timur, Xiubo.Lee, clemens, Allen Pais, nicoleotsuka

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

The series is based on 5.9-rc3 (f75aef392f86) 

v2:
  Fixed subject lines.

Allen Pais (10):
  ALSA: core: convert tasklets to use new tasklet_setup() API
  ALSA: firewire: convert tasklets to use new tasklet_setup() API
  ALSA: pci/asihpi: convert tasklets to use new tasklet_setup() API
  ALSA: riptide: convert tasklets to use new tasklet_setup() API
  ALSA: hdsp: convert tasklets to use new tasklet_setup() API
  ASoc: fsl_esai: convert tasklets to use new tasklet_setup() API
  ASoC: siu: convert tasklets to use new tasklet_setup() API
  ASoC: txx9: convert tasklets to use new tasklet_setup() API
  ALSA: usb-audio: convert tasklets to use new tasklet_setup() API
  ALSA: ua101: convert tasklets to use new tasklet_setup() API

 sound/core/timer.c            |  7 +++----
 sound/firewire/amdtp-stream.c |  8 ++++----
 sound/pci/asihpi/asihpi.c     |  9 ++++-----
 sound/pci/riptide/riptide.c   |  6 +++---
 sound/pci/rme9652/hdsp.c      |  6 +++---
 sound/pci/rme9652/hdspm.c     |  7 +++----
 sound/soc/fsl/fsl_esai.c      |  7 +++----
 sound/soc/sh/siu_pcm.c        | 10 ++++------
 sound/soc/txx9/txx9aclc.c     |  7 +++----
 sound/usb/midi.c              |  7 +++----
 sound/usb/misc/ua101.c        |  7 +++----
 11 files changed, 36 insertions(+), 45 deletions(-)

-- 
2.25.1


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

* [PATCH v2 01/10] ALSA: core: convert tasklets to use new tasklet_setup() API
  2020-09-02  4:02 [PATCH v2 00/10] ALSA: convert tasklets to use new Allen Pais
@ 2020-09-02  4:02 ` Allen Pais
  2020-09-02  4:02 ` [PATCH v2 02/10] ALSA: firewire: " Allen Pais
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Allen Pais @ 2020-09-02  4:02 UTC (permalink / raw)
  To: perex, tiwai, broonie
  Cc: alsa-devel, timur, Xiubo.Lee, clemens, Allen Pais, nicoleotsuka,
	Romain Perier

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>
---
 sound/core/timer.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sound/core/timer.c b/sound/core/timer.c
index d9f85f2d66a3..6e27d87b18ed 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -816,9 +816,9 @@ static void snd_timer_clear_callbacks(struct snd_timer *timer,
  * timer tasklet
  *
  */
-static void snd_timer_tasklet(unsigned long arg)
+static void snd_timer_tasklet(struct tasklet_struct *t)
 {
-	struct snd_timer *timer = (struct snd_timer *) arg;
+	struct snd_timer *timer = from_tasklet(timer, t, task_queue);
 	unsigned long flags;
 
 	if (timer->card && timer->card->shutdown) {
@@ -967,8 +967,7 @@ int snd_timer_new(struct snd_card *card, char *id, struct snd_timer_id *tid,
 	INIT_LIST_HEAD(&timer->ack_list_head);
 	INIT_LIST_HEAD(&timer->sack_list_head);
 	spin_lock_init(&timer->lock);
-	tasklet_init(&timer->task_queue, snd_timer_tasklet,
-		     (unsigned long)timer);
+	tasklet_setup(&timer->task_queue, snd_timer_tasklet);
 	timer->max_instances = 1000; /* default limit per timer */
 	if (card != NULL) {
 		timer->module = card->module;
-- 
2.25.1


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

* [PATCH v2 02/10] ALSA: firewire: convert tasklets to use new tasklet_setup() API
  2020-09-02  4:02 [PATCH v2 00/10] ALSA: convert tasklets to use new Allen Pais
  2020-09-02  4:02 ` [PATCH v2 01/10] ALSA: core: convert tasklets to use new tasklet_setup() API Allen Pais
@ 2020-09-02  4:02 ` Allen Pais
  2020-09-02  8:44   ` Takashi Sakamoto
  2020-09-02  4:02 ` [PATCH v2 03/10] ALSA: pci/asihpi: " Allen Pais
                   ` (8 subsequent siblings)
  10 siblings, 1 reply; 17+ messages in thread
From: Allen Pais @ 2020-09-02  4:02 UTC (permalink / raw)
  To: perex, tiwai, broonie
  Cc: alsa-devel, timur, Xiubo.Lee, clemens, Allen Pais, nicoleotsuka,
	Romain Perier

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>
---
 sound/firewire/amdtp-stream.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c
index f8586f75441d..ee1c428b1fd3 100644
--- a/sound/firewire/amdtp-stream.c
+++ b/sound/firewire/amdtp-stream.c
@@ -64,7 +64,7 @@
 #define IT_PKT_HEADER_SIZE_CIP		8 // For 2 CIP header.
 #define IT_PKT_HEADER_SIZE_NO_CIP	0 // Nothing.
 
-static void pcm_period_tasklet(unsigned long data);
+static void pcm_period_tasklet(struct tasklet_struct *t);
 
 /**
  * amdtp_stream_init - initialize an AMDTP stream structure
@@ -94,7 +94,7 @@ int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit,
 	s->flags = flags;
 	s->context = ERR_PTR(-1);
 	mutex_init(&s->mutex);
-	tasklet_init(&s->period_tasklet, pcm_period_tasklet, (unsigned long)s);
+	tasklet_setup(&s->period_tasklet, pcm_period_tasklet);
 	s->packet_index = 0;
 
 	init_waitqueue_head(&s->callback_wait);
@@ -441,9 +441,9 @@ static void update_pcm_pointers(struct amdtp_stream *s,
 	}
 }
 
-static void pcm_period_tasklet(unsigned long data)
+static void pcm_period_tasklet(struct tasklet_struct *t)
 {
-	struct amdtp_stream *s = (void *)data;
+	struct amdtp_stream *s = from_tasklet(s, t, period_tasklet);
 	struct snd_pcm_substream *pcm = READ_ONCE(s->pcm);
 
 	if (pcm)
-- 
2.25.1


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

* [PATCH v2 03/10] ALSA: pci/asihpi: convert tasklets to use new tasklet_setup() API
  2020-09-02  4:02 [PATCH v2 00/10] ALSA: convert tasklets to use new Allen Pais
  2020-09-02  4:02 ` [PATCH v2 01/10] ALSA: core: convert tasklets to use new tasklet_setup() API Allen Pais
  2020-09-02  4:02 ` [PATCH v2 02/10] ALSA: firewire: " Allen Pais
@ 2020-09-02  4:02 ` Allen Pais
  2020-09-02  4:02 ` [PATCH v2 04/10] ALSA: riptide: " Allen Pais
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Allen Pais @ 2020-09-02  4:02 UTC (permalink / raw)
  To: perex, tiwai, broonie
  Cc: alsa-devel, timur, Xiubo.Lee, clemens, Allen Pais, nicoleotsuka,
	Romain Perier

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>
---
 sound/pci/asihpi/asihpi.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c
index 023c35a2a951..35e76480306e 100644
--- a/sound/pci/asihpi/asihpi.c
+++ b/sound/pci/asihpi/asihpi.c
@@ -921,10 +921,10 @@ static void snd_card_asihpi_timer_function(struct timer_list *t)
 		add_timer(&dpcm->timer);
 }
 
-static void snd_card_asihpi_int_task(unsigned long data)
+static void snd_card_asihpi_int_task(struct tasklet_struct *t)
 {
-	struct hpi_adapter *a = (struct hpi_adapter *)data;
-	struct snd_card_asihpi *asihpi;
+	struct snd_card_asihpi *asihpi = from_tasklet(asihpi, t, t);
+	struct hpi_adapter *a = asihpi->hpi;
 
 	WARN_ON(!a || !a->snd_card || !a->snd_card->private_data);
 	asihpi = (struct snd_card_asihpi *)a->snd_card->private_data;
@@ -2871,8 +2871,7 @@ static int snd_asihpi_probe(struct pci_dev *pci_dev,
 	if (hpi->interrupt_mode) {
 		asihpi->pcm_start = snd_card_asihpi_pcm_int_start;
 		asihpi->pcm_stop = snd_card_asihpi_pcm_int_stop;
-		tasklet_init(&asihpi->t, snd_card_asihpi_int_task,
-			(unsigned long)hpi);
+		tasklet_setup(&asihpi->t, snd_card_asihpi_int_task);
 		hpi->interrupt_callback = snd_card_asihpi_isr;
 	} else {
 		asihpi->pcm_start = snd_card_asihpi_pcm_timer_start;
-- 
2.25.1


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

* [PATCH v2 04/10] ALSA: riptide: convert tasklets to use new tasklet_setup() API
  2020-09-02  4:02 [PATCH v2 00/10] ALSA: convert tasklets to use new Allen Pais
                   ` (2 preceding siblings ...)
  2020-09-02  4:02 ` [PATCH v2 03/10] ALSA: pci/asihpi: " Allen Pais
@ 2020-09-02  4:02 ` Allen Pais
  2020-09-02  4:02 ` [PATCH v2 05/10] ALSA: hdsp: " Allen Pais
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Allen Pais @ 2020-09-02  4:02 UTC (permalink / raw)
  To: perex, tiwai, broonie
  Cc: alsa-devel, timur, Xiubo.Lee, clemens, Allen Pais, nicoleotsuka,
	Romain Perier

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>
---
 sound/pci/riptide/riptide.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index b4f300281822..098c69b3b7aa 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -1070,9 +1070,9 @@ getmixer(struct cmdif *cif, short num, unsigned short *rval,
 	return 0;
 }
 
-static void riptide_handleirq(unsigned long dev_id)
+static void riptide_handleirq(struct tasklet_struct *t)
 {
-	struct snd_riptide *chip = (void *)dev_id;
+	struct snd_riptide *chip = from_tasklet(chip, t, riptide_tq);
 	struct cmdif *cif = chip->cif;
 	struct snd_pcm_substream *substream[PLAYBACK_SUBSTREAMS + 1];
 	struct snd_pcm_runtime *runtime;
@@ -1843,7 +1843,7 @@ snd_riptide_create(struct snd_card *card, struct pci_dev *pci,
 	chip->received_irqs = 0;
 	chip->handled_irqs = 0;
 	chip->cif = NULL;
-	tasklet_init(&chip->riptide_tq, riptide_handleirq, (unsigned long)chip);
+	tasklet_setup(&chip->riptide_tq, riptide_handleirq);
 
 	if ((chip->res_port =
 	     request_region(chip->port, 64, "RIPTIDE")) == NULL) {
-- 
2.25.1


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

* [PATCH v2 05/10] ALSA: hdsp: convert tasklets to use new tasklet_setup() API
  2020-09-02  4:02 [PATCH v2 00/10] ALSA: convert tasklets to use new Allen Pais
                   ` (3 preceding siblings ...)
  2020-09-02  4:02 ` [PATCH v2 04/10] ALSA: riptide: " Allen Pais
@ 2020-09-02  4:02 ` Allen Pais
  2020-09-02  4:02 ` [PATCH v2 06/10] ASoc: fsl_esai: " Allen Pais
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Allen Pais @ 2020-09-02  4:02 UTC (permalink / raw)
  To: perex, tiwai, broonie
  Cc: alsa-devel, timur, Xiubo.Lee, clemens, Allen Pais, nicoleotsuka,
	Romain Perier

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>
---
 sound/pci/rme9652/hdsp.c  | 6 +++---
 sound/pci/rme9652/hdspm.c | 7 +++----
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index 227aece17e39..dda56ecfd33b 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -3791,9 +3791,9 @@ static int snd_hdsp_set_defaults(struct hdsp *hdsp)
 	return 0;
 }
 
-static void hdsp_midi_tasklet(unsigned long arg)
+static void hdsp_midi_tasklet(struct tasklet_struct *t)
 {
-	struct hdsp *hdsp = (struct hdsp *)arg;
+	struct hdsp *hdsp = from_tasklet(hdsp, t, midi_tasklet);
 
 	if (hdsp->midi[0].pending)
 		snd_hdsp_midi_input_read (&hdsp->midi[0]);
@@ -5182,7 +5182,7 @@ static int snd_hdsp_create(struct snd_card *card,
 
 	spin_lock_init(&hdsp->lock);
 
-	tasklet_init(&hdsp->midi_tasklet, hdsp_midi_tasklet, (unsigned long)hdsp);
+	tasklet_setup(&hdsp->midi_tasklet, hdsp_midi_tasklet);
 
 	pci_read_config_word(hdsp->pci, PCI_CLASS_REVISION, &hdsp->firmware_rev);
 	hdsp->firmware_rev &= 0xff;
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 0fa49f4d15cf..572350aaf18d 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -2169,9 +2169,9 @@ static int snd_hdspm_create_midi(struct snd_card *card,
 }
 
 
-static void hdspm_midi_tasklet(unsigned long arg)
+static void hdspm_midi_tasklet(struct tasklet_struct *t)
 {
-	struct hdspm *hdspm = (struct hdspm *)arg;
+	struct hdspm *hdspm = from_tasklet(hdspm, t, midi_tasklet);
 	int i = 0;
 
 	while (i < hdspm->midiPorts) {
@@ -6836,8 +6836,7 @@ static int snd_hdspm_create(struct snd_card *card,
 
 	}
 
-	tasklet_init(&hdspm->midi_tasklet,
-			hdspm_midi_tasklet, (unsigned long) hdspm);
+	tasklet_setup(&hdspm->midi_tasklet, hdspm_midi_tasklet);
 
 
 	if (hdspm->io_type != MADIface) {
-- 
2.25.1


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

* [PATCH v2 06/10] ASoc: fsl_esai: convert tasklets to use new tasklet_setup() API
  2020-09-02  4:02 [PATCH v2 00/10] ALSA: convert tasklets to use new Allen Pais
                   ` (4 preceding siblings ...)
  2020-09-02  4:02 ` [PATCH v2 05/10] ALSA: hdsp: " Allen Pais
@ 2020-09-02  4:02 ` Allen Pais
  2020-09-02 10:08   ` Mark Brown
  2020-09-02  4:02 ` [PATCH v2 07/10] ASoC: siu: " Allen Pais
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 17+ messages in thread
From: Allen Pais @ 2020-09-02  4:02 UTC (permalink / raw)
  To: perex, tiwai, broonie
  Cc: alsa-devel, timur, Xiubo.Lee, clemens, Allen Pais, nicoleotsuka,
	Romain Perier

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>
---
 sound/soc/fsl/fsl_esai.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index 4ae36099ae82..79b861afd986 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -708,9 +708,9 @@ static void fsl_esai_trigger_stop(struct fsl_esai *esai_priv, bool tx)
 			   ESAI_xFCR_xFR, 0);
 }
 
-static void fsl_esai_hw_reset(unsigned long arg)
+static void fsl_esai_hw_reset(struct tasklet_struct *t)
 {
-	struct fsl_esai *esai_priv = (struct fsl_esai *)arg;
+	struct fsl_esai *esai_priv = from_tasklet(esai_priv, t, task);
 	bool tx = true, rx = false, enabled[2];
 	unsigned long lock_flags;
 	u32 tfcr, rfcr;
@@ -1070,8 +1070,7 @@ static int fsl_esai_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	tasklet_init(&esai_priv->task, fsl_esai_hw_reset,
-		     (unsigned long)esai_priv);
+	tasklet_setup(&esai_priv->task, fsl_esai_hw_reset);
 
 	pm_runtime_enable(&pdev->dev);
 
-- 
2.25.1


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

* [PATCH v2 07/10] ASoC: siu: convert tasklets to use new tasklet_setup() API
  2020-09-02  4:02 [PATCH v2 00/10] ALSA: convert tasklets to use new Allen Pais
                   ` (5 preceding siblings ...)
  2020-09-02  4:02 ` [PATCH v2 06/10] ASoc: fsl_esai: " Allen Pais
@ 2020-09-02  4:02 ` Allen Pais
  2020-09-02 10:10   ` Mark Brown
  2020-09-02  4:02 ` [PATCH v2 08/10] ASoC: txx9: " Allen Pais
                   ` (3 subsequent siblings)
  10 siblings, 1 reply; 17+ messages in thread
From: Allen Pais @ 2020-09-02  4:02 UTC (permalink / raw)
  To: perex, tiwai, broonie
  Cc: alsa-devel, timur, Xiubo.Lee, clemens, Allen Pais, nicoleotsuka,
	Romain Perier

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>
---
 sound/soc/sh/siu_pcm.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/sound/soc/sh/siu_pcm.c b/sound/soc/sh/siu_pcm.c
index bd9de77c35f3..50fc7810723e 100644
--- a/sound/soc/sh/siu_pcm.c
+++ b/sound/soc/sh/siu_pcm.c
@@ -198,9 +198,9 @@ static int siu_pcm_rd_set(struct siu_port *port_info,
 	return 0;
 }
 
-static void siu_io_tasklet(unsigned long data)
+static void siu_io_tasklet(struct tasklet_struct *t)
 {
-	struct siu_stream *siu_stream = (struct siu_stream *)data;
+	struct siu_stream *siu_stream = from_tasklet(siu_stream, t, tasklet);
 	struct snd_pcm_substream *substream = siu_stream->substream;
 	struct device *dev = substream->pcm->card->dev;
 	struct snd_pcm_runtime *rt = substream->runtime;
@@ -520,10 +520,8 @@ static int siu_pcm_new(struct snd_soc_component *component,
 		(*port_info)->pcm = pcm;
 
 		/* IO tasklets */
-		tasklet_init(&(*port_info)->playback.tasklet, siu_io_tasklet,
-			     (unsigned long)&(*port_info)->playback);
-		tasklet_init(&(*port_info)->capture.tasklet, siu_io_tasklet,
-			     (unsigned long)&(*port_info)->capture);
+		tasklet_setup(&(*port_info)->playback.tasklet, siu_io_tasklet);
+		tasklet_setup(&(*port_info)->capture.tasklet, siu_io_tasklet);
 	}
 
 	dev_info(card->dev, "SuperH SIU driver initialized.\n");
-- 
2.25.1


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

* [PATCH v2 08/10] ASoC: txx9: convert tasklets to use new tasklet_setup() API
  2020-09-02  4:02 [PATCH v2 00/10] ALSA: convert tasklets to use new Allen Pais
                   ` (6 preceding siblings ...)
  2020-09-02  4:02 ` [PATCH v2 07/10] ASoC: siu: " Allen Pais
@ 2020-09-02  4:02 ` Allen Pais
  2020-09-02 10:10   ` Mark Brown
  2020-09-02  4:02 ` [PATCH v2 09/10] ALSA: usb-audio: " Allen Pais
                   ` (2 subsequent siblings)
  10 siblings, 1 reply; 17+ messages in thread
From: Allen Pais @ 2020-09-02  4:02 UTC (permalink / raw)
  To: perex, tiwai, broonie
  Cc: alsa-devel, timur, Xiubo.Lee, clemens, Allen Pais, nicoleotsuka,
	Romain Perier

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>
---
 sound/soc/txx9/txx9aclc.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sound/soc/txx9/txx9aclc.c b/sound/soc/txx9/txx9aclc.c
index 4b1cd4da3e36..939b33ec39f5 100644
--- a/sound/soc/txx9/txx9aclc.c
+++ b/sound/soc/txx9/txx9aclc.c
@@ -134,9 +134,9 @@ txx9aclc_dma_submit(struct txx9aclc_dmadata *dmadata, dma_addr_t buf_dma_addr)
 
 #define NR_DMA_CHAIN		2
 
-static void txx9aclc_dma_tasklet(unsigned long data)
+static void txx9aclc_dma_tasklet(struct tasklet_struct *t)
 {
-	struct txx9aclc_dmadata *dmadata = (struct txx9aclc_dmadata *)data;
+	struct txx9aclc_dmadata *dmadata = from_tasklet(dmadata, t, tasklet);
 	struct dma_chan *chan = dmadata->dma_chan;
 	struct dma_async_tx_descriptor *desc;
 	struct snd_pcm_substream *substream = dmadata->substream;
@@ -352,8 +352,7 @@ static int txx9aclc_dma_init(struct txx9aclc_soc_device *dev,
 			"playback" : "capture");
 		return -EBUSY;
 	}
-	tasklet_init(&dmadata->tasklet, txx9aclc_dma_tasklet,
-		     (unsigned long)dmadata);
+	tasklet_setup(&dmadata->tasklet, txx9aclc_dma_tasklet);
 	return 0;
 }
 
-- 
2.25.1


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

* [PATCH v2 09/10] ALSA: usb-audio: convert tasklets to use new tasklet_setup() API
  2020-09-02  4:02 [PATCH v2 00/10] ALSA: convert tasklets to use new Allen Pais
                   ` (7 preceding siblings ...)
  2020-09-02  4:02 ` [PATCH v2 08/10] ASoC: txx9: " Allen Pais
@ 2020-09-02  4:02 ` Allen Pais
  2020-09-02  4:02 ` [PATCH v2 10/10] ALSA: ua101: " Allen Pais
  2020-09-02 11:57 ` [PATCH v2 00/10] ALSA: convert tasklets to use new Takashi Iwai
  10 siblings, 0 replies; 17+ messages in thread
From: Allen Pais @ 2020-09-02  4:02 UTC (permalink / raw)
  To: perex, tiwai, broonie
  Cc: alsa-devel, timur, Xiubo.Lee, clemens, Allen Pais, nicoleotsuka,
	Romain Perier

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>
---
 sound/usb/midi.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index df639fe03118..e8287a05e36b 100644
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -344,10 +344,9 @@ static void snd_usbmidi_do_output(struct snd_usb_midi_out_endpoint *ep)
 	spin_unlock_irqrestore(&ep->buffer_lock, flags);
 }
 
-static void snd_usbmidi_out_tasklet(unsigned long data)
+static void snd_usbmidi_out_tasklet(struct tasklet_struct *t)
 {
-	struct snd_usb_midi_out_endpoint *ep =
-		(struct snd_usb_midi_out_endpoint *) data;
+	struct snd_usb_midi_out_endpoint *ep = from_tasklet(ep, t, tasklet);
 
 	snd_usbmidi_do_output(ep);
 }
@@ -1441,7 +1440,7 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi *umidi,
 	}
 
 	spin_lock_init(&ep->buffer_lock);
-	tasklet_init(&ep->tasklet, snd_usbmidi_out_tasklet, (unsigned long)ep);
+	tasklet_setup(&ep->tasklet, snd_usbmidi_out_tasklet);
 	init_waitqueue_head(&ep->drain_wait);
 
 	for (i = 0; i < 0x10; ++i)
-- 
2.25.1


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

* [PATCH v2 10/10] ALSA: ua101: convert tasklets to use new tasklet_setup() API
  2020-09-02  4:02 [PATCH v2 00/10] ALSA: convert tasklets to use new Allen Pais
                   ` (8 preceding siblings ...)
  2020-09-02  4:02 ` [PATCH v2 09/10] ALSA: usb-audio: " Allen Pais
@ 2020-09-02  4:02 ` Allen Pais
  2020-09-02 11:57 ` [PATCH v2 00/10] ALSA: convert tasklets to use new Takashi Iwai
  10 siblings, 0 replies; 17+ messages in thread
From: Allen Pais @ 2020-09-02  4:02 UTC (permalink / raw)
  To: perex, tiwai, broonie
  Cc: alsa-devel, timur, Xiubo.Lee, clemens, Allen Pais, nicoleotsuka,
	Romain Perier

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>
---
 sound/usb/misc/ua101.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c
index 884e740a785c..3b2dce1043f5 100644
--- a/sound/usb/misc/ua101.c
+++ b/sound/usb/misc/ua101.c
@@ -247,9 +247,9 @@ static inline void add_with_wraparound(struct ua101 *ua,
 		*value -= ua->playback.queue_length;
 }
 
-static void playback_tasklet(unsigned long data)
+static void playback_tasklet(struct tasklet_struct *t)
 {
-	struct ua101 *ua = (void *)data;
+	struct ua101 *ua = from_tasklet(ua, t, playback_tasklet);
 	unsigned long flags;
 	unsigned int frames;
 	struct ua101_urb *urb;
@@ -1218,8 +1218,7 @@ static int ua101_probe(struct usb_interface *interface,
 	spin_lock_init(&ua->lock);
 	mutex_init(&ua->mutex);
 	INIT_LIST_HEAD(&ua->ready_playback_urbs);
-	tasklet_init(&ua->playback_tasklet,
-		     playback_tasklet, (unsigned long)ua);
+	tasklet_setup(&ua->playback_tasklet, playback_tasklet);
 	init_waitqueue_head(&ua->alsa_capture_wait);
 	init_waitqueue_head(&ua->rate_feedback_wait);
 	init_waitqueue_head(&ua->alsa_playback_wait);
-- 
2.25.1


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

* Re: [PATCH v2 02/10] ALSA: firewire: convert tasklets to use new tasklet_setup() API
  2020-09-02  4:02 ` [PATCH v2 02/10] ALSA: firewire: " Allen Pais
@ 2020-09-02  8:44   ` Takashi Sakamoto
  2020-09-02  9:14     ` Takashi Iwai
  0 siblings, 1 reply; 17+ messages in thread
From: Takashi Sakamoto @ 2020-09-02  8:44 UTC (permalink / raw)
  To: Allen Pais
  Cc: alsa-devel, timur, Xiubo.Lee, clemens, tiwai, nicoleotsuka,
	broonie, Romain Perier

Hi,

On Wed, Sep 02, 2020 at 09:32:13AM +0530, Allen Pais wrote:
> 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>
> ---
>  sound/firewire/amdtp-stream.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

This looks good to me.

Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>


To Iwai-san,

I'm review your patch in 'test/kill-tasklet' branch in sound.git[1].
Although I agree with the direction to obsolete tasklet usage with
workqueue, 'in_interrupt()' helper function is used in two lines in
'sound/firewire/amdtp-stream.c' since it's convenient to distinguish
running context (any softirq or user task). We need enough care of
the cases about which below two patches mention:

 * 1dba9db0eaa6 ('ALSA: firewire-lib: permit to flush queued packets
   only in process context for better PCM period granularity')
 * 4a9bfafc64f4 ('ALSA: firewire-lib: Fix stall of process context
   at packet error)

As long as I know, we have no helper function to distinguish workqueue
task from user task. The simple replacement is not good way in the case.
I'm investigating better solution but not find yet...

[1] https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/commit/?h=test/kill-tasklet&id=bd17f03415d44c1a69fcbb7c074c1dc86f4e8bc6


Thanks


Takashi Sakamoto

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

* Re: [PATCH v2 02/10] ALSA: firewire: convert tasklets to use new tasklet_setup() API
  2020-09-02  8:44   ` Takashi Sakamoto
@ 2020-09-02  9:14     ` Takashi Iwai
  0 siblings, 0 replies; 17+ messages in thread
From: Takashi Iwai @ 2020-09-02  9:14 UTC (permalink / raw)
  To: Takashi Sakamoto
  Cc: alsa-devel, Romain Perier, timur, Xiubo.Lee, clemens, tiwai,
	Allen Pais, nicoleotsuka, broonie

On Wed, 02 Sep 2020 10:44:43 +0200,
Takashi Sakamoto wrote:
> 
> To Iwai-san,
> 
> I'm review your patch in 'test/kill-tasklet' branch in sound.git[1].
> Although I agree with the direction to obsolete tasklet usage with
> workqueue, 'in_interrupt()' helper function is used in two lines in
> 'sound/firewire/amdtp-stream.c' since it's convenient to distinguish
> running context (any softirq or user task). We need enough care of
> the cases about which below two patches mention:
> 
>  * 1dba9db0eaa6 ('ALSA: firewire-lib: permit to flush queued packets
>    only in process context for better PCM period granularity')
>  * 4a9bfafc64f4 ('ALSA: firewire-lib: Fix stall of process context
>    at packet error)
> 
> As long as I know, we have no helper function to distinguish workqueue
> task from user task. The simple replacement is not good way in the case.

Thanks for pointing this out, it was indeed an overlook.

We can use current_work() to check whether the current task comes from
the dedicated work or not, e.g.

	if (current_work() == &myobject->some_work)
		its_from_my_work();


Takashi

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

* Re: [PATCH v2 06/10] ASoc: fsl_esai: convert tasklets to use new tasklet_setup() API
  2020-09-02  4:02 ` [PATCH v2 06/10] ASoc: fsl_esai: " Allen Pais
@ 2020-09-02 10:08   ` Mark Brown
  0 siblings, 0 replies; 17+ messages in thread
From: Mark Brown @ 2020-09-02 10:08 UTC (permalink / raw)
  To: Allen Pais
  Cc: alsa-devel, Romain Perier, timur, Xiubo.Lee, clemens, tiwai,
	nicoleotsuka

[-- Attachment #1: Type: text/plain, Size: 313 bytes --]

On Wed, Sep 02, 2020 at 09:32:17AM +0530, Allen Pais wrote:
> 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.

Acked-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v2 07/10] ASoC: siu: convert tasklets to use new tasklet_setup() API
  2020-09-02  4:02 ` [PATCH v2 07/10] ASoC: siu: " Allen Pais
@ 2020-09-02 10:10   ` Mark Brown
  0 siblings, 0 replies; 17+ messages in thread
From: Mark Brown @ 2020-09-02 10:10 UTC (permalink / raw)
  To: Allen Pais
  Cc: alsa-devel, Romain Perier, timur, Xiubo.Lee, clemens, tiwai,
	nicoleotsuka

[-- Attachment #1: Type: text/plain, Size: 313 bytes --]

On Wed, Sep 02, 2020 at 09:32:18AM +0530, Allen Pais wrote:
> 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.

Acked-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v2 08/10] ASoC: txx9: convert tasklets to use new tasklet_setup() API
  2020-09-02  4:02 ` [PATCH v2 08/10] ASoC: txx9: " Allen Pais
@ 2020-09-02 10:10   ` Mark Brown
  0 siblings, 0 replies; 17+ messages in thread
From: Mark Brown @ 2020-09-02 10:10 UTC (permalink / raw)
  To: Allen Pais
  Cc: alsa-devel, Romain Perier, timur, Xiubo.Lee, clemens, tiwai,
	nicoleotsuka

[-- Attachment #1: Type: text/plain, Size: 313 bytes --]

On Wed, Sep 02, 2020 at 09:32:19AM +0530, Allen Pais wrote:
> 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.

Acked-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v2 00/10] ALSA: convert tasklets to use new
  2020-09-02  4:02 [PATCH v2 00/10] ALSA: convert tasklets to use new Allen Pais
                   ` (9 preceding siblings ...)
  2020-09-02  4:02 ` [PATCH v2 10/10] ALSA: ua101: " Allen Pais
@ 2020-09-02 11:57 ` Takashi Iwai
  10 siblings, 0 replies; 17+ messages in thread
From: Takashi Iwai @ 2020-09-02 11:57 UTC (permalink / raw)
  To: Allen Pais
  Cc: alsa-devel, timur, Xiubo.Lee, clemens, tiwai, nicoleotsuka,
	broonie

On Wed, 02 Sep 2020 06:02:11 +0200,
Allen Pais wrote:
> 
> Commit 12cc923f1ccc ("tasklet: Introduce new initialization API")'
> introduced a new tasklet initialization API. This series converts
> all the sound drivers to use the new tasklet_setup() API
> 
> The series is based on 5.9-rc3 (f75aef392f86) 
> 
> v2:
>   Fixed subject lines.
> 
> Allen Pais (10):
>   ALSA: core: convert tasklets to use new tasklet_setup() API
>   ALSA: firewire: convert tasklets to use new tasklet_setup() API
>   ALSA: pci/asihpi: convert tasklets to use new tasklet_setup() API
>   ALSA: riptide: convert tasklets to use new tasklet_setup() API
>   ALSA: hdsp: convert tasklets to use new tasklet_setup() API
>   ASoc: fsl_esai: convert tasklets to use new tasklet_setup() API
>   ASoC: siu: convert tasklets to use new tasklet_setup() API
>   ASoC: txx9: convert tasklets to use new tasklet_setup() API
>   ALSA: usb-audio: convert tasklets to use new tasklet_setup() API
>   ALSA: ua101: convert tasklets to use new tasklet_setup() API

Thanks, now applied all 10 patches.

Mark, the applied branch is found in topic/tasklet-convert.  If you
need for further development of ASoC stuff, feel free to pull in.
Meanwhile the branch will be merged into my for-linus branch and
for-next branch, and will be likely included in the next pull request
in this week.


Takashi

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

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

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-02  4:02 [PATCH v2 00/10] ALSA: convert tasklets to use new Allen Pais
2020-09-02  4:02 ` [PATCH v2 01/10] ALSA: core: convert tasklets to use new tasklet_setup() API Allen Pais
2020-09-02  4:02 ` [PATCH v2 02/10] ALSA: firewire: " Allen Pais
2020-09-02  8:44   ` Takashi Sakamoto
2020-09-02  9:14     ` Takashi Iwai
2020-09-02  4:02 ` [PATCH v2 03/10] ALSA: pci/asihpi: " Allen Pais
2020-09-02  4:02 ` [PATCH v2 04/10] ALSA: riptide: " Allen Pais
2020-09-02  4:02 ` [PATCH v2 05/10] ALSA: hdsp: " Allen Pais
2020-09-02  4:02 ` [PATCH v2 06/10] ASoc: fsl_esai: " Allen Pais
2020-09-02 10:08   ` Mark Brown
2020-09-02  4:02 ` [PATCH v2 07/10] ASoC: siu: " Allen Pais
2020-09-02 10:10   ` Mark Brown
2020-09-02  4:02 ` [PATCH v2 08/10] ASoC: txx9: " Allen Pais
2020-09-02 10:10   ` Mark Brown
2020-09-02  4:02 ` [PATCH v2 09/10] ALSA: usb-audio: " Allen Pais
2020-09-02  4:02 ` [PATCH v2 10/10] ALSA: ua101: " Allen Pais
2020-09-02 11:57 ` [PATCH v2 00/10] ALSA: convert tasklets to use new Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox