Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2961012pxb; Tue, 12 Jan 2021 02:58:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJzjoXISnNn1cCFrc8Pimg/Kgqkd05R1Bttk6F6G0qbNt1PZkIDn3zDjHsSK38v3JSrwWwUb X-Received: by 2002:a05:6402:a52:: with SMTP id bt18mr2972034edb.228.1610449117043; Tue, 12 Jan 2021 02:58:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610449117; cv=none; d=google.com; s=arc-20160816; b=FRBynwfntrcnA6fMHi2go9ieJBrnSk0aWVE9Ah9ZIGWaIyUaKedfZD/pKwK9Ld2zsR PpEVtnbXkO1VVDyMH3MSeWdS59PxZXI0QKzMew1sKy0mn/Gmx0jGFETb789qCMYannde 5wV9FDEPU0GMdBTVk47S0FTcVYiP7Rj2XMJt+TgRyCmktMtSxVs/joM4nZ3uiDH5wAvK SGL6vaidK3VeQ+s3FsSmsUjJ/ESF0sYZgw8DmJyRchkm4QQMbVX1YH3IPqHstz9CCEWD evwpfRpGyJSZgqv7ttOWo+at5snCcUqMdRZJhB3438gMyPLH/vrFvxeHD3xd+ikpNgKI MPZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=X8fsop2xmYxltHA5D/rZSLD1hZ0w/2RK5zEw7HljbjI=; b=tlB+rqUWZ8oelTVhty2tUTjYfwLd28bxlQ/Cui4W3P2L4TjxnE1ZdUlh0cv/PBB/v5 JRNUt91rMg2Du0lT6Ld9BPCtPGv+KqRouc6ysVJhZosfW7qDwwoMremaKyTt4fWcO4xH Le7HBK74pMV6I3vyWtdrOb/U2dX22BqQB4nL0Nw8WaqSQ4l1J4L0ku8IiMg8GLcs+LLm C/RAdaQLYxGk5M430pcWRVOa3aTXIzbmjdE6nZcG4QvRKv7G7Ifc+5RULtGEWP5szBuA 5PS+kWa28k2PKfq7am6gfkk/70gUtC9p8Vo0JvcKxxp53XK810OkYzecWgtHKTU4bk1w z3ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FJsJoSot; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si1138305edm.287.2021.01.12.02.58.18; Tue, 12 Jan 2021 02:58:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FJsJoSot; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732893AbhALBsr (ORCPT + 99 others); Mon, 11 Jan 2021 20:48:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732842AbhALBsr (ORCPT ); Mon, 11 Jan 2021 20:48:47 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E69EEC061786; Mon, 11 Jan 2021 17:48:06 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id iq13so629596pjb.3; Mon, 11 Jan 2021 17:48:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=X8fsop2xmYxltHA5D/rZSLD1hZ0w/2RK5zEw7HljbjI=; b=FJsJoSoto67Bz6URfcf3VxYXvuNUukF1ubVd0kNrx4uGAdzDI9ObCG0R1GZYD0jacn JZWM82zQ5evijkw1empC/X3ajLIRipd+KxjJjb9/i858M28t6qu8a7Hf35pKntTBIgpJ 9soI3eLZnM3G44pzWDqc5SJjsgI27WWYX1Z6pa2hUZaXcesIjlqlRoqD6nBSqPkkaNN1 +qBXrHRNgmCCT7tzcpExxTzckGa8S4hvh1ol+6jLc9P/TJlIGRcsrh8Ug6zD4Xq961Xa ew7PeqpzYrTCkn6etVm+PLLyzAheFDbmWZkKh8dwrtP9uZNe2+1DjRANUK73yp9oaJyD eSKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=X8fsop2xmYxltHA5D/rZSLD1hZ0w/2RK5zEw7HljbjI=; b=NIUMeifJc1sLYinslWnnOsiU8uB+5LNn3CFFv+F4MpV7kOaD4jbpEw4xYTT7QHrzjy rrsCkum0G/mW1qZb5j9FCZdOOrfDGFDWuDZ13i4hMOYjEhtFtGb4IjfmMMsPl3UURIBj vG43s/X439IwxMlR2hHO4WYio6v3tGe/cutqIjfyGs8AX5MR58QB5jcvDCa9CMhaEtJK 3DhuRodh34Y8S8WXFauiDnHmTOTG3aY6dMunZGBPv77VcR/eoGBtNeHUCFi8mB86zM0G dOhF9oiYQRLDXBYJ+yxOgYLPrn9leoLhbM1loGt+Y75PEB+9lWfNdEw/UV8bALhSuhaS S90g== X-Gm-Message-State: AOAM53047MfNFEdtVXBtjI5rfEpPiAOw2MLOHluhZkhwD6xeBF+JHayQ ofS1/7+kP344L+atdql+hws= X-Received: by 2002:a17:90a:4208:: with SMTP id o8mr1812924pjg.224.1610416086514; Mon, 11 Jan 2021 17:48:06 -0800 (PST) Received: from localhost.localdomain ([49.207.194.207]) by smtp.gmail.com with ESMTPSA id 14sm904376pfy.55.2021.01.11.17.47.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 17:48:05 -0800 (PST) From: Allen Pais To: herbert@gondor.apana.org.au Cc: davem@davemloft.net, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, ludovic.desroches@microchip.com, jesper.nilsson@axis.com, lars.persson@axis.com, horia.geanta@nxp.com, aymen.sghaier@nxp.com, gcherian@marvell.com, thomas.lendacky@amd.com, john.allen@amd.com, gilad@benyossef.com, bbrezillon@kernel.org, arno@natisbad.org, schalla@marvell.com, matthias.bgg@gmail.com, jamie@jamieiles.com, giovanni.cabiddu@intel.com, heiko@sntech.de, krzk@kernel.org, vz@mleia.com, k.konieczny@samsung.com, linux-crypto@vger.kernel.org, linux-mediatek@lists.infradead.org, qat-linux@intel.com, linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH v3 06/19] crypto: ccp: convert tasklets to use new tasklet_setup() API Date: Tue, 12 Jan 2021 07:16:37 +0530 Message-Id: <20210112014650.10887-7-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210112014650.10887-1-allen.lkml@gmail.com> References: <20210112014650.10887-1-allen.lkml@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: 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: Romain Perier Signed-off-by: Allen Pais --- 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