From patchwork Fri May 14 16:12:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Anna X-Patchwork-Id: 439036 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=-19.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 AF500C433ED for ; Fri, 14 May 2021 16:13:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 790C661442 for ; Fri, 14 May 2021 16:13:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232955AbhENQOL (ORCPT ); Fri, 14 May 2021 12:14:11 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:38384 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229932AbhENQOL (ORCPT ); Fri, 14 May 2021 12:14:11 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 14EGCq4c130809; Fri, 14 May 2021 11:12:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1621008772; bh=YSz5ZzwYTAOT6ei8Kseph07xBTeULMtnxUdf40KMmaQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=dX1AYcBfQPSPJPnpGiGZ0icM/enMu5aWMjxkL5fHO1xIHyeyqNROluExor+a7Xlxc JpxJT+cytB+IEnaC2ZfGHo4QzfWVZbBye1guoI/p1DJ1/8nhNAhIbmM5EVtbFTGoop IyATEoxe6v8bBQZCPXmoQ3jlMr0gI8slJ6/VYfXI= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 14EGCqAD007529 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 14 May 2021 11:12:52 -0500 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Fri, 14 May 2021 11:12:51 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2 via Frontend Transport; Fri, 14 May 2021 11:12:52 -0500 Received: from fllv0103.dal.design.ti.com (fllv0103.dal.design.ti.com [10.247.120.73]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 14EGCpr0049105; Fri, 14 May 2021 11:12:51 -0500 Received: from localhost ([10.250.35.60]) by fllv0103.dal.design.ti.com (8.14.7/8.14.7) with ESMTP id 14EGCpCi035305; Fri, 14 May 2021 11:12:51 -0500 From: Suman Anna To: Herbert Xu , "David S. Miller" CC: Deepak Saxena , Tero Kristo , Keerthy , Gowtham Tammana , Vaibhav Gupta , , , Suman Anna Subject: [PATCH 1/6] hwrng: omap - Enable driver for TI K3 family Date: Fri, 14 May 2021 11:12:41 -0500 Message-ID: <20210514161246.22517-2-s-anna@ti.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210514161246.22517-1-s-anna@ti.com> References: <20210514161246.22517-1-s-anna@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The TI K3 family of SoCs have a SA2UL IP that contains a SafeXcel IP-76 RNG block which is supported by the OMAP RNG driver. Allow this driver to be built for TI K3 family as well. Signed-off-by: Suman Anna --- drivers/char/hw_random/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig index 1fe006f3f12f..6450074c0ad7 100644 --- a/drivers/char/hw_random/Kconfig +++ b/drivers/char/hw_random/Kconfig @@ -165,7 +165,7 @@ config HW_RANDOM_IXP4XX config HW_RANDOM_OMAP tristate "OMAP Random Number Generator support" - depends on ARCH_OMAP16XX || ARCH_OMAP2PLUS || ARCH_MVEBU + depends on ARCH_OMAP16XX || ARCH_OMAP2PLUS || ARCH_MVEBU || ARCH_K3 default HW_RANDOM help This driver provides kernel-side support for the Random Number From patchwork Fri May 14 16:12:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Anna X-Patchwork-Id: 439034 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=-19.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 8AE6FC433ED for ; Fri, 14 May 2021 16:13:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 647D36145A for ; Fri, 14 May 2021 16:13:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234168AbhENQOY (ORCPT ); Fri, 14 May 2021 12:14:24 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:38414 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233384AbhENQOX (ORCPT ); Fri, 14 May 2021 12:14:23 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 14EGD71b130858; Fri, 14 May 2021 11:13:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1621008787; bh=mEP1drGQdY1DIPP5kt3sswSyjbGDBGVFQU+imuQkVZ8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Svu7RKNaGvzax5WH/XgSCzkuwEH5KKUKiuwuSKveN9TLFYA9QojjlaXgW91XByHNc 6Wqd83+ERHpXQ4Jn9Ps3/0qQKMwGe4QgPGvnEwNNYNmmRlGLkcMwcx30/f+MXI0XN3 11APruwqqJgOikRyS6U+HD8PYj0TebzXkrGEYxbk= Received: from DFLE107.ent.ti.com (dfle107.ent.ti.com [10.64.6.28]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 14EGD7ao008254 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 14 May 2021 11:13:07 -0500 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Fri, 14 May 2021 11:13:07 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2 via Frontend Transport; Fri, 14 May 2021 11:13:07 -0500 Received: from lelv0597.itg.ti.com (lelv0597.itg.ti.com [10.181.64.32]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 14EGD7OY049818; Fri, 14 May 2021 11:13:07 -0500 Received: from localhost ([10.250.35.60]) by lelv0597.itg.ti.com (8.14.7/8.14.7) with ESMTP id 14EGD7sB009693; Fri, 14 May 2021 11:13:07 -0500 From: Suman Anna To: Herbert Xu , "David S. Miller" CC: Deepak Saxena , Tero Kristo , Keerthy , Gowtham Tammana , Vaibhav Gupta , , , Suman Anna Subject: [PATCH 4/6] crypto: sa2ul - Use of_device_get_match_data() helper Date: Fri, 14 May 2021 11:12:44 -0500 Message-ID: <20210514161246.22517-5-s-anna@ti.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210514161246.22517-1-s-anna@ti.com> References: <20210514161246.22517-1-s-anna@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Simplify the probe function by using the of_device_get_match_data() helper instead of open coding. The logic is also moved up to fix the missing pm_runtime cleanup in case of a match failure. Fixes: 0bc42311cdff ("crypto: sa2ul - Add support for AM64") Signed-off-by: Suman Anna --- drivers/crypto/sa2ul.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c index a215daedf78a..9f077ec9dbb7 100644 --- a/drivers/crypto/sa2ul.c +++ b/drivers/crypto/sa2ul.c @@ -2388,7 +2388,6 @@ MODULE_DEVICE_TABLE(of, of_match); static int sa_ul_probe(struct platform_device *pdev) { - const struct of_device_id *match; struct device *dev = &pdev->dev; struct device_node *node = dev->of_node; struct resource *res; @@ -2400,6 +2399,10 @@ static int sa_ul_probe(struct platform_device *pdev) if (!dev_data) return -ENOMEM; + dev_data->match_data = of_device_get_match_data(dev); + if (!dev_data->match_data) + return -ENODEV; + sa_k3_dev = dev; dev_data->dev = dev; dev_data->pdev = pdev; @@ -2420,13 +2423,6 @@ static int sa_ul_probe(struct platform_device *pdev) if (ret) goto destroy_dma_pool; - match = of_match_node(of_match, dev->of_node); - if (!match) { - dev_err(dev, "No compatible match found\n"); - return -ENODEV; - } - dev_data->match_data = match->data; - spin_lock_init(&dev_data->scid_lock); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); saul_base = devm_ioremap_resource(dev, res); From patchwork Fri May 14 16:12:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Anna X-Patchwork-Id: 439033 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=-19.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 02A0BC433B4 for ; Fri, 14 May 2021 16:13:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D58646145B for ; Fri, 14 May 2021 16:13:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234389AbhENQOg (ORCPT ); Fri, 14 May 2021 12:14:36 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:39830 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234061AbhENQOd (ORCPT ); Fri, 14 May 2021 12:14:33 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 14EGDHpI083558; Fri, 14 May 2021 11:13:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1621008797; bh=vXSH04tSnl7PfQFFczb4yWsfxSBpijqYvTaWF7m0q5c=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=mF+voaCdkjEYOOAmzeiiQibIyCvg9SxFTqJSExSawnZqjizHye+vKyQMSv73nfFKd kSPJY7abJS4FJ1HTCM+2CVJaoquA5ScFJkRRc0sGfU2FNOdrKjJfec4Gmkfn8xBrbh T9nwa4Y0zOQDk4J44vNwT8Dbr/pu+M+b7w2h9fOo= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 14EGDHsK066034 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 14 May 2021 11:13:17 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Fri, 14 May 2021 11:13:17 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2 via Frontend Transport; Fri, 14 May 2021 11:13:17 -0500 Received: from fllv0103.dal.design.ti.com (fllv0103.dal.design.ti.com [10.247.120.73]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 14EGDHI8050019; Fri, 14 May 2021 11:13:17 -0500 Received: from localhost ([10.250.35.60]) by fllv0103.dal.design.ti.com (8.14.7/8.14.7) with ESMTP id 14EGDHJj035832; Fri, 14 May 2021 11:13:17 -0500 From: Suman Anna To: Herbert Xu , "David S. Miller" CC: Deepak Saxena , Tero Kristo , Keerthy , Gowtham Tammana , Vaibhav Gupta , , , Suman Anna Subject: [PATCH 6/6] crypto: sa2ul - Remove child devices in remove Date: Fri, 14 May 2021 11:12:46 -0500 Message-ID: <20210514161246.22517-7-s-anna@ti.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210514161246.22517-1-s-anna@ti.com> References: <20210514161246.22517-1-s-anna@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org The sa_ul_probe creates child devices using of_platform_populate(), but these are not cleaned up in driver remove. Clean these up by removing the child devices using of_platform_depopulate(). Signed-off-by: Suman Anna --- drivers/crypto/sa2ul.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c index 216702fef945..51bb69bc573c 100644 --- a/drivers/crypto/sa2ul.c +++ b/drivers/crypto/sa2ul.c @@ -2467,6 +2467,8 @@ static int sa_ul_remove(struct platform_device *pdev) { struct sa_crypto_data *dev_data = platform_get_drvdata(pdev); + of_platform_depopulate(&pdev->dev); + sa_unregister_algos(&pdev->dev); dma_release_channel(dev_data->dma_rx2);