linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup()
@ 2020-08-17  8:09 Allen Pais
  2020-08-17  8:09 ` [PATCH 01/19] crypto: amcc: convert tasklets to use new tasklet_setup() API Allen Pais
                   ` (18 more replies)
  0 siblings, 19 replies; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais

 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


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

-- 
2.17.1


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

* [PATCH 01/19] crypto: amcc: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  2020-08-17  8:09 ` [PATCH 02/19] crypto: atmel: " Allen Pais
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais, Romain Perier

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 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.17.1


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

* [PATCH 02/19] crypto: atmel: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
  2020-08-17  8:09 ` [PATCH 01/19] crypto: amcc: convert tasklets to use new tasklet_setup() API Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  2020-08-17  8:09 ` [PATCH 03/19] crypto: axis: " Allen Pais
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais, Romain Perier

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 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 a6e14491e080..99851e40c729 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 ed40dbb98c6b..170809892acf 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.17.1


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

* [PATCH 03/19] crypto: axis: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
  2020-08-17  8:09 ` [PATCH 01/19] crypto: amcc: convert tasklets to use new tasklet_setup() API Allen Pais
  2020-08-17  8:09 ` [PATCH 02/19] crypto: atmel: " Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  2020-08-17  8:09 ` [PATCH 04/19] crypto: caam: " Allen Pais
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais, Romain Perier

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 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 1a46eeddf082..83e4c164dedb 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.17.1


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

* [PATCH 04/19] crypto: caam: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (2 preceding siblings ...)
  2020-08-17  8:09 ` [PATCH 03/19] crypto: axis: " Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  2020-08-17 12:28   ` kernel test robot
  2020-08-17  8:09 ` [PATCH 05/19] crypto: cavium: " Allen Pais
                   ` (14 subsequent siblings)
  18 siblings, 1 reply; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais, Romain Perier

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 drivers/crypto/caam/jr.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c
index bf6b03b17251..4dc923736ba8 100644
--- a/drivers/crypto/caam/jr.c
+++ b/drivers/crypto/caam/jr.c
@@ -201,11 +201,10 @@ 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);
 	void (*usercall)(struct device *dev, u32 *desc, u32 status, void *arg);
 	u32 *userdesc, userstatus;
 	void *userarg;
@@ -483,7 +482,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.17.1


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

* [PATCH 05/19] crypto: cavium: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (3 preceding siblings ...)
  2020-08-17  8:09 ` [PATCH 04/19] crypto: caam: " Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  2020-08-17  8:09 ` [PATCH 06/19] crypto: ccp: " Allen Pais
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais, Romain Perier

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 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..485105ee3178 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.17.1


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

* [PATCH 06/19] crypto: ccp: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (4 preceding siblings ...)
  2020-08-17  8:09 ` [PATCH 05/19] crypto: cavium: " Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  2020-08-17  8:09 ` [PATCH 07/19] crypto: ccree: " Allen Pais
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais, Romain Perier

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 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.17.1


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

* [PATCH 07/19] crypto: ccree: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (5 preceding siblings ...)
  2020-08-17  8:09 ` [PATCH 06/19] crypto: ccp: " Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  2020-08-17  8:09 ` [PATCH 08/19] crypto: hifn_795x: " Allen Pais
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais, Romain Perier

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 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.17.1


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

* [PATCH 08/19] crypto: hifn_795x: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (6 preceding siblings ...)
  2020-08-17  8:09 ` [PATCH 07/19] crypto: ccree: " Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  2020-08-17  8:09 ` [PATCH 09/19] crypto: img-hash: " Allen Pais
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais, Romain Perier

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 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 354836468c5d..785d7c4f44e7 100644
--- a/drivers/crypto/hifn_795x.c
+++ b/drivers/crypto/hifn_795x.c
@@ -2443,9 +2443,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,
@@ -2530,7 +2530,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.17.1


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

* [PATCH 09/19] crypto: img-hash: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (7 preceding siblings ...)
  2020-08-17  8:09 ` [PATCH 08/19] crypto: hifn_795x: " Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  2020-08-17  8:09 ` [PATCH 10/19] crypto: ixp4xx: " Allen Pais
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais, Romain Perier

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 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 87226b7c2795..0e1a32bdbaf4 100644
--- a/drivers/crypto/img-hash.c
+++ b/drivers/crypto/img-hash.c
@@ -353,9 +353,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;
@@ -885,9 +885,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) {
@@ -952,8 +952,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.17.1


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

* [PATCH 10/19] crypto: ixp4xx: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (8 preceding siblings ...)
  2020-08-17  8:09 ` [PATCH 09/19] crypto: img-hash: " Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  2020-08-17  8:09 ` [PATCH 11/19] crypto: mediatek: " Allen Pais
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais, Romain Perier

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 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 f478bb0a566a..31a584940022 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.17.1


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

* [PATCH 11/19] crypto: mediatek: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (9 preceding siblings ...)
  2020-08-17  8:09 ` [PATCH 10/19] crypto: ixp4xx: " Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  2020-08-17  8:09 ` [PATCH 12/19] crypto: omap: " Allen Pais
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais, Romain Perier

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 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 4ad3571ab6af..5557359f105c 100644
--- a/drivers/crypto/mediatek/mtk-aes.c
+++ b/drivers/crypto/mediatek/mtk-aes.c
@@ -1089,16 +1089,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);
@@ -1151,10 +1151,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 da3f0b8814aa..ea0ae45cde93 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.17.1


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

* [PATCH 12/19] crypto: omap: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (10 preceding siblings ...)
  2020-08-17  8:09 ` [PATCH 11/19] crypto: mediatek: " Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  2020-08-17  8:09 ` [PATCH 13/19] crypto: picoxcell: " Allen Pais
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais, Romain Perier

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 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 954d703f2981..3c03ee164039 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -1750,9 +1750,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);
@@ -2126,7 +2126,7 @@ static int omap_sham_probe(struct platform_device *pdev)
 
 	INIT_LIST_HEAD(&dd->list);
 	spin_lock_init(&dd->lock);
-	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.17.1


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

* [PATCH 13/19] crypto: picoxcell: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (11 preceding siblings ...)
  2020-08-17  8:09 ` [PATCH 12/19] crypto: omap: " Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  2020-08-17  8:09 ` [PATCH 14/19] crypto: qat: " Allen Pais
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais, Romain Perier

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 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 dac6eb37fff9..a394d51f8d44 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.17.1


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

* [PATCH 14/19] crypto: qat: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (12 preceding siblings ...)
  2020-08-17  8:09 ` [PATCH 13/19] crypto: picoxcell: " Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  2020-08-17  8:09 ` [PATCH 15/19] crypto: qce: " Allen Pais
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais, Romain Perier

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 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 8827aa139f96..7a2bdddb67c4 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.17.1


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

* [PATCH 15/19] crypto: qce: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (13 preceding siblings ...)
  2020-08-17  8:09 ` [PATCH 14/19] crypto: qat: " Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  2020-08-17  8:09 ` [PATCH 16/19] crypto: rockchip: " Allen Pais
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais, Romain Perier

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 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 cb6d61eb7302..0b171ef9e3b7 100644
--- a/drivers/crypto/qce/core.c
+++ b/drivers/crypto/qce/core.c
@@ -116,9 +116,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;
 
@@ -221,8 +221,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.17.1


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

* [PATCH 16/19] crypto: rockchip: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (14 preceding siblings ...)
  2020-08-17  8:09 ` [PATCH 15/19] crypto: qce: " Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  2020-08-17  8:09 ` [PATCH 17/19] crypto: s5p: " Allen Pais
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais, Romain Perier

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 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 f385587f99af..23a695f31d1d 100644
--- a/drivers/crypto/rockchip/rk3288_crypto.c
+++ b/drivers/crypto/rockchip/rk3288_crypto.c
@@ -200,9 +200,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;
@@ -230,9 +230,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);
@@ -388,10 +388,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.17.1


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

* [PATCH 17/19] crypto: s5p: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (15 preceding siblings ...)
  2020-08-17  8:09 ` [PATCH 16/19] crypto: rockchip: " Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  2020-08-17  8:09 ` [PATCH 18/19] crypto: talitos: " Allen Pais
  2020-08-17  8:09 ` [PATCH 19/19] crypto: octeontx: " Allen Pais
  18 siblings, 0 replies; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais, Romain Perier

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 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 341433fbcc4a..3647dffc307f 100644
--- a/drivers/crypto/s5p-sss.c
+++ b/drivers/crypto/s5p-sss.c
@@ -1443,9 +1443,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);
@@ -1973,9 +1973,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.17.1


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

* [PATCH 18/19] crypto: talitos: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (16 preceding siblings ...)
  2020-08-17  8:09 ` [PATCH 17/19] crypto: s5p: " Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  2020-08-17 12:33   ` kernel test robot
  2020-08-17  8:09 ` [PATCH 19/19] crypto: octeontx: " Allen Pais
  18 siblings, 1 reply; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais, Romain Perier

In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 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 7c547352a862..6d729af1f8e4 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.17.1


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

* [PATCH 19/19] crypto: octeontx: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
                   ` (17 preceding siblings ...)
  2020-08-17  8:09 ` [PATCH 18/19] crypto: talitos: " Allen Pais
@ 2020-08-17  8:09 ` Allen Pais
  18 siblings, 0 replies; 22+ messages in thread
From: Allen Pais @ 2020-08-17  8:09 UTC (permalink / raw)
  To: nicolas.ferre, alexandre.belloni, ludovic.desroches, heiko, matthias.bgg
  Cc: keescook, linux-kernel, linux-arm-kernel, linux-rockchip,
	inux-mediatek, Allen Pais

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 <allen.lkml@gmail.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.17.1


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

* Re: [PATCH 04/19] crypto: caam: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 ` [PATCH 04/19] crypto: caam: " Allen Pais
@ 2020-08-17 12:28   ` kernel test robot
  0 siblings, 0 replies; 22+ messages in thread
From: kernel test robot @ 2020-08-17 12:28 UTC (permalink / raw)
  To: Allen Pais, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	heiko, matthias.bgg
  Cc: kbuild-all, keescook, linux-kernel, linux-arm-kernel,
	linux-rockchip, inux-mediatek

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

Hi Allen,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on cryptodev/master]
[also build test ERROR on crypto/master rockchip/for-next v5.9-rc1 next-20200817]
[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/20200817-161307
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-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
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm 

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/caam/jr.c: In function 'caam_jr_dequeue':
   drivers/crypto/caam/jr.c:207:36: error: implicit declaration of function 'from_tasklet' [-Werror=implicit-function-declaration]
     207 |  struct caam_drv_private_jr *jrp = from_tasklet(jrp, t, irqtask);
         |                                    ^~~~~~~~~~~~
   drivers/crypto/caam/jr.c:207:57: error: 'irqtask' undeclared (first use in this function); did you mean 'in_task'?
     207 |  struct caam_drv_private_jr *jrp = from_tasklet(jrp, t, irqtask);
         |                                                         ^~~~~~~
         |                                                         in_task
   drivers/crypto/caam/jr.c:207:57: note: each undeclared identifier is reported only once for each function it appears in
   In file included from drivers/crypto/caam/compat.h:18,
                    from drivers/crypto/caam/jr.c:13:
>> drivers/crypto/caam/jr.c:232:20: error: 'dev' undeclared (first use in this function); did you mean 'cdev'?
     232 |   dma_unmap_single(dev,
         |                    ^~~
   include/linux/dma-mapping.h:693:61: note: in definition of macro 'dma_unmap_single'
     693 | #define dma_unmap_single(d, a, s, r) dma_unmap_single_attrs(d, a, s, r, 0)
         |                                                             ^
   drivers/crypto/caam/jr.c: In function 'caam_jr_init':
   drivers/crypto/caam/jr.c:485:2: error: implicit declaration of function 'tasklet_setup' [-Werror=implicit-function-declaration]
     485 |  tasklet_setup(&jrp->irqtask, caam_jr_dequeue);
         |  ^~~~~~~~~~~~~
   In file included from include/linux/huge_mm.h:8,
                    from include/linux/mm.h:675,
                    from include/linux/scatterlist.h:8,
                    from include/linux/dma-mapping.h:11,
                    from drivers/crypto/caam/compat.h:18,
                    from drivers/crypto/caam/jr.c:13:
   At top level:
   drivers/crypto/caam/intern.h:212:25: warning: 'caam_fops_u64_ro' defined but not used [-Wunused-const-variable=]
     212 | DEFINE_SIMPLE_ATTRIBUTE(caam_fops_u64_ro, caam_debugfs_u64_get, NULL, "%llu\n");
         |                         ^~~~~~~~~~~~~~~~
   include/linux/fs.h:3519:37: note: in definition of macro 'DEFINE_SIMPLE_ATTRIBUTE'
    3519 | static const struct file_operations __fops = {    \
         |                                     ^~~~~~
   drivers/crypto/caam/intern.h:211:25: warning: 'caam_fops_u32_ro' defined but not used [-Wunused-const-variable=]
     211 | DEFINE_SIMPLE_ATTRIBUTE(caam_fops_u32_ro, caam_debugfs_u32_get, NULL, "%llu\n");
         |                         ^~~~~~~~~~~~~~~~
   include/linux/fs.h:3519:37: note: in definition of macro 'DEFINE_SIMPLE_ATTRIBUTE'
    3519 | static const struct file_operations __fops = {    \
         |                                     ^~~~~~
   cc1: some warnings being treated as errors

# https://github.com/0day-ci/linux/commit/788de4253aaa43e2340446894f0c6ecd67fa6a49
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/20200817-161307
git checkout 788de4253aaa43e2340446894f0c6ecd67fa6a49
vim +232 drivers/crypto/caam/jr.c

8e8ec596e6c0144 Kim Phillips     2011-03-13  202  
2b163b5bce04546 Horia Geantă     2016-11-09  203  /* Deferred service handler, run as interrupt-fired tasklet */
788de4253aaa43e Allen Pais       2020-08-17  204  static void caam_jr_dequeue(struct tasklet_struct *t)
8e8ec596e6c0144 Kim Phillips     2011-03-13  205  {
8e8ec596e6c0144 Kim Phillips     2011-03-13  206  	int hw_idx, sw_idx, i, head, tail;
788de4253aaa43e Allen Pais       2020-08-17  207  	struct caam_drv_private_jr *jrp = from_tasklet(jrp, t, irqtask);
8e8ec596e6c0144 Kim Phillips     2011-03-13  208  	void (*usercall)(struct device *dev, u32 *desc, u32 status, void *arg);
8e8ec596e6c0144 Kim Phillips     2011-03-13  209  	u32 *userdesc, userstatus;
8e8ec596e6c0144 Kim Phillips     2011-03-13  210  	void *userarg;
16c4dd83a1b2a23 Vakul Garg       2019-03-05  211  	u32 outring_used = 0;
8e8ec596e6c0144 Kim Phillips     2011-03-13  212  
16c4dd83a1b2a23 Vakul Garg       2019-03-05  213  	while (outring_used ||
16c4dd83a1b2a23 Vakul Garg       2019-03-05  214  	       (outring_used = rd_reg32(&jrp->rregs->outring_used))) {
8e8ec596e6c0144 Kim Phillips     2011-03-13  215  
6aa7de059173a98 Mark Rutland     2017-10-23  216  		head = READ_ONCE(jrp->head);
8e8ec596e6c0144 Kim Phillips     2011-03-13  217  
a8ea07c21d40cf1 Kim Phillips     2012-06-22  218  		sw_idx = tail = jrp->tail;
8e8ec596e6c0144 Kim Phillips     2011-03-13  219  		hw_idx = jrp->out_ring_read_index;
a8ea07c21d40cf1 Kim Phillips     2012-06-22  220  
8e8ec596e6c0144 Kim Phillips     2011-03-13  221  		for (i = 0; CIRC_CNT(head, tail + i, JOBR_DEPTH) >= 1; i++) {
8e8ec596e6c0144 Kim Phillips     2011-03-13  222  			sw_idx = (tail + i) & (JOBR_DEPTH - 1);
8e8ec596e6c0144 Kim Phillips     2011-03-13  223  
6c5f898f12a3d65 Andrey Smirnov   2019-08-20  224  			if (jr_outentry_desc(jrp->outring, hw_idx) ==
261ea058f016bc0 Horia Geantă     2016-05-19  225  			    caam_dma_to_cpu(jrp->entinfo[sw_idx].desc_addr_dma))
8e8ec596e6c0144 Kim Phillips     2011-03-13  226  				break; /* found */
8e8ec596e6c0144 Kim Phillips     2011-03-13  227  		}
8e8ec596e6c0144 Kim Phillips     2011-03-13  228  		/* we should never fail to find a matching descriptor */
8e8ec596e6c0144 Kim Phillips     2011-03-13  229  		BUG_ON(CIRC_CNT(head, tail + i, JOBR_DEPTH) <= 0);
8e8ec596e6c0144 Kim Phillips     2011-03-13  230  
8e8ec596e6c0144 Kim Phillips     2011-03-13  231  		/* Unmap just-run descriptor so we can post-process */
cc98963dbaaea93 Horia Geantă     2018-08-06 @232  		dma_unmap_single(dev,
6c5f898f12a3d65 Andrey Smirnov   2019-08-20  233  				 caam_dma_to_cpu(jr_outentry_desc(jrp->outring,
6c5f898f12a3d65 Andrey Smirnov   2019-08-20  234  								  hw_idx)),
8e8ec596e6c0144 Kim Phillips     2011-03-13  235  				 jrp->entinfo[sw_idx].desc_size,
8e8ec596e6c0144 Kim Phillips     2011-03-13  236  				 DMA_TO_DEVICE);
8e8ec596e6c0144 Kim Phillips     2011-03-13  237  
8e8ec596e6c0144 Kim Phillips     2011-03-13  238  		/* mark completed, avoid matching on a recycled desc addr */
8e8ec596e6c0144 Kim Phillips     2011-03-13  239  		jrp->entinfo[sw_idx].desc_addr_dma = 0;
8e8ec596e6c0144 Kim Phillips     2011-03-13  240  
a118dfa0dbfcc8e Vakul Garg       2019-03-22  241  		/* Stash callback params */
8e8ec596e6c0144 Kim Phillips     2011-03-13  242  		usercall = jrp->entinfo[sw_idx].callbk;
8e8ec596e6c0144 Kim Phillips     2011-03-13  243  		userarg = jrp->entinfo[sw_idx].cbkarg;
8e8ec596e6c0144 Kim Phillips     2011-03-13  244  		userdesc = jrp->entinfo[sw_idx].desc_addr_virt;
6c5f898f12a3d65 Andrey Smirnov   2019-08-20  245  		userstatus = caam32_to_cpu(jr_outentry_jrstatus(jrp->outring,
6c5f898f12a3d65 Andrey Smirnov   2019-08-20  246  								hw_idx));
8e8ec596e6c0144 Kim Phillips     2011-03-13  247  
e7472422392461f Victoria Milhoan 2015-08-05  248  		/*
e7472422392461f Victoria Milhoan 2015-08-05  249  		 * Make sure all information from the job has been obtained
e7472422392461f Victoria Milhoan 2015-08-05  250  		 * before telling CAAM that the job has been removed from the
e7472422392461f Victoria Milhoan 2015-08-05  251  		 * output ring.
e7472422392461f Victoria Milhoan 2015-08-05  252  		 */
e7472422392461f Victoria Milhoan 2015-08-05  253  		mb();
e7472422392461f Victoria Milhoan 2015-08-05  254  
14a8e29cc201239 Kim Phillips     2012-06-22  255  		/* set done */
cbc22b062106993 Herbert Xu       2019-05-09  256  		wr_reg32(&jrp->rregs->outring_rmvd, 1);
8e8ec596e6c0144 Kim Phillips     2011-03-13  257  
8e8ec596e6c0144 Kim Phillips     2011-03-13  258  		jrp->out_ring_read_index = (jrp->out_ring_read_index + 1) &
8e8ec596e6c0144 Kim Phillips     2011-03-13  259  					   (JOBR_DEPTH - 1);
8e8ec596e6c0144 Kim Phillips     2011-03-13  260  
8e8ec596e6c0144 Kim Phillips     2011-03-13  261  		/*
8e8ec596e6c0144 Kim Phillips     2011-03-13  262  		 * if this job completed out-of-order, do not increment
8e8ec596e6c0144 Kim Phillips     2011-03-13  263  		 * the tail.  Otherwise, increment tail by 1 plus the
8e8ec596e6c0144 Kim Phillips     2011-03-13  264  		 * number of subsequent jobs already completed out-of-order
8e8ec596e6c0144 Kim Phillips     2011-03-13  265  		 */
8e8ec596e6c0144 Kim Phillips     2011-03-13  266  		if (sw_idx == tail) {
8e8ec596e6c0144 Kim Phillips     2011-03-13  267  			do {
8e8ec596e6c0144 Kim Phillips     2011-03-13  268  				tail = (tail + 1) & (JOBR_DEPTH - 1);
8e8ec596e6c0144 Kim Phillips     2011-03-13  269  			} while (CIRC_CNT(head, tail, JOBR_DEPTH) >= 1 &&
8e8ec596e6c0144 Kim Phillips     2011-03-13  270  				 jrp->entinfo[tail].desc_addr_dma == 0);
8e8ec596e6c0144 Kim Phillips     2011-03-13  271  
8e8ec596e6c0144 Kim Phillips     2011-03-13  272  			jrp->tail = tail;
8e8ec596e6c0144 Kim Phillips     2011-03-13  273  		}
8e8ec596e6c0144 Kim Phillips     2011-03-13  274  
8e8ec596e6c0144 Kim Phillips     2011-03-13  275  		/* Finally, execute user's callback */
8e8ec596e6c0144 Kim Phillips     2011-03-13  276  		usercall(dev, userdesc, userstatus, userarg);
16c4dd83a1b2a23 Vakul Garg       2019-03-05  277  		outring_used--;
8e8ec596e6c0144 Kim Phillips     2011-03-13  278  	}
8e8ec596e6c0144 Kim Phillips     2011-03-13  279  
8e8ec596e6c0144 Kim Phillips     2011-03-13  280  	/* reenable / unmask IRQs */
261ea058f016bc0 Horia Geantă     2016-05-19  281  	clrsetbits_32(&jrp->rregs->rconfig_lo, JRCFG_IMSK, 0);
8e8ec596e6c0144 Kim Phillips     2011-03-13  282  }
8e8ec596e6c0144 Kim Phillips     2011-03-13  283  

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

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

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

* Re: [PATCH 18/19] crypto: talitos: convert tasklets to use new tasklet_setup() API
  2020-08-17  8:09 ` [PATCH 18/19] crypto: talitos: " Allen Pais
@ 2020-08-17 12:33   ` kernel test robot
  0 siblings, 0 replies; 22+ messages in thread
From: kernel test robot @ 2020-08-17 12:33 UTC (permalink / raw)
  To: Allen Pais, nicolas.ferre, alexandre.belloni, ludovic.desroches,
	heiko, matthias.bgg
  Cc: kbuild-all, keescook, linux-kernel, linux-arm-kernel,
	linux-rockchip, inux-mediatek

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

Hi Allen,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on cryptodev/master]
[also build test ERROR on crypto/master rockchip/for-next v5.9-rc1 next-20200817]
[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/20200817-161307
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: powerpc-mpc83xx_defconfig (attached as .config)
compiler: powerpc-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
        # 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 error/warnings (new ones prefixed by >>):

   drivers/crypto/talitos.c: In function 'talitos1_done_4ch':
   drivers/crypto/talitos.c:407:33: error: implicit declaration of function 'from_tasklet' [-Werror=implicit-function-declaration]
     407 |  struct talitos_private *priv = from_tasklet(priv, t,  \
         |                                 ^~~~~~~~~~~~
   drivers/crypto/talitos.c:429:1: note: in expansion of macro 'DEF_TALITOS1_DONE'
     429 | DEF_TALITOS1_DONE(4ch, TALITOS1_ISR_4CHDONE)
         | ^~~~~~~~~~~~~~~~~
   drivers/crypto/talitos.c:408:3: error: 'done_task' undeclared (first use in this function); did you mean 'free_task'?
     408 |   done_task[0]);      \
         |   ^~~~~~~~~
   drivers/crypto/talitos.c:429:1: note: in expansion of macro 'DEF_TALITOS1_DONE'
     429 | DEF_TALITOS1_DONE(4ch, TALITOS1_ISR_4CHDONE)
         | ^~~~~~~~~~~~~~~~~
   drivers/crypto/talitos.c:408:3: note: each undeclared identifier is reported only once for each function it appears in
     408 |   done_task[0]);      \
         |   ^~~~~~~~~
   drivers/crypto/talitos.c:429:1: note: in expansion of macro 'DEF_TALITOS1_DONE'
     429 | DEF_TALITOS1_DONE(4ch, TALITOS1_ISR_4CHDONE)
         | ^~~~~~~~~~~~~~~~~
   drivers/crypto/talitos.c: In function 'talitos1_done_ch0':
   drivers/crypto/talitos.c:408:3: error: 'done_task' undeclared (first use in this function); did you mean 'free_task'?
     408 |   done_task[0]);      \
         |   ^~~~~~~~~
   drivers/crypto/talitos.c:430:1: note: in expansion of macro 'DEF_TALITOS1_DONE'
     430 | DEF_TALITOS1_DONE(ch0, TALITOS1_ISR_CH_0_DONE)
         | ^~~~~~~~~~~~~~~~~
   drivers/crypto/talitos.c: In function 'talitos2_done_4ch':
   drivers/crypto/talitos.c:436:3: error: 'done_task' undeclared (first use in this function); did you mean 'free_task'?
     436 |   done_task[tasklet_idx]);    \
         |   ^~~~~~~~~
   drivers/crypto/talitos.c:457:1: note: in expansion of macro 'DEF_TALITOS2_DONE'
     457 | DEF_TALITOS2_DONE(4ch, TALITOS2_ISR_4CHDONE, 0)
         | ^~~~~~~~~~~~~~~~~
   drivers/crypto/talitos.c: At top level:
>> drivers/crypto/talitos.c:458:46: error: macro "DEF_TALITOS2_DONE" requires 3 arguments, but only 2 given
     458 | DEF_TALITOS2_DONE(ch0, TALITOS2_ISR_CH_0_DONE), 0
         |                                              ^
   drivers/crypto/talitos.c:432: note: macro "DEF_TALITOS2_DONE" defined here
     432 | #define DEF_TALITOS2_DONE(name, ch_done_mask, tasklet_idx)  \
         | 
>> drivers/crypto/talitos.c:458:1: warning: data definition has no type or storage class
     458 | DEF_TALITOS2_DONE(ch0, TALITOS2_ISR_CH_0_DONE), 0
         | ^~~~~~~~~~~~~~~~~
>> drivers/crypto/talitos.c:458:1: error: type defaults to 'int' in declaration of 'DEF_TALITOS2_DONE' [-Werror=implicit-int]
>> drivers/crypto/talitos.c:458:49: error: expected identifier or '(' before numeric constant
     458 | DEF_TALITOS2_DONE(ch0, TALITOS2_ISR_CH_0_DONE), 0
         |                                                 ^
   drivers/crypto/talitos.c: In function 'talitos2_done_ch1_3':
   drivers/crypto/talitos.c:436:3: error: 'done_task' undeclared (first use in this function); did you mean 'free_task'?
     436 |   done_task[tasklet_idx]);    \
         |   ^~~~~~~~~
   drivers/crypto/talitos.c:460:1: note: in expansion of macro 'DEF_TALITOS2_DONE'
     460 | DEF_TALITOS2_DONE(ch1_3, TALITOS2_ISR_CH_1_3_DONE, 1)
         | ^~~~~~~~~~~~~~~~~
   drivers/crypto/talitos.c: In function 'talitos_probe':
   drivers/crypto/talitos.c:3390:4: error: implicit declaration of function 'tasklet_setup' [-Werror=implicit-function-declaration]
    3390 |    tasklet_setup(&priv->done_task[0], talitos1_done_ch0);
         |    ^~~~~~~~~~~~~
>> drivers/crypto/talitos.c:3395:39: error: 'talitos2_done_ch0_2' undeclared (first use in this function); did you mean 'talitos2_done_ch1_3'?
    3395 |    tasklet_setup(&priv->done_task[0], talitos2_done_ch0_2);
         |                                       ^~~~~~~~~~~~~~~~~~~
         |                                       talitos2_done_ch1_3
>> drivers/crypto/talitos.c:3398:39: error: 'talitos2_done_ch0' undeclared (first use in this function); did you mean 'talitos1_done_ch0'?
    3398 |    tasklet_setup(&priv->done_task[0], talitos2_done_ch0);
         |                                       ^~~~~~~~~~~~~~~~~
         |                                       talitos1_done_ch0
   cc1: some warnings being treated as errors

# https://github.com/0day-ci/linux/commit/0007edb339f5f9e0882f5503565ec00b1e835c03
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/20200817-161307
git checkout 0007edb339f5f9e0882f5503565ec00b1e835c03
vim +/DEF_TALITOS2_DONE +458 drivers/crypto/talitos.c

   456	
   457	DEF_TALITOS2_DONE(4ch, TALITOS2_ISR_4CHDONE, 0)
 > 458	DEF_TALITOS2_DONE(ch0, TALITOS2_ISR_CH_0_DONE), 0
   459	DEF_TALITOS2_DONE(ch0_2, TALITOS2_ISR_CH_0_2_DONE, 0)
   460	DEF_TALITOS2_DONE(ch1_3, TALITOS2_ISR_CH_1_3_DONE, 1)
   461	

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

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

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

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

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-17  8:09 [PATCH 00/19] crypto: convert tasklets to use new tasklet_setup() Allen Pais
2020-08-17  8:09 ` [PATCH 01/19] crypto: amcc: convert tasklets to use new tasklet_setup() API Allen Pais
2020-08-17  8:09 ` [PATCH 02/19] crypto: atmel: " Allen Pais
2020-08-17  8:09 ` [PATCH 03/19] crypto: axis: " Allen Pais
2020-08-17  8:09 ` [PATCH 04/19] crypto: caam: " Allen Pais
2020-08-17 12:28   ` kernel test robot
2020-08-17  8:09 ` [PATCH 05/19] crypto: cavium: " Allen Pais
2020-08-17  8:09 ` [PATCH 06/19] crypto: ccp: " Allen Pais
2020-08-17  8:09 ` [PATCH 07/19] crypto: ccree: " Allen Pais
2020-08-17  8:09 ` [PATCH 08/19] crypto: hifn_795x: " Allen Pais
2020-08-17  8:09 ` [PATCH 09/19] crypto: img-hash: " Allen Pais
2020-08-17  8:09 ` [PATCH 10/19] crypto: ixp4xx: " Allen Pais
2020-08-17  8:09 ` [PATCH 11/19] crypto: mediatek: " Allen Pais
2020-08-17  8:09 ` [PATCH 12/19] crypto: omap: " Allen Pais
2020-08-17  8:09 ` [PATCH 13/19] crypto: picoxcell: " Allen Pais
2020-08-17  8:09 ` [PATCH 14/19] crypto: qat: " Allen Pais
2020-08-17  8:09 ` [PATCH 15/19] crypto: qce: " Allen Pais
2020-08-17  8:09 ` [PATCH 16/19] crypto: rockchip: " Allen Pais
2020-08-17  8:09 ` [PATCH 17/19] crypto: s5p: " Allen Pais
2020-08-17  8:09 ` [PATCH 18/19] crypto: talitos: " Allen Pais
2020-08-17 12:33   ` kernel test robot
2020-08-17  8:09 ` [PATCH 19/19] crypto: octeontx: " Allen Pais

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).