From patchwork Thu Jan 21 04:41:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen X-Patchwork-Id: 12034599 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=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 8342AC433DB for ; Thu, 21 Jan 2021 04:43:19 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2473E206FA for ; Thu, 21 Jan 2021 04:43:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2473E206FA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+I4Y6tGgzAItwUK8UuF9xVKMkhTJBYIyI5oFF9FTDzo=; b=oB+CLXQZEPSlpfeztVXgkyq7r tOxBP+6xYcChQSZ/2Y/LM1+gPQ8kJoRijItoWuuEY2mwRySpWanX9jqE8EkLluH6aJ3KijzLihExL eIQP+FJ8WPUax0m21+w7cgcXg8KGPiCM1iC5LynN6GTyNBUxdo001KIApXTKWvVOk7/sBuUdCsZAB 9ZOl9BsHAKv4E33vhDG5soyQlVAZur2+8+e6PAjLaArlbbTW+9rjpsDxmCcegfyTbVdwJ0fClfIK6 9cmSkZqXOUj33ad2kXRpGv4B2AFkR0GN6EBdISM27jwc2Cocus5YhJOhF/cWnDlDHJF1rlA7gzGFU HfWad4MVg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2RoH-0007uW-2N; Thu, 21 Jan 2021 04:43:05 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2RoD-0007rx-Ff; Thu, 21 Jan 2021 04:43:02 +0000 Received: by mail-pj1-x1032.google.com with SMTP id u4so806255pjn.4; Wed, 20 Jan 2021 20:43:01 -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=uwo40ct7uzVjK8NcMtTbNQmNhWXoxMbACC3WJlaa3jg=; b=mOt0I8IJqC+wrRNcL/D6svMb/21zM8fB7XcpWJI9cOayuT+wX0dkbPdM8rYbJz4O3N 60x1u8ipN8sDaBnJ7ZamtUdJtANHEtMTIqUXe6+oKcFmkV/StKOsWDPYeMlyCr67baBs kyU4UM13Gsk5piZjRtNBjavM4rOt4L4fhOetcrEtfEbUzM8qhFBhR9wwPdrzxZopt6He zNPk8wM5Ihjo1zIN2+guAfHDTq0nYYHeeWYy7woqepxvQWxjaLyMqGmBZe5tUVRnLbGB y8uenFTI2C3wc+kMIIydahS2SSdfSA504CTqkghs3dM0W8V5x+oMmpQHCsU8lu+Whrxs ygTQ== 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=uwo40ct7uzVjK8NcMtTbNQmNhWXoxMbACC3WJlaa3jg=; b=mYWIwD5OQhhx46A86tApAUzMU8mvDUNrEnpz6Fgyw5FUXkwHxPqI94F9PvtOrtNMPX GST7IrPs7EDAODmjfE6CBhOn8/YX69GFRp1mIYsDdYJOuIpmwQzNhLI/k+5dKnGnDSWK +uC8Y12KQN//rnDtG+sghRRYy6P+CzILJHV3MwtbL+lLIE6OJCIQaJKIwMpiJ8Naujl5 ybzculZqV7Zargt2T1pQI+8uTrlgVgtqyUG25mz5ZxZq/D9RXcBAKlcqxEy/cdfDiiMu x9/bImTM++KIbACMSej5uwK0jgwzXmS9JhzLexvk69lF8Z5DSqGLk95nDJKHvnv/qrFC qvew== X-Gm-Message-State: AOAM532MSk6JQDaKbfmMF6V8vE7uW+eUqLXc6n1eredhVqfRPgBjKLPc jDAVkAlJYTciHHzMhcDqBzU= X-Google-Smtp-Source: ABdhPJwk13pWm8t4RlLiDyE22PMxbYkpD1T0fVbUYpisrmjHHMmBAtIajDKJyxxf/OxqZYKgEmj9hA== X-Received: by 2002:a17:902:9a03:b029:dc:31af:8dc2 with SMTP id v3-20020a1709029a03b02900dc31af8dc2mr13234733plp.39.1611204179537; Wed, 20 Jan 2021 20:42:59 -0800 (PST) Received: from localhost.localdomain ([49.207.210.174]) by smtp.gmail.com with ESMTPSA id jx15sm3916014pjb.17.2021.01.20.20.42.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 20:42:58 -0800 (PST) From: Allen Pais To: herbert@gondor.apana.org.au Subject: [PATCH v4 07/19] crypto: ccree: convert tasklets to use new tasklet_setup() API Date: Thu, 21 Jan 2021 10:11:14 +0530 Message-Id: <20210121044126.152274-8-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210121044126.152274-1-allen.lkml@gmail.com> References: <20210121044126.152274-1-allen.lkml@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210120_234301_550957_BACC00E0 X-CRM114-Status: GOOD ( 14.18 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: giovanni.cabiddu@intel.com, alexandre.belloni@bootlin.com, aymen.sghaier@nxp.com, heiko@sntech.de, qat-linux@intel.com, jamie@jamieiles.com, jesper.nilsson@axis.com, linux-samsung-soc@vger.kernel.org, horia.geanta@nxp.com, k.konieczny@samsung.com, schalla@marvell.com, krzk@kernel.org, linux-rockchip@lists.infradead.org, ludovic.desroches@microchip.com, thomas.lendacky@amd.com, arno@natisbad.org, vz@mleia.com, gilad@benyossef.com, gcherian@marvell.com, linux-mediatek@lists.infradead.org, lars.persson@axis.com, matthias.bgg@gmail.com, Allen Pais , john.allen@amd.com, bbrezillon@kernel.org, nicolas.ferre@microchip.com, linux-crypto@vger.kernel.org, Romain Perier , davem@davemloft.net Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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 | 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;