2020-08-17 09:00:07

by Allen Pais

[permalink] [raw]
Subject: [PATCH 00/10] sound: convert tasklets to use new tasklet_setup()

From: Allen Pais <[email protected]>

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

Allen Pais (10):
sound: core: convert tasklets to use new tasklet_setup() API
sound: firewire: convert tasklets to use new tasklet_setup() API
sound: asihpi: convert tasklets to use new tasklet_setup() API
sound: riptide: convert tasklets to use new tasklet_setup() API
sound: rm9652: convert tasklets to use new tasklet_setup() API
sound/soc: fsl_esai: convert tasklets to use new tasklet_setup() API
sound/soc: sh: convert tasklets to use new tasklet_setup() API
sound/soc: txx9: convert tasklets to use new tasklet_setup() API
sound: midi: convert tasklets to use new tasklet_setup() API
sound: 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.17.1


2020-08-17 09:01:28

by Allen Pais

[permalink] [raw]
Subject: [PATCH 06/10] sound/soc: fsl_esai: convert tasklets to use new tasklet_setup() API

From: Allen Pais <[email protected]>

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 <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
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.17.1

2020-08-17 09:01:41

by Allen Pais

[permalink] [raw]
Subject: [PATCH 08/10] sound/soc: txx9: convert tasklets to use new tasklet_setup() API

From: Allen Pais <[email protected]>

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 <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
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.17.1

2020-08-17 09:01:56

by Allen Pais

[permalink] [raw]
Subject: [PATCH 10/10] sound: ua101: convert tasklets to use new tasklet_setup() API

From: Allen Pais <[email protected]>

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 <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
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.17.1

2020-08-17 09:12:42

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH 00/10] sound: convert tasklets to use new tasklet_setup()

On Mon, 17 Aug 2020 10:56:53 +0200,
Allen Pais wrote:
>
> From: Allen Pais <[email protected]>
>
> 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

Is this targeted for 5.9 or 5.10?

I have a patch set to drop the whole tasklet usage in sound/*
(destined for 5.10, to be submitted soon), so if that's for 5.10,
it'll be likely superfluous.


thanks,

Takashi

2020-08-17 09:22:36

by Allen Pais

[permalink] [raw]
Subject: Re: [PATCH 00/10] sound: convert tasklets to use new tasklet_setup()

>
> Is this targeted for 5.9 or 5.10?

This is targeted for 5.9.

> I have a patch set to drop the whole tasklet usage in sound/*
> (destined for 5.10, to be submitted soon), so if that's for 5.10,
> it'll be likely superfluous.

I have picked patches from your tree to adapt to this new API.
Those can be picked in 5.10 I suppose.

Thanks.

2020-08-17 09:44:24

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH 00/10] sound: convert tasklets to use new tasklet_setup()

On Mon, 17 Aug 2020 11:18:53 +0200,
Allen Pais wrote:
>
> >
> > Is this targeted for 5.9 or 5.10?
>
> This is targeted for 5.9.

Well, then at the next time, please mention it explicitly in the cover
letter. Usually this kind of API conversion isn't done during rc. Or
it's done systematically via script or such. So unless mentioned,
it's not expected to be carried to 5.9.

In anyway, if the final purpose is to drop the old tasklet API and
that's the plan for 5.9, all tree-wide changes have to be done in
5.9 beforehand. Was that the decision?

> > I have a patch set to drop the whole tasklet usage in sound/*
> > (destined for 5.10, to be submitted soon), so if that's for 5.10,
> > it'll be likely superfluous.
>
> I have picked patches from your tree to adapt to this new API.
> Those can be picked in 5.10 I suppose.

Adapting the changes are trivial, don't worry. It was just a question
of how to organize changes.


thanks,

Takashi

2020-08-18 09:35:25

by Allen

[permalink] [raw]
Subject: Re: [PATCH 00/10] sound: convert tasklets to use new tasklet_setup()

>
> Well, then at the next time, please mention it explicitly in the cover
> letter. Usually this kind of API conversion isn't done during rc. Or
> it's done systematically via script or such. So unless mentioned,
> it's not expected to be carried to 5.9.

Sorry for having missed the detail. Will take care of it in the future.

>
> In anyway, if the final purpose is to drop the old tasklet API and
> that's the plan for 5.9, all tree-wide changes have to be done in
> 5.9 beforehand. Was that the decision?

The idea was to land the tree-wide changes as part of 5.9

>
> > > I have a patch set to drop the whole tasklet usage in sound/*
> > > (destined for 5.10, to be submitted soon), so if that's for 5.10,
> > > it'll be likely superfluous.
> >
> > I have picked patches from your tree to adapt to this new API.
> > Those can be picked in 5.10 I suppose.
>
> Adapting the changes are trivial, don't worry. It was just a question
> of how to organize changes.

Sure, Thank you.

- Allen

2020-08-18 10:27:22

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH 00/10] sound: convert tasklets to use new tasklet_setup()

On Mon, 17 Aug 2020 10:56:53 +0200,
Allen Pais wrote:
>
> From: Allen Pais <[email protected]>
>
> 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
>
> Allen Pais (10):
> sound: core: convert tasklets to use new tasklet_setup() API
> sound: firewire: convert tasklets to use new tasklet_setup() API
> sound: asihpi: convert tasklets to use new tasklet_setup() API
> sound: riptide: convert tasklets to use new tasklet_setup() API
> sound: rm9652: convert tasklets to use new tasklet_setup() API
> sound/soc: fsl_esai: convert tasklets to use new tasklet_setup() API
> sound/soc: sh: convert tasklets to use new tasklet_setup() API
> sound/soc: txx9: convert tasklets to use new tasklet_setup() API

Mark, may I apply those ASoC patches through my tree together with
others? Those seem targeting to 5.9, and I have a patch set to
convert to tasklet for 5.10, which would be better manageable when
based on top of those changes.


thanks,

Takashi


> sound: midi: convert tasklets to use new tasklet_setup() API
> sound: 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.17.1
>

2020-08-18 10:48:33

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 00/10] sound: convert tasklets to use new tasklet_setup()

On Tue, Aug 18, 2020 at 12:25:31PM +0200, Takashi Iwai wrote:

> Mark, may I apply those ASoC patches through my tree together with
> others? Those seem targeting to 5.9, and I have a patch set to
> convert to tasklet for 5.10, which would be better manageable when
> based on top of those changes.

These patches which I wasn't CCed on and which need their subject lines
fixing :( . With the subject lines fixed I guess so so

Acked-by: Mark Brown <[email protected]>

but judging from some of the other threads about similar patches that I
was randomly CCed on I'm not sure people like from_tasklet() so perhaps
there might be issues.

Allen, as documented in submitting-patches.rst please send patches to
the maintainers for the code you would like to change. The normal
kernel workflow is that people apply patches from their inboxes, if they
aren't copied they are likely to not see the patch at all and it is much
more difficult to apply patches.


Attachments:
(No filename) (978.00 B)
signature.asc (499.00 B)
Download all attachments

2020-08-18 11:02:59

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH 00/10] sound: convert tasklets to use new tasklet_setup()

On Tue, 18 Aug 2020 12:44:32 +0200,
Mark Brown wrote:
>
> On Tue, Aug 18, 2020 at 12:25:31PM +0200, Takashi Iwai wrote:
>
> > Mark, may I apply those ASoC patches through my tree together with
> > others? Those seem targeting to 5.9, and I have a patch set to
> > convert to tasklet for 5.10, which would be better manageable when
> > based on top of those changes.
>
> These patches which I wasn't CCed on and which need their subject lines
> fixing :( . With the subject lines fixed I guess so so
>
> Acked-by: Mark Brown <[email protected]>
>
> but judging from some of the other threads about similar patches that I
> was randomly CCed on I'm not sure people like from_tasklet() so perhaps
> there might be issues.

Indeed, now I noticed some complaints through other threads, too.

It's no urgent changes but something preferred to be merged in 5.9.
Let's see how the things settled.


thanks,

Takashi

2020-08-19 10:55:20

by Allen

[permalink] [raw]
Subject: Re: [PATCH 00/10] sound: convert tasklets to use new tasklet_setup()

>
> > Mark, may I apply those ASoC patches through my tree together with
> > others? Those seem targeting to 5.9, and I have a patch set to
> > convert to tasklet for 5.10, which would be better manageable when
> > based on top of those changes.
>
> These patches which I wasn't CCed on and which need their subject lines
> fixing :( . With the subject lines fixed I guess so so

Extremely sorry. I thought I had it covered. How would you like it
worded?

> Acked-by: Mark Brown <[email protected]>
>
> but judging from some of the other threads about similar patches that I
> was randomly CCed on I'm not sure people like from_tasklet() so perhaps
> there might be issues.

Yes, there is a new macro by name cast_out() is suggested in place of
from_tasklet(). Hopefully it will go in soon. Will spin out V2 with the change
and also re-word subject line.

> Allen, as documented in submitting-patches.rst please send patches to
> the maintainers for the code you would like to change. The normal
> kernel workflow is that people apply patches from their inboxes, if they
> aren't copied they are likely to not see the patch at all and it is much
> more difficult to apply patches.

I understand, I'll take care of it in the future. Thank you.

--
- Allen

2020-08-19 11:17:55

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 00/10] sound: convert tasklets to use new tasklet_setup()

On Wed, Aug 19, 2020 at 04:21:58PM +0530, Allen wrote:

> > These patches which I wasn't CCed on and which need their subject lines
> > fixing :( . With the subject lines fixed I guess so so

> Extremely sorry. I thought I had it covered. How would you like it
> worded?

ASoC:

In general you should try to follow the style for the code you're
modifying, this applies to things like commit logs as well as the code
itself.


Attachments:
(No filename) (438.00 B)
signature.asc (499.00 B)
Download all attachments

2020-08-19 11:31:35

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH 00/10] sound: convert tasklets to use new tasklet_setup()

On Wed, 19 Aug 2020 13:16:05 +0200,
Mark Brown wrote:
>
> On Wed, Aug 19, 2020 at 04:21:58PM +0530, Allen wrote:
>
> > > These patches which I wasn't CCed on and which need their subject lines
> > > fixing :( . With the subject lines fixed I guess so so
>
> > Extremely sorry. I thought I had it covered. How would you like it
> > worded?
>
> ASoC:

To be more exact, "ASoC:" prefix is for sound/soc/*, and for the rest
sound/*, use "ALSA:" prefix please.


Takashi

2020-09-01 10:06:45

by Allen

[permalink] [raw]
Subject: Re: [PATCH 00/10] sound: convert tasklets to use new tasklet_setup()

Takashi,
> > > > These patches which I wasn't CCed on and which need their subject lines
> > > > fixing :( . With the subject lines fixed I guess so so
> >
> > > Extremely sorry. I thought I had it covered. How would you like it
> > > worded?
> >
> > ASoC:
>
> To be more exact, "ASoC:" prefix is for sound/soc/*, and for the rest
> sound/*, use "ALSA:" prefix please.

I could not get the generic API accepted upstream. We would stick to
from_tasklet()
or container_of(). Could I go ahead and send out V2 using
from_tasklet() with subject line fixed?

Thanks,
--
- Allen

2020-09-01 10:13:55

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH 00/10] sound: convert tasklets to use new tasklet_setup()

On Tue, 01 Sep 2020 12:04:53 +0200,
Allen wrote:
>
> Takashi,
> > > > > These patches which I wasn't CCed on and which need their subject lines
> > > > > fixing :( . With the subject lines fixed I guess so so
> > >
> > > > Extremely sorry. I thought I had it covered. How would you like it
> > > > worded?
> > >
> > > ASoC:
> >
> > To be more exact, "ASoC:" prefix is for sound/soc/*, and for the rest
> > sound/*, use "ALSA:" prefix please.
>
> I could not get the generic API accepted upstream. We would stick to
> from_tasklet()
> or container_of(). Could I go ahead and send out V2 using
> from_tasklet() with subject line fixed?

Yes, please submit whatever should go into 5.9.


thanks,

Takashi