All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API()
@ 2020-12-07  8:59 Allen Pais
  2020-12-07  8:59 ` [RESEND 01/19] crypto: amcc: convert tasklets to use new tasklet_setup() API Allen Pais
                   ` (19 more replies)
  0 siblings, 20 replies; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais

From: Allen Pais <apais@linux.microsoft.com>

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 5.10-rc6 (b65054597872)

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                |  6 +--
 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, 151 insertions(+), 180 deletions(-)

-- 
2.25.1


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

* [RESEND 01/19] crypto: amcc: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-07  8:59 ` [RESEND 02/19] crypto: atmel: " Allen Pais
                   ` (18 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais, Romain Perier

From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
---
 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 981de43ea5e2..3700446a99d8 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


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

* [RESEND 02/19] crypto: atmel: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
  2020-12-07  8:59 ` [RESEND 01/19] crypto: amcc: convert tasklets to use new tasklet_setup() API Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-07  8:59 ` [RESEND 03/19] crypto: axis: " Allen Pais
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais, Romain Perier

From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
---
 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 75ccf41a7cb9..84a7c8a9dd02 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


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

* [RESEND 03/19] crypto: axis: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
  2020-12-07  8:59 ` [RESEND 01/19] crypto: amcc: convert tasklets to use new tasklet_setup() API Allen Pais
  2020-12-07  8:59 ` [RESEND 02/19] crypto: atmel: " Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-07  8:59 ` [RESEND 04/19] crypto: caam: " Allen Pais
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais, Romain Perier

From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
---
 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 809c3033ca74..d24658f6c496 100644
--- a/drivers/crypto/axis/artpec6_crypto.c
+++ b/drivers/crypto/axis/artpec6_crypto.c
@@ -2074,9 +2074,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;
@@ -2899,8 +2899,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


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

* [RESEND 04/19] crypto: caam: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
                   ` (2 preceding siblings ...)
  2020-12-07  8:59 ` [RESEND 03/19] crypto: axis: " Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-14 17:21   ` Horia Geantă
  2020-12-07  8:59 ` [RESEND 05/19] crypto: cavium: " Allen Pais
                   ` (15 subsequent siblings)
  19 siblings, 1 reply; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais, Romain Perier

From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
---
 drivers/crypto/caam/jr.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c
index 6f669966ba2c..1b5939e42e67 100644
--- a/drivers/crypto/caam/jr.c
+++ b/drivers/crypto/caam/jr.c
@@ -9,6 +9,7 @@
 
 #include <linux/of_irq.h>
 #include <linux/of_address.h>
+#include <linux/interrupt.h>
 
 #include "compat.h"
 #include "ctrl.h"
@@ -201,11 +202,11 @@ static irqreturn_t caam_jr_interrupt(int irq, void *st_dev)
 }
 
 /* Deferred service handler, run as interrupt-fired tasklet */
-static void caam_jr_dequeue(unsigned long devarg)
+static void caam_jr_dequeue(struct tasklet_struct *t)
 {
 	int hw_idx, sw_idx, i, head, tail;
-	struct device *dev = (struct device *)devarg;
-	struct caam_drv_private_jr *jrp = dev_get_drvdata(dev);
+	struct caam_drv_private_jr *jrp = from_tasklet(jrp, t, irqtask);
+	struct device *dev = jrp->dev;
 	void (*usercall)(struct device *dev, u32 *desc, u32 status, void *arg);
 	u32 *userdesc, userstatus;
 	void *userarg;
@@ -483,7 +484,7 @@ static int caam_jr_init(struct device *dev)
 		      (JOBR_INTC_COUNT_THLD << JRCFG_ICDCT_SHIFT) |
 		      (JOBR_INTC_TIME_THLD << JRCFG_ICTT_SHIFT));
 
-	tasklet_init(&jrp->irqtask, caam_jr_dequeue, (unsigned long)dev);
+	tasklet_setup(&jrp->irqtask, caam_jr_dequeue);
 
 	/* Connect job ring interrupt handler. */
 	error = devm_request_irq(dev, jrp->irq, caam_jr_interrupt, IRQF_SHARED,
-- 
2.25.1


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

* [RESEND 05/19] crypto: cavium: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
                   ` (3 preceding siblings ...)
  2020-12-07  8:59 ` [RESEND 04/19] crypto: caam: " Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-07  8:59 ` [RESEND 06/19] crypto: ccp: " Allen Pais
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais, Romain Perier

From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
---
 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 ++--
 4 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/drivers/crypto/cavium/cpt/cptvf_main.c b/drivers/crypto/cavium/cpt/cptvf_main.c
index a15245992cf9..87f4cc6e80c1 100644
--- a/drivers/crypto/cavium/cpt/cptvf_main.c
+++ b/drivers/crypto/cavium/cpt/cptvf_main.c
@@ -21,10 +21,10 @@ struct cptvf_wqe_info {
 	struct cptvf_wqe vq_wqe[CPT_NUM_QS_PER_VF];
 };
 
-static void vq_work_handler(unsigned long data)
+static void vq_work_handler(struct tasklet_struct *t)
 {
-	struct cptvf_wqe_info *cwqe_info = (struct cptvf_wqe_info *)data;
-	struct cptvf_wqe *cwqe = &cwqe_info->vq_wqe[0];
+	struct cptvf_wqe *cwqe = from_tasklet(cwqe, t, twork);
+	struct cptvf_wqe_info *cwqe_info = container_of(cwqe, typeof(*cwqe_info), vq_wqe[0]);;
 
 	vq_post_process(cwqe->cptvf, cwqe->qno);
 }
@@ -45,8 +45,7 @@ static int init_worker_threads(struct cpt_vf *cptvf)
 	}
 
 	for (i = 0; i < cptvf->nr_queues; i++) {
-		tasklet_init(&cwqe_info->vq_wqe[i].twork, vq_work_handler,
-			     (u64)cwqe_info);
+		tasklet_setup(&cwqe_info->vq_wqe[i].twork, vq_work_handler);
 		cwqe_info->vq_wqe[i].qno = i;
 		cwqe_info->vq_wqe[i].cptvf = cptvf;
 	}
diff --git a/drivers/crypto/cavium/nitrox/nitrox_common.h b/drivers/crypto/cavium/nitrox/nitrox_common.h
index e4be69d7e6e5..f73ae8735272 100644
--- a/drivers/crypto/cavium/nitrox/nitrox_common.h
+++ b/drivers/crypto/cavium/nitrox/nitrox_common.h
@@ -19,7 +19,7 @@ void nitrox_put_device(struct nitrox_device *ndev);
 int nitrox_common_sw_init(struct nitrox_device *ndev);
 void nitrox_common_sw_cleanup(struct nitrox_device *ndev);
 
-void pkt_slc_resp_tasklet(unsigned long data);
+void pkt_slc_resp_tasklet(struct tasklet_struct *t);
 int nitrox_process_se_request(struct nitrox_device *ndev,
 			      struct se_crypto_request *req,
 			      completion_t cb,
diff --git a/drivers/crypto/cavium/nitrox/nitrox_isr.c b/drivers/crypto/cavium/nitrox/nitrox_isr.c
index 3dec570a190a..cc6b7c78e070 100644
--- a/drivers/crypto/cavium/nitrox/nitrox_isr.c
+++ b/drivers/crypto/cavium/nitrox/nitrox_isr.c
@@ -200,9 +200,9 @@ static void clear_bmi_err_intr(struct nitrox_device *ndev)
 	dev_err_ratelimited(DEV(ndev), "BMI_INT  0x%016llx\n", value);
 }
 
-static void nps_core_int_tasklet(unsigned long data)
+static void nps_core_int_tasklet(struct tasklet_struct *t)
 {
-	struct nitrox_q_vector *qvec = (void *)(uintptr_t)(data);
+	struct nitrox_q_vector *qvec = from_tasklet(qvec, t, resp_tasklet);
 	struct nitrox_device *ndev = qvec->ndev;
 
 	/* if pf mode do queue recovery */
@@ -342,8 +342,7 @@ int nitrox_register_interrupts(struct nitrox_device *ndev)
 		cpu = qvec->ring % num_online_cpus();
 		irq_set_affinity_hint(vec, get_cpu_mask(cpu));
 
-		tasklet_init(&qvec->resp_tasklet, pkt_slc_resp_tasklet,
-			     (unsigned long)qvec);
+		tasklet_setup(&qvec->resp_tasklet, pkt_slc_resp_tasklet);
 		qvec->valid = true;
 	}
 
@@ -363,8 +362,7 @@ int nitrox_register_interrupts(struct nitrox_device *ndev)
 	cpu = num_online_cpus();
 	irq_set_affinity_hint(vec, get_cpu_mask(cpu));
 
-	tasklet_init(&qvec->resp_tasklet, nps_core_int_tasklet,
-		     (unsigned long)qvec);
+	tasklet_setup(&qvec->resp_tasklet, nps_core_int_tasklet);
 	qvec->valid = true;
 
 	return 0;
@@ -441,8 +439,7 @@ int nitrox_sriov_register_interupts(struct nitrox_device *ndev)
 	cpu = num_online_cpus();
 	irq_set_affinity_hint(vec, get_cpu_mask(cpu));
 
-	tasklet_init(&qvec->resp_tasklet, nps_core_int_tasklet,
-		     (unsigned long)qvec);
+	tasklet_setup(&qvec->resp_tasklet, nps_core_int_tasklet);
 	qvec->valid = true;
 
 	return 0;
diff --git a/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c b/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c
index 5826c2c98a50..1c113be87ada 100644
--- a/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c
+++ b/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c
@@ -579,9 +579,9 @@ static void process_response_list(struct nitrox_cmdq *cmdq)
 /**
  * pkt_slc_resp_tasklet - post processing of SE responses
  */
-void pkt_slc_resp_tasklet(unsigned long data)
+void pkt_slc_resp_tasklet(struct tasklet_struct *t)
 {
-	struct nitrox_q_vector *qvec = (void *)(uintptr_t)(data);
+	struct nitrox_q_vector *qvec = from_tasklet(qvec, t, resp_tasklet);
 	struct nitrox_cmdq *cmdq = qvec->cmdq;
 	union nps_pkt_slc_cnts slc_cnts;
 
-- 
2.25.1


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

* [RESEND 06/19] crypto: ccp: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
                   ` (4 preceding siblings ...)
  2020-12-07  8:59 ` [RESEND 05/19] crypto: cavium: " Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-07  8:59 ` [RESEND 07/19] crypto: ccree: " Allen Pais
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais, Romain Perier

From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
---
 drivers/crypto/ccp/ccp-dev-v3.c    | 9 ++++-----
 drivers/crypto/ccp/ccp-dev-v5.c    | 9 ++++-----
 drivers/crypto/ccp/ccp-dmaengine.c | 7 +++----
 3 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/crypto/ccp/ccp-dev-v3.c b/drivers/crypto/ccp/ccp-dev-v3.c
index 0d5576f6ad21..858566867fa3 100644
--- a/drivers/crypto/ccp/ccp-dev-v3.c
+++ b/drivers/crypto/ccp/ccp-dev-v3.c
@@ -321,9 +321,9 @@ static void ccp_enable_queue_interrupts(struct ccp_device *ccp)
 	iowrite32(ccp->qim, ccp->io_regs + IRQ_MASK_REG);
 }
 
-static void ccp_irq_bh(unsigned long data)
+static void ccp_irq_bh(struct tasklet_struct *t)
 {
-	struct ccp_device *ccp = (struct ccp_device *)data;
+	struct ccp_device *ccp = from_tasklet(ccp, t, irq_tasklet);
 	struct ccp_cmd_queue *cmd_q;
 	u32 q_int, status;
 	unsigned int i;
@@ -361,7 +361,7 @@ static irqreturn_t ccp_irq_handler(int irq, void *data)
 	if (ccp->use_tasklet)
 		tasklet_schedule(&ccp->irq_tasklet);
 	else
-		ccp_irq_bh((unsigned long)ccp);
+		ccp_irq_bh(&ccp->irq_tasklet);
 
 	return IRQ_HANDLED;
 }
@@ -457,8 +457,7 @@ static int ccp_init(struct ccp_device *ccp)
 
 	/* Initialize the ISR tasklet? */
 	if (ccp->use_tasklet)
-		tasklet_init(&ccp->irq_tasklet, ccp_irq_bh,
-			     (unsigned long)ccp);
+		tasklet_setup(&ccp->irq_tasklet, ccp_irq_bh);
 
 	dev_dbg(dev, "Starting threads...\n");
 	/* Create a kthread for each queue */
diff --git a/drivers/crypto/ccp/ccp-dev-v5.c b/drivers/crypto/ccp/ccp-dev-v5.c
index 7838f63bab32..e68b05a3169b 100644
--- a/drivers/crypto/ccp/ccp-dev-v5.c
+++ b/drivers/crypto/ccp/ccp-dev-v5.c
@@ -733,9 +733,9 @@ static void ccp5_enable_queue_interrupts(struct ccp_device *ccp)
 		iowrite32(SUPPORTED_INTERRUPTS, ccp->cmd_q[i].reg_int_enable);
 }
 
-static void ccp5_irq_bh(unsigned long data)
+static void ccp5_irq_bh(struct tasklet_struct *t)
 {
-	struct ccp_device *ccp = (struct ccp_device *)data;
+	struct ccp_device *ccp = from_tasklet(ccp, t, irq_tasklet);
 	u32 status;
 	unsigned int i;
 
@@ -772,7 +772,7 @@ static irqreturn_t ccp5_irq_handler(int irq, void *data)
 	if (ccp->use_tasklet)
 		tasklet_schedule(&ccp->irq_tasklet);
 	else
-		ccp5_irq_bh((unsigned long)ccp);
+		ccp5_irq_bh(&ccp->irq_tasklet);
 	return IRQ_HANDLED;
 }
 
@@ -894,8 +894,7 @@ static int ccp5_init(struct ccp_device *ccp)
 	}
 	/* Initialize the ISR tasklet */
 	if (ccp->use_tasklet)
-		tasklet_init(&ccp->irq_tasklet, ccp5_irq_bh,
-			     (unsigned long)ccp);
+		tasklet_setup(&ccp->irq_tasklet, ccp5_irq_bh);
 
 	dev_dbg(dev, "Loading LSB map...\n");
 	/* Copy the private LSB mask to the public registers */
diff --git a/drivers/crypto/ccp/ccp-dmaengine.c b/drivers/crypto/ccp/ccp-dmaengine.c
index 0770a83bf1a5..a85690866b05 100644
--- a/drivers/crypto/ccp/ccp-dmaengine.c
+++ b/drivers/crypto/ccp/ccp-dmaengine.c
@@ -121,9 +121,9 @@ static void ccp_cleanup_desc_resources(struct ccp_device *ccp,
 	}
 }
 
-static void ccp_do_cleanup(unsigned long data)
+static void ccp_do_cleanup(struct tasklet_struct *t)
 {
-	struct ccp_dma_chan *chan = (struct ccp_dma_chan *)data;
+	struct ccp_dma_chan *chan = from_tasklet(chan, t, cleanup_tasklet);
 	unsigned long flags;
 
 	dev_dbg(chan->ccp->dev, "%s - chan=%s\n", __func__,
@@ -712,8 +712,7 @@ int ccp_dmaengine_register(struct ccp_device *ccp)
 		INIT_LIST_HEAD(&chan->active);
 		INIT_LIST_HEAD(&chan->complete);
 
-		tasklet_init(&chan->cleanup_tasklet, ccp_do_cleanup,
-			     (unsigned long)chan);
+		tasklet_setup(&chan->cleanup_tasklet, ccp_do_cleanup);
 
 		dma_chan->device = dma_dev;
 		dma_cookie_init(dma_chan);
-- 
2.25.1


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

* [RESEND 07/19] crypto: ccree: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
                   ` (5 preceding siblings ...)
  2020-12-07  8:59 ` [RESEND 06/19] crypto: ccp: " Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-07 18:23   ` kernel test robot
  2020-12-09  6:46   ` Gilad Ben-Yossef
  2020-12-07  8:59 ` [RESEND 08/19] crypto: hifn_795x: " Allen Pais
                   ` (12 subsequent siblings)
  19 siblings, 2 replies; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais, Romain Perier

From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
---
 drivers/crypto/ccree/cc_fips.c        |  6 +++---
 drivers/crypto/ccree/cc_request_mgr.c | 12 ++++++------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/crypto/ccree/cc_fips.c b/drivers/crypto/ccree/cc_fips.c
index 702aefc21447..bad228a36776 100644
--- a/drivers/crypto/ccree/cc_fips.c
+++ b/drivers/crypto/ccree/cc_fips.c
@@ -109,9 +109,9 @@ void cc_tee_handle_fips_error(struct cc_drvdata *p_drvdata)
 }
 
 /* Deferred service handler, run as interrupt-fired tasklet */
-static void fips_dsr(unsigned long devarg)
+static void fips_dsr(struct tasklet_struct *t)
 {
-	struct cc_drvdata *drvdata = (struct cc_drvdata *)devarg;
+	struct cc_drvdata *drvdata = from_tasklet(drvdata, t, tasklet);
 	u32 irq, val;
 
 	irq = (drvdata->irq & (CC_GPR0_IRQ_MASK));
@@ -143,7 +143,7 @@ int cc_fips_init(struct cc_drvdata *p_drvdata)
 	p_drvdata->fips_handle = fips_h;
 
 	dev_dbg(dev, "Initializing fips tasklet\n");
-	tasklet_init(&fips_h->tasklet, fips_dsr, (unsigned long)p_drvdata);
+	tasklet_setup(&fips_h->tasklet, fips_dsr);
 	fips_h->drvdata = p_drvdata;
 	fips_h->nb.notifier_call = cc_ree_fips_failure;
 	atomic_notifier_chain_register(&fips_fail_notif_chain, &fips_h->nb);
diff --git a/drivers/crypto/ccree/cc_request_mgr.c b/drivers/crypto/ccree/cc_request_mgr.c
index 33fb27745d52..ec0f3bf00d33 100644
--- a/drivers/crypto/ccree/cc_request_mgr.c
+++ b/drivers/crypto/ccree/cc_request_mgr.c
@@ -70,7 +70,7 @@ static const u32 cc_cpp_int_masks[CC_CPP_NUM_ALGS][CC_CPP_NUM_SLOTS] = {
 	  BIT(CC_HOST_IRR_REE_OP_ABORTED_SM_7_INT_BIT_SHIFT) }
 };
 
-static void comp_handler(unsigned long devarg);
+static void comp_handler(struct tasklet_struct *t);
 #ifdef COMP_IN_WQ
 static void comp_work_handler(struct work_struct *work);
 #endif
@@ -140,8 +140,7 @@ int cc_req_mgr_init(struct cc_drvdata *drvdata)
 	INIT_DELAYED_WORK(&req_mgr_h->compwork, comp_work_handler);
 #else
 	dev_dbg(dev, "Initializing completion tasklet\n");
-	tasklet_init(&req_mgr_h->comptask, comp_handler,
-		     (unsigned long)drvdata);
+	tasklet_setup(&req_mgr_h->comptask, comp_handler);
 #endif
 	req_mgr_h->hw_queue_size = cc_ioread(drvdata,
 					     CC_REG(DSCRPTR_QUEUE_SRAM_SIZE));
@@ -611,11 +610,12 @@ static inline u32 cc_axi_comp_count(struct cc_drvdata *drvdata)
 }
 
 /* Deferred service handler, run as interrupt-fired tasklet */
-static void comp_handler(unsigned long devarg)
+static void comp_handler(struct tasklet_struct *t)
 {
-	struct cc_drvdata *drvdata = (struct cc_drvdata *)devarg;
 	struct cc_req_mgr_handle *request_mgr_handle =
-						drvdata->request_mgr_handle;
+				from_tasklet(request_mgr_handle, t, comptask);
+	struct cc_drvdata *drvdata = container_of((void *)request_mgr_handle,
+				     typeof(*drvdata), request_mgr_handle);
 	struct device *dev = drvdata_to_dev(drvdata);
 	u32 irq;
 
-- 
2.25.1


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

* [RESEND 08/19] crypto: hifn_795x: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
                   ` (6 preceding siblings ...)
  2020-12-07  8:59 ` [RESEND 07/19] crypto: ccree: " Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-07  8:59 ` [RESEND 09/19] crypto: img-hash: " Allen Pais
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais, Romain Perier

From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
---
 drivers/crypto/hifn_795x.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
index 7e7a8f01ea6b..47f7bb43477e 100644
--- a/drivers/crypto/hifn_795x.c
+++ b/drivers/crypto/hifn_795x.c
@@ -2445,9 +2445,9 @@ static int hifn_register_alg(struct hifn_device *dev)
 	return err;
 }
 
-static void hifn_tasklet_callback(unsigned long data)
+static void hifn_tasklet_callback(struct tasklet_struct *t)
 {
-	struct hifn_device *dev = (struct hifn_device *)data;
+	struct hifn_device *dev = from_tasklet(dev, t, tasklet);
 
 	/*
 	 * This is ok to call this without lock being held,
@@ -2533,7 +2533,7 @@ static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	pci_set_drvdata(pdev, dev);
 
-	tasklet_init(&dev->tasklet, hifn_tasklet_callback, (unsigned long)dev);
+	tasklet_setup(&dev->tasklet, hifn_tasklet_callback);
 
 	crypto_init_queue(&dev->queue, 1);
 
-- 
2.25.1


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

* [RESEND 09/19] crypto: img-hash: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
                   ` (7 preceding siblings ...)
  2020-12-07  8:59 ` [RESEND 08/19] crypto: hifn_795x: " Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-07  8:59 ` [RESEND 10/19] crypto: ixp4xx: " Allen Pais
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais, Romain Perier

From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
---
 drivers/crypto/img-hash.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c
index 91f555ccbb31..9b66f9d8c52a 100644
--- a/drivers/crypto/img-hash.c
+++ b/drivers/crypto/img-hash.c
@@ -354,9 +354,9 @@ static int img_hash_dma_init(struct img_hash_dev *hdev)
 	return 0;
 }
 
-static void img_hash_dma_task(unsigned long d)
+static void img_hash_dma_task(struct tasklet_struct *t)
 {
-	struct img_hash_dev *hdev = (struct img_hash_dev *)d;
+	struct img_hash_dev *hdev = from_tasklet(hdev, t, dma_task);
 	struct img_hash_request_ctx *ctx = ahash_request_ctx(hdev->req);
 	u8 *addr;
 	size_t nbytes, bleft, wsend, len, tbc;
@@ -886,9 +886,9 @@ static int img_unregister_algs(struct img_hash_dev *hdev)
 	return 0;
 }
 
-static void img_hash_done_task(unsigned long data)
+static void img_hash_done_task(struct tasklet_struct *t)
 {
-	struct img_hash_dev *hdev = (struct img_hash_dev *)data;
+	struct img_hash_dev *hdev = from_tasklet(hdev, t, done_task);
 	int err = 0;
 
 	if (hdev->err == -EINVAL) {
@@ -953,8 +953,8 @@ static int img_hash_probe(struct platform_device *pdev)
 
 	INIT_LIST_HEAD(&hdev->list);
 
-	tasklet_init(&hdev->done_task, img_hash_done_task, (unsigned long)hdev);
-	tasklet_init(&hdev->dma_task, img_hash_dma_task, (unsigned long)hdev);
+	tasklet_setup(&hdev->done_task, img_hash_done_task);
+	tasklet_setup(&hdev->dma_task, img_hash_dma_task);
 
 	crypto_init_queue(&hdev->queue, IMG_HASH_QUEUE_LENGTH);
 
-- 
2.25.1


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

* [RESEND 10/19] crypto: ixp4xx: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
                   ` (8 preceding siblings ...)
  2020-12-07  8:59 ` [RESEND 09/19] crypto: img-hash: " Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-07  8:59 ` [RESEND 11/19] crypto: mediatek: " Allen Pais
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais, Romain Perier

From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
---
 drivers/crypto/ixp4xx_crypto.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c
index 276012e7c482..de6b51d030d4 100644
--- a/drivers/crypto/ixp4xx_crypto.c
+++ b/drivers/crypto/ixp4xx_crypto.c
@@ -414,7 +414,7 @@ static void irqhandler(void *_unused)
 	tasklet_schedule(&crypto_done_tasklet);
 }
 
-static void crypto_done_action(unsigned long arg)
+static void crypto_done_action(struct tasklet_struct *unused)
 {
 	int i;
 
@@ -497,7 +497,7 @@ static int init_ixp_crypto(struct device *dev)
 		goto err;
 	}
 	qmgr_set_irq(RECV_QID, QUEUE_IRQ_SRC_NOT_EMPTY, irqhandler, NULL);
-	tasklet_init(&crypto_done_tasklet, crypto_done_action, 0);
+	tasklet_setup(&crypto_done_tasklet, crypto_done_action);
 
 	qmgr_enable_irq(RECV_QID);
 	return 0;
-- 
2.25.1


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

* [RESEND 11/19] crypto: mediatek: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
                   ` (9 preceding siblings ...)
  2020-12-07  8:59 ` [RESEND 10/19] crypto: ixp4xx: " Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-07  8:59 ` [RESEND 12/19] crypto: omap: " Allen Pais
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais, Romain Perier

From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
---
 drivers/crypto/mediatek/mtk-aes.c | 14 ++++++--------
 drivers/crypto/mediatek/mtk-sha.c | 14 ++++++--------
 2 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/drivers/crypto/mediatek/mtk-aes.c b/drivers/crypto/mediatek/mtk-aes.c
index 7323066724c3..fa49bb5b043b 100644
--- a/drivers/crypto/mediatek/mtk-aes.c
+++ b/drivers/crypto/mediatek/mtk-aes.c
@@ -1080,16 +1080,16 @@ static struct aead_alg aes_gcm_alg = {
 	},
 };
 
-static void mtk_aes_queue_task(unsigned long data)
+static void mtk_aes_queue_task(struct tasklet_struct *t)
 {
-	struct mtk_aes_rec *aes = (struct mtk_aes_rec *)data;
+	struct mtk_aes_rec *aes = from_tasklet(aes, t, queue_task);
 
 	mtk_aes_handle_queue(aes->cryp, aes->id, NULL);
 }
 
-static void mtk_aes_done_task(unsigned long data)
+static void mtk_aes_done_task(struct tasklet_struct *t)
 {
-	struct mtk_aes_rec *aes = (struct mtk_aes_rec *)data;
+	struct mtk_aes_rec *aes = from_tasklet(aes, t, done_task);
 	struct mtk_cryp *cryp = aes->cryp;
 
 	mtk_aes_unmap(cryp, aes);
@@ -1142,10 +1142,8 @@ static int mtk_aes_record_init(struct mtk_cryp *cryp)
 		spin_lock_init(&aes[i]->lock);
 		crypto_init_queue(&aes[i]->queue, AES_QUEUE_SIZE);
 
-		tasklet_init(&aes[i]->queue_task, mtk_aes_queue_task,
-			     (unsigned long)aes[i]);
-		tasklet_init(&aes[i]->done_task, mtk_aes_done_task,
-			     (unsigned long)aes[i]);
+		tasklet_setup(&aes[i]->queue_task, mtk_aes_queue_task);
+		tasklet_setup(&aes[i]->done_task, mtk_aes_done_task);
 	}
 
 	/* Link to ring0 and ring1 respectively */
diff --git a/drivers/crypto/mediatek/mtk-sha.c b/drivers/crypto/mediatek/mtk-sha.c
index 3d5d7d68b03b..1f55f6143fb7 100644
--- a/drivers/crypto/mediatek/mtk-sha.c
+++ b/drivers/crypto/mediatek/mtk-sha.c
@@ -1163,16 +1163,16 @@ static struct ahash_alg algs_sha384_sha512[] = {
 },
 };
 
-static void mtk_sha_queue_task(unsigned long data)
+static void mtk_sha_queue_task(struct tasklet_struct *t)
 {
-	struct mtk_sha_rec *sha = (struct mtk_sha_rec *)data;
+	struct mtk_sha_rec *sha = from_tasklet(sha, t, queue_task);
 
 	mtk_sha_handle_queue(sha->cryp, sha->id - MTK_RING2, NULL);
 }
 
-static void mtk_sha_done_task(unsigned long data)
+static void mtk_sha_done_task(struct tasklet_struct *t)
 {
-	struct mtk_sha_rec *sha = (struct mtk_sha_rec *)data;
+	struct mtk_sha_rec *sha = from_tasklet(sha, t, done_task);
 	struct mtk_cryp *cryp = sha->cryp;
 
 	mtk_sha_unmap(cryp, sha);
@@ -1218,10 +1218,8 @@ static int mtk_sha_record_init(struct mtk_cryp *cryp)
 		spin_lock_init(&sha[i]->lock);
 		crypto_init_queue(&sha[i]->queue, SHA_QUEUE_SIZE);
 
-		tasklet_init(&sha[i]->queue_task, mtk_sha_queue_task,
-			     (unsigned long)sha[i]);
-		tasklet_init(&sha[i]->done_task, mtk_sha_done_task,
-			     (unsigned long)sha[i]);
+		tasklet_setup(&sha[i]->queue_task, mtk_sha_queue_task);
+		tasklet_setup(&sha[i]->done_task, mtk_sha_done_task);
 	}
 
 	/* Link to ring2 and ring3 respectively */
-- 
2.25.1


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

* [RESEND 12/19] crypto: omap: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
                   ` (10 preceding siblings ...)
  2020-12-07  8:59 ` [RESEND 11/19] crypto: mediatek: " Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-07  8:59 ` [RESEND 13/19] crypto: picoxcell: " Allen Pais
                   ` (7 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais, Romain Perier

From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
---
 drivers/crypto/omap-aes.c  | 6 +++---
 drivers/crypto/omap-des.c  | 6 +++---
 drivers/crypto/omap-sham.c | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
index 4fd14d90cc40..4eae24167a5d 100644
--- a/drivers/crypto/omap-aes.c
+++ b/drivers/crypto/omap-aes.c
@@ -502,9 +502,9 @@ static void omap_aes_copy_ivout(struct omap_aes_dev *dd, u8 *ivbuf)
 		((u32 *)ivbuf)[i] = omap_aes_read(dd, AES_REG_IV(dd, i));
 }
 
-static void omap_aes_done_task(unsigned long data)
+static void omap_aes_done_task(struct tasklet_struct *t)
 {
-	struct omap_aes_dev *dd = (struct omap_aes_dev *)data;
+	struct omap_aes_dev *dd = from_tasklet(dd, t, done_task);
 
 	pr_debug("enter done_task\n");
 
@@ -1150,7 +1150,7 @@ static int omap_aes_probe(struct platform_device *pdev)
 		 (reg & dd->pdata->major_mask) >> dd->pdata->major_shift,
 		 (reg & dd->pdata->minor_mask) >> dd->pdata->minor_shift);
 
-	tasklet_init(&dd->done_task, omap_aes_done_task, (unsigned long)dd);
+	tasklet_setup(&dd->done_task, omap_aes_done_task);
 
 	err = omap_aes_dma_init(dd);
 	if (err == -EPROBE_DEFER) {
diff --git a/drivers/crypto/omap-des.c b/drivers/crypto/omap-des.c
index c9d38bcfd1c7..fddcfc3ba57b 100644
--- a/drivers/crypto/omap-des.c
+++ b/drivers/crypto/omap-des.c
@@ -594,9 +594,9 @@ static int omap_des_crypt_req(struct crypto_engine *engine,
 	return omap_des_crypt_dma_start(dd);
 }
 
-static void omap_des_done_task(unsigned long data)
+static void omap_des_done_task(struct tasklet_struct *t)
 {
-	struct omap_des_dev *dd = (struct omap_des_dev *)data;
+	struct omap_des_dev *dd = from_tasklet(dd, t, done_task);
 	int i;
 
 	pr_debug("enter done_task\n");
@@ -1011,7 +1011,7 @@ static int omap_des_probe(struct platform_device *pdev)
 		 (reg & dd->pdata->major_mask) >> dd->pdata->major_shift,
 		 (reg & dd->pdata->minor_mask) >> dd->pdata->minor_shift);
 
-	tasklet_init(&dd->done_task, omap_des_done_task, (unsigned long)dd);
+	tasklet_setup(&dd->done_task, omap_des_done_task);
 
 	err = omap_des_dma_init(dd);
 	if (err == -EPROBE_DEFER) {
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index a3b38d2c92e7..b0fa0443793b 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -1724,9 +1724,9 @@ static struct ahash_alg algs_sha384_sha512[] = {
 },
 };
 
-static void omap_sham_done_task(unsigned long data)
+static void omap_sham_done_task(struct tasklet_struct *t)
 {
-	struct omap_sham_dev *dd = (struct omap_sham_dev *)data;
+	struct omap_sham_dev *dd = from_tasklet(dd, t, done_task);
 	int err = 0;
 
 	dev_dbg(dd->dev, "%s: flags=%lx\n", __func__, dd->flags);
@@ -2083,7 +2083,7 @@ static int omap_sham_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, dd);
 
 	INIT_LIST_HEAD(&dd->list);
-	tasklet_init(&dd->done_task, omap_sham_done_task, (unsigned long)dd);
+	tasklet_setup(&dd->done_task, omap_sham_done_task);
 	crypto_init_queue(&dd->queue, OMAP_SHAM_QUEUE_LENGTH);
 
 	err = (dev->of_node) ? omap_sham_get_res_of(dd, dev, &res) :
-- 
2.25.1


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

* [RESEND 13/19] crypto: picoxcell: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
                   ` (11 preceding siblings ...)
  2020-12-07  8:59 ` [RESEND 12/19] crypto: omap: " Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-07  8:59 ` [RESEND 14/19] crypto: qat: " Allen Pais
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais, Romain Perier

From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
---
 drivers/crypto/picoxcell_crypto.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/picoxcell_crypto.c b/drivers/crypto/picoxcell_crypto.c
index fb34bf92861d..e96fd1caba14 100644
--- a/drivers/crypto/picoxcell_crypto.c
+++ b/drivers/crypto/picoxcell_crypto.c
@@ -1136,9 +1136,9 @@ static int spacc_req_submit(struct spacc_req *req)
 		return spacc_ablk_submit(req);
 }
 
-static void spacc_spacc_complete(unsigned long data)
+static void spacc_spacc_complete(struct tasklet_struct *t)
 {
-	struct spacc_engine *engine = (struct spacc_engine *)data;
+	struct spacc_engine *engine = from_tasklet(engine, t, complete);
 	struct spacc_req *req, *tmp;
 	unsigned long flags;
 	LIST_HEAD(completed);
@@ -1648,8 +1648,7 @@ static int spacc_probe(struct platform_device *pdev)
 		return -ENXIO;
 	}
 
-	tasklet_init(&engine->complete, spacc_spacc_complete,
-		     (unsigned long)engine);
+	tasklet_setup(&engine->complete, spacc_spacc_complete);
 
 	ret = devm_add_action(&pdev->dev, spacc_tasklet_kill,
 			      &engine->complete);
-- 
2.25.1


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

* [RESEND 14/19] crypto: qat: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
                   ` (12 preceding siblings ...)
  2020-12-07  8:59 ` [RESEND 13/19] crypto: picoxcell: " Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-07  8:59 ` [RESEND 15/19] crypto: qce: " Allen Pais
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais, Romain Perier

From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
---
 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 ++--
 .../crypto/qat/qat_common/adf_transport_internal.h    |  2 +-
 drivers/crypto/qat/qat_common/adf_vf_isr.c            | 11 +++++------
 5 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/drivers/crypto/qat/qat_common/adf_isr.c b/drivers/crypto/qat/qat_common/adf_isr.c
index 36136f7db509..2c725c01ee4f 100644
--- a/drivers/crypto/qat/qat_common/adf_isr.c
+++ b/drivers/crypto/qat/qat_common/adf_isr.c
@@ -239,9 +239,8 @@ static int adf_setup_bh(struct adf_accel_dev *accel_dev)
 	int i;
 
 	for (i = 0; i < hw_data->num_banks; i++)
-		tasklet_init(&priv_data->banks[i].resp_handler,
-			     adf_response_handler,
-			     (unsigned long)&priv_data->banks[i]);
+		tasklet_setup(&priv_data->banks[i].resp_handler,
+			     adf_response_handler);
 	return 0;
 }
 
diff --git a/drivers/crypto/qat/qat_common/adf_sriov.c b/drivers/crypto/qat/qat_common/adf_sriov.c
index 963b2bea78f2..f9e276cb6f23 100644
--- a/drivers/crypto/qat/qat_common/adf_sriov.c
+++ b/drivers/crypto/qat/qat_common/adf_sriov.c
@@ -49,9 +49,10 @@ static void adf_iov_send_resp(struct work_struct *work)
 	kfree(pf2vf_resp);
 }
 
-static void adf_vf2pf_bh_handler(void *data)
+static void adf_vf2pf_bh_handler(struct tasklet_struct *t)
 {
-	struct adf_accel_vf_info *vf_info = (struct adf_accel_vf_info *)data;
+	struct adf_accel_vf_info *vf_info =
+				 from_tasklet(vf_info, t, vf2pf_bh_tasklet);
 	struct adf_pf2vf_resp *pf2vf_resp;
 
 	pf2vf_resp = kzalloc(sizeof(*pf2vf_resp), GFP_ATOMIC);
@@ -81,9 +82,8 @@ static int adf_enable_sriov(struct adf_accel_dev *accel_dev)
 		vf_info->accel_dev = accel_dev;
 		vf_info->vf_nr = i;
 
-		tasklet_init(&vf_info->vf2pf_bh_tasklet,
-			     (void *)adf_vf2pf_bh_handler,
-			     (unsigned long)vf_info);
+		tasklet_setup(&vf_info->vf2pf_bh_tasklet,
+			     adf_vf2pf_bh_handler);
 		mutex_init(&vf_info->pf2vf_lock);
 		ratelimit_state_init(&vf_info->vf2pf_ratelimit,
 				     DEFAULT_RATELIMIT_INTERVAL,
diff --git a/drivers/crypto/qat/qat_common/adf_transport.c b/drivers/crypto/qat/qat_common/adf_transport.c
index 2ad774017200..60982c67b466 100644
--- a/drivers/crypto/qat/qat_common/adf_transport.c
+++ b/drivers/crypto/qat/qat_common/adf_transport.c
@@ -297,9 +297,9 @@ static void adf_ring_response_handler(struct adf_etr_bank_data *bank)
 	}
 }
 
-void adf_response_handler(uintptr_t bank_addr)
+void adf_response_handler(struct tasklet_struct *t)
 {
-	struct adf_etr_bank_data *bank = (void *)bank_addr;
+	struct adf_etr_bank_data *bank = from_tasklet(bank, t, resp_handler);
 
 	/* Handle all the responses and reenable IRQs */
 	adf_ring_response_handler(bank);
diff --git a/drivers/crypto/qat/qat_common/adf_transport_internal.h b/drivers/crypto/qat/qat_common/adf_transport_internal.h
index c7faf4e2d302..ff891f5bc783 100644
--- a/drivers/crypto/qat/qat_common/adf_transport_internal.h
+++ b/drivers/crypto/qat/qat_common/adf_transport_internal.h
@@ -46,7 +46,7 @@ struct adf_etr_data {
 	struct dentry *debug;
 };
 
-void adf_response_handler(uintptr_t bank_addr);
+void adf_response_handler(struct tasklet_struct *t);
 #ifdef CONFIG_DEBUG_FS
 #include <linux/debugfs.h>
 int adf_bank_debugfs_add(struct adf_etr_bank_data *bank);
diff --git a/drivers/crypto/qat/qat_common/adf_vf_isr.c b/drivers/crypto/qat/qat_common/adf_vf_isr.c
index c4a44dc6af3e..79c0d51ea263 100644
--- a/drivers/crypto/qat/qat_common/adf_vf_isr.c
+++ b/drivers/crypto/qat/qat_common/adf_vf_isr.c
@@ -68,9 +68,10 @@ static void adf_dev_stop_async(struct work_struct *work)
 	kfree(stop_data);
 }
 
-static void adf_pf2vf_bh_handler(void *data)
+static void adf_pf2vf_bh_handler(struct tasklet_struct *t)
 {
-	struct adf_accel_dev *accel_dev = data;
+	struct adf_accel_dev *accel_dev = from_tasklet(accel_dev, t,
+						       vf.pf2vf_bh_tasklet);
 	struct adf_hw_device_data *hw_data = accel_dev->hw_device;
 	struct adf_bar *pmisc =
 			&GET_BARS(accel_dev)[hw_data->get_misc_bar_id(hw_data)];
@@ -138,8 +139,7 @@ static void adf_pf2vf_bh_handler(void *data)
 
 static int adf_setup_pf2vf_bh(struct adf_accel_dev *accel_dev)
 {
-	tasklet_init(&accel_dev->vf.pf2vf_bh_tasklet,
-		     (void *)adf_pf2vf_bh_handler, (unsigned long)accel_dev);
+	tasklet_setup(&accel_dev->vf.pf2vf_bh_tasklet, adf_pf2vf_bh_handler);
 
 	mutex_init(&accel_dev->vf.vf2pf_lock);
 	return 0;
@@ -215,8 +215,7 @@ static int adf_setup_bh(struct adf_accel_dev *accel_dev)
 {
 	struct adf_etr_data *priv_data = accel_dev->transport;
 
-	tasklet_init(&priv_data->banks[0].resp_handler, adf_response_handler,
-		     (unsigned long)priv_data->banks);
+	tasklet_setup(&priv_data->banks[0].resp_handler, adf_response_handler);
 	return 0;
 }
 
-- 
2.25.1


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

* [RESEND 15/19] crypto: qce: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
                   ` (13 preceding siblings ...)
  2020-12-07  8:59 ` [RESEND 14/19] crypto: qat: " Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-07  8:59 ` [RESEND 16/19] crypto: rockchip: " Allen Pais
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais, Romain Perier

From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
---
 drivers/crypto/qce/core.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/qce/core.c b/drivers/crypto/qce/core.c
index ea616b7259ae..b817c74a281c 100644
--- a/drivers/crypto/qce/core.c
+++ b/drivers/crypto/qce/core.c
@@ -117,9 +117,9 @@ static int qce_handle_queue(struct qce_device *qce,
 	return ret;
 }
 
-static void qce_tasklet_req_done(unsigned long data)
+static void qce_tasklet_req_done(struct tasklet_struct *t)
 {
-	struct qce_device *qce = (struct qce_device *)data;
+	struct qce_device *qce = from_tasklet(qce, t, done_tasklet);
 	struct crypto_async_request *req;
 	unsigned long flags;
 
@@ -222,8 +222,7 @@ static int qce_crypto_probe(struct platform_device *pdev)
 		goto err_clks;
 
 	spin_lock_init(&qce->lock);
-	tasklet_init(&qce->done_tasklet, qce_tasklet_req_done,
-		     (unsigned long)qce);
+	tasklet_setup(&qce->done_tasklet, qce_tasklet_req_done);
 	crypto_init_queue(&qce->queue, QCE_QUEUE_LENGTH);
 
 	qce->async_req_enqueue = qce_async_request_enqueue;
-- 
2.25.1


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

* [RESEND 16/19] crypto: rockchip: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
                   ` (14 preceding siblings ...)
  2020-12-07  8:59 ` [RESEND 15/19] crypto: qce: " Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-07  8:59 ` [RESEND 17/19] crypto: s5p: " Allen Pais
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais, Romain Perier

From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
---
 drivers/crypto/rockchip/rk3288_crypto.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/crypto/rockchip/rk3288_crypto.c b/drivers/crypto/rockchip/rk3288_crypto.c
index 35d73061d156..af6ad9f49009 100644
--- a/drivers/crypto/rockchip/rk3288_crypto.c
+++ b/drivers/crypto/rockchip/rk3288_crypto.c
@@ -201,9 +201,9 @@ static int rk_crypto_enqueue(struct rk_crypto_info *dev,
 	return ret;
 }
 
-static void rk_crypto_queue_task_cb(unsigned long data)
+static void rk_crypto_queue_task_cb(struct tasklet_struct *T)
 {
-	struct rk_crypto_info *dev = (struct rk_crypto_info *)data;
+	struct rk_crypto_info *dev = from_tasklet(dev, t, queue_task);
 	struct crypto_async_request *async_req, *backlog;
 	unsigned long flags;
 	int err = 0;
@@ -231,9 +231,9 @@ static void rk_crypto_queue_task_cb(unsigned long data)
 		dev->complete(dev->async_req, err);
 }
 
-static void rk_crypto_done_task_cb(unsigned long data)
+static void rk_crypto_done_task_cb(struct tasklet_struct *t)
 {
-	struct rk_crypto_info *dev = (struct rk_crypto_info *)data;
+	struct rk_crypto_info *dev = from_tasklet(dev, t, done_task);
 
 	if (dev->err) {
 		dev->complete(dev->async_req, dev->err);
@@ -389,10 +389,8 @@ static int rk_crypto_probe(struct platform_device *pdev)
 	crypto_info->dev = &pdev->dev;
 	platform_set_drvdata(pdev, crypto_info);
 
-	tasklet_init(&crypto_info->queue_task,
-		     rk_crypto_queue_task_cb, (unsigned long)crypto_info);
-	tasklet_init(&crypto_info->done_task,
-		     rk_crypto_done_task_cb, (unsigned long)crypto_info);
+	tasklet_setup(&crypto_info->queue_task, rk_crypto_queue_task_cb);
+	tasklet_setup(&crypto_info->done_task, rk_crypto_done_task_cb);
 	crypto_init_queue(&crypto_info->queue, 50);
 
 	crypto_info->enable_clk = rk_crypto_enable_clk;
-- 
2.25.1


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

* [RESEND 17/19] crypto: s5p: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
                   ` (15 preceding siblings ...)
  2020-12-07  8:59 ` [RESEND 16/19] crypto: rockchip: " Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-07  9:50   ` Krzysztof Kozlowski
  2020-12-07  8:59 ` [RESEND 18/19] crypto: talitos: " Allen Pais
                   ` (2 subsequent siblings)
  19 siblings, 1 reply; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais, Romain Perier

From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
---
 drivers/crypto/s5p-sss.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c
index 88a6c853ffd7..81d5222d5e63 100644
--- a/drivers/crypto/s5p-sss.c
+++ b/drivers/crypto/s5p-sss.c
@@ -1444,9 +1444,9 @@ static int s5p_hash_handle_queue(struct s5p_aes_dev *dd,
  * s5p_hash_tasklet_cb() - hash tasklet
  * @data:	ptr to s5p_aes_dev
  */
-static void s5p_hash_tasklet_cb(unsigned long data)
+static void s5p_hash_tasklet_cb(struct tasklet_struct *t)
 {
-	struct s5p_aes_dev *dd = (struct s5p_aes_dev *)data;
+	struct s5p_aes_dev *dd = from_tasklet(dd, t, hash_tasklet);
 
 	if (!test_bit(HASH_FLAGS_BUSY, &dd->hash_flags)) {
 		s5p_hash_handle_queue(dd, NULL);
@@ -1974,9 +1974,9 @@ static void s5p_aes_crypt_start(struct s5p_aes_dev *dev, unsigned long mode)
 	s5p_aes_complete(req, err);
 }
 
-static void s5p_tasklet_cb(unsigned long data)
+static void s5p_tasklet_cb(struct tasklet_struct *t)
 {
-	struct s5p_aes_dev *dev = (struct s5p_aes_dev *)data;
+	struct s5p_aes_dev *dev = from_tasklet(dev, t, tasklet);
 	struct crypto_async_request *async_req, *backlog;
 	struct s5p_aes_reqctx *reqctx;
 	unsigned long flags;
@@ -2257,7 +2257,7 @@ static int s5p_aes_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, pdata);
 	s5p_dev = pdata;
 
-	tasklet_init(&pdata->tasklet, s5p_tasklet_cb, (unsigned long)pdata);
+	tasklet_setup(&pdata->tasklet, s5p_tasklet_cb);
 	crypto_init_queue(&pdata->queue, CRYPTO_QUEUE_LEN);
 
 	for (i = 0; i < ARRAY_SIZE(algs); i++) {
@@ -2267,8 +2267,7 @@ static int s5p_aes_probe(struct platform_device *pdev)
 	}
 
 	if (pdata->use_hash) {
-		tasklet_init(&pdata->hash_tasklet, s5p_hash_tasklet_cb,
-			     (unsigned long)pdata);
+		tasklet_setup(&pdata->hash_tasklet, s5p_hash_tasklet_cb);
 		crypto_init_queue(&pdata->hash_queue, SSS_HASH_QUEUE_LENGTH);
 
 		for (hash_i = 0; hash_i < ARRAY_SIZE(algs_sha1_md5_sha256);
-- 
2.25.1


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

* [RESEND 18/19] crypto: talitos: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
                   ` (16 preceding siblings ...)
  2020-12-07  8:59 ` [RESEND 17/19] crypto: s5p: " Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-07  8:59 ` [RESEND 19/19] crypto: octeontx: " Allen Pais
  2020-12-07  9:13 ` [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Krzysztof Kozlowski
  19 siblings, 0 replies; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais, Romain Perier

From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
---
 drivers/crypto/talitos.c | 42 ++++++++++++++++++----------------------
 1 file changed, 19 insertions(+), 23 deletions(-)

diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index 66773892f665..7cc985ce0766 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -402,10 +402,11 @@ static void flush_channel(struct device *dev, int ch, int error, int reset_ch)
  * process completed requests for channels that have done status
  */
 #define DEF_TALITOS1_DONE(name, ch_done_mask)				\
-static void talitos1_done_##name(unsigned long data)			\
+static void talitos1_done_##name(struct tasklet_struct *t)		\
 {									\
-	struct device *dev = (struct device *)data;			\
-	struct talitos_private *priv = dev_get_drvdata(dev);		\
+	struct talitos_private *priv = from_tasklet(priv, t,		\
+		done_task[0]);						\
+	struct device *dev = priv->dev;					\
 	unsigned long flags;						\
 									\
 	if (ch_done_mask & 0x10000000)					\
@@ -428,11 +429,12 @@ static void talitos1_done_##name(unsigned long data)			\
 DEF_TALITOS1_DONE(4ch, TALITOS1_ISR_4CHDONE)
 DEF_TALITOS1_DONE(ch0, TALITOS1_ISR_CH_0_DONE)
 
-#define DEF_TALITOS2_DONE(name, ch_done_mask)				\
-static void talitos2_done_##name(unsigned long data)			\
+#define DEF_TALITOS2_DONE(name, ch_done_mask, tasklet_idx)		\
+static void talitos2_done_##name(struct tasklet_struct *t)		\
 {									\
-	struct device *dev = (struct device *)data;			\
-	struct talitos_private *priv = dev_get_drvdata(dev);		\
+	struct talitos_private *priv = from_tasklet(priv, t,		\
+		done_task[tasklet_idx]);				\
+	struct device *dev = priv->dev;					\
 	unsigned long flags;						\
 									\
 	if (ch_done_mask & 1)						\
@@ -452,10 +454,10 @@ static void talitos2_done_##name(unsigned long data)			\
 	spin_unlock_irqrestore(&priv->reg_lock, flags);			\
 }
 
-DEF_TALITOS2_DONE(4ch, TALITOS2_ISR_4CHDONE)
-DEF_TALITOS2_DONE(ch0, TALITOS2_ISR_CH_0_DONE)
-DEF_TALITOS2_DONE(ch0_2, TALITOS2_ISR_CH_0_2_DONE)
-DEF_TALITOS2_DONE(ch1_3, TALITOS2_ISR_CH_1_3_DONE)
+DEF_TALITOS2_DONE(4ch, TALITOS2_ISR_4CHDONE, 0)
+DEF_TALITOS2_DONE(ch0, TALITOS2_ISR_CH_0_DONE, 0)
+DEF_TALITOS2_DONE(ch0_2, TALITOS2_ISR_CH_0_2_DONE, 0)
+DEF_TALITOS2_DONE(ch1_3, TALITOS2_ISR_CH_1_3_DONE, 1)
 
 /*
  * locate current (offending) descriptor
@@ -3385,23 +3387,17 @@ static int talitos_probe(struct platform_device *ofdev)
 
 	if (has_ftr_sec1(priv)) {
 		if (priv->num_channels == 1)
-			tasklet_init(&priv->done_task[0], talitos1_done_ch0,
-				     (unsigned long)dev);
+			tasklet_setup(&priv->done_task[0], talitos1_done_ch0);
 		else
-			tasklet_init(&priv->done_task[0], talitos1_done_4ch,
-				     (unsigned long)dev);
+			tasklet_setup(&priv->done_task[0], talitos1_done_4ch);
 	} else {
 		if (priv->irq[1]) {
-			tasklet_init(&priv->done_task[0], talitos2_done_ch0_2,
-				     (unsigned long)dev);
-			tasklet_init(&priv->done_task[1], talitos2_done_ch1_3,
-				     (unsigned long)dev);
+			tasklet_setup(&priv->done_task[0], talitos2_done_ch0_2);
+			tasklet_setup(&priv->done_task[1], talitos2_done_ch1_3);
 		} else if (priv->num_channels == 1) {
-			tasklet_init(&priv->done_task[0], talitos2_done_ch0,
-				     (unsigned long)dev);
+			tasklet_setup(&priv->done_task[0], talitos2_done_ch0);
 		} else {
-			tasklet_init(&priv->done_task[0], talitos2_done_4ch,
-				     (unsigned long)dev);
+			tasklet_setup(&priv->done_task[0], talitos2_done_4ch);
 		}
 	}
 
-- 
2.25.1


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

* [RESEND 19/19] crypto: octeontx: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
                   ` (17 preceding siblings ...)
  2020-12-07  8:59 ` [RESEND 18/19] crypto: talitos: " Allen Pais
@ 2020-12-07  8:59 ` Allen Pais
  2020-12-07  9:13 ` [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Krzysztof Kozlowski
  19 siblings, 0 replies; 26+ messages in thread
From: Allen Pais @ 2020-12-07  8:59 UTC (permalink / raw)
  To: herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, horia.geanta, aymen.sghaier,
	bbrezillon, arno, schalla, matthias.bgg, heiko, krzk, vz,
	k.konieczny, linux-crypto, Allen Pais

From: Allen Pais <apais@microsoft.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: Allen Pais <apais@microsoft.com>
---
 drivers/crypto/marvell/octeontx/otx_cptvf_main.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/crypto/marvell/octeontx/otx_cptvf_main.c b/drivers/crypto/marvell/octeontx/otx_cptvf_main.c
index 228fe8e47e0e..515049cca9e3 100644
--- a/drivers/crypto/marvell/octeontx/otx_cptvf_main.c
+++ b/drivers/crypto/marvell/octeontx/otx_cptvf_main.c
@@ -17,11 +17,12 @@
 #define DRV_NAME	"octeontx-cptvf"
 #define DRV_VERSION	"1.0"
 
-static void vq_work_handler(unsigned long data)
+static void vq_work_handler(struct tasklet_struct *t)
 {
-	struct otx_cptvf_wqe_info *cwqe_info =
-					(struct otx_cptvf_wqe_info *) data;
-
+	struct otx_cptvf_wqe *cwqe = from_tasklet(cwqe, t, twork);
+	struct otx_cptvf_wqe_info *cwqe_info = container_of(cwqe,
+							typeof(*cwqe_info),
+							vq_wqe[0]);
 	otx_cpt_post_process(&cwqe_info->vq_wqe[0]);
 }
 
@@ -41,8 +42,7 @@ static int init_worker_threads(struct otx_cptvf *cptvf)
 	}
 
 	for (i = 0; i < cptvf->num_queues; i++) {
-		tasklet_init(&cwqe_info->vq_wqe[i].twork, vq_work_handler,
-			     (u64)cwqe_info);
+		tasklet_setup(&cwqe_info->vq_wqe[i].twork, vq_work_handler);
 		cwqe_info->vq_wqe[i].cptvf = cptvf;
 	}
 	cptvf->wqe_info = cwqe_info;
-- 
2.25.1


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

* Re: [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API()
  2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
                   ` (18 preceding siblings ...)
  2020-12-07  8:59 ` [RESEND 19/19] crypto: octeontx: " Allen Pais
@ 2020-12-07  9:13 ` Krzysztof Kozlowski
  19 siblings, 0 replies; 26+ messages in thread
From: Krzysztof Kozlowski @ 2020-12-07  9:13 UTC (permalink / raw)
  To: Allen Pais
  Cc: herbert, davem, nicolas.ferre, alexandre.belloni,
	ludovic.desroches, jesper.nilsson, lars.persson, horia.geanta,
	aymen.sghaier, bbrezillon, arno, schalla, matthias.bgg, heiko,
	vz, k.konieczny, linux-crypto, Allen Pais

On Mon, Dec 07, 2020 at 02:29:12PM +0530, Allen Pais wrote:
> From: Allen Pais <apais@linux.microsoft.com>
> 
> 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

Please use the scripts/get_maintainers.pl to get the list of necessary
discussion lists to Cc. You skipped several of them.

Best regards,
Krzysztof

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

* Re: [RESEND 17/19] crypto: s5p: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 ` [RESEND 17/19] crypto: s5p: " Allen Pais
@ 2020-12-07  9:50   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 26+ messages in thread
From: Krzysztof Kozlowski @ 2020-12-07  9:50 UTC (permalink / raw)
  To: Allen Pais
  Cc: herbert, davem, nicolas.ferre, alexandre.belloni,
	ludovic.desroches, jesper.nilsson, lars.persson, horia.geanta,
	aymen.sghaier, bbrezillon, arno, schalla, matthias.bgg, heiko,
	vz, k.konieczny, linux-crypto, Allen Pais, Romain Perier

On Mon, Dec 07, 2020 at 02:29:29PM +0530, Allen Pais wrote:
> From: Allen Pais <apais@microsoft.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.

Wrap your commit msg lines as described in submitting patches.

With the commit msg fixup:
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

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

* Re: [RESEND 07/19] crypto: ccree: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 ` [RESEND 07/19] crypto: ccree: " Allen Pais
@ 2020-12-07 18:23   ` kernel test robot
  2020-12-09  6:46   ` Gilad Ben-Yossef
  1 sibling, 0 replies; 26+ messages in thread
From: kernel test robot @ 2020-12-07 18:23 UTC (permalink / raw)
  To: kbuild-all

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

Hi Allen,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on crypto/master]
[also build test ERROR on rockchip/for-next sparc-next/master v5.10-rc7 next-20201207]
[cannot apply to cryptodev/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Allen-Pais/crypto-convert-tasklets-to-use-new-tasklet_setup-API/20201207-170424
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git master
config: powerpc-randconfig-m031-20201207 (attached as .config)
compiler: powerpc64le-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/ecb2ecb81c98d4b5b97ac311cc967a806adf0681
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Allen-Pais/crypto-convert-tasklets-to-use-new-tasklet_setup-API/20201207-170424
        git checkout ecb2ecb81c98d4b5b97ac311cc967a806adf0681
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/crypto/ccree/cc_fips.c:112:13: error: conflicting types for 'fips_dsr'
     112 | static void fips_dsr(struct tasklet_struct *t)
         |             ^~~~~~~~
   drivers/crypto/ccree/cc_fips.c:11:13: note: previous declaration of 'fips_dsr' was here
      11 | static void fips_dsr(unsigned long devarg);
         |             ^~~~~~~~
   In file included from <command-line>:
   drivers/crypto/ccree/cc_fips.c: In function 'fips_dsr':
>> include/linux/kernel.h:1002:51: error: 'struct cc_drvdata' has no member named 'tasklet'
    1002 |  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
         |                                                   ^~
   include/linux/compiler_types.h:299:9: note: in definition of macro '__compiletime_assert'
     299 |   if (!(condition))     \
         |         ^~~~~~~~~
   include/linux/compiler_types.h:319:2: note: in expansion of macro '_compiletime_assert'
     319 |  _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |  ^~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
      39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
         |                                     ^~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:1002:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
    1002 |  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
         |  ^~~~~~~~~~~~~~~~
   include/linux/kernel.h:1002:20: note: in expansion of macro '__same_type'
    1002 |  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
         |                    ^~~~~~~~~~~
   include/linux/interrupt.h:637:2: note: in expansion of macro 'container_of'
     637 |  container_of(callback_tasklet, typeof(*var), tasklet_fieldname)
         |  ^~~~~~~~~~~~
   drivers/crypto/ccree/cc_fips.c:114:31: note: in expansion of macro 'from_tasklet'
     114 |  struct cc_drvdata *drvdata = from_tasklet(drvdata, t, tasklet);
         |                               ^~~~~~~~~~~~
>> include/linux/compiler_types.h:135:35: error: 'struct cc_drvdata' has no member named 'tasklet'
     135 | #define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
         |                                   ^~~~~~~~~~~~~~~~~~
   include/linux/stddef.h:17:32: note: in expansion of macro '__compiler_offsetof'
      17 | #define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
         |                                ^~~~~~~~~~~~~~~~~~~
   include/linux/kernel.h:1005:21: note: in expansion of macro 'offsetof'
    1005 |  ((type *)(__mptr - offsetof(type, member))); })
         |                     ^~~~~~~~
   include/linux/interrupt.h:637:2: note: in expansion of macro 'container_of'
     637 |  container_of(callback_tasklet, typeof(*var), tasklet_fieldname)
         |  ^~~~~~~~~~~~
   drivers/crypto/ccree/cc_fips.c:114:31: note: in expansion of macro 'from_tasklet'
     114 |  struct cc_drvdata *drvdata = from_tasklet(drvdata, t, tasklet);
         |                               ^~~~~~~~~~~~

vim +/fips_dsr +112 drivers/crypto/ccree/cc_fips.c

   110	
   111	/* Deferred service handler, run as interrupt-fired tasklet */
 > 112	static void fips_dsr(struct tasklet_struct *t)
   113	{
   114		struct cc_drvdata *drvdata = from_tasklet(drvdata, t, tasklet);
   115		u32 irq, val;
   116	
   117		irq = (drvdata->irq & (CC_GPR0_IRQ_MASK));
   118	
   119		if (irq) {
   120			cc_tee_handle_fips_error(drvdata);
   121		}
   122	
   123		/* after verifying that there is nothing to do,
   124		 * unmask AXI completion interrupt.
   125		 */
   126		val = (CC_REG(HOST_IMR) & ~irq);
   127		cc_iowrite(drvdata, CC_REG(HOST_IMR), val);
   128	}
   129	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30422 bytes --]

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

* Re: [RESEND 07/19] crypto: ccree: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 ` [RESEND 07/19] crypto: ccree: " Allen Pais
  2020-12-07 18:23   ` kernel test robot
@ 2020-12-09  6:46   ` Gilad Ben-Yossef
  2020-12-09 11:35     ` Allen
  1 sibling, 1 reply; 26+ messages in thread
From: Gilad Ben-Yossef @ 2020-12-09  6:46 UTC (permalink / raw)
  To: Allen Pais
  Cc: Herbert Xu, David Miller, nicolas.ferre, alexandre.belloni,
	ludovic.desroches, jesper.nilsson, lars.persson,
	Horia Geantă,
	aymen.sghaier, bbrezillon, Arnaud Ebalard, schalla,
	Matthias Brugger, heiko, krzk, vz, k.konieczny,
	Linux Crypto Mailing List, Allen Pais, Romain Perier

Hi Allen,

Thank you for the patch.

Please make sure to CC maintainers on changes to drivers they
maintain, otherwise it's hard to keep track. Thanks!

On Mon, Dec 7, 2020 at 11:02 AM Allen Pais <allen.lkml@gmail.com> wrote:
>
> From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
> ---
>  drivers/crypto/ccree/cc_fips.c        |  6 +++---
>  drivers/crypto/ccree/cc_request_mgr.c | 12 ++++++------
>  2 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/crypto/ccree/cc_fips.c b/drivers/crypto/ccree/cc_fips.c
> index 702aefc21447..bad228a36776 100644
> --- a/drivers/crypto/ccree/cc_fips.c
> +++ b/drivers/crypto/ccree/cc_fips.c
> @@ -109,9 +109,9 @@ void cc_tee_handle_fips_error(struct cc_drvdata *p_drvdata)
>  }
>
>  /* Deferred service handler, run as interrupt-fired tasklet */
> -static void fips_dsr(unsigned long devarg)
> +static void fips_dsr(struct tasklet_struct *t)

Sorry for the nitpick, but I would really prefer to have a more
meaningful name for this parameter than just 't'.

tasklet, task, tsk... any descriptive name is fine.

>  {
> -       struct cc_drvdata *drvdata = (struct cc_drvdata *)devarg;
> +       struct cc_drvdata *drvdata = from_tasklet(drvdata, t, tasklet);
>         u32 irq, val;
>
>         irq = (drvdata->irq & (CC_GPR0_IRQ_MASK));
> @@ -143,7 +143,7 @@ int cc_fips_init(struct cc_drvdata *p_drvdata)
>         p_drvdata->fips_handle = fips_h;
>
>         dev_dbg(dev, "Initializing fips tasklet\n");
> -       tasklet_init(&fips_h->tasklet, fips_dsr, (unsigned long)p_drvdata);
> +       tasklet_setup(&fips_h->tasklet, fips_dsr);
>         fips_h->drvdata = p_drvdata;
>         fips_h->nb.notifier_call = cc_ree_fips_failure;
>         atomic_notifier_chain_register(&fips_fail_notif_chain, &fips_h->nb);
> diff --git a/drivers/crypto/ccree/cc_request_mgr.c b/drivers/crypto/ccree/cc_request_mgr.c
> index 33fb27745d52..ec0f3bf00d33 100644
> --- a/drivers/crypto/ccree/cc_request_mgr.c
> +++ b/drivers/crypto/ccree/cc_request_mgr.c
> @@ -70,7 +70,7 @@ static const u32 cc_cpp_int_masks[CC_CPP_NUM_ALGS][CC_CPP_NUM_SLOTS] = {
>           BIT(CC_HOST_IRR_REE_OP_ABORTED_SM_7_INT_BIT_SHIFT) }
>  };
>
> -static void comp_handler(unsigned long devarg);
> +static void comp_handler(struct tasklet_struct *t);
>  #ifdef COMP_IN_WQ
>  static void comp_work_handler(struct work_struct *work);
>  #endif
> @@ -140,8 +140,7 @@ int cc_req_mgr_init(struct cc_drvdata *drvdata)
>         INIT_DELAYED_WORK(&req_mgr_h->compwork, comp_work_handler);
>  #else
>         dev_dbg(dev, "Initializing completion tasklet\n");
> -       tasklet_init(&req_mgr_h->comptask, comp_handler,
> -                    (unsigned long)drvdata);
> +       tasklet_setup(&req_mgr_h->comptask, comp_handler);
>  #endif
>         req_mgr_h->hw_queue_size = cc_ioread(drvdata,
>                                              CC_REG(DSCRPTR_QUEUE_SRAM_SIZE));
> @@ -611,11 +610,12 @@ static inline u32 cc_axi_comp_count(struct cc_drvdata *drvdata)
>  }
>
>  /* Deferred service handler, run as interrupt-fired tasklet */
> -static void comp_handler(unsigned long devarg)
> +static void comp_handler(struct tasklet_struct *t)
>  {
> -       struct cc_drvdata *drvdata = (struct cc_drvdata *)devarg;
>         struct cc_req_mgr_handle *request_mgr_handle =
> -                                               drvdata->request_mgr_handle;
> +                               from_tasklet(request_mgr_handle, t, comptask);
> +       struct cc_drvdata *drvdata = container_of((void *)request_mgr_handle,
> +                                    typeof(*drvdata), request_mgr_handle);
>         struct device *dev = drvdata_to_dev(drvdata);
>         u32 irq;
>
> --
> 2.25.1
>

Other than that it looks good to me.

Thanks,
Gilad

-- 
Gilad Ben-Yossef
Chief Coffee Drinker

values of β will give rise to dom!

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

* Re: [RESEND 07/19] crypto: ccree: convert tasklets to use new tasklet_setup() API
  2020-12-09  6:46   ` Gilad Ben-Yossef
@ 2020-12-09 11:35     ` Allen
  0 siblings, 0 replies; 26+ messages in thread
From: Allen @ 2020-12-09 11:35 UTC (permalink / raw)
  To: Gilad Ben-Yossef
  Cc: Herbert Xu, David Miller, nicolas.ferre, alexandre.belloni,
	ludovic.desroches, jesper.nilsson, lars.persson,
	Horia Geantă,
	aymen.sghaier, bbrezillon, Arnaud Ebalard, schalla,
	Matthias Brugger, heiko, krzk, vz, k.konieczny,
	Linux Crypto Mailing List, Allen Pais, Romain Perier

> >
> > Signed-off-by: Romain Perier <romain.perier@gmail.com>
> > Signed-off-by: Allen Pais <apais@microsoft.com>
> > ---
> >  drivers/crypto/ccree/cc_fips.c        |  6 +++---
> >  drivers/crypto/ccree/cc_request_mgr.c | 12 ++++++------
> >  2 files changed, 9 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/crypto/ccree/cc_fips.c b/drivers/crypto/ccree/cc_fips.c
> > index 702aefc21447..bad228a36776 100644
> > --- a/drivers/crypto/ccree/cc_fips.c
> > +++ b/drivers/crypto/ccree/cc_fips.c
> > @@ -109,9 +109,9 @@ void cc_tee_handle_fips_error(struct cc_drvdata *p_drvdata)
> >  }
> >
> >  /* Deferred service handler, run as interrupt-fired tasklet */
> > -static void fips_dsr(unsigned long devarg)
> > +static void fips_dsr(struct tasklet_struct *t)
>
> Sorry for the nitpick, but I would really prefer to have a more
> meaningful name for this parameter than just 't'.
>
> tasklet, task, tsk... any descriptive name is fine.
>

 Sure, I will fix it and send out V2.

Thanks.

> >  {
> > -       struct cc_drvdata *drvdata = (struct cc_drvdata *)devarg;
> > +       struct cc_drvdata *drvdata = from_tasklet(drvdata, t, tasklet);
> >         u32 irq, val;
> >
> >         irq = (drvdata->irq & (CC_GPR0_IRQ_MASK));
> > @@ -143,7 +143,7 @@ int cc_fips_init(struct cc_drvdata *p_drvdata)
> >         p_drvdata->fips_handle = fips_h;
> >
> >         dev_dbg(dev, "Initializing fips tasklet\n");
> > -       tasklet_init(&fips_h->tasklet, fips_dsr, (unsigned long)p_drvdata);
> > +       tasklet_setup(&fips_h->tasklet, fips_dsr);
> >         fips_h->drvdata = p_drvdata;
> >         fips_h->nb.notifier_call = cc_ree_fips_failure;
> >         atomic_notifier_chain_register(&fips_fail_notif_chain, &fips_h->nb);
> > diff --git a/drivers/crypto/ccree/cc_request_mgr.c b/drivers/crypto/ccree/cc_request_mgr.c
> > index 33fb27745d52..ec0f3bf00d33 100644
> > --- a/drivers/crypto/ccree/cc_request_mgr.c
> > +++ b/drivers/crypto/ccree/cc_request_mgr.c
> > @@ -70,7 +70,7 @@ static const u32 cc_cpp_int_masks[CC_CPP_NUM_ALGS][CC_CPP_NUM_SLOTS] = {
> >           BIT(CC_HOST_IRR_REE_OP_ABORTED_SM_7_INT_BIT_SHIFT) }
> >  };
> >
> > -static void comp_handler(unsigned long devarg);
> > +static void comp_handler(struct tasklet_struct *t);
> >  #ifdef COMP_IN_WQ
> >  static void comp_work_handler(struct work_struct *work);
> >  #endif
> > @@ -140,8 +140,7 @@ int cc_req_mgr_init(struct cc_drvdata *drvdata)
> >         INIT_DELAYED_WORK(&req_mgr_h->compwork, comp_work_handler);
> >  #else
> >         dev_dbg(dev, "Initializing completion tasklet\n");
> > -       tasklet_init(&req_mgr_h->comptask, comp_handler,
> > -                    (unsigned long)drvdata);
> > +       tasklet_setup(&req_mgr_h->comptask, comp_handler);
> >  #endif
> >         req_mgr_h->hw_queue_size = cc_ioread(drvdata,
> >                                              CC_REG(DSCRPTR_QUEUE_SRAM_SIZE));
> > @@ -611,11 +610,12 @@ static inline u32 cc_axi_comp_count(struct cc_drvdata *drvdata)
> >  }
> >
> >  /* Deferred service handler, run as interrupt-fired tasklet */
> > -static void comp_handler(unsigned long devarg)
> > +static void comp_handler(struct tasklet_struct *t)
> >  {
> > -       struct cc_drvdata *drvdata = (struct cc_drvdata *)devarg;
> >         struct cc_req_mgr_handle *request_mgr_handle =
> > -                                               drvdata->request_mgr_handle;
> > +                               from_tasklet(request_mgr_handle, t, comptask);
> > +       struct cc_drvdata *drvdata = container_of((void *)request_mgr_handle,
> > +                                    typeof(*drvdata), request_mgr_handle);
> >         struct device *dev = drvdata_to_dev(drvdata);
> >         u32 irq;
> >
> > --
> > 2.25.1
> >
>
> Other than that it looks good to me.
>
> Thanks,
> Gilad
>
> --
> Gilad Ben-Yossef
> Chief Coffee Drinker
>
> values of β will give rise to dom!



-- 
       - Allen

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

* Re: [RESEND 04/19] crypto: caam: convert tasklets to use new tasklet_setup() API
  2020-12-07  8:59 ` [RESEND 04/19] crypto: caam: " Allen Pais
@ 2020-12-14 17:21   ` Horia Geantă
  0 siblings, 0 replies; 26+ messages in thread
From: Horia Geantă @ 2020-12-14 17:21 UTC (permalink / raw)
  To: Allen Pais, herbert
  Cc: davem, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	jesper.nilsson, lars.persson, Aymen Sghaier, bbrezillon, arno,
	schalla, matthias.bgg, heiko, krzk, vz, k.konieczny,
	linux-crypto, Allen Pais, Romain Perier

On 12/7/2020 11:00 AM, Allen Pais wrote:
> From: Allen Pais <apais@microsoft.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 <apais@microsoft.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>

Thanks,
Horia

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

end of thread, other threads:[~2020-12-14 17:23 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07  8:59 [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Allen Pais
2020-12-07  8:59 ` [RESEND 01/19] crypto: amcc: convert tasklets to use new tasklet_setup() API Allen Pais
2020-12-07  8:59 ` [RESEND 02/19] crypto: atmel: " Allen Pais
2020-12-07  8:59 ` [RESEND 03/19] crypto: axis: " Allen Pais
2020-12-07  8:59 ` [RESEND 04/19] crypto: caam: " Allen Pais
2020-12-14 17:21   ` Horia Geantă
2020-12-07  8:59 ` [RESEND 05/19] crypto: cavium: " Allen Pais
2020-12-07  8:59 ` [RESEND 06/19] crypto: ccp: " Allen Pais
2020-12-07  8:59 ` [RESEND 07/19] crypto: ccree: " Allen Pais
2020-12-07 18:23   ` kernel test robot
2020-12-09  6:46   ` Gilad Ben-Yossef
2020-12-09 11:35     ` Allen
2020-12-07  8:59 ` [RESEND 08/19] crypto: hifn_795x: " Allen Pais
2020-12-07  8:59 ` [RESEND 09/19] crypto: img-hash: " Allen Pais
2020-12-07  8:59 ` [RESEND 10/19] crypto: ixp4xx: " Allen Pais
2020-12-07  8:59 ` [RESEND 11/19] crypto: mediatek: " Allen Pais
2020-12-07  8:59 ` [RESEND 12/19] crypto: omap: " Allen Pais
2020-12-07  8:59 ` [RESEND 13/19] crypto: picoxcell: " Allen Pais
2020-12-07  8:59 ` [RESEND 14/19] crypto: qat: " Allen Pais
2020-12-07  8:59 ` [RESEND 15/19] crypto: qce: " Allen Pais
2020-12-07  8:59 ` [RESEND 16/19] crypto: rockchip: " Allen Pais
2020-12-07  8:59 ` [RESEND 17/19] crypto: s5p: " Allen Pais
2020-12-07  9:50   ` Krzysztof Kozlowski
2020-12-07  8:59 ` [RESEND 18/19] crypto: talitos: " Allen Pais
2020-12-07  8:59 ` [RESEND 19/19] crypto: octeontx: " Allen Pais
2020-12-07  9:13 ` [RESEND 00/19] crypto: convert tasklets to use new tasklet_setup API() Krzysztof Kozlowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.