From patchwork Mon Dec 7 08:59:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Pais X-Patchwork-Id: 339848 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EE9AC4361B for ; Mon, 7 Dec 2020 09:01:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE1382333D for ; Mon, 7 Dec 2020 09:01:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726452AbgLGJBP (ORCPT ); Mon, 7 Dec 2020 04:01:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726207AbgLGJBO (ORCPT ); Mon, 7 Dec 2020 04:01:14 -0500 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB32FC0613D0 for ; Mon, 7 Dec 2020 01:00:31 -0800 (PST) Received: by mail-pf1-x42d.google.com with SMTP id c12so2089571pfo.10 for ; Mon, 07 Dec 2020 01:00:31 -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=nllu/1tGGDrEMJ/oLNxcbjQW0tHY+y5w5t3p2pyUa+M=; b=coDYmNpHSBdexEszS/lxNf+euhBncaDaj/GZHlSSADcBf5TZE0aDXv/F5x+8VM61Vd s5KfRX5O37Jb/lNu4mNT8Bx9GqUYSkdvXYq9K8XXC+xOlJrZIVsPV9nmRe43ZVWVksVp kYPLliJpULr0WMSHryPK4Q0oEQsU1Dpkbz28oTKONHbyWplTkhFdS5sUosYDMveaBABc 15sHiLZwvj2MC1nRavwZ0gXnLVfKcb9TPl/HKxze8iNrer9LhJ62Gd934ITSMzKE+HG0 8qw+r7lmqmeRY1lHYjeli/Gfr/rGkefLerTabTImvWYiDpY1I2zIStM62h1kVS3C4ey5 fZBw== 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=nllu/1tGGDrEMJ/oLNxcbjQW0tHY+y5w5t3p2pyUa+M=; b=jKws2di7ixX8elXd2te4IbVPYg/BGJKMqZ9CIw4ByKFLQvHB2+iT/xiQlEIT7kwEX2 gD04xtLn2EXahLlpeXwC/y+4zGww2fAvS6JtMJ8MawlOUGECEY4vJrzDPOz274/U1RGr 8lYmWSTUh49l0qGWagAFwg35JiltI7nreqBgI2t9NRsAYAgFx4QT6xsHbxvfgUsMEMfP xI+C0ww9E9KhSG+dCAl6M7gAPb8TigHc+0ej9zNBSp15uq1hR7+j7bqZyoTzBK6zWpUz w0xs3khpvYzFXYeGkrDA7I+FWt2Yj6sdnbKKyKXcv7ndpsgusFMoYyfxe/T+hdvNUtfi d4YA== X-Gm-Message-State: AOAM533VKQHVqdby/wZYwrgTLIo6e1P/yyLT9aybRngjMJyO6TkFKLIv Fw+ns0odex6Y7tetb998P5w= X-Google-Smtp-Source: ABdhPJwwk8liiggnVy6F4SuwIj/Nc9hO+9RpP0MMqzpZ7u0O/1tJ/9qt1x+xCF2w8xqZnLhs6mssNA== X-Received: by 2002:aa7:8a88:0:b029:19d:8f05:b7a6 with SMTP id a8-20020aa78a880000b029019d8f05b7a6mr15035971pfc.39.1607331631239; Mon, 07 Dec 2020 01:00:31 -0800 (PST) Received: from localhost.localdomain ([49.207.208.18]) by smtp.gmail.com with ESMTPSA id w200sm11325029pfc.14.2020.12.07.01.00.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 01:00:30 -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, bbrezillon@kernel.org, arno@natisbad.org, schalla@marvell.com, matthias.bgg@gmail.com, heiko@sntech.de, krzk@kernel.org, vz@mleia.com, k.konieczny@samsung.com, linux-crypto@vger.kernel.org, Allen Pais , Romain Perier Subject: [RESEND 07/19] crypto: ccree: convert tasklets to use new tasklet_setup() API Date: Mon, 7 Dec 2020 14:29:19 +0530 Message-Id: <20201207085931.661267-8-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201207085931.661267-1-allen.lkml@gmail.com> References: <20201207085931.661267-1-allen.lkml@gmail.com> MIME-Version: 1.0 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/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;