Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3861407pxb; Mon, 8 Feb 2021 01:52:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJwmctL4c/zYtoSwY+9rNRn3rjFxoDZGuKGN4rFO5Qn8B1J4Yk+XPi9MGFHVREvq+zBo7YpG X-Received: by 2002:a17:906:1241:: with SMTP id u1mr16216937eja.196.1612777964618; Mon, 08 Feb 2021 01:52:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612777964; cv=none; d=google.com; s=arc-20160816; b=HYpsAfcmrCoJ1yZSJYaDwwV4ML4eFDRQUJIaWF1v4wQhk4Oizt2HRBQBzobScdYPz2 wXFrhPV59IZnqHlXj/OhBfTrztdY+98uetBM4FqrckmIADp2CVwbue/I0r6DixxHl4Lm 56e/CsOlG56dVIX3tVCxwZZuBd9U5nHnY2A435Up4SVmgdPrII2URkIiAkIvv7ZnuZgd WkUFVqPfn05hJFXccTlQ1K5OK1SOqyrpyFTPgFVjjXUP5jjptVustG6koS4p6KrxfXiO HeyAUQV+kk3oj8ngyIujKR26CMHF2RVE7zeb6ZMWpdfHxFKWcTC69aHAflVBVdqCk2Fa izpQ== 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=+bF0wgyuousrsBjw1bti5ZYiRgHZLvFxR0KyJROcYJo=; b=L9wGZh6+ESzuiPMllbBljIPoxFnFUzNt7Y/o0nIXLlXPeg+oYuVIP1Idzs0bvz/Mcj uStt1f9TjCo8dw7Dy/KeJmAPLyaxZqFWqXEdrsNtrmWcnqg6EkYdLZw8JFlXmKZ7IcQF 02/U8SPwEHCn9uuzMJwfv/+59kOh6lq/v+7atXsnUuSB9VAm3oV8oIXWHCAvGHirIrRD 2HEvDllfGy6emh9do5LOdgvuJW1n+xlt4ZOyYDJZF6meQtzkIjZK0p8bsyUoppoCdDPM 9LFqjxdJ6ozPYrrTQ9NnMRcCpwyw99igKLV74N6VfWx4J3dpwZoQcWVGwafeeeLzBnr2 xFvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Qe13dpiJ; 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 j4si783252ejm.600.2021.02.08.01.52.21; Mon, 08 Feb 2021 01:52:44 -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=Qe13dpiJ; 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 S232058AbhBHJuG (ORCPT + 99 others); Mon, 8 Feb 2021 04:50:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231920AbhBHJrH (ORCPT ); Mon, 8 Feb 2021 04:47:07 -0500 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AB08C061756; Mon, 8 Feb 2021 01:43:59 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id b21so9839257pgk.7; Mon, 08 Feb 2021 01:43:59 -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=+bF0wgyuousrsBjw1bti5ZYiRgHZLvFxR0KyJROcYJo=; b=Qe13dpiJ2EyXyorjYGbTlkKsgJ0aG+PwD7TV41EurpvUsRkrNW+HEmoqZsalEm6UKP 2WXix8TADk3fZ7z/SB+w0ezHpkRd66/dilOaYeSnvcNS6y3ljpD0edzhdzAHrGCue6Yk ASPaZVGlIHHZoyjgV+SZA6LdAEuM6qhwTBxWxBcAkX6I+zc6gIcloL1yDtLYcg+qOU9c XR0yAepvaexXnwLkDB08mf/WPYqG49Csw8DECwz7KbqIMLWmIjC5jpx2lQxy3dvveMGf t63iWQsclVHmdYYwCdwEAyEeilIDbMe3AJMOMTjaxbIg4SkEeUHYndvevq2noWTmR40K //3g== 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=+bF0wgyuousrsBjw1bti5ZYiRgHZLvFxR0KyJROcYJo=; b=kxi6cYz694gNF9PippUMQjxed0/HTFxT+hpIJj5eONZwyD0d+fGQDi6fMLRBpEkBLb VNYyqRatmTNktcPG4+35JYSr1PEasY3522OKkLxIHSGQZbl3s4496zW5OVwOITzvkpho y1tYXVxhQx5IM4mjg5KPrl4RVhMaufUcJVDp5qQkeSoA5bWqCGrqUSjTJn5XmjVeG4BY YHrD5WNPtOtujbCw0r7t7UMeOIs/6vmQkX4Xml2KWLdpbAkf9nHSPuNpJZoaMyq4ayGq MAz+k/6X5wg8Hgd1ABif7R7g9qOTgmNw+iPftSUhg3VqZsbU/6XSFwA5RehCLi1o0hKy wl5A== X-Gm-Message-State: AOAM531XohnDHv1Yu0pEWUKHxV0ELjDEcLsaz3hrMHC9yQZYYiTukq4E R4PMUb50X+D4m6lNiQPjE7k= X-Received: by 2002:a63:505d:: with SMTP id q29mr16119348pgl.89.1612777439189; Mon, 08 Feb 2021 01:43:59 -0800 (PST) Received: from localhost.localdomain ([49.207.205.214]) by smtp.gmail.com with ESMTPSA id k69sm12208958pfd.4.2021.02.08.01.43.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 01:43:58 -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 v5 06/19] crypto: ccp: convert tasklets to use new tasklet_setup() API Date: Mon, 8 Feb 2021 15:12:25 +0530 Message-Id: <20210208094238.571015-7-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210208094238.571015-1-allen.lkml@gmail.com> References: <20210208094238.571015-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. Acked-by: John Allen 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