From: Allen Pais <[email protected]>
Commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
introduced a new tasklet initialization API. This series converts
all the crypto modules to use the new tasklet_setup() API
The series is based on v5.11-rc4 (19c329f68089)
v4:
- added acks
- fixed checkpatch errors(Giovanni Cabiddu)
v3:
- fixed rockchip driver(Emil Renner Berthing)
v2:
- added acks
- addressed comments [Krzysztof and Gilad]
Allen Pais (19):
crypto: amcc: convert tasklets to use new tasklet_setup() API
crypto: atmel: convert tasklets to use new tasklet_setup() API
crypto: axis: convert tasklets to use new tasklet_setup() API
crypto: caam: convert tasklets to use new tasklet_setup() API
crypto: cavium: convert tasklets to use new tasklet_setup() API
crypto: ccp: convert tasklets to use new tasklet_setup() API
crypto: ccree: convert tasklets to use new tasklet_setup() API
crypto: hifn_795x: convert tasklets to use new tasklet_setup() API
crypto: img-hash: convert tasklets to use new tasklet_setup() API
crypto: ixp4xx: convert tasklets to use new tasklet_setup() API
crypto: mediatek: convert tasklets to use new tasklet_setup() API
crypto: omap: convert tasklets to use new tasklet_setup() API
crypto: picoxcell: convert tasklets to use new tasklet_setup() API
crypto: qat: convert tasklets to use new tasklet_setup() API
crypto: qce: convert tasklets to use new tasklet_setup() API
crypto: rockchip: convert tasklets to use new tasklet_setup() API
crypto: s5p: convert tasklets to use new tasklet_setup() API
crypto: talitos: convert tasklets to use new tasklet_setup() API
crypto: octeontx: convert tasklets to use new tasklet_setup() API
drivers/crypto/amcc/crypto4xx_core.c | 7 ++--
drivers/crypto/atmel-aes.c | 14 +++----
drivers/crypto/atmel-sha.c | 14 +++----
drivers/crypto/atmel-tdes.c | 14 +++----
drivers/crypto/axis/artpec6_crypto.c | 7 ++--
drivers/crypto/caam/jr.c | 9 ++--
drivers/crypto/cavium/cpt/cptvf_main.c | 9 ++--
drivers/crypto/cavium/nitrox/nitrox_common.h | 2 +-
drivers/crypto/cavium/nitrox/nitrox_isr.c | 13 +++---
drivers/crypto/cavium/nitrox/nitrox_reqmgr.c | 4 +-
drivers/crypto/ccp/ccp-dev-v3.c | 9 ++--
drivers/crypto/ccp/ccp-dev-v5.c | 9 ++--
drivers/crypto/ccp/ccp-dmaengine.c | 7 ++--
drivers/crypto/ccree/cc_fips.c | 8 ++--
drivers/crypto/ccree/cc_request_mgr.c | 12 +++---
drivers/crypto/hifn_795x.c | 6 +--
drivers/crypto/img-hash.c | 12 +++---
drivers/crypto/ixp4xx_crypto.c | 4 +-
.../crypto/marvell/octeontx/otx_cptvf_main.c | 12 +++---
drivers/crypto/mediatek/mtk-aes.c | 14 +++----
drivers/crypto/mediatek/mtk-sha.c | 14 +++----
drivers/crypto/omap-aes.c | 6 +--
drivers/crypto/omap-des.c | 6 +--
drivers/crypto/omap-sham.c | 6 +--
drivers/crypto/picoxcell_crypto.c | 7 ++--
drivers/crypto/qat/qat_common/adf_isr.c | 5 +--
drivers/crypto/qat/qat_common/adf_sriov.c | 10 ++---
drivers/crypto/qat/qat_common/adf_transport.c | 4 +-
.../qat/qat_common/adf_transport_internal.h | 2 +-
drivers/crypto/qat/qat_common/adf_vf_isr.c | 11 +++--
drivers/crypto/qce/core.c | 7 ++--
drivers/crypto/rockchip/rk3288_crypto.c | 14 +++----
drivers/crypto/s5p-sss.c | 13 +++---
drivers/crypto/talitos.c | 42 +++++++++----------
34 files changed, 152 insertions(+), 181 deletions(-)
--
2.25.1
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
drivers/crypto/amcc/crypto4xx_core.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c
index 8d1b918a0533..0e13430a5b9b 100644
--- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -1072,9 +1072,9 @@ static void crypto4xx_unregister_alg(struct crypto4xx_device *sec_dev)
}
}
-static void crypto4xx_bh_tasklet_cb(unsigned long data)
+static void crypto4xx_bh_tasklet_cb(struct tasklet_struct *t)
{
- struct device *dev = (struct device *)data;
+ struct device *dev = from_tasklet(dev, t, tasklet);
struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev);
struct pd_uinfo *pd_uinfo;
struct ce_pd *pd;
@@ -1452,8 +1452,7 @@ static int crypto4xx_probe(struct platform_device *ofdev)
goto err_build_sdr;
/* Init tasklet for bottom half processing */
- tasklet_init(&core_dev->tasklet, crypto4xx_bh_tasklet_cb,
- (unsigned long) dev);
+ tasklet_setup(&core_dev->tasklet, crypto4xx_bh_tasklet_cb);
core_dev->dev->ce_base = of_iomap(ofdev->dev.of_node, 0);
if (!core_dev->dev->ce_base) {
--
2.25.1
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
drivers/crypto/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 e813115d5432..72b65cdff856 100644
--- a/drivers/crypto/img-hash.c
+++ b/drivers/crypto/img-hash.c
@@ -355,9 +355,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;
@@ -887,9 +887,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) {
@@ -954,8 +954,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
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
drivers/crypto/ccree/cc_fips.c | 8 ++++----
drivers/crypto/ccree/cc_request_mgr.c | 12 ++++++------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/crypto/ccree/cc_fips.c b/drivers/crypto/ccree/cc_fips.c
index 702aefc21447..c1d03d99e3c3 100644
--- a/drivers/crypto/ccree/cc_fips.c
+++ b/drivers/crypto/ccree/cc_fips.c
@@ -8,7 +8,7 @@
#include "cc_driver.h"
#include "cc_fips.h"
-static void fips_dsr(unsigned long devarg);
+static void fips_dsr(struct tasklet_struct *tsk);
struct cc_fips_handle {
struct tasklet_struct tasklet;
@@ -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 *tsk)
{
- struct cc_drvdata *drvdata = (struct cc_drvdata *)devarg;
+ struct cc_drvdata *drvdata = from_tasklet(drvdata, tsk, 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
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
drivers/crypto/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
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
drivers/crypto/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 f016448e43bb..6424bcc74139 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 99b053094f5a..c6fb8b3263e1 100644
--- a/drivers/crypto/cavium/nitrox/nitrox_isr.c
+++ b/drivers/crypto/cavium/nitrox/nitrox_isr.c
@@ -201,9 +201,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 */
@@ -343,8 +343,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;
}
@@ -364,8 +363,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;
@@ -442,8 +440,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 53ef06792133..676f3d00bf61 100644
--- a/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c
+++ b/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c
@@ -580,9 +580,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
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
drivers/crypto/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 8b0f17fc09fb..b783ab58d718 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
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
drivers/crypto/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..85f314c79734 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
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
drivers/crypto/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 c45853463530..50b4dcd49753 100644
--- a/drivers/crypto/qat/qat_common/adf_isr.c
+++ b/drivers/crypto/qat/qat_common/adf_isr.c
@@ -244,9 +244,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 8c822c2861c2..748f81294fb5 100644
--- a/drivers/crypto/qat/qat_common/adf_sriov.c
+++ b/drivers/crypto/qat/qat_common/adf_sriov.c
@@ -24,9 +24,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);
@@ -52,9 +53,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 5a7030acdc33..03dcbeac25d7 100644
--- a/drivers/crypto/qat/qat_common/adf_transport.c
+++ b/drivers/crypto/qat/qat_common/adf_transport.c
@@ -324,9 +324,9 @@ static void adf_ring_response_handler(struct adf_etr_bank_data *bank)
adf_handle_response(&bank->rings[i]);
}
-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);
struct adf_hw_csr_ops *csr_ops = GET_CSR_OPS(bank->accel_dev);
/* Handle all the responses and reenable IRQs */
diff --git a/drivers/crypto/qat/qat_common/adf_transport_internal.h b/drivers/crypto/qat/qat_common/adf_transport_internal.h
index 501bcf0f1809..aaec7b2bc220 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 38d316a42ba6..1d0ff58fd9b5 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;
@@ -216,8 +216,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
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Acked-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Romain Perier <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
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 682c8a450a57..128512a365e1 100644
--- a/drivers/crypto/s5p-sss.c
+++ b/drivers/crypto/s5p-sss.c
@@ -1445,9 +1445,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);
@@ -1975,9 +1975,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;
@@ -2258,7 +2258,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++) {
@@ -2268,8 +2268,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
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
drivers/crypto/atmel-aes.c | 14 ++++++--------
drivers/crypto/atmel-sha.c | 14 ++++++--------
drivers/crypto/atmel-tdes.c | 14 ++++++--------
3 files changed, 18 insertions(+), 24 deletions(-)
diff --git a/drivers/crypto/atmel-aes.c b/drivers/crypto/atmel-aes.c
index b1d286004295..804e6a5a39d4 100644
--- a/drivers/crypto/atmel-aes.c
+++ b/drivers/crypto/atmel-aes.c
@@ -2300,16 +2300,16 @@ static void atmel_aes_dma_cleanup(struct atmel_aes_dev *dd)
dma_release_channel(dd->src.chan);
}
-static void atmel_aes_queue_task(unsigned long data)
+static void atmel_aes_queue_task(struct tasklet_struct *t)
{
- struct atmel_aes_dev *dd = (struct atmel_aes_dev *)data;
+ struct atmel_aes_dev *dd = from_tasklet(dd, t, queue_task);
atmel_aes_handle_queue(dd, NULL);
}
-static void atmel_aes_done_task(unsigned long data)
+static void atmel_aes_done_task(struct tasklet_struct *t)
{
- struct atmel_aes_dev *dd = (struct atmel_aes_dev *)data;
+ struct atmel_aes_dev *dd = from_tasklet(dd, t, done_task);
dd->is_async = true;
(void)dd->resume(dd);
@@ -2499,10 +2499,8 @@ static int atmel_aes_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&aes_dd->list);
spin_lock_init(&aes_dd->lock);
- tasklet_init(&aes_dd->done_task, atmel_aes_done_task,
- (unsigned long)aes_dd);
- tasklet_init(&aes_dd->queue_task, atmel_aes_queue_task,
- (unsigned long)aes_dd);
+ tasklet_setup(&aes_dd->done_task, atmel_aes_done_task);
+ tasklet_setup(&aes_dd->queue_task, atmel_aes_queue_task);
crypto_init_queue(&aes_dd->queue, ATMEL_AES_QUEUE_LENGTH);
diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
index 352d80cb5ae9..8ec8a32606e8 100644
--- a/drivers/crypto/atmel-sha.c
+++ b/drivers/crypto/atmel-sha.c
@@ -1314,9 +1314,9 @@ static struct ahash_alg sha_384_512_algs[] = {
},
};
-static void atmel_sha_queue_task(unsigned long data)
+static void atmel_sha_queue_task(struct tasklet_struct *t)
{
- struct atmel_sha_dev *dd = (struct atmel_sha_dev *)data;
+ struct atmel_sha_dev *dd = from_tasklet(dd, t, queue_task);
atmel_sha_handle_queue(dd, NULL);
}
@@ -1353,9 +1353,9 @@ static int atmel_sha_done(struct atmel_sha_dev *dd)
return err;
}
-static void atmel_sha_done_task(unsigned long data)
+static void atmel_sha_done_task(struct tasklet_struct *t)
{
- struct atmel_sha_dev *dd = (struct atmel_sha_dev *)data;
+ struct atmel_sha_dev *dd = from_tasklet(dd, t, done_task);
dd->is_async = true;
(void)dd->resume(dd);
@@ -2570,10 +2570,8 @@ static int atmel_sha_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&sha_dd->list);
spin_lock_init(&sha_dd->lock);
- tasklet_init(&sha_dd->done_task, atmel_sha_done_task,
- (unsigned long)sha_dd);
- tasklet_init(&sha_dd->queue_task, atmel_sha_queue_task,
- (unsigned long)sha_dd);
+ tasklet_setup(&sha_dd->done_task, atmel_sha_done_task);
+ tasklet_setup(&sha_dd->queue_task, atmel_sha_queue_task);
crypto_init_queue(&sha_dd->queue, ATMEL_SHA_QUEUE_LENGTH);
diff --git a/drivers/crypto/atmel-tdes.c b/drivers/crypto/atmel-tdes.c
index 4d63cb13a54f..b7a734f666ae 100644
--- a/drivers/crypto/atmel-tdes.c
+++ b/drivers/crypto/atmel-tdes.c
@@ -1049,16 +1049,16 @@ static struct skcipher_alg tdes_algs[] = {
},
};
-static void atmel_tdes_queue_task(unsigned long data)
+static void atmel_tdes_queue_task(struct tasklet_struct *t)
{
- struct atmel_tdes_dev *dd = (struct atmel_tdes_dev *)data;
+ struct atmel_tdes_dev *dd = from_tasklet(dd, t, queue_task);
atmel_tdes_handle_queue(dd, NULL);
}
-static void atmel_tdes_done_task(unsigned long data)
+static void atmel_tdes_done_task(struct tasklet_struct *t)
{
- struct atmel_tdes_dev *dd = (struct atmel_tdes_dev *) data;
+ struct atmel_tdes_dev *dd = from_tasklet(dd, t, done_task);
int err;
if (!(dd->flags & TDES_FLAGS_DMA))
@@ -1177,10 +1177,8 @@ static int atmel_tdes_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&tdes_dd->list);
spin_lock_init(&tdes_dd->lock);
- tasklet_init(&tdes_dd->done_task, atmel_tdes_done_task,
- (unsigned long)tdes_dd);
- tasklet_init(&tdes_dd->queue_task, atmel_tdes_queue_task,
- (unsigned long)tdes_dd);
+ tasklet_setup(&tdes_dd->done_task, atmel_tdes_done_task);
+ tasklet_setup(&tdes_dd->queue_task, atmel_tdes_queue_task);
crypto_init_queue(&tdes_dd->queue, ATMEL_TDES_QUEUE_LENGTH);
--
2.25.1
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
drivers/crypto/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 a45bdcf3026d..7e4223716620 100644
--- a/drivers/crypto/omap-aes.c
+++ b/drivers/crypto/omap-aes.c
@@ -503,9 +503,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");
@@ -1151,7 +1151,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 ae0d320d3c60..5dc7e23879a5 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -1725,9 +1725,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);
@@ -2084,7 +2084,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
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
drivers/crypto/talitos.c | 42 ++++++++++++++++++----------------------
1 file changed, 19 insertions(+), 23 deletions(-)
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index 4fd85f31630a..be4f7dd810fd 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -403,10 +403,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) \
@@ -429,11 +430,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) \
@@ -453,10 +455,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
@@ -3386,23 +3388,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
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
drivers/crypto/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 80b75085c265..374281e9d6b9 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;
@@ -235,8 +235,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
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
drivers/crypto/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 84f9c16d984c..e64fa3e22521 100644
--- a/drivers/crypto/picoxcell_crypto.c
+++ b/drivers/crypto/picoxcell_crypto.c
@@ -1137,9 +1137,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);
@@ -1649,8 +1649,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
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Allen Pais <[email protected]>
---
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 c076d0b3ad5f..831550123719 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
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
drivers/crypto/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 f55aacdafbef..c241762aa23b 100644
--- a/drivers/crypto/mediatek/mtk-sha.c
+++ b/drivers/crypto/mediatek/mtk-sha.c
@@ -1164,16 +1164,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);
@@ -1219,10 +1219,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
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
drivers/crypto/axis/artpec6_crypto.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/crypto/axis/artpec6_crypto.c b/drivers/crypto/axis/artpec6_crypto.c
index 9ad188cffd0d..52e0c7fdbfa8 100644
--- a/drivers/crypto/axis/artpec6_crypto.c
+++ b/drivers/crypto/axis/artpec6_crypto.c
@@ -2075,9 +2075,9 @@ static void artpec6_crypto_timeout(struct timer_list *t)
tasklet_schedule(&ac->task);
}
-static void artpec6_crypto_task(unsigned long data)
+static void artpec6_crypto_task(struct tasklet_struct *t)
{
- struct artpec6_crypto *ac = (struct artpec6_crypto *)data;
+ struct artpec6_crypto *ac = from_tasklet(ac, t, task);
struct artpec6_crypto_req_common *req;
struct artpec6_crypto_req_common *n;
struct list_head complete_done;
@@ -2900,8 +2900,7 @@ static int artpec6_crypto_probe(struct platform_device *pdev)
artpec6_crypto_init_debugfs();
#endif
- tasklet_init(&ac->task, artpec6_crypto_task,
- (unsigned long)ac);
+ tasklet_setup(&ac->task, artpec6_crypto_task);
ac->pad_buffer = devm_kzalloc(&pdev->dev, 2 * ARTPEC_CACHE_LINE_MAX,
GFP_KERNEL);
--
2.25.1
From: Allen Pais <[email protected]>
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Acked-by: John Allen <[email protected]>
Signed-off-by: Romain Perier <[email protected]>
Signed-off-by: Allen Pais <[email protected]>
---
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
On Thu, Jan 21, 2021 at 10:11:08AM +0530, Allen Pais wrote:
> From: Allen Pais <[email protected]>
>
> In preparation for unconditionally passing the
> struct tasklet_struct pointer to all tasklet
> callbacks, switch to using the new tasklet_setup()
> and from_tasklet() to pass the tasklet pointer explicitly.
>
> Signed-off-by: Romain Perier <[email protected]>
> Signed-off-by: Allen Pais <[email protected]>
> ---
> drivers/crypto/amcc/crypto4xx_core.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
This doesn't even compile:
CC [M] drivers/crypto/amcc/crypto4xx_core.o
CC [M] drivers/crypto/amcc/crypto4xx_alg.o
CC [M] drivers/crypto/amcc/crypto4xx_trng.o
CHECK ../drivers/crypto/amcc/crypto4xx_trng.c
../drivers/crypto/amcc/crypto4xx_core.c: In function ‘crypto4xx_cipher_done’:
../drivers/crypto/amcc/crypto4xx_core.c:526:13: warning: variable ‘addr’ set but not used [-Wunused-but-set-variable]
dma_addr_t addr;
^~~~
../drivers/crypto/amcc/crypto4xx_core.c: In function ‘crypto4xx_ahash_done’:
../drivers/crypto/amcc/crypto4xx_core.c:557:24: warning: variable ‘ctx’ set but not used [-Wunused-but-set-variable]
struct crypto4xx_ctx *ctx;
^~~
In file included from <command-line>:
../drivers/crypto/amcc/crypto4xx_core.c: In function ‘crypto4xx_bh_tasklet_cb’:
../include/linux/kernel.h:694:51: error: ‘struct device’ has no member named ‘tasklet’
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~
./../include/linux/compiler_types.h:306:9: note: in definition of macro ‘__compiletime_assert’
if (!(condition)) \
^~~~~~~~~
./../include/linux/compiler_types.h:326:2: note: in expansion of macro ‘_compiletime_assert’
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~~~~~~~~~~~
../include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
../include/linux/kernel.h:694:2: note: in expansion of macro ‘BUILD_BUG_ON_MSG’
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~~~~~~
../include/linux/kernel.h:694:20: note: in expansion of macro ‘__same_type’
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~
../include/linux/interrupt.h:646:2: note: in expansion of macro ‘container_of’
container_of(callback_tasklet, typeof(*var), tasklet_fieldname)
^~~~~~~~~~~~
../drivers/crypto/amcc/crypto4xx_core.c:1078:23: note: in expansion of macro ‘from_tasklet’
struct device *dev = from_tasklet(dev, t, tasklet);
^~~~~~~~~~~~
./../include/linux/compiler_types.h:146:35: error: ‘struct device’ has no member named ‘tasklet’
#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
^~~~~~~~~~~~~~~~~~
../include/linux/stddef.h:17:32: note: in expansion of macro ‘__compiler_offsetof’
#define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
^~~~~~~~~~~~~~~~~~~
../include/linux/kernel.h:697:21: note: in expansion of macro ‘offsetof’
((type *)(__mptr - offsetof(type, member))); })
^~~~~~~~
../include/linux/interrupt.h:646:2: note: in expansion of macro ‘container_of’
container_of(callback_tasklet, typeof(*var), tasklet_fieldname)
^~~~~~~~~~~~
../drivers/crypto/amcc/crypto4xx_core.c:1078:23: note: in expansion of macro ‘from_tasklet’
struct device *dev = from_tasklet(dev, t, tasklet);
^~~~~~~~~~~~
Thanks,
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt