Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp707937ybv; Thu, 13 Feb 2020 08:06:59 -0800 (PST) X-Google-Smtp-Source: APXvYqzHHS9bD5YFZxHTO/xceRz1SU862N49aryj9RKmir/tamwEm3Ld7TZUnWTXRbrJL7CSs+M8 X-Received: by 2002:aca:eccd:: with SMTP id k196mr3237392oih.95.1581610019733; Thu, 13 Feb 2020 08:06:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581610019; cv=none; d=google.com; s=arc-20160816; b=Ky6PL5fZ0vXerX0J5sPlGaXcYhZYhSSQcTY6GBxYtrtQSii3bo3cpm78Y7z+H+iVpE 7M+P/JvSbZ5xQ2ktB+gq4v+402H1NBgjGe5HuGgfqGwxX3ivjSagZVCLHxGB1OZhbq9P MgpThnzDCB8zemWD6sV7N/olxTSJphOvi9xwcUwmnTL0XWwm6kX4Md448k+IeOsAdvp/ prn6PoeCyoFoK2MVKdQUSOEn7c82fPWl+5I1zIAYPe5znhvo+Q4alXLX4YnymdiLnT+S dyGZbeuwEi3c6XzNlBvUbtuEWW836MO7It0uRffLrJO3apULFf2+i8fiWj663eBNqS6K XiFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0xvGwOPDh9QgUjlBIuyxeXQYNY0tAxTj8IcR2IYh69w=; b=CLyTUlbjiNRrV0z5m0nRVS3ruzgnzKbWPU0b7od/QLDiQePtzMGQocOKtME2IKvnKE LuL9uSaq8ESDReLXWUuoPSeEuTT3oD3RgE1YfQKLpNFr1eDyGyFnTTPNQPaPyhSfFHeK a5gJXWYcQmxKBAwAUC00mzZ1boDqT1zIFruduJ1NdsZs/o0oxVjMGnntOU9RuLaSFjoP mf16s0qElwvyE5cye8U7vH5rqdDkjUNgidAMuFooRD2bXUVM6tjbK40P6/Ak41kmUazx RmBfFls6EBbelNz/PPbeqpV8BnGSjAScBuM5TW8G8GwXfpWzhD/H4BaaGcg8E56Tvta6 1Jwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jQJY2Iip; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9si1330717ois.90.2020.02.13.08.06.42; Thu, 13 Feb 2020 08:06:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jQJY2Iip; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728807AbgBMQFp (ORCPT + 99 others); Thu, 13 Feb 2020 11:05:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:35458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728473AbgBMPXq (ORCPT ); Thu, 13 Feb 2020 10:23:46 -0500 Received: from localhost (unknown [104.132.1.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CDDAC24690; Thu, 13 Feb 2020 15:23:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607425; bh=Vhtu+GJd61zC6VEPXpl3uRiKHP47EvSOLhiqTowZbW8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jQJY2IipXAzSlnHUly93KVW5IGOQukTWPNq1m8NyfrlxVIM4JlG8XSpvMgxPUsoYp jOmmy3iBpZNbUtcP8YqI1bOV6DdHCXrx5tII3BoOzQMyBdJFKVySLE99UNrDtbLq4c Km94hRvbpVY/wVYNN5Sc2SE6VhVEFvWRhe8OdTpY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chuhong Yuan , Herbert Xu Subject: [PATCH 4.9 039/116] crypto: picoxcell - adjust the position of tasklet_init and fix missed tasklet_kill Date: Thu, 13 Feb 2020 07:19:43 -0800 Message-Id: <20200213151858.326928796@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213151842.259660170@linuxfoundation.org> References: <20200213151842.259660170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chuhong Yuan commit 7f8c36fe9be46862c4f3c5302f769378028a34fa upstream. Since tasklet is needed to be initialized before registering IRQ handler, adjust the position of tasklet_init to fix the wrong order. Besides, to fix the missed tasklet_kill, this patch adds a helper function and uses devm_add_action to kill the tasklet automatically. Fixes: ce92136843cb ("crypto: picoxcell - add support for the picoxcell crypto engines") Signed-off-by: Chuhong Yuan Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/picoxcell_crypto.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) --- a/drivers/crypto/picoxcell_crypto.c +++ b/drivers/crypto/picoxcell_crypto.c @@ -1632,6 +1632,11 @@ static bool spacc_is_compatible(struct p return false; } +static void spacc_tasklet_kill(void *data) +{ + tasklet_kill(data); +} + static int spacc_probe(struct platform_device *pdev) { int i, err, ret = -EINVAL; @@ -1674,6 +1679,14 @@ static int spacc_probe(struct platform_d return -ENXIO; } + tasklet_init(&engine->complete, spacc_spacc_complete, + (unsigned long)engine); + + ret = devm_add_action(&pdev->dev, spacc_tasklet_kill, + &engine->complete); + if (ret) + return ret; + if (devm_request_irq(&pdev->dev, irq->start, spacc_spacc_irq, 0, engine->name, engine)) { dev_err(engine->dev, "failed to request IRQ\n"); @@ -1736,8 +1749,6 @@ static int spacc_probe(struct platform_d INIT_LIST_HEAD(&engine->completed); INIT_LIST_HEAD(&engine->in_progress); engine->in_flight = 0; - tasklet_init(&engine->complete, spacc_spacc_complete, - (unsigned long)engine); platform_set_drvdata(pdev, engine);