From patchwork Thu Feb 22 14:22:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 129252 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp650884lja; Thu, 22 Feb 2018 06:23:32 -0800 (PST) X-Google-Smtp-Source: AH8x225MknV76E2Fdwix9ps5nJ8lyD4y7vFs3MVA33KZ9K/mOfvotumhC91o0uhku9S1ME1C4UH8 X-Received: by 2002:a17:902:b215:: with SMTP id t21-v6mr6859056plr.414.1519309412132; Thu, 22 Feb 2018 06:23:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519309412; cv=none; d=google.com; s=arc-20160816; b=nUXXEommRrGQYXfa7L+/GLslzYC2gTMfcjoUJv9gi/3sG3ywysjcYoaPnbQajrMLoo cOMjOQJ8ZN6jlyMZb24wZ9a5nKPWkZxaw8Gls8mcv36r7LYSpQ4uDFkfJ/mxh8UlNZnT TmOteX3AZOKZkQ05zHOkY6hpm0ITK1uYMoX9w6i6hKxGIdqti/2PJsJ5cNchcTysYO1P 4pD+O+Jgn8s28AbW76CrwuqXIFAsRsMdktcJsqDXIaJhBBTUDh5Zah3oXi6amWFsrD4S 1XThlmu1sMzwVgaQXI9MhLy+xuzFM85F3ufyeNIyVBTyhUmmRBKD8aJP0Xg4K0F60beo JK3Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Wh8QljMeAjFdEXTPy7ohXGq00a0zQ29xSWkC2pVDqaI=; b=sKZxobxSVtGsM0xFgcH3iEH7icSSxm56iMyyiflaW7gIl7pvZkSFYC6Zgf9qte8IXh h8fT/z9SSK8rXSaM+5DWhEZ0jtyvM/jbwJ0cUT9jpN6UYRzeIN1JjbHNEoZcIjqOphiA 00jBqVDwiaoJuxLk6yGmApdFQjEyAKUOc03BJKH7C09KRmZ++fB/46LCwiAQnddU30UG 2E7P/EenuFkjvqHa9EtibP7HKVkBSCzsK3UJ9sL/iaRr8M6P2ZRq/k1umXkCG42P/4lH MZDTPgmXdxLrl5O2OXuR5HteeRRO8aKkoAvcQRxUktBZz0Gv3QXGmvZCkxJbdmvIAHNQ D4xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EM0jsAKB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i70si101111pgc.86.2018.02.22.06.23.31; Thu, 22 Feb 2018 06:23:32 -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=@linaro.org header.s=google header.b=EM0jsAKB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932852AbeBVOX1 (ORCPT + 28 others); Thu, 22 Feb 2018 09:23:27 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:39709 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932815AbeBVOXW (ORCPT ); Thu, 22 Feb 2018 09:23:22 -0500 Received: by mail-wm0-f67.google.com with SMTP id 191so4028040wmm.4 for ; Thu, 22 Feb 2018 06:23:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Wh8QljMeAjFdEXTPy7ohXGq00a0zQ29xSWkC2pVDqaI=; b=EM0jsAKBu/dyzWzUAG+5jTVc7D9/FEJRNZg/nb2lTB1BKQPnuzGccTWb/LNfSdW0bg oxY5FRFfqd4N2s7ldoVWdspgWs7/tbWcguO8IBZizM4P6RxF3mICDePn/Q4JvqwykXM2 ti7TcZPBkgqVffJEfepmBFujrjxoBNjGRm3kM= 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=Wh8QljMeAjFdEXTPy7ohXGq00a0zQ29xSWkC2pVDqaI=; b=A6BF4aGRnJR5JUE7DeYLjOUWF3hgbiUFyL1F/dZrIy9OWc+qbglt9UwwGHHqeI1boA ENSOCu/25TzX0vbbcfDtezth4I4jrEnkZ0IlM0jqdza97qTHgMJn6bH97//uqh0TMd1F hykttkS2YTS3vMX7aiC7O5wihhHboye+KyC9w26eEf+Mpl2LPGzBE+RTx2KIq1skM8M5 CWG3oezSjr0giknJiNocPzpxKjBYo/24bLoYY8ffrvHuuylLJu2He4+84OXEnsmnBtfH 61bj1kKkkcjeqnQAD+ooT5pIyXs9OYb+hJbqFxN/SUVFHSLvPBRpJBUR0baNtLrKUdv5 q8qw== X-Gm-Message-State: APf1xPBwaB8YpXdbHkbvnc2YfQ9AjG9BcCsUo3qStyE1Z4ap/y7T8ihd li7WfyTn9C5ZF/v0gfmI3x2Wuw== X-Received: by 10.28.109.10 with SMTP id i10mr5501773wmc.107.1519309400979; Thu, 22 Feb 2018 06:23:20 -0800 (PST) Received: from arch-late.localdomain (a109-49-46-234.cpe.netcabo.pt. [109.49.46.234]) by smtp.gmail.com with ESMTPSA id g96sm239784wrd.73.2018.02.22.06.23.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Feb 2018 06:23:20 -0800 (PST) From: Rui Miguel Silva To: horia.geanta@nxp.com, aymen.sghaier@nxp.com, Herbert Xu Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Ryan Harkin , Bryan O'Donoghue , Rui Miguel Silva , Fabio Estevam , Peng Fan , "David S. Miller" , Lukas Auer , stable@vger.kernel.org Subject: [PATCH v4 1/4] crypto: caam - Fix null dereference at error path Date: Thu, 22 Feb 2018 14:22:47 +0000 Message-Id: <20180222142250.31348-2-rui.silva@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180222142250.31348-1-rui.silva@linaro.org> References: <20180222142250.31348-1-rui.silva@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org caam_remove already removes the debugfs entry, so we need to remove the one immediately before calling caam_remove. This fix a NULL dereference at error paths is caam_probe fail. Fixes: 67c2315def06 ("crypto: caam - add Queue Interface (QI) backend support") Tested-by: Ryan Harkin Cc: "Horia Geantă" Cc: Aymen Sghaier Cc: Fabio Estevam Cc: Peng Fan Cc: "David S. Miller" Cc: Lukas Auer Cc: # 4.12+ Reviewed-by: Horia Geantă Signed-off-by: Rui Miguel Silva --- drivers/crypto/caam/ctrl.c | 3 --- 1 file changed, 3 deletions(-) -- 2.16.2 diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index e843cf410373..361e750f9cba 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -815,9 +815,6 @@ static int caam_probe(struct platform_device *pdev) return 0; caam_remove: -#ifdef CONFIG_DEBUG_FS - debugfs_remove_recursive(ctrlpriv->dfs_root); -#endif caam_remove(pdev); return ret; From patchwork Thu Feb 22 14:22:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 129253 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp650967lja; Thu, 22 Feb 2018 06:23:36 -0800 (PST) X-Google-Smtp-Source: AH8x226/upwOCpR6eJ7k0WM0XQ2A/CBSWTWyYZ5cjY4QG6OR4NVe7tuP15t/57jK3uFcBcbDQ8RZ X-Received: by 2002:a17:902:7b92:: with SMTP id w18-v6mr6577741pll.159.1519309416261; Thu, 22 Feb 2018 06:23:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519309416; cv=none; d=google.com; s=arc-20160816; b=gW/ks84W4UNEftA+7Wxdr0mLqrCAVCMp2ZTLveN+mto6QT8bTwOBrADQeLGdGSbHVl kenRrPFZzpGzrMtYTJy0fvDsMlqpQbFq/1987ngcjE6Su3YSvxTwkVrlI8oZk1Zroa/E 3wAqerJqMZJOlGEX+Vc6f045AG5SRhFocydA8ihy699zOGml4+eMebB40XEItHdLEw9S ATvlWYqsYNejfSjltI7gvd/du6o5Ujd/plMP/44mVr1xe67l9rZ5JBpI41khdYkkNrUH xEbzlU7T7TeajyST8s7mMTOtxCrMV8V5BsBWhPhp3JpD1ELvTZX8osHZQzl0lNbRMg1S X7Hg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=VQLkVYAokuxIGY6q0pRWyc2wH+L5FqZ0zb7KvUrrEME=; b=cId/1rLPFkCP4TNTFW6UgVDeBIUE9xbJ6p3PYFizbTOHR8N+4TYMiKx+0Sv2Zu28Yu WzQatCj0XX2+p8Qvbb6YVgHGXWQ0MHf3UFTBmD+WSqjrvnKvQI2pgliEj1rvZI/Oq1Ka ow3GmU0SBCiBmcZgam7Rw0U6KQC/zGPfn7L8Hy05r1TWvjvhWWrVMFgulyvpviNMSpI8 biJvRtl2PpfR18F2Q4sRqHRykqJQcjzOLVRrbmDJEgNuTxN3wqveC1YIEUgWtXm2Ue5A aYAecbz1q/3cv0Uy+o1BBLKVKPnNoPQH+S25ssDICg4a4UEKM8ubV9GM03834CNMwFIF k3Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jEOX8dkb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si87327pgq.614.2018.02.22.06.23.35; Thu, 22 Feb 2018 06:23:36 -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=@linaro.org header.s=google header.b=jEOX8dkb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932871AbeBVOXa (ORCPT + 28 others); Thu, 22 Feb 2018 09:23:30 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35224 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932848AbeBVOX2 (ORCPT ); Thu, 22 Feb 2018 09:23:28 -0500 Received: by mail-wm0-f68.google.com with SMTP id x21so4003298wmh.0 for ; Thu, 22 Feb 2018 06:23:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VQLkVYAokuxIGY6q0pRWyc2wH+L5FqZ0zb7KvUrrEME=; b=jEOX8dkbGLn+WQLfETh2y438tflJDnOPWNR3dVC+CTiw9rvE34rN9r8bqKovjTEN82 SgiKhQ7r0KbdT35lLXpdGGDMio4L0Ipmnie/encq5HxsVUy3qCVLDXp31jdxCPO8uWWg o/PQbToeqVt7qllidUBV7F1XTd/PGA+1AEFH0= 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=VQLkVYAokuxIGY6q0pRWyc2wH+L5FqZ0zb7KvUrrEME=; b=Try6RGtoOEbNeGsdImqre/ssoHpFXDeC+XEP8u0w5HXkcUdxPgUL38qwfRUNIqmOz9 uIRxMhObj+P0/L8rSHcDQMmuUeBAwc4W9GEg506iYvBqTTWEf6JEs9w8fP/6P9SQ09uM 6dye3QYtegljd4T9e/Q3QOEdU8g/zp3vKUxnxy2z/YODrYNjSyX+utLxRW8nvyTWZ4b6 k9HcysOZW9MZMNga3AYTGpWgewbY02v5EHINWSRnbiW2YA0rhtdszio3WuN7aj5Ozrh+ Rd5TEMwbaj6vfHdbzhiGLkQNCfALECeEZZJPdGzqa+KOXe+Kc/LWbmEAhUqwl5w8YkUh DQSA== X-Gm-Message-State: APf1xPAA4iKzADawcO7G6fzp6msxsZIySIrVe09wY15QHfoAJDeUBc0v yIrZ7jnMl7tu6dwHo1eBpLW9Ag== X-Received: by 10.28.22.201 with SMTP id 192mr4947762wmw.45.1519309407150; Thu, 22 Feb 2018 06:23:27 -0800 (PST) Received: from arch-late.localdomain (a109-49-46-234.cpe.netcabo.pt. [109.49.46.234]) by smtp.gmail.com with ESMTPSA id g96sm239784wrd.73.2018.02.22.06.23.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Feb 2018 06:23:26 -0800 (PST) From: Rui Miguel Silva To: horia.geanta@nxp.com, aymen.sghaier@nxp.com, Herbert Xu Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Ryan Harkin , Bryan O'Donoghue , Rui Miguel Silva , Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Fabio Estevam , Peng Fan , "David S. Miller" , Lukas Auer Subject: [PATCH v4 3/4] clk: imx7d: add CAAM clock Date: Thu, 22 Feb 2018 14:22:49 +0000 Message-Id: <20180222142250.31348-4-rui.silva@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180222142250.31348-1-rui.silva@linaro.org> References: <20180222142250.31348-1-rui.silva@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add CAAM clock so that we could use the Cryptographic Acceleration and Assurance Module (CAAM) hardware block. Cc: Michael Turquette Cc: Stephen Boyd Cc: linux-clk@vger.kernel.org Cc: "Horia Geantă" Cc: Aymen Sghaier Cc: Fabio Estevam Cc: Peng Fan Cc: "David S. Miller" Cc: Lukas Auer Reviewed-by: Fabio Estevam Signed-off-by: Rui Miguel Silva --- drivers/clk/imx/clk-imx7d.c | 1 + include/dt-bindings/clock/imx7d-clock.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) -- 2.16.2 diff --git a/drivers/clk/imx/clk-imx7d.c b/drivers/clk/imx/clk-imx7d.c index 80dc211eb74b..52ab096fb39c 100644 --- a/drivers/clk/imx/clk-imx7d.c +++ b/drivers/clk/imx/clk-imx7d.c @@ -795,6 +795,7 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node) clks[IMX7D_DRAM_PHYM_ALT_ROOT_CLK] = imx_clk_gate4("dram_phym_alt_root_clk", "dram_phym_alt_post_div", base + 0x4130, 0); clks[IMX7D_DRAM_ALT_ROOT_CLK] = imx_clk_gate4("dram_alt_root_clk", "dram_alt_post_div", base + 0x4130, 0); clks[IMX7D_OCOTP_CLK] = imx_clk_gate4("ocotp_clk", "ipg_root_clk", base + 0x4230, 0); + clks[IMX7D_CAAM_CLK] = imx_clk_gate4("caam_clk", "ipg_root_clk", base + 0x4240, 0); clks[IMX7D_USB_HSIC_ROOT_CLK] = imx_clk_gate4("usb_hsic_root_clk", "usb_hsic_post_div", base + 0x4420, 0); clks[IMX7D_SDMA_CORE_CLK] = imx_clk_gate4("sdma_root_clk", "ahb_root_clk", base + 0x4480, 0); clks[IMX7D_PCIE_CTRL_ROOT_CLK] = imx_clk_gate4("pcie_ctrl_root_clk", "pcie_ctrl_post_div", base + 0x4600, 0); diff --git a/include/dt-bindings/clock/imx7d-clock.h b/include/dt-bindings/clock/imx7d-clock.h index e2f99ae72d5c..2bc5618feaeb 100644 --- a/include/dt-bindings/clock/imx7d-clock.h +++ b/include/dt-bindings/clock/imx7d-clock.h @@ -452,5 +452,6 @@ #define IMX7D_OCOTP_CLK 439 #define IMX7D_NAND_RAWNAND_CLK 440 #define IMX7D_NAND_USDHC_BUS_RAWNAND_CLK 441 -#define IMX7D_CLK_END 442 +#define IMX7D_CAAM_CLK 442 +#define IMX7D_CLK_END 443 #endif /* __DT_BINDINGS_CLOCK_IMX7D_H */