2021-01-07 12:29:05

by Allen

[permalink] [raw]
Subject: [PATCH v2 00/19]crypto: convert tasklets to use new tasklet_setup API()

From: Allen Pais <[email protected]>

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

The series is based on v5.11-rc2 (e71ba9452f0b)

v2:
- added acks
- addressed comments [Krzysztof and Gilad]

Allen Pais (19):
crypto: amcc: convert tasklets to use new tasklet_setup() API
crypto: atmel: convert tasklets to use new tasklet_setup() API
crypto: axis: convert tasklets to use new tasklet_setup() API
crypto: caam: convert tasklets to use new tasklet_setup() API
crypto: cavium: convert tasklets to use new tasklet_setup() API
crypto: ccp: convert tasklets to use new tasklet_setup() API
crypto: ccree: convert tasklets to use new tasklet_setup() API
crypto: hifn_795x: convert tasklets to use new tasklet_setup() API
crypto: img-hash: convert tasklets to use new tasklet_setup() API
crypto: ixp4xx: convert tasklets to use new tasklet_setup() API
crypto: mediatek: convert tasklets to use new tasklet_setup() API
crypto: omap: convert tasklets to use new tasklet_setup() API
crypto: picoxcell: convert tasklets to use new tasklet_setup() API
crypto: qat: convert tasklets to use new tasklet_setup() API
crypto: qce: convert tasklets to use new tasklet_setup() API
crypto: rockchip: convert tasklets to use new tasklet_setup() API
crypto: s5p: convert tasklets to use new tasklet_setup() API
crypto: talitos: convert tasklets to use new tasklet_setup() API
crypto: octeontx: convert tasklets to use new tasklet_setup() API

drivers/crypto/amcc/crypto4xx_core.c | 7 ++--
drivers/crypto/atmel-aes.c | 14 +++----
drivers/crypto/atmel-sha.c | 14 +++----
drivers/crypto/atmel-tdes.c | 14 +++----
drivers/crypto/axis/artpec6_crypto.c | 7 ++--
drivers/crypto/caam/jr.c | 9 ++--
drivers/crypto/cavium/cpt/cptvf_main.c | 9 ++--
drivers/crypto/cavium/nitrox/nitrox_common.h | 2 +-
drivers/crypto/cavium/nitrox/nitrox_isr.c | 13 +++---
drivers/crypto/cavium/nitrox/nitrox_reqmgr.c | 4 +-
drivers/crypto/ccp/ccp-dev-v3.c | 9 ++--
drivers/crypto/ccp/ccp-dev-v5.c | 9 ++--
drivers/crypto/ccp/ccp-dmaengine.c | 7 ++--
drivers/crypto/ccree/cc_fips.c | 8 ++--
drivers/crypto/ccree/cc_request_mgr.c | 12 +++---
drivers/crypto/hifn_795x.c | 6 +--
drivers/crypto/img-hash.c | 12 +++---
drivers/crypto/ixp4xx_crypto.c | 4 +-
.../crypto/marvell/octeontx/otx_cptvf_main.c | 12 +++---
drivers/crypto/mediatek/mtk-aes.c | 14 +++----
drivers/crypto/mediatek/mtk-sha.c | 14 +++----
drivers/crypto/omap-aes.c | 6 +--
drivers/crypto/omap-des.c | 6 +--
drivers/crypto/omap-sham.c | 6 +--
drivers/crypto/picoxcell_crypto.c | 7 ++--
drivers/crypto/qat/qat_common/adf_isr.c | 5 +--
drivers/crypto/qat/qat_common/adf_sriov.c | 10 ++---
drivers/crypto/qat/qat_common/adf_transport.c | 4 +-
.../qat/qat_common/adf_transport_internal.h | 2 +-
drivers/crypto/qat/qat_common/adf_vf_isr.c | 11 +++--
drivers/crypto/qce/core.c | 7 ++--
drivers/crypto/rockchip/rk3288_crypto.c | 14 +++----
drivers/crypto/s5p-sss.c | 13 +++---
drivers/crypto/talitos.c | 42 +++++++++----------
34 files changed, 152 insertions(+), 181 deletions(-)

--
2.25.1


2021-01-07 12:29:42

by Allen

[permalink] [raw]
Subject: [PATCH v2 03/19] crypto: axis: 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]>
---
drivers/crypto/axis/artpec6_crypto.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/axis/artpec6_crypto.c b/drivers/crypto/axis/artpec6_crypto.c
index 9ad188cffd0d..52e0c7fdbfa8 100644
--- a/drivers/crypto/axis/artpec6_crypto.c
+++ b/drivers/crypto/axis/artpec6_crypto.c
@@ -2075,9 +2075,9 @@ static void artpec6_crypto_timeout(struct timer_list *t)
tasklet_schedule(&ac->task);
}

-static void artpec6_crypto_task(unsigned long data)
+static void artpec6_crypto_task(struct tasklet_struct *t)
{
- struct artpec6_crypto *ac = (struct artpec6_crypto *)data;
+ struct artpec6_crypto *ac = from_tasklet(ac, t, task);
struct artpec6_crypto_req_common *req;
struct artpec6_crypto_req_common *n;
struct list_head complete_done;
@@ -2900,8 +2900,7 @@ static int artpec6_crypto_probe(struct platform_device *pdev)
artpec6_crypto_init_debugfs();
#endif

- tasklet_init(&ac->task, artpec6_crypto_task,
- (unsigned long)ac);
+ tasklet_setup(&ac->task, artpec6_crypto_task);

ac->pad_buffer = devm_kzalloc(&pdev->dev, 2 * ARTPEC_CACHE_LINE_MAX,
GFP_KERNEL);
--
2.25.1

2021-01-07 12:29:51

by Allen

[permalink] [raw]
Subject: [PATCH v2 02/19] crypto: atmel: 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]>
---
drivers/crypto/atmel-aes.c | 14 ++++++--------
drivers/crypto/atmel-sha.c | 14 ++++++--------
drivers/crypto/atmel-tdes.c | 14 ++++++--------
3 files changed, 18 insertions(+), 24 deletions(-)

diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
index b1d286004295..804e6a5a39d4 100644
--- a/drivers/crypto/atmel-aes.c
+++ b/drivers/crypto/atmel-aes.c
@@ -2300,16 +2300,16 @@ static void atmel_aes_dma_cleanup(struct atmel_aes_dev *dd)
dma_release_channel(dd->src.chan);
}

-static void atmel_aes_queue_task(unsigned long data)
+static void atmel_aes_queue_task(struct tasklet_struct *t)
{
- struct atmel_aes_dev *dd = (struct atmel_aes_dev *)data;
+ struct atmel_aes_dev *dd = from_tasklet(dd, t, queue_task);

atmel_aes_handle_queue(dd, NULL);
}

-static void atmel_aes_done_task(unsigned long data)
+static void atmel_aes_done_task(struct tasklet_struct *t)
{
- struct atmel_aes_dev *dd = (struct atmel_aes_dev *)data;
+ struct atmel_aes_dev *dd = from_tasklet(dd, t, done_task);

dd->is_async = true;
(void)dd->resume(dd);
@@ -2499,10 +2499,8 @@ static int atmel_aes_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&aes_dd->list);
spin_lock_init(&aes_dd->lock);

- tasklet_init(&aes_dd->done_task, atmel_aes_done_task,
- (unsigned long)aes_dd);
- tasklet_init(&aes_dd->queue_task, atmel_aes_queue_task,
- (unsigned long)aes_dd);
+ tasklet_setup(&aes_dd->done_task, atmel_aes_done_task);
+ tasklet_setup(&aes_dd->queue_task, atmel_aes_queue_task);

crypto_init_queue(&aes_dd->queue, ATMEL_AES_QUEUE_LENGTH);

diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
index 352d80cb5ae9..8ec8a32606e8 100644
--- a/drivers/crypto/atmel-sha.c
+++ b/drivers/crypto/atmel-sha.c
@@ -1314,9 +1314,9 @@ static struct ahash_alg sha_384_512_algs[] = {
},
};

-static void atmel_sha_queue_task(unsigned long data)
+static void atmel_sha_queue_task(struct tasklet_struct *t)
{
- struct atmel_sha_dev *dd = (struct atmel_sha_dev *)data;
+ struct atmel_sha_dev *dd = from_tasklet(dd, t, queue_task);

atmel_sha_handle_queue(dd, NULL);
}
@@ -1353,9 +1353,9 @@ static int atmel_sha_done(struct atmel_sha_dev *dd)
return err;
}

-static void atmel_sha_done_task(unsigned long data)
+static void atmel_sha_done_task(struct tasklet_struct *t)
{
- struct atmel_sha_dev *dd = (struct atmel_sha_dev *)data;
+ struct atmel_sha_dev *dd = from_tasklet(dd, t, done_task);

dd->is_async = true;
(void)dd->resume(dd);
@@ -2570,10 +2570,8 @@ static int atmel_sha_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&sha_dd->list);
spin_lock_init(&sha_dd->lock);

- tasklet_init(&sha_dd->done_task, atmel_sha_done_task,
- (unsigned long)sha_dd);
- tasklet_init(&sha_dd->queue_task, atmel_sha_queue_task,
- (unsigned long)sha_dd);
+ tasklet_setup(&sha_dd->done_task, atmel_sha_done_task);
+ tasklet_setup(&sha_dd->queue_task, atmel_sha_queue_task);

crypto_init_queue(&sha_dd->queue, ATMEL_SHA_QUEUE_LENGTH);

diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c
index 4d63cb13a54f..b7a734f666ae 100644
--- a/drivers/crypto/atmel-tdes.c
+++ b/drivers/crypto/atmel-tdes.c
@@ -1049,16 +1049,16 @@ static struct skcipher_alg tdes_algs[] = {
},
};

-static void atmel_tdes_queue_task(unsigned long data)
+static void atmel_tdes_queue_task(struct tasklet_struct *t)
{
- struct atmel_tdes_dev *dd = (struct atmel_tdes_dev *)data;
+ struct atmel_tdes_dev *dd = from_tasklet(dd, t, queue_task);

atmel_tdes_handle_queue(dd, NULL);
}

-static void atmel_tdes_done_task(unsigned long data)
+static void atmel_tdes_done_task(struct tasklet_struct *t)
{
- struct atmel_tdes_dev *dd = (struct atmel_tdes_dev *) data;
+ struct atmel_tdes_dev *dd = from_tasklet(dd, t, done_task);
int err;

if (!(dd->flags & TDES_FLAGS_DMA))
@@ -1177,10 +1177,8 @@ static int atmel_tdes_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&tdes_dd->list);
spin_lock_init(&tdes_dd->lock);

- tasklet_init(&tdes_dd->done_task, atmel_tdes_done_task,
- (unsigned long)tdes_dd);
- tasklet_init(&tdes_dd->queue_task, atmel_tdes_queue_task,
- (unsigned long)tdes_dd);
+ tasklet_setup(&tdes_dd->done_task, atmel_tdes_done_task);
+ tasklet_setup(&tdes_dd->queue_task, atmel_tdes_queue_task);

crypto_init_queue(&tdes_dd->queue, ATMEL_TDES_QUEUE_LENGTH);

--
2.25.1

2021-01-07 12:30:10

by Allen

[permalink] [raw]
Subject: [PATCH v2 01/19] crypto: amcc: 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]>
---
drivers/crypto/amcc/crypto4xx_core.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c
index 8d1b918a0533..0e13430a5b9b 100644
--- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -1072,9 +1072,9 @@ static void crypto4xx_unregister_alg(struct crypto4xx_device *sec_dev)
}
}

-static void crypto4xx_bh_tasklet_cb(unsigned long data)
+static void crypto4xx_bh_tasklet_cb(struct tasklet_struct *t)
{
- struct device *dev = (struct device *)data;
+ struct device *dev = from_tasklet(dev, t, tasklet);
struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev);
struct pd_uinfo *pd_uinfo;
struct ce_pd *pd;
@@ -1452,8 +1452,7 @@ static int crypto4xx_probe(struct platform_device *ofdev)
goto err_build_sdr;

/* Init tasklet for bottom half processing */
- tasklet_init(&core_dev->tasklet, crypto4xx_bh_tasklet_cb,
- (unsigned long) dev);
+ tasklet_setup(&core_dev->tasklet, crypto4xx_bh_tasklet_cb);

core_dev->dev->ce_base = of_iomap(ofdev->dev.of_node, 0);
if (!core_dev->dev->ce_base) {
--
2.25.1