Commit 12cc923f1ccc ("tasklet: Introduce new initialization API")'
introduced a new tasklet initialization API. This series converts
all the mmc drivers to use the new tasklet_setup() API
Allen Pais (10):
mmc: atmel-mci: convert tasklets to use new tasklet_setup() API
mmc: au1xmmc: convert tasklets to use new tasklet_setup() API
mmc: cb710: convert tasklets to use new tasklet_setup() API
mmc: dw_mmc: convert tasklets to use new tasklet_setup() API
mmc: omap: convert tasklets to use new tasklet_setup() API
mmc: renesas: convert tasklets to use new tasklet_setup() API
mmc: s3cmci: convert tasklets to use new tasklet_setup() API
mmc: tifm_sd: convert tasklets to use new tasklet_setup() API
mmc: uniphier: convert tasklets to use new tasklet_setup() API
mmc: via-sdmmc: convert tasklets to use new tasklet_setup() API
drivers/mmc/host/atmel-mci.c | 6 +++---
drivers/mmc/host/au1xmmc.c | 15 ++++++--------
drivers/mmc/host/cb710-mmc.c | 11 +++++-----
drivers/mmc/host/dw_mmc.c | 6 +++---
drivers/mmc/host/omap.c | 7 +++----
drivers/mmc/host/renesas_sdhi.h | 1 +
drivers/mmc/host/renesas_sdhi_core.c | 2 ++
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 20 +++++++++----------
drivers/mmc/host/renesas_sdhi_sys_dmac.c | 9 ++++-----
drivers/mmc/host/s3cmci.c | 6 +++---
drivers/mmc/host/tifm_sd.c | 7 +++----
drivers/mmc/host/uniphier-sd.c | 14 ++++++-------
drivers/mmc/host/via-sdmmc.c | 7 +++----
13 files changed, 53 insertions(+), 58 deletions(-)
--
2.17.1
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]>
---
drivers/mmc/host/atmel-mci.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 300901415aa2..562cf8eb993f 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -1719,9 +1719,9 @@ static void atmci_detect_change(struct timer_list *t)
}
}
-static void atmci_tasklet_func(unsigned long priv)
+static void atmci_tasklet_func(struct tasklet_struct *t)
{
- struct atmel_mci *host = (struct atmel_mci *)priv;
+ struct atmel_mci *host = from_tasklet(host, t, tasklet);
struct mmc_request *mrq = host->mrq;
struct mmc_data *data = host->data;
enum atmel_mci_state state = host->state;
@@ -2496,7 +2496,7 @@ static int atmci_probe(struct platform_device *pdev)
host->mapbase = regs->start;
- tasklet_init(&host->tasklet, atmci_tasklet_func, (unsigned long)host);
+ tasklet_setup(&host->tasklet, atmci_tasklet_func);
ret = request_irq(irq, atmci_interrupt, 0, dev_name(&pdev->dev), host);
if (ret) {
--
2.17.1
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]>
---
drivers/mmc/host/s3cmci.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
index 444b2769ae2c..7540221d402d 100644
--- a/drivers/mmc/host/s3cmci.c
+++ b/drivers/mmc/host/s3cmci.c
@@ -549,9 +549,9 @@ static void do_pio_write(struct s3cmci_host *host)
enable_imask(host, S3C2410_SDIIMSK_TXFIFOHALF);
}
-static void pio_tasklet(unsigned long data)
+static void pio_tasklet(struct tasklet_struct *t)
{
- struct s3cmci_host *host = (struct s3cmci_host *) data;
+ struct s3cmci_host *host = from_tasklet(host, t, pio_tasklet);
s3cmci_disable_irq(host, true);
@@ -1565,7 +1565,7 @@ static int s3cmci_probe(struct platform_device *pdev)
host->pdata = pdev->dev.platform_data;
spin_lock_init(&host->complete_lock);
- tasklet_init(&host->pio_tasklet, pio_tasklet, (unsigned long) host);
+ tasklet_setup(&host->pio_tasklet, pio_tasklet);
if (host->is2440) {
host->sdiimsk = S3C2440_SDIIMSK;
--
2.17.1
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]>
---
drivers/mmc/host/uniphier-sd.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/mmc/host/uniphier-sd.c b/drivers/mmc/host/uniphier-sd.c
index f82baf99fd69..c822bb7beaca 100644
--- a/drivers/mmc/host/uniphier-sd.c
+++ b/drivers/mmc/host/uniphier-sd.c
@@ -81,9 +81,9 @@ static void uniphier_sd_dma_endisable(struct tmio_mmc_host *host, int enable)
}
/* external DMA engine */
-static void uniphier_sd_external_dma_issue(unsigned long arg)
+static void uniphier_sd_external_dma_issue(struct tasklet_struct *t)
{
- struct tmio_mmc_host *host = (void *)arg;
+ struct tmio_mmc_host *host = from_tasklet(host, t, dma_issue);
struct uniphier_sd_priv *priv = uniphier_sd_priv(host);
uniphier_sd_dma_endisable(host, 1);
@@ -190,8 +190,7 @@ static void uniphier_sd_external_dma_request(struct tmio_mmc_host *host,
host->chan_rx = chan;
host->chan_tx = chan;
- tasklet_init(&host->dma_issue, uniphier_sd_external_dma_issue,
- (unsigned long)host);
+ tasklet_setup(&host->dma_issue, uniphier_sd_external_dma_issue);
}
static void uniphier_sd_external_dma_release(struct tmio_mmc_host *host)
@@ -228,9 +227,9 @@ static const struct tmio_mmc_dma_ops uniphier_sd_external_dma_ops = {
.dataend = uniphier_sd_external_dma_dataend,
};
-static void uniphier_sd_internal_dma_issue(unsigned long arg)
+static void uniphier_sd_internal_dma_issue(struct tasklet_struct *t)
{
- struct tmio_mmc_host *host = (void *)arg;
+ struct tmio_mmc_host *host = from_tasklet(host, t, dma_issue);
unsigned long flags;
spin_lock_irqsave(&host->lock, flags);
@@ -309,8 +308,7 @@ static void uniphier_sd_internal_dma_request(struct tmio_mmc_host *host,
host->chan_tx = (void *)0xdeadbeaf;
- tasklet_init(&host->dma_issue, uniphier_sd_internal_dma_issue,
- (unsigned long)host);
+ tasklet_setup(&host->dma_issue, uniphier_sd_internal_dma_issue);
}
static void uniphier_sd_internal_dma_release(struct tmio_mmc_host *host)
--
2.17.1
On Mon, Aug 17, 2020 at 5:35 PM Allen Pais <[email protected]> wrote:
>
> Commit 12cc923f1ccc ("tasklet: Introduce new initialization API")'
> introduced a new tasklet initialization API. This series converts
> all the mmc drivers to use the new tasklet_setup() API
I did not know this was the direction to invest efforts
because I thought the threaded-irq was supposed to replace
the tasklet.
> Allen Pais (10):
> mmc: atmel-mci: convert tasklets to use new tasklet_setup() API
> mmc: au1xmmc: convert tasklets to use new tasklet_setup() API
> mmc: cb710: convert tasklets to use new tasklet_setup() API
> mmc: dw_mmc: convert tasklets to use new tasklet_setup() API
> mmc: omap: convert tasklets to use new tasklet_setup() API
> mmc: renesas: convert tasklets to use new tasklet_setup() API
> mmc: s3cmci: convert tasklets to use new tasklet_setup() API
> mmc: tifm_sd: convert tasklets to use new tasklet_setup() API
> mmc: uniphier: convert tasklets to use new tasklet_setup() API
> mmc: via-sdmmc: convert tasklets to use new tasklet_setup() API
>
> drivers/mmc/host/atmel-mci.c | 6 +++---
> drivers/mmc/host/au1xmmc.c | 15 ++++++--------
> drivers/mmc/host/cb710-mmc.c | 11 +++++-----
> drivers/mmc/host/dw_mmc.c | 6 +++---
> drivers/mmc/host/omap.c | 7 +++----
> drivers/mmc/host/renesas_sdhi.h | 1 +
> drivers/mmc/host/renesas_sdhi_core.c | 2 ++
> drivers/mmc/host/renesas_sdhi_internal_dmac.c | 20 +++++++++----------
> drivers/mmc/host/renesas_sdhi_sys_dmac.c | 9 ++++-----
> drivers/mmc/host/s3cmci.c | 6 +++---
> drivers/mmc/host/tifm_sd.c | 7 +++----
> drivers/mmc/host/uniphier-sd.c | 14 ++++++-------
> drivers/mmc/host/via-sdmmc.c | 7 +++----
> 13 files changed, 53 insertions(+), 58 deletions(-)
>
> --
> 2.17.1
>
--
Best Regards
Masahiro Yamada
On Mon, Aug 17, 2020 at 09:53:13PM +0900, Masahiro Yamada wrote:
> On Mon, Aug 17, 2020 at 5:35 PM Allen Pais <[email protected]> wrote:
> >
> > Commit 12cc923f1ccc ("tasklet: Introduce new initialization API")'
> > introduced a new tasklet initialization API. This series converts
> > all the mmc drivers to use the new tasklet_setup() API
>
>
> I did not know this was the direction to invest efforts
> because I thought the threaded-irq was supposed to replace
> the tasklet.
Both can happen. It seemed to me that mechanical conversions from
tasklet to threaded-irq was not possible, though, so best to convert the
old API away from being a exploit target (saved arguments on the
heap) while conversions to threaded-irq can happen on a case-by-case
basis.
--
Kees Cook