From patchwork Wed Jan 31 02:00:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 126302 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp272263ljc; Tue, 30 Jan 2018 18:03:48 -0800 (PST) X-Google-Smtp-Source: AH8x225HpI2CpHWqjrxoylGkIA1SYnh8vpQzOXsJn5+vtCyOngAJ9I0+RZ/jCbhqTisWDDXKWkxT X-Received: by 10.101.72.69 with SMTP id i5mr21889858pgs.9.1517364228830; Tue, 30 Jan 2018 18:03:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517364228; cv=none; d=google.com; s=arc-20160816; b=bi5/P+STGLib0MiS8IaIOnH2ohiVnB7KuAxj/8AVvTOE7UjVGCT8nTjC1EX8ACBa3G XTZiwErKl3IDKNEijMqPiMOyuRZ3TEL4n8vZlNeflbTv2cWPiGOAaunl3c8rKLN6bXej 1SgR6RDltRfg8GUWMLno/psJKUxKMwg+zLcaCRZIucSLCyP8H7FIEzHYEWGLmRXtyG5/ ChwXHQACSKDvjt5z4rpdQyn/TRz5W+v0295Fc1LHSNPlMvTSbSjn5YzsacMjD0ar1Yv7 EqL5DNOnD2v0Nh51dXFl1i0M/gxHji6KFMDvWbu93pIZe+0Yz0+DJBARaxPK8oLz8nch Tt3g== 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=uc0nnJoVz4Ozc4VaDT+66vpkrhSa0xuOjchanFlXOq4=; b=utHrudfPDPSNMpcKuOVqcH6qjtu9KhyjBXp9U7z2fktdmoHOZKxbJVLP/OtvP1FtrY 5Ug306kSdl1TLeFwSjmxuG4lq4LhLqOmyrbWbXZ0uEoLviI28U7zg583AVv+ArPYqFBb TXaoHh7HakXfImJ18DNKwAJEhtpbFP2D3SjwS2qk62kHW2NernV8ckdSMWJcBIr5++ST DDZJJZ1A+jtdMMRnHG+fgm8WXnxiEf32rJadAlv5lAmgft4xL4DDANvVJDZKZGAo1Ki0 1DqzosZM+5FOmw167giC1nHG4UjXOWEC+fQ7zKDMfLW8ylahA/XYS+JBQANjfQK4xVl6 P4Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nexus-software-ie.20150623.gappssmtp.com header.s=20150623 header.b=J/ak7NCs; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 s77si15628741pfj.128.2018.01.30.18.03.48; Tue, 30 Jan 2018 18:03:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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=@nexus-software-ie.20150623.gappssmtp.com header.s=20150623 header.b=J/ak7NCs; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752642AbeAaCDr (ORCPT + 1 other); Tue, 30 Jan 2018 21:03:47 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:36673 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752877AbeAaCAo (ORCPT ); Tue, 30 Jan 2018 21:00:44 -0500 Received: by mail-wm0-f67.google.com with SMTP id f3so4895032wmc.1 for ; Tue, 30 Jan 2018 18:00:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexus-software-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uc0nnJoVz4Ozc4VaDT+66vpkrhSa0xuOjchanFlXOq4=; b=J/ak7NCsaqnov+MDooLCVxQwLJsnkcJ+IrBvECFfEwt929TizLpoYr0wPnhC0l6zYX sdFsHwf3vL+uEWyzZAy6PaT81OoB2yX53M2Taxw91AxKTf8HEu/nGilk5WKLbRR/WQXs YGC+HZiiFGNZjxKJnuFYqxIdCVtw4roZgTRuECr/SGyW00C+cA973S1I1YtvdSHsFsJO sLlIY2zSIiVSBXT+u95f+ht6NVHQ6XXTNEezmWMP2E11BeMguw5y5tmuAH/rI1pqDLzc 5lBs8OIEla1+xX+XJo9ePm/jMHAt4pJeSxuCKUQW8S3aAPCK70y9A/KZC99BpQzwsOAb qS6A== 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=uc0nnJoVz4Ozc4VaDT+66vpkrhSa0xuOjchanFlXOq4=; b=sweeRoTAswxjqle7LNEVk5AUvVr3dFx0ZLdBHk7Rd8Ziyb9p4dNr762jp17nz7RwB4 V0mgxl9kdQGvoBEvSCGhbtIq0cA0DctLTuXPI4cNwok6D35sOfWFCFKXkrkYJHl/0jac hrVLhu2yD+Sbe8xk/4IDO/du3u+4cgrZ3ZTlxa6lJoPvUn/QWyMSvdTK0oXuBl9iBGkc 4qq1aR39nuVKgwjLEVuP+6Ub5+LcIfl5Qw83AKU9DvbQdqAQtp4XpAOnAYV7BLmjeW3m iAuFVMekYsvI9D3gP6AoehC9rvqxSdteILRCBLDgMfK7lEW4eOxzH2aF34rD1Z4vCzN2 Dt2A== X-Gm-Message-State: AKwxytdeN3RZ+oF8Se3E6pQSTuXQw97EjDJNqxghQl12tJJfM/LuLbLT ageArToWEXvVLkhCdLJmrzfH6g== X-Received: by 10.80.172.131 with SMTP id x3mr22923578edc.260.1517364043369; Tue, 30 Jan 2018 18:00:43 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id w26sm9030867edw.7.2018.01.30.18.00.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jan 2018 18:00:42 -0800 (PST) From: Bryan O'Donoghue To: horia.geanta@nxp.com, aymen.sghaier@nxp.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: fabio.estevam@nxp.com, peng.fan@nxp.com, davem@davemloft.net, lukas.auer@aisec.fraunhofer.de, rui.silva@linaro.org, ryan.harkin@linaro.org, "# 4 . 12+" , Bryan O'Donoghue Subject: [PATCH v3 1/5] crypto: caam: Fix null dereference at error path Date: Wed, 31 Jan 2018 02:00:36 +0000 Message-Id: <1517364040-27607-2-git-send-email-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517364040-27607-1-git-send-email-pure.logic@nexus-software.ie> References: <1517364040-27607-1-git-send-email-pure.logic@nexus-software.ie> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Rui Miguel Silva 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. [bod: changed name prefix to "crypto: caam: Fix .."] [bod: added Fixes tag] Fixes: 67c2315def06 ("crypto: caam - add Queue Interface (QI) backend support") Tested-by: Ryan Harkin Signed-off-by: Rui Miguel Silva 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: Bryan O'Donoghue --- drivers/crypto/caam/ctrl.c | 3 --- 1 file changed, 3 deletions(-) -- 2.7.4 diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index 027e121..98986d3 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -809,9 +809,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 Wed Jan 31 02:00:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 126301 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp270335ljc; Tue, 30 Jan 2018 18:01:19 -0800 (PST) X-Google-Smtp-Source: AH8x224LSazF2QNoYyxcPntXzT3lhgYmw36ZtqXXpQYMAJlIlYwOoF4uPl9DrEjPGN9aE9lrvtbf X-Received: by 10.98.196.205 with SMTP id h74mr32002036pfk.129.1517364078972; Tue, 30 Jan 2018 18:01:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517364078; cv=none; d=google.com; s=arc-20160816; b=kcj9uWuGc/o5xi5kPtKBM0uNRf3Cts3wqhgGtSHD3jjx+pkQZC5+7liZ/ucA6jRPTp LcCWm5UXVDgwot3gvb1rjYHAPIuecVXm8V00ChOgkp7tUwYuHA3lim0bGmZFbzon2ufE gi6E6ti2//eaOp8t2AEA2uFs/uQ/jgHSDHBFTE3WY7eX5Gy/0nJ1/hGRdoNPx3dPFx83 k71HeWr4AliCqwJaSi3cf9jRZEzmMhxdTgr+RdCJS7icftzqMW4y1JuP/XMLXBP2u4sC KfTkvJky52eWL3ygf3L7/Agedyu013OIb0j6YbS/jCCUEiM3o6vstu9hna4aG4yxmdqg xH3w== 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=k/mtmFcZjhbujFvF90cmhZRC2Eyj/wHY3siJgMSaLUk=; b=JQEYG5PvuRH1wXkb74bqA20fezbFVoB90kWd+QR40Cy6czwgXI4p162A+mOh0OCnYo RdIA7vXv9l8edNq180GfaAyU+qidMmQtt+nieLx6kMbxa0ogS3ato3e6UPlfCUgGOGuv U9TvS14QfUBmjQA89jbUAI7vxb0he1FG8IL+t7Hrn1uGS/utGwEA12X9hsGuK6I5AXTG SAPnwspyXzc/fqOxORTm7YoUCejeeZcBXUJ1YzCokZH6X5jJPxIr2fqEjpdx+L3K5az3 bTxRGRNYL3VPFGXcgNViTJpiVWizX0pEH4apBp2F+34P9LrQqxDC1X8rRL4joGVaomzz uXjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nexus-software-ie.20150623.gappssmtp.com header.s=20150623 header.b=uJZSNvOc; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 i17si434451pfk.151.2018.01.30.18.01.18; Tue, 30 Jan 2018 18:01:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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=@nexus-software-ie.20150623.gappssmtp.com header.s=20150623 header.b=uJZSNvOc; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753080AbeAaCBR (ORCPT + 1 other); Tue, 30 Jan 2018 21:01:17 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34139 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752940AbeAaCAr (ORCPT ); Tue, 30 Jan 2018 21:00:47 -0500 Received: by mail-wm0-f66.google.com with SMTP id j21so6196766wmh.1 for ; Tue, 30 Jan 2018 18:00:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexus-software-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k/mtmFcZjhbujFvF90cmhZRC2Eyj/wHY3siJgMSaLUk=; b=uJZSNvOcxawQk0MZ1+a1V55xeH+ORmOdxI38FnCO3GzQVeXpLoIkfOpbaBgyK4fe7T qwDfTWQ74m98ap6Xnax8jIZINhfRltcFpdIMgESZpfQ8gSCU5E211HNkfxdtzOE3TYYE mZGHZBpQ/euMTQQwTF8yq+X4EPvH3C7pCxfLBC7uNB1tON/3fYp97bCWXHNB1vchqnpD vbCAlJwNc8qFBxL95KUQ/HFA9/hXjtDjnoqQrZqKcUi/XOCGWREIr77JbOHdf39C6qHl kjfJjKDKiwT5oCZ0ZFdQxqke7sDlhrSzlTybz2EYFxy5PVqim7uk2jMGnUt8MAynSRo3 zciQ== 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=k/mtmFcZjhbujFvF90cmhZRC2Eyj/wHY3siJgMSaLUk=; b=jzAQ5DGrKeXlHU2n8jYH86bbwsv+yd7T4Ub66UakQF6qTBRhJ6L6zXjaxpqR0bBzN/ ujd9MbUF+g5TXnoxTFVlSNMq57oqrtwO/VOkFWGJZjq4s1TRIuYikuihLvqavx7yeWIn fmq3OYt6AUL1vT5mYwrMgV8dxriH/RKYaQtc9B5ZCZi680X0g6fjnhS+SrHN39d/D18D Ijna3C9qTfpjppsQS84PMfoWMX7/keAcGmBrhHqHBfqWOgIZv5LY5Q6FW7UogUfX2AY3 wjx0rpgyLFlxPo7RXL4bCpZv95G4GkwjC5rPyLCAa4odRIUAYax0ZVl+/t353l6eLhAW Tl1g== X-Gm-Message-State: AKwxytc/X8EvjagfEvF5rAzTCaYFWfxNnQ3wfiKdoLLvsclSpJeEhndw 6OW2xRMvm7aRNhJky6yKBi3DEw== X-Received: by 10.80.139.2 with SMTP id l2mr55007640edl.14.1517364046619; Tue, 30 Jan 2018 18:00:46 -0800 (PST) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id w26sm9030867edw.7.2018.01.30.18.00.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jan 2018 18:00:46 -0800 (PST) From: Bryan O'Donoghue To: horia.geanta@nxp.com, aymen.sghaier@nxp.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: fabio.estevam@nxp.com, peng.fan@nxp.com, davem@davemloft.net, lukas.auer@aisec.fraunhofer.de, rui.silva@linaro.org, ryan.harkin@linaro.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Bryan O'Donoghue Subject: [PATCH v3 4/5] clk: imx7d: add CAAM clock Date: Wed, 31 Jan 2018 02:00:39 +0000 Message-Id: <1517364040-27607-5-git-send-email-pure.logic@nexus-software.ie> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517364040-27607-1-git-send-email-pure.logic@nexus-software.ie> References: <1517364040-27607-1-git-send-email-pure.logic@nexus-software.ie> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Rui Miguel Silva Add CAAM clock so that we could use the Cryptographic Acceleration and Assurance Module (CAAM) hardware block. Signed-off-by: Rui Miguel Silva 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 Signed-off-by: Bryan O'Donoghue --- drivers/clk/imx/clk-imx7d.c | 1 + include/dt-bindings/clock/imx7d-clock.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) -- 2.7.4 Reviewed-by: Fabio Estevam diff --git a/drivers/clk/imx/clk-imx7d.c b/drivers/clk/imx/clk-imx7d.c index 80dc211..52ab096 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 e2f99ae..2bc5618 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 */