RDMA/hfi1: Convert tasklets to use new tasklet_setup() API

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.

Link: https://lore.kernel.org/r/20200903060637.424458-3-allen.lkml@gmail.com
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
Allen Pais 2020-09-03 11:36:34 +05:30 committed by Jason Gunthorpe
parent 53c2a706ae
commit 55db47d082
1 changed files with 11 additions and 11 deletions

View File

@ -232,11 +232,11 @@ static const struct sdma_set_state_action sdma_action_table[] = {
static void sdma_complete(struct kref *); static void sdma_complete(struct kref *);
static void sdma_finalput(struct sdma_state *); static void sdma_finalput(struct sdma_state *);
static void sdma_get(struct sdma_state *); static void sdma_get(struct sdma_state *);
static void sdma_hw_clean_up_task(unsigned long); static void sdma_hw_clean_up_task(struct tasklet_struct *);
static void sdma_put(struct sdma_state *); static void sdma_put(struct sdma_state *);
static void sdma_set_state(struct sdma_engine *, enum sdma_states); static void sdma_set_state(struct sdma_engine *, enum sdma_states);
static void sdma_start_hw_clean_up(struct sdma_engine *); static void sdma_start_hw_clean_up(struct sdma_engine *);
static void sdma_sw_clean_up_task(unsigned long); static void sdma_sw_clean_up_task(struct tasklet_struct *);
static void sdma_sendctrl(struct sdma_engine *, unsigned); static void sdma_sendctrl(struct sdma_engine *, unsigned);
static void init_sdma_regs(struct sdma_engine *, u32, uint); static void init_sdma_regs(struct sdma_engine *, u32, uint);
static void sdma_process_event( static void sdma_process_event(
@ -545,9 +545,10 @@ static void sdma_err_progress_check(struct timer_list *t)
schedule_work(&sde->err_halt_worker); schedule_work(&sde->err_halt_worker);
} }
static void sdma_hw_clean_up_task(unsigned long opaque) static void sdma_hw_clean_up_task(struct tasklet_struct *t)
{ {
struct sdma_engine *sde = (struct sdma_engine *)opaque; struct sdma_engine *sde = from_tasklet(sde, t,
sdma_hw_clean_up_task);
u64 statuscsr; u64 statuscsr;
while (1) { while (1) {
@ -604,9 +605,9 @@ static void sdma_flush_descq(struct sdma_engine *sde)
sdma_desc_avail(sde, sdma_descq_freecnt(sde)); sdma_desc_avail(sde, sdma_descq_freecnt(sde));
} }
static void sdma_sw_clean_up_task(unsigned long opaque) static void sdma_sw_clean_up_task(struct tasklet_struct *t)
{ {
struct sdma_engine *sde = (struct sdma_engine *)opaque; struct sdma_engine *sde = from_tasklet(sde, t, sdma_sw_clean_up_task);
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&sde->tail_lock, flags); spin_lock_irqsave(&sde->tail_lock, flags);
@ -1454,11 +1455,10 @@ int sdma_init(struct hfi1_devdata *dd, u8 port)
sde->tail_csr = sde->tail_csr =
get_kctxt_csr_addr(dd, this_idx, SD(TAIL)); get_kctxt_csr_addr(dd, this_idx, SD(TAIL));
tasklet_init(&sde->sdma_hw_clean_up_task, sdma_hw_clean_up_task, tasklet_setup(&sde->sdma_hw_clean_up_task,
(unsigned long)sde); sdma_hw_clean_up_task);
tasklet_setup(&sde->sdma_sw_clean_up_task,
tasklet_init(&sde->sdma_sw_clean_up_task, sdma_sw_clean_up_task, sdma_sw_clean_up_task);
(unsigned long)sde);
INIT_WORK(&sde->err_halt_worker, sdma_err_halt_wait); INIT_WORK(&sde->err_halt_worker, sdma_err_halt_wait);
INIT_WORK(&sde->flush_worker, sdma_field_flush); INIT_WORK(&sde->flush_worker, sdma_field_flush);