Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3689974ybv; Mon, 10 Feb 2020 04:46:11 -0800 (PST) X-Google-Smtp-Source: APXvYqyGPUBdra4l753l/zEz48Lu4A2A+dN/0dSG/zVS0kHcVyeCgPG6HSQ8/Gpo9WtNMju52J8O X-Received: by 2002:a9d:7593:: with SMTP id s19mr863711otk.219.1581338771469; Mon, 10 Feb 2020 04:46:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581338771; cv=none; d=google.com; s=arc-20160816; b=c70SYh1ZAFjDg44hnkKc/Mz+qVWNJDUo2SS5GtEAB4XZvIbZqGEJuDC1Cw3xDk+a4b iHtNVrIjO1dwvlwi1Ay6Ivj2YMtIlXnDL26Hfk0x7rufcIVj7I6FRu26ZGiJT+c7pkDd EKUwDos6J4zqdKca4Gemu5NFc5Su205FNmsF3v6IjiB5xbKcow3QoxYKHeLdcI3bmRsL Q+DnvZ+FwV8zdZSDZqpDVGiT5gCclFu6oGt3Fc4Gzi6bxCs0azmqJpeM6ieraV8kQ8BT sxmUvsRyO+0fElxlreq2BB7VSiet2jMN6KCxQ8WjriismmWZF3azqOwRQ6eWG1abhIzw RTgw== 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=tH5o7Rtcg7KGYeDMEBDBZeUYzjLLp7EBElo3Avzh6X8=; b=FLFRm/g/yRBSo0Y7Lk5jEjlD5CKWa9+a9M/Np6doiynmy8PIz9UyZOBHi/FiPOfvfU 7tL5BVUmlAPSp5sBl08GaSZTn19Po0AydMwWm3tPrNBXOp9d41jNYrSCWSqfDW4+E/1K BwkZ12pJZ56AA6K0Wz6UPtGCRQVseBr4ptsyeDSHWNHHL0u1qahmffqIdGl4j4gdWwoy Zn+WOEKVGxTxWxR4eM8w0+HZOQIb26vhnpc8WGqzcpPvObaUQxI/nuaeiNPtmb7hjXrP qKEf8nqcK4FJ81jOEdlHgZM6pOFdy+pg0XS2OtmTEoi4yowRj47KDI+RXooQLW3GyF9E GVNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GzElSbxd; 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 b5si175756ots.78.2020.02.10.04.45.58; Mon, 10 Feb 2020 04:46:11 -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=GzElSbxd; 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 S1730698AbgBJMor (ORCPT + 99 others); Mon, 10 Feb 2020 07:44:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:41376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728299AbgBJMkp (ORCPT ); Mon, 10 Feb 2020 07:40:45 -0500 Received: from localhost (unknown [209.37.97.194]) (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 180862467D; Mon, 10 Feb 2020 12:40:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338445; bh=0kGnIQmYHLHLyFnEWBAylLFxR0+B2VN0YAnNjlZp0IQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GzElSbxd5x3YMDS5phrGTxOY48tvQdZ11uBSsLlf1DB5POY9KFLftlJxIl48vDIRc UZQgs7NOg22hyiQVm28AsETYQn97FHfUYE6T1zrIv/LWtORoFGIuqBkvUudcznVpHf uXr3Pt6ZLgAtJg8HrWQQlUN8n7UTV4wmoY/DonCA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chuhong Yuan , Herbert Xu Subject: [PATCH 5.5 186/367] crypto: picoxcell - adjust the position of tasklet_init and fix missed tasklet_kill Date: Mon, 10 Feb 2020 04:31:39 -0800 Message-Id: <20200210122441.826444883@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@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 @@ -1595,6 +1595,11 @@ static const struct of_device_id spacc_o MODULE_DEVICE_TABLE(of, spacc_of_id_table); #endif /* CONFIG_OF */ +static void spacc_tasklet_kill(void *data) +{ + tasklet_kill(data); +} + static int spacc_probe(struct platform_device *pdev) { int i, err, ret; @@ -1637,6 +1642,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"); @@ -1694,8 +1707,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);