From patchwork Wed Apr 7 15:30:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 417152 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=-16.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 5BC0AC43461 for ; Wed, 7 Apr 2021 07:15:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2CCE26138B for ; Wed, 7 Apr 2021 07:15:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346272AbhDGHPx (ORCPT ); Wed, 7 Apr 2021 03:15:53 -0400 Received: from mail-vi1eur05on2041.outbound.protection.outlook.com ([40.107.21.41]:7137 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1346256AbhDGHPt (ORCPT ); Wed, 7 Apr 2021 03:15:49 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vlla1UVU/KWsRrs+NYhfsEZtF3HJYyvdbDOMvU8zTGRR741RpYzB/x+vbNDGPxLgA2XVihbOJq2uY67TYv0efOs3YZ9Lw1X+tP+wuWlG25mMOY8OAMlSW7B5qPjmxwTehQ1KwSrQCI36ftLg/nM/ZyaL258wfKmVDG2LE2mkepMRkZfWhLA2ndiap5zeLjbCVnD8L3AXW0uiTDpLdW/X9X1Qm0h5BXuYoXfLi7M3yZ0xPzQnCOE/TaVXL5DKqM8Ynl5nSRY7Ved6zLYUsrkseOtDY+dV4KUVkOnpv6kmu77r+FJzpUNGyBufOOk3aGajzLRrCMmcC/A3HiNLYLht1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QJ72kGobutbcDxLx+bWS8PzUgxHjzbso6I9Vt7rhhAY=; b=CQK/ly5GwqQE9RQpb7Wg3kaWcERse51wm/WNHzWm4BQVse6Fikckiso7684I9ZjtAcfSGRIee+myD93KOko1ubLwOh9ZecjI37PIzv1R/jXa3cCzA8twgSOX46eK9PpIbgnWmKaQQ37ZCkkuJkn+P7faTN/p18gJourVuhZVpHakWq6WX2Xcy6VUu/CuwQ8tztygt/smzBOzBxUMvRlXDi0Esdm01bGlQFMwLeVS7yHG1i8y6Jm5l6UaGCG5qGL1LXV0pBHqdOGyvhBt3itEYDDHc6npahFW552KU2BOgBY7m61kV+8rjBsymyKd9r3x3UgFgUVUgv1uesljvyiYmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QJ72kGobutbcDxLx+bWS8PzUgxHjzbso6I9Vt7rhhAY=; b=Vtth+cVAJR760nBCaDxq36+u6+JR1BY4APwerskyMZYn7dKP+tYW6E6jxFXkzavD1a78BDXR9On68cxmrbqLGG5rkQEju1CwVLE0EYiyOA1x6tyBiV1fCZJ5nohtdp1ZPeP2SMa1aBrsMuYTK6O7zN3IUWDmP7YjX852vz0QVK0= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB7326.eurprd04.prod.outlook.com (2603:10a6:800:1b0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17; Wed, 7 Apr 2021 07:15:37 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3%7]) with mapi id 15.20.3999.032; Wed, 7 Apr 2021 07:15:37 +0000 From: Robin Gong To: vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, xiaoning.wang@nxp.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH v14 01/12] Revert "ARM: dts: imx6q: Use correct SDMA script for SPI5 core" Date: Wed, 7 Apr 2021 23:30:45 +0800 Message-Id: <1617809456-17693-2-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> References: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4020.17 via Frontend Transport; Wed, 7 Apr 2021 07:15:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bb11d9f3-3951-44c1-1b3c-08d8f994f17d X-MS-TrafficTypeDiagnostic: VE1PR04MB7326: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:660; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1rFBc14QgaGFyKBFCHydRNsK208oiCsabjKwl6QeA1hYUovohWjqMRUZtUh5dPDJdonZ9wGxTPcOHIhaJiLTCEU+hPo7DE8Bzs9rIdQqPbniQAtvdRAyolu13Mmj52IbMFs5bnRW22VLMFq6GI4jOweJ99qhtmfWWNpl8uFQxBNj9jvqEJqIsQB1NSo9clxrw69X9gvWHlgOPol9I/BicMLYDWWxiLq4I9rEZDj5yJ0Qyf02BRmaqMPA4oWK5W3wUASWIbozZKV/r6gLVyLX5UepKlrRfT0MrfBcnNvBY20sMNAjbCkO+71zUiC7jsEwEuP2UAb2J/yUl/S0WXFSoUhi5YYrNgnzF/XcWKm0pKB5Y0+u49de1bCjRaB9/5PMRFPqgPYULfldwQgURwAwjcSL2dq+a0uwZKVNyZqJ0uO6Kx0DWCWvDiEKZIfFV/37jNkkgcsqN6o/fzOXu4sGVZ8PHjt0YNTxiODQFTtNLbk6Gd29qCvCXOmgNyloUUoLhEm2yOSiQd2WVRDCfO0NBJiL4eDf+N6GtXtcFVcuD/SDiJwq9Xq3gbaQ4Rp1iZl7//SI+gCqRbmIusP3TXgCogRemtc+yipGXn93OsFVn1E0IPBKW8tvgxrpzA43HFxo/SMIrmUYqeO4FjH83cNhq15RR0BVkxnKimUAoJUFnsml//kydKstRPi3smaWErLSEKodQQsZdCfN2KhA/zq/I+1bF+D1xWCMfjsYnV1v5X3bu4hYvFFrLbv2G3OTVMAgMZBJqr/MokyvcC7pQa8vI1EZmWDRntE1dyO5OqOykbBatVlGxVI4wqKHDme5oWbN X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(396003)(136003)(39860400002)(7416002)(83380400001)(2906002)(66476007)(5660300002)(66946007)(66556008)(6666004)(38350700001)(36756003)(6512007)(16526019)(186003)(2616005)(26005)(6486002)(6636002)(86362001)(921005)(478600001)(8676002)(38100700001)(316002)(4326008)(956004)(8936002)(6506007)(52116002)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: vT/cUA+Fk+Z+j/ytk+pjbSk7xzO2LyhQOstaZDTP6Tnsdzwyk2tfNRaHzaf7mPB4/PNzvV0mMFP3mL7fccPRmhTrK5IxBCr5mL6do8+Yqpu+eqgz6bv9+YhRK/cs6YH0t7ZebHjW/o3qiqzABEipMZVL4Q4uQd0hQOYqWbuIPPEclxr/zUQe+3rh8Mdg+DkXoL5BjwZ2XpW38q7XpGvq0TF0WDkZ3XVBBLzCBAuu91ySQED4EUuGIgIFz0HOOahstwDRipjp6h3tEFHlvsbFev44KuGE0Pz8r0OMn1YLj/a8aloTqUDidE45NGafO2vCWVWnrsyZbLcZ4rGMIYkCg+X/6hT4yL6iPrC+RQgi9O611bU+M0q/SPd/twedzbKRb2NywzNsVVK8rMzM53MndsPdCQH9KXub6MjEqrVEaYE1qt4BHQPHznQYIciGOqIGSozh6+glm+iMghhdnS5lQwKoHIqsrN4wqyOOrM4qyGbn0na2JAGbDMKI6eI/Ob4jw7aWQsJVW3jI5KX4QZfcOQR+KUS+4MO1tc93N4z3Un6AAHYx3wCMSX4Nx2PHAI3nvwllSFEH6QGST1XcioBQnEE0d0HkrF7QgSRV3aO67En5zOEimzmuE03uQWuLLbH3GfPMreDdhuqJIyGd0ymvgJabqG3e6uwL/CkgtEWX5lc1PmnZ0cgSzzvakVl+g9vcmU+GT/pVtj0hZU14Pdy+AFITlTGQbT+aLKCO2kxRW4C2s/NvEEmB3rKn3rWGRsEJirr3OmhHdKhzg1Z7WVrxyBtKpGVMvYCBBeWXwhg5rMM3qvfyc6TBm6GYPlcV6wyreu9WkzvpdrfxvbhwB7OxeGWyIAW4ZTs099iZK58nOExREmGGYY+FMXWb0D3jj12D6sGVxPA24sUSmKGR1melygZWe4rJXvJ13DwVMYzbHUDpePns7lkpwLEY8dZBljiItQ3J4LZBlbufnpX5OkFsb8r4t8yTGWqUbWbX4pt1BETNy4XpRNgOh82W1iuJkcM1ljm19XCEtj8nOArnyFg/KCbBmtaiqjHChfomrMQDOouSUH70ABMwdC8bis6m07EQlMUmpNihGPWSzRcUiVr1W6dUMi+gF9CDV5oFn4hqMKo8nRK8OkYJut117A9WhNrQI8z99tqUcDs50YU5NhhbJZ+6lmWDs2Guw0PvLylaZGVfxww+0rvH1pFCdKIQPsKcKHxzrHLIJqXRotipC8kx3/AwVtAuo1SeeCIiZaY1RwMXPo2q6tvgfAy3Ecy2w4wXU+kIhnGMfbgb8CZW9+Axe/PXUa6xRLqet6RmTgywA7NQfTSgV3U+DMh5LVXRB2E7 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb11d9f3-3951-44c1-1b3c-08d8f994f17d X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2021 07:15:37.6848 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cId/K2OZOoZik/mITYwpj1rAs9UubUove9GKV4+Mn29A9U4NLvRLjrv0aS7T1lLiBMSaF24GxWqgUq8VeoKSrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7326 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org There are two ways for SDMA accessing SPBA devices: one is SDMA->AIPS ->SPBA(masterA port), another is SDMA->SPBA(masterC port). Please refer to the 'Figure 58-1. i.MX 6Dual/6Quad SPBA connectivity' of i.mx6DQ Reference Manual. SDMA provide the corresponding app_2_mcu/mcu_2_app and shp_2_mcu/mcu_2_shp script for such two options. So both AIPS and SPBA scripts should keep the same behaviour, the issue only caught in AIPS script sounds not solide. The issue is more likely as the ecspi errata ERR009165(http://www.nxp.com/docs/en/errata/IMX6DQCE.pdf): eCSPI: TXFIFO empty flag glitch can cause the current FIFO transfer to be sent twice So revert commit 'df07101e1c4a' firstly. Signed-off-by: Robin Gong Acked-by: Sascha Hauer --- arch/arm/boot/dts/imx6q.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi index 8d209c1..9caba45 100644 --- a/arch/arm/boot/dts/imx6q.dtsi +++ b/arch/arm/boot/dts/imx6q.dtsi @@ -177,7 +177,7 @@ clocks = <&clks IMX6Q_CLK_ECSPI5>, <&clks IMX6Q_CLK_ECSPI5>; clock-names = "ipg", "per"; - dmas = <&sdma 11 8 1>, <&sdma 12 8 2>; + dmas = <&sdma 11 7 1>, <&sdma 12 7 2>; dma-names = "rx", "tx"; status = "disabled"; }; From patchwork Wed Apr 7 15:30:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 417923 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=-14.0 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,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 EDF43C433B4 for ; Wed, 7 Apr 2021 07:15:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C2E646139B for ; Wed, 7 Apr 2021 07:15:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346256AbhDGHP4 (ORCPT ); Wed, 7 Apr 2021 03:15:56 -0400 Received: from mail-vi1eur05on2070.outbound.protection.outlook.com ([40.107.21.70]:44897 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1346268AbhDGHPz (ORCPT ); Wed, 7 Apr 2021 03:15:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TolRM7+ubBKkOISnae3wMIREXsh+0R4u81qbr9PIp06kQi92gm+eE+5HqP1oqKxWfwQtGtWgrSHJXbl2+Rj3k8x67yjtHfM+H5feiZzJqGwLZIG/xLcuZQH3yltgzLifCYULd+mleLFDwMTGyI7mzrFe4juxyIvcI0aBDfLCbV9LMuMwrcb+n34bzcwF7uVu3T8SiLYeYl6ccQUFRe+s+bZU5CcRYZa3wG3Or4czDZiNsNek8+Wic7r75jYe96E+SuQeXwI8TwOdy0mV0plKV3xzAM1IA6DwjT5Y/XttBS9biiQ75TYCiokbr8g1skQh8V7ALfiAcdqM07JYZtVyzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NohpbX1KCjpCzOGoRNYXm1GGmodOK5+pSXpQ//vTgpc=; b=ZkXxDX9gYHpUo+Z4m6Chg/c3VQtBaUfIQOfphXICjbqRfYYx8mGcs9ASoF2xWJ5j2x6+T6i4leO1RuLV9s8FCpcjAW2AzIvvBEYbTd/yzKpdTC/1WWj1vUPWpFlAhWL+6MI9odZJvzlryNSy0u006rpkv9b9q5km3CdAVgSF1QfU2qx9QolDo2GBfsW9DoBz5jZG5yvch1B7/ZXCPK3elsnHDWMdW/PnjrzFSYOtbgNskTXOIEVNBpB+x9d6COLsQE3UXmSlMaNqadW48DtytHarXvn/W4B/n5Ox4AttGsY2H8jHIrUQtncne2bu0bK1DVweD79I1T1/z4V60/O54w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NohpbX1KCjpCzOGoRNYXm1GGmodOK5+pSXpQ//vTgpc=; b=dRT0/Oc2vGU6coHWFZ8qWTIQ+Jqz4hMRo6RyGyGr8j/83RhkuJdH0MT8iq3FBZPwtIOzy/yzNO5qIqCdhtzJFvHmghwpvbJIIb5hb8oixftiFN1Y4Q9tbBQBsK1jdqVaOjUbEMF9YxQ9Iza9ilfKgJd1Aw71AxEaPNzCTcKN8AI= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB7326.eurprd04.prod.outlook.com (2603:10a6:800:1b0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17; Wed, 7 Apr 2021 07:15:44 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3%7]) with mapi id 15.20.3999.032; Wed, 7 Apr 2021 07:15:44 +0000 From: Robin Gong To: vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, xiaoning.wang@nxp.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH v14 02/12] Revert "ARM: dts: imx6: Use correct SDMA script for SPI cores" Date: Wed, 7 Apr 2021 23:30:46 +0800 Message-Id: <1617809456-17693-3-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> References: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4020.17 via Frontend Transport; Wed, 7 Apr 2021 07:15:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4173008b-1287-4840-7a64-08d8f994f53c X-MS-TrafficTypeDiagnostic: VE1PR04MB7326: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:660; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qi+Iz/lUFZHn1H2gP4+TMGxTBCFND4evvuFlU8/yKzas4UWWcl47II4upnF5Uxmv7OWTvUXRn+8RKJJOPLfZBfulkqHmvK6yIWHO6/ordL8CD2CuqXh6P5PTqOB5vIt6/hojclYB890ldT6r4kXqtqv0DI90d9JwwoDDdL2bCklspHPoFmuV+d+F68V6YAu58HO1zEHxO8mJP2qVc3bV4YR+D21OQLi0hIfrTnYMabSK6Ry+kEwDEeMNCAqlLWx9G8QDh/JkQROMXg5tK7LczVe08ySPHSqd2vjWj9L6yUOghxO8GT23D3ObEXwZBPcPPT1WMhiKGcC5qMWgrbSwYuKchObeF/NEoiaBFaBfXu3/nw8ARAqiGtvSTdGw9zOUh35ihuc3WnnTnD2kgs/4QR3KJ4V/rwn3iz5aUS5ZS0pIzfbQOMrRAWvfMdtHs08b7D7eIontQx7f3AagFU7QRoKrjgC52/G+GJSKFmIDV5AMuRNNOwSZc68TEzQeyZJrpQXf5OhzUs6JLjil47s+kQz2YbjoEAVt7Vt8+LaOkEZbSxhcKyPoalDbdHqHAB6yTzfc0sipuK2gBkGZ/z6LHu7PoDbEGs7qv7fGy0iSoFwfsy+AIqoyCdb7Cav2U+oMC8G9sz6mhpd7r50bk+7AZDaGpgwwnXyEBmeYJGwwS2MEnhNwAc1Jp7PGDCpTeTcUPVVAe9xnXcwuCOi2Ue2wj9d8RcUI4Tg15QGcBjetkg+Qd/+or7/bB9IiNLHafCuknkjOIdaPWAlSw5/zxDSmNw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(396003)(136003)(39860400002)(7416002)(83380400001)(2906002)(66476007)(5660300002)(66946007)(66556008)(6666004)(38350700001)(36756003)(6512007)(16526019)(186003)(2616005)(26005)(6486002)(6636002)(86362001)(921005)(478600001)(8676002)(38100700001)(316002)(4326008)(956004)(8936002)(6506007)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: WXARBfCSs0B1gVdNvtWUVjJyx1qfW5zybrB9PlcmyMa8Xm5yxRYxfffa6fKwstAsoW8srUXHI8LwCKWR9qSdapb27nQWhI8jFbWlL9ALJVTy28i1VwYekvHqJlu/GkBtv+eDHGkz6zEl9xiSjksremTQ2MI4yT1wanfNI9pu0uM2uh2kKOS3U3uxq8tWg9Egwvi6BaspZYEyERXF1E2Dd9RvS0qqWNj/4uUgxR2pyZfQoSyIkBG6hrR0z6anDZnXZPHpAzw+mp5rXJerRxbG9QoV2IeQAx5LS7Ey/k9sMtYzvFSEXnSe2MoPjK1RNXBcT1eVuFrpNsMIg47dI9Reuh1bzxvHkkz9u1iv/OP3xchJ0VKhEZtgCbwUxSchzrCHIQboz1+Z7R2ZifUYN10i3S8zsFQ6xJPiDJCC/PH0bV0T0nSZV+fBzSJ01hQ/VxV+F9u+p59FeFYiLELCkw+aslzl9xQP/cE1HedwyDLoOpTRK2mqw1llP/dctPhYdEADlcAwJuTlOPBQw/owRe18r0ZFYq6AmQU/cW2oIPej1t+ipnhB1rW9DXzQZjZyef5ZtrPiJEVP3p/SbA0l7ixvxlcZYM2tZINVziPgqPTR8u63pgafK8ILWBVz2oGPfy+rJVG/RlXZRiiLpxQOEZfs+gM+ARCi1wzAfymPX1x/PFWOY9gogBrkE2w/ZjboBUnIaqUQjXyih3Dly70H4aYAMDRhenO4hi4lEE2wKhnaghXJsJiFOeBkcTUZdLZvmwKDT4DSZoatOynbAxTLYMdZG5oKMz9E9oosxsLcpjCuW7BPlcGEiPTo7lJhqvdeE45ddHTVhUcRfJ3Zni+OlKnKbYYCJGLgPnJAyVmM+jgpythRRZ4r2eqIJCXFatNNablQPjCQ4KbagIx7iUch7V6mUpl4da1ZHTRUQOupIYjq28z1smyZ8ELgHm33R1KxvGdJ4GbWzocjSc8e6BkYP8D41lvT3ACh6JN6kzKPO4O/SYBWaLOzrDXUe8CLlevLyKAPNNP7fxpSQgE/tBDUvJ2LiXvEBl/S0HS3nDDTrszRH6BQWXL5NxDU0Nw6Dmin6cUZOg5lo65yoC8LYw6qorO3Wf3WXZxZTDEdRI/xG1hkYga0FxnSc8gAiyIK7kP/tYA92KghdZKATBCvdTyApwggkVmsI2InDw0SRTxiXSjaUYGhi4KY7c4J+fTHlL0z44Ki/s3cEIK3DoMaR7+7Z210QXHt0S0gg7Mr7iag+cXP/bLGXgP+QQMTW8cFlNzY1Vt2zSsG1M3nmHXqr1iwwP4BbYbBDkHtuTiHHeAviwWWqOb/+CP6oyzmBeLCK+DiF6JN X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4173008b-1287-4840-7a64-08d8f994f53c X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2021 07:15:43.9451 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Wcj220AiV0MKyyiMQF/3T+t/TK0jVyADbzt4SzgCBkaTMA+xctfaESuSxm0ViU03V5bxcqltM3TsPzEQjkV7CQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7326 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org There are two ways for SDMA accessing SPBA devices: one is SDMA->AIPS ->SPBA(masterA port), another is SDMA->SPBA(masterC port). Please refer to the 'Figure 58-1. i.MX 6Dual/6Quad SPBA connectivity' of i.mx6DQ Reference Manual. SDMA provide the corresponding app_2_mcu/mcu_2_app and shp_2_mcu/mcu_2_shp script for such two options. So both AIPS and SPBA scripts should keep the same behaviour, the issue only caught in AIPS script sounds not solide. The issue is more likely as the ecspi errata ERR009165(http://www.nxp.com/docs/en/errata/IMX6DQCE.pdf): eCSPI: TXFIFO empty flag glitch can cause the current FIFO transfer to be sent twice So revert commit 'dd4b487b32a3' firstly. Signed-off-by: Robin Gong Acked-by: Sascha Hauer --- arch/arm/boot/dts/imx6qdl.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi index 82e01ce..89c342f 100644 --- a/arch/arm/boot/dts/imx6qdl.dtsi +++ b/arch/arm/boot/dts/imx6qdl.dtsi @@ -334,7 +334,7 @@ clocks = <&clks IMX6QDL_CLK_ECSPI1>, <&clks IMX6QDL_CLK_ECSPI1>; clock-names = "ipg", "per"; - dmas = <&sdma 3 8 1>, <&sdma 4 8 2>; + dmas = <&sdma 3 7 1>, <&sdma 4 7 2>; dma-names = "rx", "tx"; status = "disabled"; }; @@ -348,7 +348,7 @@ clocks = <&clks IMX6QDL_CLK_ECSPI2>, <&clks IMX6QDL_CLK_ECSPI2>; clock-names = "ipg", "per"; - dmas = <&sdma 5 8 1>, <&sdma 6 8 2>; + dmas = <&sdma 5 7 1>, <&sdma 6 7 2>; dma-names = "rx", "tx"; status = "disabled"; }; @@ -362,7 +362,7 @@ clocks = <&clks IMX6QDL_CLK_ECSPI3>, <&clks IMX6QDL_CLK_ECSPI3>; clock-names = "ipg", "per"; - dmas = <&sdma 7 8 1>, <&sdma 8 8 2>; + dmas = <&sdma 7 7 1>, <&sdma 8 7 2>; dma-names = "rx", "tx"; status = "disabled"; }; @@ -376,7 +376,7 @@ clocks = <&clks IMX6QDL_CLK_ECSPI4>, <&clks IMX6QDL_CLK_ECSPI4>; clock-names = "ipg", "per"; - dmas = <&sdma 9 8 1>, <&sdma 10 8 2>; + dmas = <&sdma 9 7 1>, <&sdma 10 7 2>; dma-names = "rx", "tx"; status = "disabled"; }; From patchwork Wed Apr 7 15:30:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 417151 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=-16.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 470BAC433B4 for ; Wed, 7 Apr 2021 07:15:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 075D06139B for ; Wed, 7 Apr 2021 07:15:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238340AbhDGHQF (ORCPT ); Wed, 7 Apr 2021 03:16:05 -0400 Received: from mail-eopbgr150071.outbound.protection.outlook.com ([40.107.15.71]:40655 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1346268AbhDGHQF (ORCPT ); Wed, 7 Apr 2021 03:16:05 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mwe9VE5lGkYc60ktY2mxrsTTq63Fvb7NTwwPPKFeloKSzjZwzgrBt/35Xvd/4oM2moN/0rXhD4TKVP3GTwcYN7gTkD4gtqmUV2Xf+kOjmaxVnVHH7ua2zQl7teQG97TmDOqKEs7bJ+yihTkOkHZpVjRCgXjta0zzsGBXSfNDlUM+XIgoBB+ulYTW7ogfJZLhq0CrjNAjNMmJ+oV063kOOmw+40d+0549RCzhUMhpGeygV0Nc+/XwiwR4pd1m8YK4iKdjDXnBexdBsCNlOPHNbFPszm8NgmOloCIuQQvMAI7y5Fp9OoRjWl/5151+rC/qmjUpJimvu+MGs8WCkEs0gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IuhrTIJKl5JhJW4phvz7ezIbJ5GeJbE7LgYQrcWZcSM=; b=oBGlxzJzvwKyWvbIzyhbsThfkty4V3H6ynVbbK2hHnIYyU0UvUGQsJkP6XYK6jw/5l3ddVh26Lv+6WpZER7S0fpfOp3qx4L6nOHXAfK389/6Bb20eseR78M7vYYd2FI2oHgUfPGUJhOhNBqtt7aIF4cU55qyHS1WBSbS3X2wDma3U8MOrZ2YaoWnazIsHqj3z0JAhbn3jAgRs7NzmuI/pHChBfwjc2z6nVjR1Q0F7bCziDJf8qbupilH63lHH18HVAvGgplr4GLsaKqnz9fmVKnpqY4XRIUbLNExmLBhId6p0w89rBPOLnO1R80VZy8OzuC3iB3yWl3e2grzySz6OQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IuhrTIJKl5JhJW4phvz7ezIbJ5GeJbE7LgYQrcWZcSM=; b=aBDdo9rFr0GuaIaCkN5bDcAWv1R9Umk4UmzbrwB+HOrGRgVoS2y5Fu3lIFsVXQrJrBlp9Pqvm738adHtD8f47tDVdXxtfjPBTXUuNIEIadOixs5SAJE1/gO/xJKnKg7zxiHy1AAgZ0izvZSZau4FKcGLvSrPlYue1araAyrN4co= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB6509.eurprd04.prod.outlook.com (2603:10a6:803:125::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28; Wed, 7 Apr 2021 07:15:50 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3%7]) with mapi id 15.20.3999.032; Wed, 7 Apr 2021 07:15:50 +0000 From: Robin Gong To: vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, xiaoning.wang@nxp.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH v14 03/12] Revert "dmaengine: imx-sdma: refine to load context only once" Date: Wed, 7 Apr 2021 23:30:47 +0800 Message-Id: <1617809456-17693-4-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> References: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4020.17 via Frontend Transport; Wed, 7 Apr 2021 07:15:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5230fcbf-ecac-4b87-eb83-08d8f994f8f3 X-MS-TrafficTypeDiagnostic: VE1PR04MB6509: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:132; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: L52Kz+bryOW0sE/gQpf79s9zAu0dd9ao8Xf1DkJML4AfJ6IlT5rjS+wUk693ELMH4cqd7HapC4x0/Yo4OgUBoZF5qLIdSdfM9BRJ53BKsPlOHC+fCKtziEEk/DIbq6osieoqShwvJWDq/pFF5CJoiKvqadT/dHyugEj9Xmo+Vssn5EQgLS0VXrSsfWp+05lUrrB6OASwzVBuNbgYBx5aWgKXvagu6gzFPAeF4GsI+71dk9KcM6O+1IgWkwz5+j08mq08n93Mrph3FCrv1O1qIpk1d+PHFfxP5kpC4xHNoPqtOCy4lpnH2D+3R4vEO2B6s+n1gD/z9dBzWgKiNFkmEIXTG/kpH24lOCb2+H9qQVLdYGI+TCvOcR1y8eIXiFZj9yXnMbeNUG9i4W+kJqHTbI36oy1jSvint35Jl9uSEJn/ZGcFHZp+Oq0VY97f+wsXNyj1vma6JgF3kJr3TXIE285jEIKrtCmXJTEPANbircveqWFjI/1iUO4ksahr4mpalojYnFZwE+2cDR/WdwviclM6Absrc4LvAWoMaGf6rdXKCXfw7AtxlEFjabxXJpI1+IOSpTXiipskN6HnHfxbyZ2pICFmdpbDbCe6UExn9oHEJG9oj9lUcVot2py+UTZyjgHw61e68eFFAV+mVpTYb00mziE7hB52cNlicwLxwrBDHdPSjf7uA+tRTfOVOj3BoYYeFcOKh7fe6bVZ7ufjKQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(376002)(39860400002)(136003)(346002)(396003)(6486002)(6512007)(4326008)(52116002)(478600001)(5660300002)(8936002)(66946007)(2616005)(956004)(26005)(8676002)(6506007)(38350700001)(36756003)(66476007)(66556008)(38100700001)(186003)(16526019)(2906002)(921005)(83380400001)(86362001)(7416002)(6636002)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: F0iYW1RFNMrYLQBCHEG13OBWkqdCVtBMcCweDsxtFYPu/+Mi5HuRp0yRxfvJMnpac+ORqnx0iDUosy0NURJu/kzqcrKWbCd4/4TLAGbmlpAMUUHIjUef1EVPToImICnurDaxFPeN4ZUJ9hYpi6VorbnAaCcDot9wfdPYVoRN/6E/D9FHgIuob4GBVckZIMC40dI0m+BS2e8k/MkmxHkARtFekyRd7RCBcr+h/5eIcxYHBsoSu1J2kGzSzZ2OkWBw/mqLEDORJbZn/7uDt4YL6WyXZgHiQ5+0kxdhXY2sSXyjeHkphMprlY8vpl6Gwpa8z3pkk8ZeniAKJdsAXH+KMgOnp6SQCOlEe0Qjh6/0RLMhPK2c6G70Nw0pCH5BtUafIq67xiPpgl5mIeSTJUk2Z7sWon5TtC/qNO+8eoNZ6nP7lix+r3ag45A8D6DJfJsXA6Nhpd+B7vC3l92qUj6Nm8jebLUlcIPwAbbJa8Js4RT4a+XowkRn1fyg/453h3KbrEjnWLBLci/HOhCp7rwqwkJq+FeTJbG5KdiPKo3VSU5cyi0KccKyokZc2OtBZyuX4MsYvLxhPTncjBh7wFT9eb30wb08+yPJY79GqYmN67AgCPa6uGH1hT5TTZI6qiljb9FrJIqDV1lhqtlg8I9IcI1giIypQyr8LQPNdyaxgyX1WmJPWZKxF2aoGuTVylZ3C8nAb4CJ/04SiCehAY4M4KmWx/+veLvRxaAq//XNCFrp7PVEc/U+loB+coVnxBURZM+weYXwmp/4PU2gLWeV2BY1UM7rjsyfcwpwiStR15B4k8tJTt+XheLhatGJ4NuBW7+It4xgHxjTSKL2WfyEQFCbw52nEw9C9hIDbdVz7es1M+AtiUzZ/rsFo8OChiD4Aip5yP/zeKz9SSGq6QQqR674U/VN//XljUSaKpDHjyVWeyXIiylSWb86SQIKDfc6HHi+xfvxwos/Be7ADOJLi2OQXWEd26gyZIx9aE4zq8gQrkkmAthzS5iRXrnOIL9orQeNisLEVi01Sg2awVp1quz024yveE65X8Fuql3lNSSaZLnK/oT65QXTgFuPw+qIVSxyWIMBUxki5G3cC+GZTfr2DWgxOBbG9KVSFEfKHrXFew4/9GPkN87Z5t6vZUxORxA1Ceb1vP4ezlXP9A9s2RDfCeZhAOFGRNXYSzBmUzxatrUpVAnVxMAjO8LC+6kljSsZBBLYeza7vIRc3mgd7fKsF6DYUzw/kRPip+l0etrRoY0FiQYueCFkV0FjyVmJRpTY0SMDWJSDn8Ad9SO3CqP+9m7EUG4nkpV5cilIcSoeFbzWSy9TYHxd+GdqgzS0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5230fcbf-ecac-4b87-eb83-08d8f994f8f3 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2021 07:15:50.3104 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6IDl7OrmKuvlR8tS9ic2ibGLb3Dl6s8y2dUYmtNTZWHcOXXlrNTtRXncOLd5kbT1w8YR6p5PxlbZ65GVDyH7Qw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6509 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org This reverts commit ad0d92d7ba6aecbe2705907c38ff8d8be4da1e9c, because in spi-imx case, burst length may be changed dynamically. Fixes: ad0d92d7ba6a ("dmaengine: imx-sdma: refine to load context only once") Cc: Signed-off-by: Robin Gong Acked-by: Sascha Hauer Tested-by: Richard Leitner --- drivers/dma/imx-sdma.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index d5590c0..02f8584 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -379,7 +379,6 @@ struct sdma_channel { unsigned long watermark_level; u32 shp_addr, per_addr; enum dma_status status; - bool context_loaded; struct imx_dma_data data; struct work_struct terminate_worker; }; @@ -954,9 +953,6 @@ static int sdma_load_context(struct sdma_channel *sdmac) int ret; unsigned long flags; - if (sdmac->context_loaded) - return 0; - if (sdmac->direction == DMA_DEV_TO_MEM) load_address = sdmac->pc_from_device; else if (sdmac->direction == DMA_DEV_TO_DEV) @@ -999,8 +995,6 @@ static int sdma_load_context(struct sdma_channel *sdmac) spin_unlock_irqrestore(&sdma->channel_0_lock, flags); - sdmac->context_loaded = true; - return ret; } @@ -1039,7 +1033,6 @@ static void sdma_channel_terminate_work(struct work_struct *work) vchan_get_all_descriptors(&sdmac->vc, &head); spin_unlock_irqrestore(&sdmac->vc.lock, flags); vchan_dma_desc_free_list(&sdmac->vc, &head); - sdmac->context_loaded = false; } static int sdma_terminate_all(struct dma_chan *chan) @@ -1307,7 +1300,6 @@ static void sdma_free_chan_resources(struct dma_chan *chan) sdmac->event_id0 = 0; sdmac->event_id1 = 0; - sdmac->context_loaded = false; sdma_set_channel_priority(sdmac, 0); From patchwork Wed Apr 7 15:30:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 417922 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=-16.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 04F33C433B4 for ; Wed, 7 Apr 2021 07:16:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C46CD6138B for ; Wed, 7 Apr 2021 07:16:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346352AbhDGHQJ (ORCPT ); Wed, 7 Apr 2021 03:16:09 -0400 Received: from mail-eopbgr30089.outbound.protection.outlook.com ([40.107.3.89]:25859 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237787AbhDGHQJ (ORCPT ); Wed, 7 Apr 2021 03:16:09 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f6I6QRxOxO0yYfmvexQQE7LSD9lFaSJ3aVUnBJr+1iISv7ZI66Kk5nJbBaPXtH94hTKJGlSNJWp72HT9DY9ZCUfAFEIl4xu2LZlyBhdaGqn8pq2ole8Nplxw/QWDOrAvqIxLd/vcxK+oHxU5yB2nNDuViC3xOfDFB43VY3myxyNWDxEIFn/U6KXfyQRawrEVUHO0Mnw6pt3tV/66+LLg6eKaYk+3HOkO36ZUZ66J86WJ6KEzu6f/rYNkFTfxvFrEwiTS8j8F3cRaPql2x0jF3JcgOT0DmnH9gZ/gYN0lxl1Cs0rp+9p0/PZ6Dj5Tqhc4U6m5whpl4CyBRsMFds4HBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CxxWqYCZL3ulrwAp2tlBDwUh4YE/HLrn3+vQSUeDltE=; b=BfEeCBh9GcPLyqFRNuPCmRWBnqxF49LYY8hPLnAElzsp4X4yPt2ommciMpGxjmFHnjXZYM+uciH7DiemsAYa6oVgltpCOAYjUo+oiGEqiCLSedTDv1rEEjfIzCpxxTzJt36HcH0OlY6qvlViOVTFBjr92mOFiiJ7maSg0y4k3GTJwec+ZHy24Rmo64jk6efLz8/AUepsquYN94RAIVbv3G1F2HY6Nzcf5CIbYNR6TmP9+eg7zYga/W7MM7FchD1tWCmjfP6v3dvcMyNsXygdfIFNokHx7dL4208bBHn2u1pbGuVnNDD0z9W11gNTfRknFn11Bt1pvXm1y0V4Bw61+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CxxWqYCZL3ulrwAp2tlBDwUh4YE/HLrn3+vQSUeDltE=; b=FE+lgtx6FRpFTkXaTDI3NbqVqBfodCm1OQ866VDkBlihXgWghaeDrZHfEYrz3y3jldx97L8N2z+uYuskVxOmhcX1p3wz/hC9699bLtQtGVN8WJCxKCu0HeZk3aUT5lVlj08TWz43FEW7mvsuP3eUxhM18qoa4RP0LUUJ9IgtHes= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB6509.eurprd04.prod.outlook.com (2603:10a6:803:125::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28; Wed, 7 Apr 2021 07:15:57 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3%7]) with mapi id 15.20.3999.032; Wed, 7 Apr 2021 07:15:57 +0000 From: Robin Gong To: vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, xiaoning.wang@nxp.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH v14 04/12] dmaengine: imx-sdma: remove duplicated sdma_load_context Date: Wed, 7 Apr 2021 23:30:48 +0800 Message-Id: <1617809456-17693-5-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> References: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4020.17 via Frontend Transport; Wed, 7 Apr 2021 07:15:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: be86e70c-435b-4f9a-3239-08d8f994fd15 X-MS-TrafficTypeDiagnostic: VE1PR04MB6509: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2331; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +nGiXiCx9/uTcizftfsUaVxlMK6/3JBlJzJmdZt2EhItSCvqc7omxPIXDzv2kfN2Sz565mVFGYYThS6v4f9LVbMXZMc3I5RLHkIFF3U+grdN3va1EnSxCV7RgOh5R+IpRuWG5q1I7bHlJVDNK+kujQkHBPraZtrWjdkWhN8wtdtS0wHhm0+NKFr3P7fGZpb75avPylPygdztvc+/QdqRn5/PaByFJPZJBsPw58dbDrZ9/FFiJbv0BuqXu8thvvmpm2hjhYTvTZgrhnV6u1d6xHdvuPiPT7jAdg7lOGx4YdNRgJuWMNdMwB/R118McvNbRIlqCejLmL22qJDVB6etgG93SZeTnj312FeTASevv6isakdordQgIU7m4PJeaZOWbcT4Q77CXWVfKevoy1ywBvN/jd8CgOgKduEvAOBO0oBWd4amwkUO4goWVTR5GvzfxW5vT7/+8uFdpkYXw/BuElsBPKrlcJ1R8KSeydS1uVvKS4VnWydihpgruL23vAF0Sf1pd+aFxthIPeizpz038ZG/qcylmU0VQ3u6qj0HTGa38yTBLIovMx68SaZs4vOvk/3FDKtKSJ1C1x14nz07AXohb1uLNxtuD+imrXAgEw0hNJwZOTt1CVp/MCwyQfcFhWB0E7HRZSKb8qgCjSiRguv7BdwMxF8WcDet+04SHeD6qSSHwlrsRbDbk1aqfxCnjvQyHdllSOHCsJtDEpOXnA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(376002)(39860400002)(136003)(346002)(396003)(6486002)(6512007)(4326008)(52116002)(478600001)(5660300002)(6666004)(8936002)(66946007)(2616005)(956004)(26005)(8676002)(6506007)(38350700001)(36756003)(66476007)(66556008)(38100700001)(186003)(16526019)(2906002)(921005)(83380400001)(86362001)(7416002)(6636002)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: kEQjzvJx09lpXNbeLTg37xP5vTGEV3c95SvJK5pnfBzXt9Qct308cEI6ftZVTQSr4vjfGiA9aNYTfv+FqkUg0snQYLkuw/0TEgb+boRACwWPI/DBV7/DlRS/4HSEJ1UnO7HR42Q1IEvKt/rhkwSIstwMbjViACjOo3xBY/NgtJ5Z2lASQ+3l8T5fnxq/XgLlh6zPfuB+ZxU1JVKxtEbgtEzc633GvishRF+0hUdC0BAB8TcTs4mCVlRXUCrHjWKaPNR9kDcLY4llaAbYaFseXURWRAFggh2cMWDGfIebqw2qvOea42pipdpxcArnd/F0EZrjLKJGBq8Wwl12CFgtbIkqYRTeHeAl0LWxkVvcAXMHH+ee/VqOBAEoa4DL6kIY+penmzMPaKSclCfIg+5pa6XXLKoLRnAuK3A0j8liZPvnoaZ36O5EIR+EAEBImYWhT4TTC/4Ak+YJP3T+CHXl7ney/VWIwLDQ+21nC8O3Fv/j/wSJ2S/hEIHNg6qaIqDh+QOE4Xd+dGB4c59k7JWkkkGLAoX+iMtauEZ6/I7MjyCWPUkwH41Yph6LoLJrHv33NI39VUfL0v4SudTG4u802NzC1WJQxIPXqPa+QFKmYzCjYYWeWMd3TugWQUfe+VLOA9jfOt1VmCVkjofM9M17sU0KZ9SBsn341KNurR7q6i0KtUA+hpQqwVqTHMl62yxJwXqvdiUKS+rHM+z+Kq/93C+Ev2VWhe8MrHWQKys/Ga/Ch9Se+kCM2VTQokNDEDhjH18NorWB4y/4Q+zg/1Su5x7NhfXRb5s2UP2ZZJFsfGofTuYHNt2CMHVp+ikck2+Dpi9+8Nyr4PGJuco1sAJN1A30CkpVr7RV2kIU16X9bTgKooGU0PzrY8ukDoRqcFwRjcCPu83oXCGn2dN2FdwPGXgioNx2kc6FgC8ttS5o6F2phxSuFv38nQlyK5Y+vHIZwxxhen2zHTqX0aLTSXKAK0Blf028resPdly5hyEylKqj6S4V+bGK0V0AntewOKqYIy/w8qD/p5KIEE9iwEJYK8eves12CNYPFfdI59fBstooWFzFgOIDbpr6+0yFUOD/UiD8vpbyZjl2pISnKByTqyK/Iw4TcpvcTnpcAKsasbMpG86nMMqlLSy7c7eYnZBVrq7XYsgpIDnouSVPxGfkswDp0798Ctdfy2kpyAdPhGtbz9XkWUJ8JIwPX+P0Qe8sZ+daNMRTLKS6vnbfldQQUlcfmx0hYI8xFoMdPANQwJRIgP6NjvvFlljrMVRsTr+Tbch00H+b8jA1gVtyePFQ2EieOmhmBYR0rfkFujb9JQ2v2tCWOtUUzCurhR10THl3 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: be86e70c-435b-4f9a-3239-08d8f994fd15 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2021 07:15:57.2714 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Gys9lO9UOcshbGSGoZa+dsyX5M5c96dmkwy7qvzdtkyN+BSNFjP7pDeSbY93k5fECV8OGWMQksd0FbOOQDJTsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6509 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Since sdma_transfer_init() will do sdma_load_context before any sdma transfer, no need once more in sdma_config_channel(). Fixes: ad0d92d7ba6a ("dmaengine: imx-sdma: refine to load context only once") Cc: Signed-off-by: Robin Gong Acked-by: Vinod Koul Tested-by: Richard Leitner --- drivers/dma/imx-sdma.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 02f8584..1c636d2 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -1107,7 +1107,6 @@ static void sdma_set_watermarklevel_for_p2p(struct sdma_channel *sdmac) static int sdma_config_channel(struct dma_chan *chan) { struct sdma_channel *sdmac = to_sdma_chan(chan); - int ret; sdma_disable_channel(chan); @@ -1147,9 +1146,7 @@ static int sdma_config_channel(struct dma_chan *chan) sdmac->watermark_level = 0; /* FIXME: M3_BASE_ADDRESS */ } - ret = sdma_load_context(sdmac); - - return ret; + return 0; } static int sdma_set_channel_priority(struct sdma_channel *sdmac, From patchwork Wed Apr 7 15:30:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 417150 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=-16.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 E06B4C433B4 for ; Wed, 7 Apr 2021 07:16:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B780F6139B for ; Wed, 7 Apr 2021 07:16:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346374AbhDGHQR (ORCPT ); Wed, 7 Apr 2021 03:16:17 -0400 Received: from mail-vi1eur05on2069.outbound.protection.outlook.com ([40.107.21.69]:41953 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237787AbhDGHQP (ORCPT ); Wed, 7 Apr 2021 03:16:15 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cl4u3Z/8QrKA9/RE7978pP4X2AaScxB3hFlOBba2tHJsnwQx3fN2cncWNuXOoL9zV6TxcWh0I5uvo9WQ/XE28qhB/KJbTE1Fo45R44SbfOHf/aaZeYcl4uuKdCbhxTV9TwWXlbRkdwQ2Pg8byqcwBC8anGijkC57MUqs2FD3MuQUH51p2NnnX9KX6sy/+w7518dyD8Zo2cjFdeKxj2VU4KFqZSfOaw7DTnQT9OcEp2PFSZxGp4N402Fq/bxZTz5/1wniNXm2QueyXfWRNPzLjZL3iu085ljdiRV4JZFL6tw3XpxpMaQ9bVOQodpdmv7cFNuX1CFGCZKBOIt0Fmv/FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zIt5LKORsGd+tCRzDis7KbbsWHYFGr5ZTYZd82CoRi4=; b=lEvws2PBKLQC9bFOgAdJP1/kTc2mmWlqtVyr4qoRS1tnz4TuqO0eI4CKM0Ad+XLZaUDuyf8w6Mx8x/AdjLsxdWrkQiPYd/t0zSLozmSmTxbAH9hsHyJRk5OQbLmAnZrL8uQqT6haW0CPwcAVO1N1aZZCXHo1aCdn6bVvAKhSyLEiF9FjNnhgqwHLcayd/gbSXXaMF6A4ujiuJMLb7WIodntMf8+ceQJlqLq+CmkDpGd//rxFUbIWkolMb+QT6fWBgLgn/Kr75DeQMTFjONfDOYXNd4UWXOHKFkExP+FBaNFdprsFgpEEx92AmsiWBDCFTZRiuhlVCxXpZGDCfpMRxA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zIt5LKORsGd+tCRzDis7KbbsWHYFGr5ZTYZd82CoRi4=; b=mZz8lt6JWytxiBxpsQvhZebyblq+eWxdHna0VxAKfK1x8v9sowjUfc7J7WtrQx6wC0cH0/+b1qjPtmdSgJPpt3SL7NJNWxxFPmhvRUT5Uwgy3DlEERv0xRUVDPb9VGFPRX/7BkdWIIje6j35jVrJK/lDahK4oid7JBQV4KxFYZg= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB7326.eurprd04.prod.outlook.com (2603:10a6:800:1b0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17; Wed, 7 Apr 2021 07:16:04 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3%7]) with mapi id 15.20.3999.032; Wed, 7 Apr 2021 07:16:04 +0000 From: Robin Gong To: vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, xiaoning.wang@nxp.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH v14 05/12] dmaengine: dma: imx-sdma: add fw_loaded and is_ram_script Date: Wed, 7 Apr 2021 23:30:49 +0800 Message-Id: <1617809456-17693-6-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> References: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4020.17 via Frontend Transport; Wed, 7 Apr 2021 07:15:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b6cf7e3f-b1bd-4f5e-2c3b-08d8f99500e7 X-MS-TrafficTypeDiagnostic: VE1PR04MB7326: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N1w1rTEykv2X22aCRhbOhxOVJr2k1aCWBWfiIJ3tF6uol8aUErIhHPo9J/auO6GZtwzEo96w6jh3Ek6+9uhr3/KLZoHisakDr/sCd4JbRs4H08nzYORD4n5u0G8dgkllbHg4npDUHQ0yRQ/TVx+Sp70ghqMW8JflwmX3fsWSVjlcFGUT2mnflzjyAukhlmathUFEqoCJ5A6bsVdEgi8yvjpvXiPoHZHGiYE7PvObyVHcnLqtnXsaPyy6uQRdQ/acru4F4tUK+wpj4507TUoLwIWK6qOX5hy9EKtq7O7MjnQqADnkF7hkYa+mUXifIEBRfon9UTPal5bvMXLLF43Deyf9iyjLjddOe62wyrAuLSDWKpKecSCOAKZD0EyDw5MXhmXg4TnpbxJGgEQ6MfCzZa+2HV2RIqC+g+1TCktB1xNvJkHRzXJ3KAN75Lp4T0HJ7UWZWonOmGCG06VxDywZQSD3tw4AW51w38+dalOT8KT4R7HuX/27+IGp7TVTgydH0MgUvjY6vk4Y+H4Hy3rShClhTzvDqy8sBQo+TY8AE+S9PeFfodWxt9uLunvzb3I0cfVG0YhmvJxN4Ka/VwAK0BJGan7aa7nlf0GjOnWh4Yqaf+i5aOYm+3L3O5Tjf0tSGQ1ZnsCe6AzbckDbRTUCfV/CxUZc/ua+POyCk3TWCqG1H1y33z8s03UwxmsGk8f2 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(396003)(136003)(39860400002)(7416002)(83380400001)(2906002)(66476007)(5660300002)(66946007)(66556008)(6666004)(38350700001)(36756003)(6512007)(16526019)(186003)(2616005)(26005)(6486002)(6636002)(86362001)(921005)(478600001)(8676002)(38100700001)(316002)(4326008)(956004)(8936002)(6506007)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: YJB9xtOKi/PlaZQpKQdJOCKd5SsbWIDFhY6kHI0aj70rTXHNKI+RBRssVb6Vl3bdVl4i5Bxn9BMcLp1fXyqDab/S7B8XeYMGA7GwHT3xdD+R7MdKnCDyrv/Hiz6tupImVt6zNsok+4g9oJBRnIwLuykabkV8vPhBu229/Nk5eaXb0pejorYqhL+dKwgdzCBbqfEBoM5hm089HUgmou9jdKt7lwS+fI8x0/pP2OGKXCFRhhw5rylUoiElr98iOhHtuICMv55rkfk6+NyfGbE2f0Gp3Vqui5EtghHXxZDMYt9w4VR3f1uOUdqKBgyfBVNZRys3l+cgMr0azX4knEiIcy9hetGaqjIyOMo/1olcJFBjM4wjfYH9j3+vZU5y9dX4R7/mbl8EOYysIGMf3DyuNPBfL3pZkoeu2NsOwmQsoU21oDnWdFng+JIutUXvv0k7T3g9u+K+mJjno+TirtHwR5qGN+GxpIieTTmtPP9ZDsXFr2kozVDWBV8hRn3Gam4vNDPi5gsJSswnEoc7xiX4h+8N9HVtIH4gF17Tf1bEpD42r0/nFiaDJwXye3zOk4rcdBlLZttD1ZmR/FHoh9oS1yO0Lm3b//i8RuGu5jUbFcZyGLUv2MaY9JPHfnYB26chymV559vDqJ9x+jV7ejQPIIiSuPgMc/6vJOXQJOP94yKsHZqgctZ9qihLmklaxKnwwmY7x3Sxy987/VxgEFOrn+Cybfcc9vQbJKYTPGULx16EVMRQtkknEY7sDM6Jn55TYUcOKX43mvO2NpvKc3EGtWLTT2TlxIC4lpesHUVlHHpvnUnwUyvfq7a/2HxC8qUfce/91TE+rCdxRwnWE4LJj+YsvlPURj9SqNjtzsDA6XooQct2qkrQClKvZJkf1Yt3mH6kwcY0GYm42fvxaia0pm0fTArydEt+YEylS2ENgvhikjyyLiImtxYstmevF7kuvmkDWYOh7WUu6BvTzCLiyzFhUQiX+2BwoKPogGky55be8wRYG6yI4OCa4W1ASfV2RnkFrpss5KG8i5QWO09Vsk4IfZG3cBWi6oPexJ4DfcfIai5QBMXMyO9MIc+YkxdhqWchA3WLQAIuidf/pp2Pg70AmstoDB7ABPRb4McAjPzkGJMbzhb2fZkGtqeZaYXH6xCnfSCE+WnAT0CGaZPf5FhBA5rIUnv7NMJCVZWkgHNpuN8svlamXE14V3KvrnIloAlIIibdMOj8JH5MDh9mOjaNwJUVLYTSUhDWUK2OowBmy8FsBYyt7B+Y3QU8JHwuQ6Khzh6UTUivU+aBIrHAGIyQKxvqoxXzAGyMtH2rWFSS44mYfplw/DQgeBDVAZ8R X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6cf7e3f-b1bd-4f5e-2c3b-08d8f99500e7 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2021 07:16:04.0394 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8XQHuVWGPkUGtgoGB2A0My5oeWbkOfSPT5U6d7yuIEJHDPdeEVRAi2LdHTqHZlecf8oNZtdWPGW7Nu9xODIXxA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7326 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Add 'fw_loaded' and 'is_ram_script' to check if the script used by channel is ram script and it's loaded or not, so that could prevent meaningless following malloc dma descriptor and bd allocate in sdma_transfer_init(), otherwise memory may be consumed out potentially without free in case that spi fallback into pio while dma transfer failed by sdma firmware not ready(next ERR009165 patch depends on sdma RAM scripts/firmware). Signed-off-by: Robin Gong Acked-by: Vinod Koul --- drivers/dma/imx-sdma.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 1c636d2..78dcfe2 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -381,6 +381,7 @@ struct sdma_channel { enum dma_status status; struct imx_dma_data data; struct work_struct terminate_worker; + bool is_ram_script; }; #define IMX_DMA_SG_LOOP BIT(0) @@ -444,6 +445,7 @@ struct sdma_engine { struct sdma_buffer_descriptor *bd0; /* clock ratio for AHB:SDMA core. 1:1 is 1, 2:1 is 0*/ bool clk_ratio; + bool fw_loaded; }; static int sdma_config_write(struct dma_chan *chan, @@ -899,6 +901,7 @@ static void sdma_get_pc(struct sdma_channel *sdmac, case IMX_DMATYPE_SSI_DUAL: per_2_emi = sdma->script_addrs->ssish_2_mcu_addr; emi_2_per = sdma->script_addrs->mcu_2_ssish_addr; + sdmac->is_ram_script = true; break; case IMX_DMATYPE_SSI_SP: case IMX_DMATYPE_MMC: @@ -913,6 +916,7 @@ static void sdma_get_pc(struct sdma_channel *sdmac, per_2_emi = sdma->script_addrs->asrc_2_mcu_addr; emi_2_per = sdma->script_addrs->asrc_2_mcu_addr; per_2_per = sdma->script_addrs->per_2_per_addr; + sdmac->is_ram_script = true; break; case IMX_DMATYPE_ASRC_SP: per_2_emi = sdma->script_addrs->shp_2_mcu_addr; @@ -1309,6 +1313,11 @@ static struct sdma_desc *sdma_transfer_init(struct sdma_channel *sdmac, { struct sdma_desc *desc; + if (!sdmac->sdma->fw_loaded && sdmac->is_ram_script) { + dev_warn_once(sdmac->sdma->dev, "sdma firmware not ready!\n"); + goto err_out; + } + desc = kzalloc((sizeof(*desc)), GFP_NOWAIT); if (!desc) goto err_out; @@ -1559,6 +1568,8 @@ static int sdma_config_write(struct dma_chan *chan, { struct sdma_channel *sdmac = to_sdma_chan(chan); + sdmac->is_ram_script = false; + if (direction == DMA_DEV_TO_MEM) { sdmac->per_address = dmaengine_cfg->src_addr; sdmac->watermark_level = dmaengine_cfg->src_maxburst * @@ -1738,6 +1749,8 @@ static void sdma_load_firmware(const struct firmware *fw, void *context) sdma_add_scripts(sdma, addr); + sdma->fw_loaded = true; + dev_info(sdma->dev, "loaded firmware %d.%d\n", header->version_major, header->version_minor); From patchwork Wed Apr 7 15:30:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 417921 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=-16.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 630BAC433ED for ; Wed, 7 Apr 2021 07:16:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 361FC6138B for ; Wed, 7 Apr 2021 07:16:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346408AbhDGHQY (ORCPT ); Wed, 7 Apr 2021 03:16:24 -0400 Received: from mail-eopbgr30081.outbound.protection.outlook.com ([40.107.3.81]:41938 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1346385AbhDGHQW (ORCPT ); Wed, 7 Apr 2021 03:16:22 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U4PkUjULXo6VGHQza6UigD5yyXBy2aZy8bgqpYd157RVZvIF3xOaD4yM9/AhmB0WVEtwkyHn2ilHdL1xEm+BVIW1oMlMTYKCxt/Ig8+bOukF2F5IHHNTiQSztPUjlCoLXuDP/q8q6qUT4KMTwFDq+YNN17sP13jx9jLqPwahQMlp3dMmU/mRtlihapb8u4WbvSKT5h4Hd2uteK+itI7nnpM5cdTk2pllQrjhgHSjzRdAVDYU9E6rQw5gT8Bqy6es9ehIgcoNKdl1coz/HTcaTxhT6MBArB6gJ+UacpPs7sq8HZVn/PQeUk/P7GREF24MtrpnNCYAyKKhaHIXJjqspQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fiJnpPaTlSqgyxfFsv/N8BjdfbnBxrwPPZjdYhqivR8=; b=dEnlBx7rjgZlVuogBMo08STdTPgzhDVdrCtZv3tDvDfNjmZBeKFdlaGtHDQtntE17Yt7OIIGbRj1gd63lrHq4VRpN+MwzncttItmbwMPAD0hlZBy24rvA46weLbjdzrJGKgWKVhPZJoHIM0uwCFGtQWSoa3IdE3+92DtdFxfduAFjOKKN9eauQOcs/IXlDsH1DtOedo6tBRLcsnzC1OOEUr8/kIEcAqJEO7cCboRKAMoneJyUYYM+ltruwxPNZGYLzLeKG+QnmpmwKp77983BqJ6lFw5BfgqhVls5S79Jri1gWxYpUuyYXx+wdo2g+FDY2lO2zg4j3R9fadm/MJUmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fiJnpPaTlSqgyxfFsv/N8BjdfbnBxrwPPZjdYhqivR8=; b=sf7L8fs8BIUC/QyH0+Nsdf7xGXQrq33UT7YdU1Ve8oEdv8+Qpbu3l9qNDEWIcrR53+nu9RpAEZMY6e2qVLU5UzHk845ZA83oVvAMaKl16niE2yN3elO7gRirLZtt/V4EeU3n0MuyD8iE/7Sou2GnIe1vbl2eJJdJyBUaAiavAPo= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB6509.eurprd04.prod.outlook.com (2603:10a6:803:125::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28; Wed, 7 Apr 2021 07:16:11 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3%7]) with mapi id 15.20.3999.032; Wed, 7 Apr 2021 07:16:11 +0000 From: Robin Gong To: vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, xiaoning.wang@nxp.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH v14 06/12] dmaengine: imx-sdma: add mcu_2_ecspi script Date: Wed, 7 Apr 2021 23:30:50 +0800 Message-Id: <1617809456-17693-7-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> References: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4020.17 via Frontend Transport; Wed, 7 Apr 2021 07:16:04 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 455d82c1-d2fb-4550-f9e8-08d8f995053d X-MS-TrafficTypeDiagnostic: VE1PR04MB6509: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:361; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gLpGknAUk2omSEnjgHYCSSAgNHefMk2Uoy1XWiOAxgBMxjZV0jxsOhwWVUXlHQ9u7m+mCAcoqCpTKnhwi6yxYuLtV5bybNcafJS/J8LnTQ3hJTFcM7+t9Xroo9KR30Tqwtj2tBtImi1Y4DBGAP1AFVXzgltGDLefU+IwpjVRyvwpENh6r3S1Jna/1pe95RW96UpeGzrkTi7jAfSa7BmLHiIkekt4npf01mMxqet1l6OQ6MivuVaHWiXge6WgFForsr0+ChGHMljSoKpZAW8xR9Lp2fdL8brw/8b05L4BF4wEioMzRdVClGTjEzRqCvdx3cq5Qsb8AkM2OLeBLfddiPHLP1ocKS3oYk5eNUTl0QrPeQS6jzW0c7xI7md9xwu0H2MF9Fv3dj3/xQT62aFOvIjVdFr1449S7+qYQgYTPVuXCUh9IHpTv/49I/9ofkdbaOGIdq21u9BDZMBcF7F+PgSiJ9RGHuoui5KxGzjB896qQu8irRsTtl9OHCvhpyHs6+Dn87x2O68MyODCZ1Lf2jJ68Mk3PSR/4ewuPdA/UeE2F1qH9/J6GgBYqGGLnMXdU8hCIBOb5yDkI/0q48NqvCi+gCQm5q9INiGMfGa2+aboHYzrLCJ0nmpqTZesEKrjxpQ1ZI4nzLPGfqvzPdAc/VwEGme4LppVXmmQihsHQP6RsmHRUQYtyoX/ECN98shL X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(376002)(39860400002)(136003)(346002)(396003)(6486002)(6512007)(4326008)(52116002)(478600001)(5660300002)(6666004)(8936002)(66946007)(4744005)(2616005)(956004)(26005)(8676002)(6506007)(38350700001)(36756003)(66476007)(66556008)(38100700001)(186003)(16526019)(2906002)(921005)(86362001)(7416002)(6636002)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: CUxDZFVK3d0RCl+CEDE0F8bJka9TPzoa/miLCwnHn+cL3IOA5lRPZviDCCmZkZEKpT7u1NN/L3348EDCtSF6Ha0CF/HwiichrNfx5YA1R3g+sS4myDI27t0DIlFbJvGjLm40FWdxPPXkBH8zDkhVkLitRZFM7goE+ka64oxI0+O97S+OitwTL9HxoMoZPApxAMvNc6MbH7YYa6asUM8gyaPkrON5uu8BfC3gwXjJuGlY/8tD8IZTsce19/YLQUroe8NKtKAOV8oFzz8lyAOGvXTx01vpzY/q9TfZt9tf83OeVRyacQzjB7NTFJIL03cF1QiCC48/2iFfTsqYLt6nWxO25n8iBzs2BoIlskP8krZ/C4nSma3bDuZnIyCr3C7azCiI1joR3klnSAlJWsXcTLl+uNl1I0eLvxfv5A5KMInBF79ioKKOjp49W15Dqjoq7575pOZe+QoLkp5Mo+nfn7O3r6tZzSOwasruHsa/YR9DV94lTvmn499BuQ7Od4vmOJZFi+Ek3EMGZDCwV/ontP7tFSvzRASxqwJMhkPnUCcX+v3TMaSYldbF42yKGY+o719iR4TGbCUUQZVZWvH6vKa6FI6zzPPaImByOYSK5zemiUd4ePjxRelfsdfHhxk27tx79WoTJo2waT6OwOmwhScTP3mLOIQ7zEil7FcMCIcrto6QkzwhnqQRjOk86HYD7TTLEnDBRRGXxl6s8Rn+wbMVwJhhOUjMb1Z2wDRku3XaRCV+ar/+u+N9A+L4hS5+as5xNAK6ZCeZOe5pyUVsL2gFENIXw2iOzfhX9LZgFpJplBMunVYGJ1PHb0QhJHuCE08SQUEZnzpw2NT/CCqgUXEdhCMzowpDxQznWdVK93eBIxBzlt+QbyFvA4vzKKtYF4cryp2NmoEeyxpa/XMVivflpdJbBZ36PFc8SCEMlqjuDAOeQWrtbeIAkYg8QlTu11In9aa/Dj7McHemaPoy8jvbHmXfyVtMD4Z3AesEjGblNPuhsWKEzq+zM4RmyC6C31iwqv8JBZz4lb9Qj8fEoMOKricDVtyQhS129Htcmuus0zjfjO9B/x6IGQ+91fqvhxdsJzvhh6Z8a+BxWjjn/9ooUZoc9bR/7UNge2mAD8WMzhXJkq1buNKcoVTs7o8bt0egixQ2Ie6dPhTAL6cSpJIxbVf/wULZOQPXJlSXp78hsvngEWaJOFbxDLRoKQTXpzjfqX7r52zGOQmndzfkiZxteBngWfE42pGfwviIFBfDjoM7f2hSxgE3oUFYycUIeVyXe+V87UuABmJAec5E+JdwUBE4x1ujlADwLdWwB8WzujwMOVWV9DE5kMGrH75g X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 455d82c1-d2fb-4550-f9e8-08d8f995053d X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2021 07:16:10.9714 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0W2X7dQlpVk3Uc/P2C++cqFFjRiPuRYg5lmGsr4e5bb3sB+7cUKFeq6O4ZuwRrymwhs9rsZCdLwh7fzxod7VbQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6509 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Add mcu_2_ecspi script to fix ecspi errata ERR009165. Signed-off-by: Robin Gong Acked-by: Vinod Koul Reviewed-by: Lucas Stach --- drivers/dma/imx-sdma.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 78dcfe2..86bd383 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -892,6 +892,10 @@ static void sdma_get_pc(struct sdma_channel *sdmac, emi_2_per = sdma->script_addrs->mcu_2_ata_addr; break; case IMX_DMATYPE_CSPI: + per_2_emi = sdma->script_addrs->app_2_mcu_addr; + emi_2_per = sdma->script_addrs->mcu_2_ecspi_addr; + sdmac->is_ram_script = true; + break; case IMX_DMATYPE_EXT: case IMX_DMATYPE_SSI: case IMX_DMATYPE_SAI: From patchwork Wed Apr 7 15:30:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 417149 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=-16.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 7EC69C433B4 for ; Wed, 7 Apr 2021 07:16:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 494D96138B for ; Wed, 7 Apr 2021 07:16:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346468AbhDGHQd (ORCPT ); Wed, 7 Apr 2021 03:16:33 -0400 Received: from mail-vi1eur05on2058.outbound.protection.outlook.com ([40.107.21.58]:28417 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1349349AbhDGHQ3 (ORCPT ); Wed, 7 Apr 2021 03:16:29 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DRVTsQ9biBiJTEfYyWRs+5EVg3wAiasiIsuJ6yksGSmabLgh5a+N4cvpaPll562PqRvtAh22hc6TFLNxX750F42ts78v2MUl4p89jM1Z+sTfwVsPUPGFomhIYBWF1ow8Wqyc9PDJWr3MPH0rLWrj0XxWQvCeIiFFMcqtugqCh5O3w7hjk5MBNURWziNvdRpIyXPIi6To/1h4V0jl4x/NTda42QZ53oRUBjBazorGO7bb4F/6LkrtrnjfpWKahhgVw1x9TI+hk6anNHEvBrPfgGEVs/Uu4c67vttnNR4ddxVtbjn7pRFBst7k8D3A/E+hQ9sXUeW7mR3fAxYmVTziOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AtYuoAWU5nvGRG/5slzid8bTmp98z0SLULmC9zpRUdk=; b=PCqD+8mZwL+fLvDYH1FxaFWBYou8EU0fbRsYLS5SoJz+1DZNnKaKnBRWl+rKRkMw78tZtfi9wJnF4CB4lU8QqKwUbpX/l0Q65LeqjFdKdt3y4q/rSDjlRwXYqxa5H+ito6n9hD1TNM7hahK1hZFoeKIYa6+blRINgiBLZz/9o11AVp+NqRPbnCa8FaToCqY7qZbe96pGtciumoOCgByGdeX27CZ+VrW/YoP79ZZF4YxKwrEI0NtytzfmnfgjPIV9Ryy2dlSZzX4BOXepU7lws7GMyueyd4Dy2tr50k6pDUgPm+bd+TkUgS5Tmx4qwbw5b+tF3AxFfCs5QLCWmWB77w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AtYuoAWU5nvGRG/5slzid8bTmp98z0SLULmC9zpRUdk=; b=pGRTLEleQCn9PQBnYOc3lxtMujzGRENg/6GHrMpb4+SKm4NycLKT9upUmct5pKaJzB9+hRyOD/w0styeS1SUtggyC4LI8PCwGekmbnG+056cafquWNTcgUAlmG07uZctu3ziEQfw3vhEi76kobdWy+J3a2/P9ZrqyzvPHH6aVso= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB7326.eurprd04.prod.outlook.com (2603:10a6:800:1b0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17; Wed, 7 Apr 2021 07:16:17 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3%7]) with mapi id 15.20.3999.032; Wed, 7 Apr 2021 07:16:17 +0000 From: Robin Gong To: vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, xiaoning.wang@nxp.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH v14 07/12] spi: imx: fix ERR009165 Date: Wed, 7 Apr 2021 23:30:51 +0800 Message-Id: <1617809456-17693-8-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> References: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4020.17 via Frontend Transport; Wed, 7 Apr 2021 07:16:11 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f52764a0-0e24-4ce8-8f6e-08d8f9950919 X-MS-TrafficTypeDiagnostic: VE1PR04MB7326: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DM1jaOGKckmwEVarXe7DnQ/ilQW0ZYic/eoohppxoiAGcIa2fFj6fWVGIT3U9R5ligpD4rkQNzoSrATSYo7Z0QaubK2R/IaJqkh0NRPmLdimf+WbaKwfOUU7dJ9q09/VoTZZ4YWYi891PCP4UQM+oH5gZkAYnXzXfvvf5Nb/iEoJ3/fgXIFaKQpUV514fpItAJDEthJ6aNml8MYkKBghDOjybS6snMdfdp78ZNpTlCkuy2qcOU0qr1ohpH3w74tfX7nYtbvohA8hl7ArnqAeVxr7rT2P19f4zDQIMwmtlHpMagcmOZbpXe8L/QPSjEtv87nADt1JavHArQEF6OAXPXWNt/W+Cqel9+mD6/z37s310JSYXj6Aagnif94R6Tl67S1VVcL1UMfGC1Ngf+Y8j94zCdjiCKqDLNyWGU3mQy0LS7BPonEVEvD5FmHHo0x8biHJzMH0y9hGM+W1stmg6xoiNWEQGcOeX5QB14dfE3WPAoFSOjva6CnA6Kwvo+5c4lDAM1GxHHkiLQyn5RyuBuyNtziXvFYo+zYRqCMMRzK3nqnw/C1TuqKuPsee6mUCaWvAuInuoPJL/RhC6a9g2QHHiJImrb8Oa9zkrQa3SdDmfrhxCna8k2d0wnnp5i27+sJfgCRx3jBrDOZF0LAYp5ydBRwK3Ganz+wlcBjEwUFNnG9YNX+mwRLVUmmmjXYOOJ4K/txEQaCjgCKQETnUtQ1phL4Jtbsyy8W4uVld1pYFNvHdPvmohAKMxRE8ygyLcB/Lwg0Dhgz4rtl/d8oR9Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(366004)(396003)(136003)(39860400002)(7416002)(83380400001)(2906002)(66476007)(5660300002)(66946007)(66556008)(6666004)(38350700001)(36756003)(6512007)(16526019)(186003)(2616005)(26005)(6486002)(6636002)(86362001)(921005)(478600001)(966005)(8676002)(38100700001)(316002)(4326008)(956004)(8936002)(6506007)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: BwaiFF3av62WBY5uMEZAKYmLBxRcvT9nrsQpTkTONIrSOqCqAYab4YpNMfZ8vGxZdDZTHxwtV7FA5SBSgyc65RqgiyVA6z+pizl7Q9IxXc0qhMbKuWFdkFFa2+eaA4HeZu/i2oIcMasYjjPtXwj9E5dmyaPLjnaoC46Y8bO7/Ma6M0Oc6M9ZH5jfBJOe1XnxePZoLThl+it8/+bYfdJykzKQP7izJK3OYDQji4N9IZ/++N4qgvK4GPmRjNW9MEspqTpO54rB4rqYGejMBeUPM8vxqSRQMWIpSPlDQGskLsEacsAsonjREqX++M4ypeoBRx1u5MUaJo2R3ixEUrrB1KljUWEG0ZTvfsOEKe6gg1HxYpRTbZspWzEGee14gKlp02DsOHPSeFE48dc3CnN5Y6929Csvdn/8iGUTIVE5s8TbCPnMlDT5OtHLKqXDymQaQWK/7cUHaI/L+qZ2KAuVW30QPtO0Q+0Wkq4PGtlcCOUMZlQWKLn50C6vN+N/6WMPsmAprwdZ+HB9NRnnJqmrLvSsgt8B4iDFoNIsTjdUh/NPLOQ/PEk3UmFkIXkjUwhxxFBq/NapaTO0sQW7R2LzT/TI0PXXvgoYLnqZ+kAHNM9YOOFdhiVMWDpeWKBsGkN1abBiPj4DiazketEZmG9/Ynxy8rgcGZZeagKVPPuOhktFwktbVOnChZ+GRnyhW83mUlg6q3DFlTvVvYyjsLWIJEvIDzTO202C77bLTmuvCXzg+FXuM+o3VIdq0Kf+vhsd6NZYO95YZdgzmBGA75Y7YssFWBvmGtI8ri0Ck+++PMKgdSFGu41FhtYM3OK9L4WmpXNrzaPuztIbgUeYu+cfCDYoMPSNNc4HkBOYFFCHqXQSGpuTCDsnPCx7hWSfqLFs6DCgCM2LN1xypQJp2ljlJx83mc01+/3ZhYNPjaFPQE+rBJbaE4maakLPaDsR6pHkTJU/ZF6d2T4tjETLBijjsVkZj5JGLlotOfxHNlSNBedKqziMHzFtU6RtDTT7Cv7yBW/5odLgkK/UtXerL29+7cXrRvyl4Fns0exyXib/FhnjchE1w20L5LzJBvYahS631rigZ1W4TqZjJ0smCnNTmCFmhrdVFwIHgkdhKjAnq2qFpRdGOfRTJSb58lrWh+z7A4b3VsUtvGAdTokYda1QmNjUC30wLBZj+RSTOq0miUWz/sZ5wg5utfK9bVBpSWcyCKW88iVGz02lfr9xWVKqab/5fyjv5zyuaVzPn6ewndR1PJNcEP2r/rYp0ARpux4rtPfX9g6/OjDQnmwYDLSZVqBu5pVViANkapn40cMfF84xUwkrJJPB08nf4sipvngf X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f52764a0-0e24-4ce8-8f6e-08d8f9950919 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2021 07:16:17.2247 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +l4GPDHz00w+AY5wlYYeKJNylxLl0uY3+A7gsHpJVyT0mGKaNoRy5ZCvUmVrBjzmdbxASMH6hc/vtYDcwe4LDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7326 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Change to XCH mode even in dma mode, please refer to the below errata: https://www.nxp.com/docs/en/errata/IMX6DQCE.pdf Signed-off-by: Robin Gong Acked-by: Mark Brown --- drivers/spi/spi-imx.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 4fe767a..cf235b9 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -593,8 +593,8 @@ static int mx51_ecspi_prepare_transfer(struct spi_imx_data *spi_imx, ctrl |= mx51_ecspi_clkdiv(spi_imx, t->speed_hz, &clk); spi_imx->spi_bus_clk = clk; - if (spi_imx->usedma) - ctrl |= MX51_ECSPI_CTRL_SMC; + /* ERR009165: work in XHC mode as PIO */ + ctrl &= ~MX51_ECSPI_CTRL_SMC; writel(ctrl, spi_imx->base + MX51_ECSPI_CTRL); @@ -625,7 +625,7 @@ static void mx51_setup_wml(struct spi_imx_data *spi_imx) * and enable DMA request. */ writel(MX51_ECSPI_DMA_RX_WML(spi_imx->wml - 1) | - MX51_ECSPI_DMA_TX_WML(spi_imx->wml) | + MX51_ECSPI_DMA_TX_WML(0) | MX51_ECSPI_DMA_RXT_WML(spi_imx->wml) | MX51_ECSPI_DMA_TEDEN | MX51_ECSPI_DMA_RXDEN | MX51_ECSPI_DMA_RXTDEN, spi_imx->base + MX51_ECSPI_DMA); @@ -1234,10 +1234,6 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx, { int ret; - /* use pio mode for i.mx6dl chip TKT238285 */ - if (of_machine_is_compatible("fsl,imx6dl")) - return 0; - spi_imx->wml = spi_imx->devtype_data->fifo_size / 2; /* Prepare for TX DMA: */ From patchwork Wed Apr 7 15:30:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 417920 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=-16.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 0A2C2C433ED for ; Wed, 7 Apr 2021 07:16:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D8C186138B for ; Wed, 7 Apr 2021 07:16:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346422AbhDGHQg (ORCPT ); Wed, 7 Apr 2021 03:16:36 -0400 Received: from mail-eopbgr150044.outbound.protection.outlook.com ([40.107.15.44]:28997 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1346438AbhDGHQf (ORCPT ); Wed, 7 Apr 2021 03:16:35 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zk2UhfLvBoEw4JcUaq5pyZoRNdhyFfrTd3iP/ha5+fCsM0bjRLed+jAvJZk7Y6kelmNlWYvPe90MVXwDgqe5WXNnARRu7AXuPdE3AiqvgMIjeCJ3D2G1AtJoXx2iBwKLECzEMYpMzofPC1jQqMbBKbDRXFUO4Evoy5v+lwpwgn4UC+cVWjzGrTguFsFzBxB7Rb1eljOflZm/gXujkRJ7oK11EJiTAj1oAmLZVFO5AXfE66ypvS6u7FUWlXeq1jQguNGtDTeEx2BtQOqUkcoTIp5j1800aDnLH+lOvuBvg7Dri30/NbMvYyeSvEDMyUSO8kDDxktJE8rPzxKDrPk7vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Rpwm2cmTe5xyTNoXrx30icysSCF1vy3vcYas8FeT17k=; b=Ou8LlgMbQ/HqMQ5sc9ICV0KaFTfKcnVGHxPLjqsfLs4fi6Pj4lGEf2ll5GNNm0Ywf3IMs6a2vTGuYiHcPy2RG+f/cNlFFox9l0G9fE1gKEGuDNsDxXEmGqIE/tj7T1qI3gs39za0eISVTL+Fb9gTUCROnzho1N1SIA2pBDt5RIzAs3afX3hvn9U/WXcgoUzeiyDJfWSnYJFaEOj1fQHWmlUfKgzmGHQOr0eFxWHg31h+lbLHhRd/asGiOc65UkGFAb1AK18sZkS3t/cXh5W71wHuZTB+q6bcICPFPF0MQsHGgLxyMnhDKjHp7mkZoTRQXjyGEzwNnyniUYC8iB5uZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Rpwm2cmTe5xyTNoXrx30icysSCF1vy3vcYas8FeT17k=; b=geZTdL2LXh9Ja7VNUXUMb6F1mNI2jotcldFWAUCw1EJRT2M59xsmoaqYLQZhUi+9Tbs5Pn8pxOhTvgvp/evtkmsIAAf+or1+r0F89bVYJH1DqzFj2xdyuK3O1Za2TIGgcTqluLkSfO9peVOrngUj2tYdBLB3xt95kv4Po232SHk= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB6509.eurprd04.prod.outlook.com (2603:10a6:803:125::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28; Wed, 7 Apr 2021 07:16:23 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3%7]) with mapi id 15.20.3999.032; Wed, 7 Apr 2021 07:16:23 +0000 From: Robin Gong To: vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, xiaoning.wang@nxp.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH v14 08/12] spi: imx: remove ERR009165 workaround on i.mx6ul Date: Wed, 7 Apr 2021 23:30:52 +0800 Message-Id: <1617809456-17693-9-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> References: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4020.17 via Frontend Transport; Wed, 7 Apr 2021 07:16:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 147cd492-ba3d-4d86-7df5-08d8f9950cd6 X-MS-TrafficTypeDiagnostic: VE1PR04MB6509: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R3pKaWtiw/PACzFlaOmxRYKsTj/tnJZSncbEj1gRW425jhi0Q4uLnilA6+hkgG9IhzwU+G83o6qReul/874U4cDwFpubUsxghslZbiLd3FcEk9IxRzaOt6pOg3IxvblUGM6P1nWguWa/nbOgfdvfyQka0cCmfh0ntPCaGIysDVwuoFM1l6rUC6kNNG64556fsAYH3bBQVSKn8ZoDXkS+waCptM2lWgcJDr1KPkjCUFCMMYnzhMtWyOJFubNteFrPFE3cxN3SOgSSRX/vBSvUouMp7qQWsFJeyjh7TyQGf9e5MYLx3lR1Xv9j94soqLpGlpDtq7NkkgEGy0sfxms5CReRGtUwSD6IYD+vS34KpJUF9NpYbcj8hvGh9tAk4bUMQaz10zMIfWEmmwCIaAhlPn1T6CC+KY60BqkaiO3zCWNgOU3uoAmJGlB4LTerOa4WUrDpyeTEoVbqYmHSmbJehpx/Gxvv8cGy6pDqUvAKPwNzuYB1YwlDQmBQB6mFr6ZK9HIwqAogvtRBjpdjYm2YxzR4IZyoGnLDALCie0G4OPjQiIF5gC/8f3RMGQU2lrxHBC6g4PKNhbuPQ1ko//TR5OHJO49NgeTfojc+DeTFhXvMRPYWEICtdk1YWmpAh+aZ/Ccqy2YWBywKRgUJNfl01713U4uzsk2/sf7OR63MnlyzD/t18f4Iaj7Hb8yIQ0LlxUBg4tB/1jwfoGLadnfq8QKpcqx2D1xgQl3qyEPJz9WOsB/6LTzYg5Xr+SquCDILY8XuWWqEladnzUqIaozcHQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(376002)(39860400002)(136003)(346002)(396003)(6486002)(6512007)(4326008)(52116002)(478600001)(5660300002)(6666004)(8936002)(66946007)(966005)(2616005)(956004)(26005)(8676002)(6506007)(38350700001)(36756003)(66476007)(66556008)(38100700001)(186003)(16526019)(2906002)(921005)(83380400001)(86362001)(7416002)(6636002)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: OriwH6YCXxEf47jalQVaw1HiJxS1XLSO4CUzgFMBtz8ub3DWK5Rq9oZcfbEpSDn9YmLmbNYbM7EDXzan2LzSTQveBpAe0CeGnOdLQF59YJGHf/N/jBIzo5XosfkLNeOG6eGWGNved1oIjNqFmH1saFO/ZAYYVA9SeZzDQux7XcquK5ZHvSka0Ck40wYtf4NHMRGBOf/0dGcItOOktKDRmKZn9ODfOZ8Jr+/2NBdZCa7+d3lh34Ru9sncQnCJAkoOX3cmAmjFGwbInwHP6CksFejRzA5Z7IEUeabeQMxuNBgKMyKxZwGuU5UT/m8GSPpLORMNDXRM/CEYARqIERJMSELMPNGv+7s+aor22XQSmDJpeR9TYinGccbvWFGRmg5w1VGw0iBcKjTwbWI/BR30EcKFpqWh4RwA35XY3MAuafL+JFTbf1gHCx6uH3lgXwp+yf+NMf0vOgaC6DojK2X23BPn5bSXfRwEkV9L4WUq7q0eg8Va/wI14CFFXMoslfM0KUjpvQX5+O9Upb1P7MggMEx94Cw9S/21bCrhcQsKUbdBMHYeY/23/1acnwuwZaNNWpqdFsftJ5i6JxOrKUiZ0+ABTHmCuBu+RjojREW/JKBBrPmRCulPxiqeFJYUdeznNYu8lqL/KXzca/q4YaIw9Bp/20XZFWNTMeynlP0a47FYOgZ/9Hm86D6w55/0/oKRFV/zIyIA4IW5+Nb4jHZfpUgpHmMppeXiApjxXeT+aa0hFvm91083dVEiLNepDTDIf6dAW63pe4XFM0ONUqu8vCS3tbIoVuv9yvIxDg7YqHRWARLvAoDVe/bqacohooU+/5Z90aKZmCr0ZHDarSLXdqM/vQoFGrO3S3/4cqCPaFoqHrDRpNgzfoei6YtQpLKWzVnXxVSDp3RqR9nfMi8DliR6kf+zbpZq6FXuHS/7U7eEpZONGiIzYoOUJhFnjiL3bxtKcJlt6jlFRXBopQDnc8OVpaIDsH1bby/18q4IzxH7QBTUpkmanEXsY3xrc+Qz6wG4Rw5NBFZFGcEXGWRcWdFKL/7q9+0G/gJWC3p73go9YYpQdB9lMxC+vT2JvNAGoEfgeDPRHPLOMr3ooQYXWHZTYV/bEWO6VmzY4MRCzr9bo5bUdr5fD1aSc0b4RaZ0gB7ETI1q2eFwQHdAI7tU5AoxECvSCEMnO3eeH7Mtetm2GyJKwOj9o7PvZhGPrTyi+1a2IWzG6pdubkyhJr2sLi/276p/gTOHI89WlV1xh8kLjPfOkD75Wpm4x/4prfrabhTmjSGIK2Xs/tmy8ivQ/egwwNBkigXvdq2dZ10GlOJaKnAhkBZsQ0jNg0uEXf4C X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 147cd492-ba3d-4d86-7df5-08d8f9950cd6 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2021 07:16:23.5630 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DWNXsmSq1ockoUs34CkkKnY7AaIpXoH6+C2YuU0N7+Rb0ZKvar+h+KWNxoyrQom+Qe1f+qMcQv//wSutJqRbvA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6509 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org ERR009165 fixed on i.mx6ul/6ull/6sll. All other i.mx6/7 and i.mx8m/8mm still need this errata. Please refer to nxp official errata document from https://www.nxp.com/ . For removing workaround on those chips. Add new i.mx6ul type. Signed-off-by: Robin Gong Acked-by: Mark Brown --- drivers/spi/spi-imx.c | 47 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index cf235b9..d18ee25 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -59,6 +59,7 @@ enum spi_imx_devtype { IMX35_CSPI, /* CSPI on all i.mx except above */ IMX51_ECSPI, /* ECSPI on i.mx51 */ IMX53_ECSPI, /* ECSPI on i.mx53 and later */ + IMX6UL_ECSPI, /* ERR009165 fix from i.mx6ul */ }; struct spi_imx_data; @@ -78,6 +79,11 @@ struct spi_imx_devtype_data { bool has_slavemode; unsigned int fifo_size; bool dynamic_burst; + /* + * ERR009165 fixed or not: + * https://www.nxp.com/docs/en/errata/IMX6DQCE.pdf + */ + bool tx_glitch_fixed; enum spi_imx_devtype devtype; }; @@ -134,6 +140,11 @@ static inline int is_imx51_ecspi(struct spi_imx_data *d) return d->devtype_data->devtype == IMX51_ECSPI; } +static inline int is_imx6ul_ecspi(struct spi_imx_data *d) +{ + return d->devtype_data->devtype == IMX6UL_ECSPI; +} + static inline int is_imx53_ecspi(struct spi_imx_data *d) { return d->devtype_data->devtype == IMX53_ECSPI; @@ -593,8 +604,14 @@ static int mx51_ecspi_prepare_transfer(struct spi_imx_data *spi_imx, ctrl |= mx51_ecspi_clkdiv(spi_imx, t->speed_hz, &clk); spi_imx->spi_bus_clk = clk; - /* ERR009165: work in XHC mode as PIO */ - ctrl &= ~MX51_ECSPI_CTRL_SMC; + /* + * ERR009165: work in XHC mode instead of SMC as PIO on the chips + * before i.mx6ul. + */ + if (spi_imx->usedma && spi_imx->devtype_data->tx_glitch_fixed) + ctrl |= MX51_ECSPI_CTRL_SMC; + else + ctrl &= ~MX51_ECSPI_CTRL_SMC; writel(ctrl, spi_imx->base + MX51_ECSPI_CTRL); @@ -620,12 +637,16 @@ static int mx51_ecspi_prepare_transfer(struct spi_imx_data *spi_imx, static void mx51_setup_wml(struct spi_imx_data *spi_imx) { + u32 tx_wml = 0; + + if (spi_imx->devtype_data->tx_glitch_fixed) + tx_wml = spi_imx->wml; /* * Configure the DMA register: setup the watermark * and enable DMA request. */ writel(MX51_ECSPI_DMA_RX_WML(spi_imx->wml - 1) | - MX51_ECSPI_DMA_TX_WML(0) | + MX51_ECSPI_DMA_TX_WML(tx_wml) | MX51_ECSPI_DMA_RXT_WML(spi_imx->wml) | MX51_ECSPI_DMA_TEDEN | MX51_ECSPI_DMA_RXDEN | MX51_ECSPI_DMA_RXTDEN, spi_imx->base + MX51_ECSPI_DMA); @@ -1019,6 +1040,23 @@ static struct spi_imx_devtype_data imx53_ecspi_devtype_data = { .devtype = IMX53_ECSPI, }; +static struct spi_imx_devtype_data imx6ul_ecspi_devtype_data = { + .intctrl = mx51_ecspi_intctrl, + .prepare_message = mx51_ecspi_prepare_message, + .prepare_transfer = mx51_ecspi_prepare_transfer, + .trigger = mx51_ecspi_trigger, + .rx_available = mx51_ecspi_rx_available, + .reset = mx51_ecspi_reset, + .setup_wml = mx51_setup_wml, + .fifo_size = 64, + .has_dmamode = true, + .dynamic_burst = true, + .has_slavemode = true, + .tx_glitch_fixed = true, + .disable = mx51_ecspi_disable, + .devtype = IMX6UL_ECSPI, +}; + static const struct of_device_id spi_imx_dt_ids[] = { { .compatible = "fsl,imx1-cspi", .data = &imx1_cspi_devtype_data, }, { .compatible = "fsl,imx21-cspi", .data = &imx21_cspi_devtype_data, }, @@ -1027,6 +1065,7 @@ static const struct of_device_id spi_imx_dt_ids[] = { { .compatible = "fsl,imx35-cspi", .data = &imx35_cspi_devtype_data, }, { .compatible = "fsl,imx51-ecspi", .data = &imx51_ecspi_devtype_data, }, { .compatible = "fsl,imx53-ecspi", .data = &imx53_ecspi_devtype_data, }, + { .compatible = "fsl,imx6ul-ecspi", .data = &imx6ul_ecspi_devtype_data, }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, spi_imx_dt_ids); @@ -1604,7 +1643,7 @@ static int spi_imx_probe(struct platform_device *pdev) spi_imx->bitbang.master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH \ | SPI_NO_CS; if (is_imx35_cspi(spi_imx) || is_imx51_ecspi(spi_imx) || - is_imx53_ecspi(spi_imx)) + is_imx53_ecspi(spi_imx) || is_imx6ul_ecspi(spi_imx)) spi_imx->bitbang.master->mode_bits |= SPI_LOOP | SPI_READY; spi_imx->spi_drctl = spi_drctl; From patchwork Wed Apr 7 15:30:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 417148 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=-14.0 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,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 69E26C433B4 for ; Wed, 7 Apr 2021 07:16:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 43015613A3 for ; Wed, 7 Apr 2021 07:16:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346432AbhDGHQo (ORCPT ); Wed, 7 Apr 2021 03:16:44 -0400 Received: from mail-eopbgr150040.outbound.protection.outlook.com ([40.107.15.40]:23958 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1346476AbhDGHQm (ORCPT ); Wed, 7 Apr 2021 03:16:42 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f58vv7xZzNFKT26mudm7isPXstPN+Dt4SdMgL93LqNkWNKtf97tYxnhGah9vKWEprhfO+jcI2H8wfnXTwoeg0DttoCRxdygOzse7BjtQn+ol6oZmS8OMpau7l9tPW4Iq/OxxDC8ftqn79ZWz6iFHH5ypKMD/3b3EsU89qM2ydKv2Vj8UU7fXdHD2+NSTOs/t5EgtDYXdWW/H8Qum57hlhuycEIGKLriBkurLupw7kYMsmvPU2oR2ErPjua/5XcLddFalhiZ3HBB9V1Gje55J2wSeIijEfUHP1S/i8xT2fZ1945xD7qQNh/flE0ZS6J3Eo1Etz3MKCf9M+Y7tfxo+eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CiLrrVV2i4glZvF0Sv8xK+s2y7uQfS+YPmBYdyvVALM=; b=mkbCNSSUwHizQS7WVqk6ERk0kCdvfrqSGuY2cDGkzUzLFJSIR+/OeGKaLbV3Q8B7DNFKxge2aIjx1BGwmnbePb7DzXGF0YT9OjcPxMVId9kq5s5aqniK4QvyB/q5DC6r1YTYAYPInRUQPX/zdJ3YPwu1hSGt8jiyVIxBPGnQvwFDYMFDUP+O/TuDRy40evQLjmNBkGwPHdkT0CFL97V3ceYv4W0hQK1R/YRdgbb7Asrs/5T8Hv+ZzfJYoPgc6XEFrOJOSPWZGNPo6Cnwi4z6tXfpd2df0ExSBd4lWKKDHDNeT8EdK/rLEHK03CwxfyH/Sx6eRKoqPu4Yv5Wzby3wMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CiLrrVV2i4glZvF0Sv8xK+s2y7uQfS+YPmBYdyvVALM=; b=UwJu9zo7+M5mIPaOeZycqKzmm57+zAY+lKmU8Q7gnJaqwQkx0I8m8Ttq+vU7r9u9T46gDqTCP6bCQa/ybWNzXHksryDPV0BuR1KEUEMPNyNDMWymRqs/dGWglzdCSDpgJTX9ar1FDpGi6mHJqLMbaPr7zm83Qc/WdlnvzfVesr4= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB6509.eurprd04.prod.outlook.com (2603:10a6:803:125::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28; Wed, 7 Apr 2021 07:16:30 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3%7]) with mapi id 15.20.3999.032; Wed, 7 Apr 2021 07:16:30 +0000 From: Robin Gong To: vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, xiaoning.wang@nxp.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH v14 09/12] dmaengine: imx-sdma: remove ERR009165 on i.mx6ul Date: Wed, 7 Apr 2021 23:30:53 +0800 Message-Id: <1617809456-17693-10-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> References: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4020.17 via Frontend Transport; Wed, 7 Apr 2021 07:16:23 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3ff1786a-b380-4467-aefb-08d8f99510bb X-MS-TrafficTypeDiagnostic: VE1PR04MB6509: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MmTwzZSKunf3M/NsWvFAq/spjrzvR9FCHM7MJ1JKJ4pGi2WEeADAbC7Uj3HfFyuFZXoYlwPWKk6jM99mXYTjHvMD+6NUmdEZN7rs8mNOi/e+GezaPyks9F3DZBsnEnpVCDOdU8uRQe2MmUhmq3fsoTm4mH/D1KS+KchEu9VeVc2YLvHISgP5rirlsCqLrGthsd83yLkrsfnd8t2d7DZZOrSr/1Ycd4Zui1oUpwzl7HzUZFS88NdqQThv0+UVWCq80sqD9v5k5ojS5raGkzGfnQO40iTkjONQSn3XI4KCtDwa0tkOtsX+8Nz3qveuUoP2ER1TvYstaNEJI/ICvVFCHQKG11qRLtCpIC8WqV4hc+CzjiDEDbgyHw6S33ECkqZV+ko6ddnzfdKa4v1rMhu3WrEglSa/GN92cBdQqX+GPVeWRtTlF1xS1Nyz+4gnw+QzUIIyoJycQUR8V4+9eMSAZT1YwA2+JtoSavPzSKvUYwJrzSTDypFdKqKmLBWZ1uPo24/D5iGL60O+EJnEeeiIXqxgfFfnq95JtN9hP6HKenpTMCyQL1TuOxE5GTmj6EcvsdVB8BJKJLYhtCxiKOAVViGH6zBgVBWfP3hEtYgVG2bVd/pfarOMxoz5PkWOtDW8FRkj3owqYq1nuq7QJNAUO7nj0K73aNT7/b3BCFg81NwlnG2jSodlZCdBp0NaeNA91OSFwUUua69L3ckhQDk9hPxxhZya6TA4oQwjep5xM/eDPsK8FGEdIgW7akbGyLmvxsDZ06fZ2aZNhG8Vlc8RNA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(376002)(39860400002)(136003)(346002)(396003)(6486002)(6512007)(4326008)(52116002)(478600001)(5660300002)(6666004)(8936002)(66946007)(966005)(2616005)(956004)(26005)(8676002)(6506007)(38350700001)(36756003)(66476007)(66556008)(38100700001)(186003)(16526019)(2906002)(921005)(83380400001)(86362001)(7416002)(6636002)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: S4J2LMeh3JDaZ0QYRbKzOlLBhDkGPN4WqNaKbhXz44U5w29lvyi3m+uvVRsgaIHrY7VpTqbxS3XR8HohBh67YJQU0UG1XuQ86dQ+YcZCk1AUboM2b2tCWNGEsafq9JzXbAkJB3F6Cojv16yIuj53hYZm27z8u38vDROc9X5il/Q8I4Hn/KTF8k/zQGmKIuwM/rzDSFhWwYUOJaPs3IfZbMqEFlkbAZMx2uOAgmxngJ2mjq6IiLE//lZRC4qHDKKuWIdjALwmAcc9JRKHHyby5xjxmhuV0tkK1z4piC4tgS201vMFFFo9nDEoRZg5KFxiQjbNyf+GYd1ZLvkvl4eDWLAAZNKlCRsBVbCj0XmIBXUb4J/RoXq7bTnt4OwV2SDqoPeZpfaxVOeg5nuI7pvINp3bhBFgMWFfqs0wR8FY6cAI18cpue2apO9ENFEqGo3dZ7RFu/lB7PHjoT2YW6l+riwCDAw5Ij+R9nfKnO/yjD68ZsetcAIIY+78Y38i2esQ0qgf8i6P6dZTXBrSMsGJw0JjH6LiQ78LT4lxoyU02SU+J6by2u+9hJ1jvsUJVUiy3Q3iqvZzgMjBf6kOyVF2FnACg9Q/Nf71UMQ4uzeiUjUKrOtjb2dpLCSQfUrRvF0YtYtsTElxtF1GenSiFAMeGtemPFIcl++v1La6rBLcSRHWq+UdeDHipStfqW+um441WK6RxyDG1ZBDJZG5jlN4diEiIZ/m3pUatP+lg8ZDHvx+CD1JzAS/JjvnRAeMyxBUZIoU/glPqAymL0vSPf6khLv1A+6kWnFvrabes3D23+CKfr0a6cfbkucJRee8/20BJmu9f0Fb0advJivbxTefZuQ6c0xlZmMFsl3KGFcpeO9O3flE4anWwqonm0rbl8KGdAXRz7B2uT9Tqjy8JkbyhJe8ZIDuVJifh7my/i6I3dLYt+YdyyG7sOLmkkNqkW15hcw8/3RRQEa1D5Sxfb8IBBIYowwXxZ7j7B8orK7jQVkyUL7eR9gcTkK+kSiawy/epirn0njAhiKEG+y23N+gHBxVxgwqjPs0A0tjPRDNujCsVIZguZrFuRDLw/SZqwNx/maD4Cie488t144Z+Tepd4SyJGxWLIub1hfw+MzGxd4g8lDrrxHocTIhwkp0pgkXsKuKLbYqZyIWlo6LN+E+1DYISaqnu/ScAJ/e/lPBv+qGHVUmOZ0XbTzFm7AbcAaEns6bv0Hy8K6epO7dWXRADkSne/JivXdj1k7rWOzO92Lxyvqd2sXk36vf+zTuPDrc8lCI187ozT9sox9zGFYw2OdPyJ//QRglnE5JS/80Kz9IYlWJs26HnCjyiD2yJ9BH X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ff1786a-b380-4467-aefb-08d8f99510bb X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2021 07:16:30.0673 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: f1lpTYRBkPYJ2GeZ2wLSTPXqxvGrl31hK1YSPOn8mEi4OqflBrrIuBMDL5PnLIAwkSj+j82FzyWGPq3CDV1Xmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6509 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org ECSPI issue fixed from i.mx6ul at hardware level, no need ERR009165 anymore on those chips such as i.mx8mq. Signed-off-by: Robin Gong Acked-by: Vinod Koul --- drivers/dma/imx-sdma.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 86bd383..af85116 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -422,6 +422,13 @@ struct sdma_driver_data { int num_events; struct sdma_script_start_addrs *script_addrs; bool check_ratio; + /* + * ecspi ERR009165 fixed should be done in sdma script + * and it has been fixed in soc from i.mx6ul. + * please get more information from the below link: + * https://www.nxp.com/docs/en/errata/IMX6DQCE.pdf + */ + bool ecspi_fixed; }; struct sdma_engine { @@ -542,6 +549,13 @@ static struct sdma_driver_data sdma_imx6q = { .script_addrs = &sdma_script_imx6q, }; +static struct sdma_driver_data sdma_imx6ul = { + .chnenbl0 = SDMA_CHNENBL0_IMX35, + .num_events = 48, + .script_addrs = &sdma_script_imx6q, + .ecspi_fixed = true, +}; + static struct sdma_script_start_addrs sdma_script_imx7d = { .ap_2_ap_addr = 644, .uart_2_mcu_addr = 819, @@ -575,6 +589,7 @@ static const struct of_device_id sdma_dt_ids[] = { { .compatible = "fsl,imx31-sdma", .data = &sdma_imx31, }, { .compatible = "fsl,imx25-sdma", .data = &sdma_imx25, }, { .compatible = "fsl,imx7d-sdma", .data = &sdma_imx7d, }, + { .compatible = "fsl,imx6ul-sdma", .data = &sdma_imx6ul, }, { .compatible = "fsl,imx8mq-sdma", .data = &sdma_imx8mq, }, { /* sentinel */ } }; @@ -1144,8 +1159,17 @@ static int sdma_config_channel(struct dma_chan *chan) if (sdmac->peripheral_type == IMX_DMATYPE_ASRC_SP || sdmac->peripheral_type == IMX_DMATYPE_ASRC) sdma_set_watermarklevel_for_p2p(sdmac); - } else + } else { + /* + * ERR009165 fixed from i.mx6ul, no errata need, + * set bit31 to let sdma script skip the errata. + */ + if (sdmac->peripheral_type == IMX_DMATYPE_CSPI && + sdmac->direction == DMA_MEM_TO_DEV && + sdmac->sdma->drvdata->ecspi_fixed) + __set_bit(31, &sdmac->watermark_level); __set_bit(sdmac->event_id0, sdmac->event_mask); + } /* Address */ sdmac->shp_addr = sdmac->per_address; From patchwork Wed Apr 7 15:30:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 417919 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=-16.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 868EEC43461 for ; Wed, 7 Apr 2021 07:16:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 62EAB613A0 for ; Wed, 7 Apr 2021 07:16:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349395AbhDGHQu (ORCPT ); Wed, 7 Apr 2021 03:16:50 -0400 Received: from mail-eopbgr150088.outbound.protection.outlook.com ([40.107.15.88]:65189 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1346510AbhDGHQr (ORCPT ); Wed, 7 Apr 2021 03:16:47 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GLVTZmvmF0V1pr3XPZPwHoDvO41JMCrWrD+2nPxmusfaE4kEqXl+21N0lYsexRzF4IYkLvnRF7EVyJtCLac7Zf0+8l+8d/kRWY0sY3EFYSXYyRYVkB7DrRpQmOI3okbgghPnkZyxl1gULKJZBKEz7qcBzxziEeSYkOJNYRiVGke5NsTOZjnAj8E9mQ/re2q6CxAxGJpgrA1J5HkoNkwyFyqwIK1WjhLGexm7Gwh6mmFYIYEFkB4sITWVg20gVImAeks+N8h7Ei9V0jm3iktWZczyO2Ac/Rb0Ups9fzj04Z0CoWN2cQQl3BFtLUly5TTP7qkXw4rTygQlnZBu+dYCyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sZvU3VGhVcTeYxe4fB6geATT0prKN/x1vEpROhK8pVc=; b=TmvU3MA7EZxshL+kx9fZ//jKJFSLpsMIFxZwLUupERB339Dv1nPa5wWmi6s17O/bqgy/kzA2Q4oKSobAk2VxG5mZ5lh5jtQ3bQHL/fsQZReYTWSSeE/GxuxqpYX8z/qEu1VRKMHQEyHfyBLUQzlPx6AK3dpMD5X25Nv+hoPmn+IvkWByRZ7M8OffoXXUDX5QO7O0U24Oj03JWPAh0kOmBkdJ3r29rBK48Z9G4Oesqq7mU0uAjN9YvicnOfGtzUTxRi0G7ayncyGJMEX4A2s5v9RkHexaTkwRdevCZMZGhMYJOgNRzks6l0HFzlp1R4/tAOeW4r1C4kfPEeRulSL+Sw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sZvU3VGhVcTeYxe4fB6geATT0prKN/x1vEpROhK8pVc=; b=fDRWJs9t2AehAV7WwH/7jvR3ddo82oG9dtkmf2rhzNpa6spEKuLGMbwyvTU9ulgH/p1o9A7ysYoNQXi1OEMPAU522n1ABqeZ1ado7ZX5VQkA6Ue0/JoYgKoowIohoAMB9WssbYWQvdsXz54NhTg0tYS1tPUD12P2tJG6fkU6lqU= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB6509.eurprd04.prod.outlook.com (2603:10a6:803:125::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28; Wed, 7 Apr 2021 07:16:36 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3%7]) with mapi id 15.20.3999.032; Wed, 7 Apr 2021 07:16:36 +0000 From: Robin Gong To: vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, xiaoning.wang@nxp.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH v14 10/12] dma: imx-sdma: add i.mx6ul compatible name Date: Wed, 7 Apr 2021 23:30:54 +0800 Message-Id: <1617809456-17693-11-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> References: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4020.17 via Frontend Transport; Wed, 7 Apr 2021 07:16:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6dc3dd4b-9a4a-4fbd-0162-08d8f9951478 X-MS-TrafficTypeDiagnostic: VE1PR04MB6509: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:632; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: z0ZFDXd8njGJQqbIrUTR+G90QtuH8vd8uBOw+wovRAzWBQX5t4Mh21nyOzbRzjbs3wMnmA7Z1ehOwGj41ipWkWyxKPggLD9fzg892nuidrUjSriKaJprhxMtoMJRsKwJkjy/wKJNhspfH1onVt+C2CmLNYuF4jrXAEVEaQaQBiDvTB4piXja8uJ2So0A+AWkyljtju3gisvjRvlFqCcqqwebKQ4JYfA7d/0uXRb5B0iXaOcPgkvxLSp9CLYSMjUlUh5YzVBq23oFnzHzsddvOawUONdz5BmMrvMRiYwuzgaEb+XmQfBdaWlRvaPF/fMOoO02YktV8tdKET9tey14pDhdVZRfg144RlbFMDyHe/qTJlLRH8z/7CWvsFAVNZM8Gv3YyNCZ8MWdpgHLiHnZAcVcvVwdbuZkrfcIYdOVD3ggCNQNWPCXVoKjHUsRwRzD6ixxSsuHg+4lI328ds6t05Yzb9CQxj4udnc7fDcKnIDuZGzVFDLaHAhSLibHMR/sYvkhNaOwNviWpV7LRpPyBWTUiKxb7wvPcdgGTAzJ/sjo55mfLb/SVDvAIc7xMpUXfGZv9xfTufyiEfeFxvRi0aKDA6JriGAz4BiCYoDtxxovKPfqTCz1G1O26jw19moeTLjEInJTXcDMXeorVFT5Ido56cl/qP9RdU/O7A9Mrn7HxtSfFfwzHZs+/i5GHJ/U X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(376002)(39860400002)(136003)(346002)(396003)(6486002)(6512007)(4326008)(52116002)(478600001)(5660300002)(6666004)(8936002)(66946007)(4744005)(2616005)(956004)(26005)(8676002)(6506007)(38350700001)(36756003)(66476007)(66556008)(38100700001)(186003)(16526019)(2906002)(921005)(86362001)(7416002)(6636002)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: tnk0iLAraGO61kp8Scid+IXaZpbZirn8+bQazmbWjgiLL0HV1SQMbg1fjnHE59xOqEzzFuQXALdfML04SDahe7fRkjLSkr8jiDz2lq2jazDsaweTU7MhqlNXs2BEwCqns1HrGXEnRFOhfPVdH0imgr8QLgxuKduuzAyHa4Iu5nQHq3ZyPN7s2LIY1w4OP4L3tdQZCRIxSPerCXQyQ2lQLK+q4b9KCwi+9RG45XVXU9BlBh8UjxIJu10CJIFHltJEyLYO3VBbNJtW8K6uY5H7Snz7m20tlAAEw6iBz1ZXVR9WZ8OOKoRJpAbn2Y2DaTa8E+PfpClzlYTejmahNeL/6LSFhyrLraUgdWPDLTsVFsQ6IsMzg9F/IQTr98rCk+s+hY3FF+yrelNICzioz0614l/gQZtF0Q82x/pLy3FR7c+Tu1OQDaVPFUVMP73oa+buR9UAgTPlsWBYgphkVOQGIEPANu0Si2V6YU7jyxJv7NxMzn8xFX+X1s/KhbwfZyMobEig2g31PdEVNxuOiUfIJueZjEr0F+fA7ZcHysk0kD7awnLpY/hjLZmxRBNJ2U8vvyn7wedGaG10ut33LExbLuk7axq3e286loVTVLcKGeP6lnQO6ZxjWx0B80YWPgDfCVGcppVb7i8GCFr2qnsNubS3W1jw3WTmh0TKoAcnhoewy44tuuhMGtNJy3y7E4XocaMxkcZiwalMVQe2kYdOt+UOf/2lJpbaA04optjqgRCRmbJA/ZRvRlQk6NFdL7rbIOHsk6EVKC2mJmiQXa977cNJzm2SXLOnP2VRH8inVaUazbWn5KOZJSedOKQu1jzgDafHOQJcJiWB4N2Ftskr617exgeFt0TbXCGdoaBES0niAGQiuvhQ76xzBh+EEDqhax60RJrhKKvF5yMDKBDW6RnwzgBs55Y70a721l0Q1mYSHawRQZJuoY7clKfeVDNG3Y0GWHILL7g97In1ri+0YfT2hqb85JZQKX5rxB1+DtXDU95JDo/nPJ45EGwJxIiFc+VhPrXmSMKX3QrWX37/Gcc5ptAX5atLHJEu4hM2GqlQm2KmI5FAYIbmH/2OYfu7lIayRLmMSDnzQTyzWr8+duN21zSa29VRRZdvkon7RrG6bm6qtJGwoi7nQrXoS8moAksvLYO6/DMGUzWlPI8lxZXzvDJVx37htMOU/+DptLJzb6jO6d4/ZQB47gw7I0ib9kFEtDO+l6ONeqTYnsN5gNvKSK3U1Jy3YjEdMcxHgcIh8nmDDAXfKlF57kZDesNYDdMS2EXVPK0RuOcS8dplvTl6Ri+xXCxFqjdo9eEJ2uO1+UvEGP1gIQEdfpJ9zXrL X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6dc3dd4b-9a4a-4fbd-0162-08d8f9951478 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2021 07:16:36.5465 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /RhsLVb/mEnzzKu73Vq2qupbkknHBGHJ+UQ4QLvtbmtUbQF9CdWVKhyycv/fdUgrwvtwrKK4cSHu53WMQUtR1g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6509 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Add i.mx6ul compatible name in binding doc. Signed-off-by: Robin Gong Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt index c9e9740..12c316f 100644 --- a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt +++ b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt @@ -9,6 +9,7 @@ Required properties: "fsl,imx53-sdma" "fsl,imx6q-sdma" "fsl,imx7d-sdma" + "fsl,imx6ul-sdma" "fsl,imx8mq-sdma" "fsl,imx8mm-sdma" "fsl,imx8mn-sdma" From patchwork Wed Apr 7 15:30:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 417147 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=-21.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 47F5CC433ED for ; Wed, 7 Apr 2021 07:16:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1E793613A3 for ; Wed, 7 Apr 2021 07:16:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346525AbhDGHRD (ORCPT ); Wed, 7 Apr 2021 03:17:03 -0400 Received: from mail-eopbgr30063.outbound.protection.outlook.com ([40.107.3.63]:43331 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1349390AbhDGHQy (ORCPT ); Wed, 7 Apr 2021 03:16:54 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gxINwIkMTaxYrNOXyY6TpQnq6Y9RBkr+pshIErFpMFAyWBV59h+39Te2pDNTGUZ3zuAxMel5mD8wIEnDIgKb+rb/5JaLPkGzxt+3Qc8ywYRfCNbQ8qkaRqdqCXnF8YL0YbxK/fnMK56xLbkYiCA+5JE56ldGPl5jzmgXvgKrK0nhNvODhndGodGqvxaawYabyYxWE3dauJPlyUoBGvMV+O4ODJ0vqaq40tvUJPpIorPX5mLq68vbbkMnJ/lZIeo37Jl3H1K6SVPz70IByEHVS4Knn4KeoDjflvFbwrFZow8q17ZqJRalDAzV4zSjor2u5xfPS8zBz0IwCT+gYnrxvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tYa8r5TxtWVOSf7TiNgPJ8GJxUj8rQjNL69BTbnVrPk=; b=N6RcPmw+Dl5cZFFR3Su37W5PGV/JvSl/VG/nhIBl+Wj3Bo5h6d/AmG1oxG8oo7rk2Vo41d/1l5hE3ENgYdN1zcIWwxAw18K3wOab/cN1VLli8pbq7DwNkmxq619UwyvSfuWwktfw4kgY2HSeAQVUhK+84Dhx+609quRv1Lg9KpAtJx4ht5uQh1hTNFpq+dj0tKtWx97UfhTEqJtqj/yMmNGmEkx48Da23C3Xf/yk2HUkbORZvKaqKzE51mXyweWJE/he7X+sj5HAIfan+KEJpypdmUhjJpiAqoWvcFwkI6afFsiLti2ZNnUBBkGMICxdahS5v14CcveXIcQmTvmNGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tYa8r5TxtWVOSf7TiNgPJ8GJxUj8rQjNL69BTbnVrPk=; b=rM4itNMVfeEtpkS1fh5bnyiEkX7PIIqBxURK3r9nygGCL9A4WXYFdL8Kv9kD9VK+aZlHx6/9PaWtv0TwczG2sG8612E/siRSVqcvVSEW+VLkvJbyVzf0VjIPTOw+OxLCciZbjIc/IX0jmqfRZdZYK3gQkTF9KSsCGMNr3uXHB3o= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB6509.eurprd04.prod.outlook.com (2603:10a6:803:125::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28; Wed, 7 Apr 2021 07:16:42 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3%7]) with mapi id 15.20.3999.032; Wed, 7 Apr 2021 07:16:42 +0000 From: Robin Gong To: vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, xiaoning.wang@nxp.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH v14 11/12] dmaengine: imx-sdma: add uart rom script Date: Wed, 7 Apr 2021 23:30:55 +0800 Message-Id: <1617809456-17693-12-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> References: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4020.17 via Frontend Transport; Wed, 7 Apr 2021 07:16:36 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 43be4d34-d30f-4326-378c-08d8f9951852 X-MS-TrafficTypeDiagnostic: VE1PR04MB6509: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +E+wyeNLMgCIld4BfR5vWGT925gSZXPq2ZtOxyzwNrB8xxCt5uBVSZ7MA2RwhLryqdYFAf3q/yYTugSNjghYt53GNwXUTExjyX5+co4W7BAmuCaPppNMbmDp6yYvI24sAfgI3fQM/ltqM5WNJJ/9yUPVgkunfU/tiGgQ1gHEzHPW+C/KOnPBd8Qc2rxFB18SDZRkszVRqaHSMQh6B18FGfQlbntnwFom3HWBB0boDA3yutzOlv6SOsJV1BeGiUDzuut6Xun64edqoexo3kSnKDBaJgYqItQY98WQdld3ayWPQb/2Hvp5BR5VRylSgip9pTAl6GyG2MG335VzkNAH8oJ2BGsHgUHVgE19h2MdVOa27TI1f8Mk4dbp4FPoDHkq95qh6Wliqze5zagIvnieuVDdGEZtGxrhp/TXGZlAX922hYQrTBAr2QOf0rT4SG23X2c6BGSxP5pPgltSvk8H7Xl5GoprpzG73s0bdwuC1YKBG0jgV9yM6HFn80hrKjqrlthT3zsKwl+E1wshoVRNk80SGjXdRGe0VpqOrZ6vuu5vx+3ccD2xs1eiiZD9ISZmdXBpr/Nrfr2nCICn+cbtHkS4Mj/Xu11THqnNGY+rs5FKIKb8BEXgM9msWlfekTgck4UjG4kBmFG06r4lfvO1neTIAh6kNj3g/cNr6jPm374mX0pZfysMlNzGzoUw1QAnGe7f33I/5e8jU5ZbY1ql/5EgGd1lT9iDoliFwntXY2MTeeJHqnXkz9mhx5Rdxn2Ix/SitapJ7JXFMxAq41zABw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(376002)(39860400002)(136003)(346002)(396003)(6486002)(6512007)(4326008)(52116002)(478600001)(5660300002)(6666004)(8936002)(66946007)(966005)(2616005)(956004)(26005)(8676002)(6506007)(38350700001)(36756003)(66476007)(66556008)(38100700001)(186003)(16526019)(2906002)(921005)(83380400001)(86362001)(7416002)(6636002)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 1nQ+Fyjv0n/LQZQGbQO075PcX0hcoNtDIpmcU6xGgmqQzMpAkddA4PuuSNzCmc5kyK6+jbO+9p6gsZFP+O0Yyk0uyrQkgHs902D1fY9NYrWrtsN8EDAa3MtM04apfH8TmQyojDrCJyhn0zbRkafI580lFat7GliLD0w70kNdLvtS4R/BijnBOKUpMQRRcw3JVo+k/eLUx/E9/x/lyu56UpTT6w2+uNGNeD8ATK/ECKpH5zjldHQfqi76PDFfCnePS0EArSzWKjFXy2h3UTON9vrqPCpZbBrbHry0iUT07PN7rn4o8/zooetDIGvcel3+8hJ2dIjH7H5nTGttRAu5OZgGCg8xFHKtUp1E/dPxz9b5oDKZT2qC+hrUYp3Kbd/AwOv5YJH0mBAFGXa/r2cIWEbazYK/rDqxJ//m9TSAZAcRGZMVOu13j2y8zm1xfwAGVPoLkd71Lw5TMD55IFY2q0Uj/lkYvSUBhJbveQ6J9ipeezV91JsroMN6lO/SF/S9hyQ7J/TgxcT32lQVpRkymoQmpVbyF1VgcCnOAcQkZO0PQpgKixgmYUHUHlcGn18dUgq+ivNY0wrH0d4aM6O40KA8qMmg230RR1YpOoD94iU01LHfgDn/o5exCiUKJ/844Ay7yR/y/z5BGieSpUcsZL8xYqTEf8r8BpuxqRJaU6J1/C5M/iu6u+NYfjX2Hy4RukYJ3BXLA0h6gFV1LEJXrpbsgZwWJjY4qmooFDdAY2Vm0gaRkEivA3AidcOydUWe0xJvo9+8Rdwl8pR4ag96cxizLy/DwIe1TCrO2VJl0jz5vESC+8EQIRarjPjTGfweX4acHqOQ1OvFQ77X1Xw1gabTyw8x2V9MXZI84SRfKbbbZhv704rHBYFsHI5LxioCUSNcWwHPqeEHIj30HUf3TYO0jYAz+m2IaCuvVY2PLAlF7YVzfCM61dxWec5tfGEemB5hmFTt6X94WwbywjX+WcMjCDurQ7hVwUkacZlJFm08G5DGPVXaLCnQX6vctijqgHYMBHSSvmNN//qrGPCgzahOvE0gK9B50n7tN6oE9eFPpIDgJV5lNM4iXIwvS4eTRuOaThEHVZTTYxNgl+aTNyNExpGLYQMrZLCRU56nqnux5AdNzJFU7N4PhBXdyNiDk5J52YZs79sIdlCLyc1aSTcFkkt+mow8SH0NHxdkYP7Eo5uI2nWY2g4TJqRo4xqpvW0Dbx9EE2DA7On4RLX/OsQebOrkTxiqgkA5wpjVyEimxfZ7NqqNxl7pOyaeoHc3vEdfxufAPaLDRdA5o2nqBiE34vEYYgsQzNm2ZxTYMACuAodymOlmxpmL3P3JiHn5 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43be4d34-d30f-4326-378c-08d8f9951852 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2021 07:16:42.7859 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2Df24RH6fI8nChE9j6Dba2Bw8thNHOazpNJVaLdlqwT2qlFPZ9jRHlLYVuX6C+eHx/KN0PgW+C0GMb7DrCCaag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6509 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org For the compatibility of NXP internal legacy kernel before 4.19 which is based on uart ram script and upstreaming kernel based on uart rom script, add both uart ram/rom script in latest sdma firmware. By default uart rom script used. Besides, add two multi-fifo scripts for SAI/PDM on i.mx8m/8mm and add back qspi script miss for v4(i.mx7d/8m/8mm family, but v3 is for i.mx6). rom script: uart_2_mcu_addr uartsh_2_mcu_addr /* through spba bus */ am script: uart_2_mcu_ram_addr uartsh_2_mcu_ram_addr /* through spba bus */ Please get latest sdma firmware from the below and put them into the path (/lib/firmware/imx/sdma/): https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git /tree/imx/sdma Signed-off-by: Robin Gong Acked-by: Vinod Koul Reviewed-by: Lucas Stach --- drivers/dma/imx-sdma.c | 17 +++++++++++++++-- include/linux/platform_data/dma-imx-sdma.h | 8 ++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index af85116..9519b41 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -1696,8 +1696,8 @@ static void sdma_issue_pending(struct dma_chan *chan) #define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1 34 #define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V2 38 -#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V3 41 -#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V4 42 +#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V3 45 +#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V4 46 static void sdma_add_scripts(struct sdma_engine *sdma, const struct sdma_script_start_addrs *addr) @@ -1721,6 +1721,19 @@ static void sdma_add_scripts(struct sdma_engine *sdma, for (i = 0; i < sdma->script_number; i++) if (addr_arr[i] > 0) saddr_arr[i] = addr_arr[i]; + + /* + * get uart_2_mcu_addr/uartsh_2_mcu_addr rom script specially because + * they are now replaced by uart_2_mcu_ram_addr/uartsh_2_mcu_ram_addr + * to be compatible with legacy freescale/nxp sdma firmware, and they + * are located in the bottom part of sdma_script_start_addrs which are + * beyond the SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1. + */ + if (addr->uart_2_mcu_addr) + sdma->script_addrs->uart_2_mcu_addr = addr->uart_2_mcu_addr; + if (addr->uartsh_2_mcu_addr) + sdma->script_addrs->uartsh_2_mcu_addr = addr->uartsh_2_mcu_addr; + } static void sdma_load_firmware(const struct firmware *fw, void *context) diff --git a/include/linux/platform_data/dma-imx-sdma.h b/include/linux/platform_data/dma-imx-sdma.h index 725602d..91dac29 100644 --- a/include/linux/platform_data/dma-imx-sdma.h +++ b/include/linux/platform_data/dma-imx-sdma.h @@ -20,12 +20,12 @@ struct sdma_script_start_addrs { s32 per_2_firi_addr; s32 mcu_2_firi_addr; s32 uart_2_per_addr; - s32 uart_2_mcu_addr; + s32 uart_2_mcu_ram_addr; s32 per_2_app_addr; s32 mcu_2_app_addr; s32 per_2_per_addr; s32 uartsh_2_per_addr; - s32 uartsh_2_mcu_addr; + s32 uartsh_2_mcu_ram_addr; s32 per_2_shp_addr; s32 mcu_2_shp_addr; s32 ata_2_mcu_addr; @@ -52,6 +52,10 @@ struct sdma_script_start_addrs { s32 zcanfd_2_mcu_addr; s32 zqspi_2_mcu_addr; s32 mcu_2_ecspi_addr; + s32 mcu_2_sai_addr; + s32 sai_2_mcu_addr; + s32 uart_2_mcu_addr; + s32 uartsh_2_mcu_addr; /* End of v3 array */ s32 mcu_2_zqspi_addr; /* End of v4 array */ From patchwork Wed Apr 7 15:30:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 417918 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=-16.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 EEC09C43462 for ; Wed, 7 Apr 2021 07:16:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D25A5613A3 for ; Wed, 7 Apr 2021 07:16:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349409AbhDGHRF (ORCPT ); Wed, 7 Apr 2021 03:17:05 -0400 Received: from mail-eopbgr30063.outbound.protection.outlook.com ([40.107.3.63]:43331 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1349414AbhDGHRE (ORCPT ); Wed, 7 Apr 2021 03:17:04 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WPeEub9zPvivYaqgeK7f7tFytrQNRoi/vEzdh9dliJuy9jX8BzBAIKvNVQyTXPtejqI9hyJ4zu8LEB3fRLlehvrdXtKcvQ/YWgn4DRku11PjazUS+Wa+GlYh4s1xVUHYK7l4cvIKS6GbLyRXNbGVBkEQn3fkZJQdfNoM8RiifdVVYxajFclXxiSW1aQ7SlFrkVCkzi+kEa3fODsZnWFkvKIyhSG44tKeCZUc+uh+zf4ACBbGt78p/pD43eV5ric0kaRJvkIRYn0YNxp/T7gvpHOzCtoFjJ4VAdQzInTSLd3v1OdPvR63TcrsBQGzYRePGhSifj2yJwlWN/4pwQ1C2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QnKNg6HF8H0zCLKEHAhfnF4PwBG+Kv3Zqrvtux+Dlg8=; b=ZFe52zNJlYwLjq4/jIxCmtuA5yCyEBTmBlEI018AmS/a1Vs4B/0gOqs5DfoScjeCp7m26EeyjwaaosJ7NSJzvcAKxm4k9tX8xuKgz/m90WcXcMjI6RdDTvUk9DvpzyhsK2hQJiIbt0dhMVT8M3mHfF75ukinFtvy6kOo9StDPn9NYJB8M4UaGV/Fq6TwFGuo1HTeO/Rq0IcLaKS3waYacsIH2ZEyfUTDEJaLnzscE6bnu9eh3rmfAq3SAKyADdP2WC21zmPb4eVicm+4TO1WTyRAFWEd8TFPA0uW4CBA3jJBaLv6h9YE/mgkNKYSGa1Hh43MW3id00I4jORo6VhpRg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QnKNg6HF8H0zCLKEHAhfnF4PwBG+Kv3Zqrvtux+Dlg8=; b=YGNIZ0YbYje1cAuMFG0zuOuAQmlFeMOAj6T5T+zNz3E9Wt6R8jZKiR9fb+38LdkhQwKThxJr5Bj2CxEat5/QWViE1r/OSSnAaOxEIsRt+oep7VUt3PvBtSQOq5LucZMeUF7Szx6cr7dOsovEb5p1qJ8rAJI1uZr3VR02xsyRfJw= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VE1PR04MB6509.eurprd04.prod.outlook.com (2603:10a6:803:125::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.28; Wed, 7 Apr 2021 07:16:49 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::e8e2:7756:13bc:2cb3%7]) with mapi id 15.20.3999.032; Wed, 7 Apr 2021 07:16:49 +0000 From: Robin Gong To: vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, xiaoning.wang@nxp.com Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH v14 12/12] dmaengine: imx-sdma: add terminated list for freed descriptor in worker Date: Wed, 7 Apr 2021 23:30:56 +0800 Message-Id: <1617809456-17693-13-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> References: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) To VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from robin-OptiPlex-790.ap.freescale.net (119.31.174.66) by HK0PR01CA0049.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.4020.17 via Frontend Transport; Wed, 7 Apr 2021 07:16:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 384ee712-0b80-49d4-d8ad-08d8f9951c05 X-MS-TrafficTypeDiagnostic: VE1PR04MB6509: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5h2HfPjWJR1xuAEL1bjT+a9UGq3QsXnQynWGnWIRo0AnOEGD5quobCgLfaSmeNvxOCgJiCvi1Rswrj7gMcqJjptPyPO9x6ey4FoVNI3gm3Rs5YU2tiBGgwnd5Pza/VtCiwCA/W1ywO1a9J5qyWoFkTSng3r6/5xEqH7ahytCl8lFf35WGThvXaFPzqkt4+jlS0jfraMV3R88x7E6pCJeRRRWdgwFH7O+S0OmngNFsSEraTz7mbB6rawu3EfQAPh5Myay2pRFrWPPJndJp12cnD15nYvBIfwu0x2Cf+3IeMWvJgQuLSsbQVlVstoLUGLegwjBL0/p3DRLG+Ek9baoSX/JWKqF0sNwOPmOouYl11bUb/du3RhIFDLdM3BV4c7iYPOMGoHHfXEZaQWPIFOb9b2CkNRn0zo7hy5sWCsvFWv1P+S9LQWCsmBrXuqrVmoXKgwbumcZX2zlTWufakucybCLOI8RmuYNL0PQ3i7zzLnK3bggpuLjmceWSWlntfVliGWeZKS1/VK0LNvCeyCWu+7GAhDyfAEVGLGFnO1YqMuXHBs+8PnzAaYx4vBt+ge1kjFpdFtL5gldjZWuOCAT7W3MZUq0MHXPYxXXjBQvS8/AKp7k0BANdRbjzV/F8Wo2B3jeYbkGYInAUhgc/aGtr5LLIS4fzlv0JylTf7YOD19Ujz07iF1QNpwm0PQ+ufCTeRvsmdaiNPEXm5j9Bo24TqD152YobC29l8JU5MXTLsc/4NwX9HcPtEXOLogQUjb0Kg3kQfO0j6awIEo778M9xw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6638.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(376002)(39860400002)(136003)(346002)(396003)(6486002)(6512007)(4326008)(52116002)(478600001)(5660300002)(6666004)(8936002)(66946007)(966005)(2616005)(956004)(26005)(8676002)(6506007)(38350700001)(36756003)(66476007)(66556008)(38100700001)(186003)(16526019)(2906002)(921005)(83380400001)(86362001)(7416002)(6636002)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 0d5fuVncq/Vm88gQF+OCMC7gPmo2ZI1CmG+lLPIzu+iYSWPjxYuBymSpJT+KKoYOenIzO+UkRMBkuxifR6Ua25iAOqke3A0nUQ0/sH+ZlH49CzZjZTA0NiUHzhkJJl0ZgiNvporJJ7jp5Y/8kuRXVnEkcV1frdMJhUrK96dIWK/4/AqoROW8fAwibLtMZS7O5jAO9OLhYvnVPvps2SGisTS+bUaNWLGqxAhSiWaQeeFRmuDoqycFDIdA5exP7S7Wwg+CHGwtsdK+wECFAU4nXSJh52OquN3wCxTmjBcfNv3FypkuxdS9EKuL5XFS10Vrs5rILEWXgiUsyD2THcLtNtR64utzt+gZsyQ0fhX2k7vzt0aHR97mAsskaXt5y3ezy80rJ5JO9hq/JIfLv29oXEEHDQfW8YJMS0OurpNO6mnjSqngjD7vRu7WGyvZ1QfR6m+IY+iRofl0j2W4RC7wicACpoQuDmO4pPvcIn5shSbZ3OQh5M9J7BBBQf/KwQFARbextQLcyprSt9RBQsVeXf1pZ+lHVbosGrKUoNIeYLU+EuINoqsJPgYrrMh8PMr1yo1HWrTlLKMRPqj8D3sEWKK/38VOOaiCGQ2i/jxYq2ZxlLTIZtVhCcSopTrJvdpfWBhscKmIKgw5AMprE+Ry+DLG7agEzfcnkPZxG303ScASdi0XNTaJFsDlhoPOwCtFjzdINA5hANS8mtdLVKxZF8LYXvTh6otGqtw8ZUx7SdC1GYwl1cpjbHvKJ8poXyXSyOK48za6bic6vg8xtmj/RwV7n7QvI5JXgZjMrogud1NiqLccYNNQeDsE53grPBmAcF6/qO+eURUSiICxOW4gVRJed8vm2D4B0qp9nApFIHGch1ED0eIbmFTOX2sQ9KCd8Xc7Rz3I+olahdG9ai5/6PK+vjHPzDUMEblNfDDVQKbp+4S2c5Du+tD20hI2WWCIHNISlCijjjsbwqqXq77wgxLFV1CRqNFlo8WgC5OBjy5pI9k1SuGt6h9fdCVRvRAmuFSFqjSp0z1c3G0vOHBpJqSKd5K3IqTfj+CAGohO17loNfKZZ0jY2AJFp3qBjDoqyk4zUc0bVGAkayePKzuXEJS5hcy8nHV0A05egBU/8bWESdkr8n9ZzlrCIScLam4bWCK/KMjx2HhqzT29Lz0t50YeGTxLtkZANJec7B8TtG1dQWGUqBkUlzXRsMwma4qTFiu+RY/EzhL6/d/aL9v3Neo5721cxVz8Q69tyRZnrAWN0jUUpBmqXbpdVy7O2p+XRlAfZTRs/UcgAl0xEm+rbfpPeqDgXQ+KMJ7OGguZPXrhO7tJWtzrBQtgI7x++U78 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 384ee712-0b80-49d4-d8ad-08d8f9951c05 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2021 07:16:48.9972 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: D9xtfrlx6Ym/PQShDs0cjNHl/ETJcA4w61fBr0TOCJshmouloR3TcjuY3+MOs6+uSr/OWB5lES6N7ge7yXJYBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6509 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Add terminated list for keeping descriptor so that it could be freed in worker without any potential involving next descriptor raised up before this descriptor freed, because vchan_get_all_descriptors get all descriptors including the last terminated descriptor and the next descriptor, hence, the next descriptor maybe freed unexpectly when it's done in worker without this patch. https://www.spinics.net/lists/dmaengine/msg23367.html Signed-off-by: Robin Gong Reported-by: Richard Leitner Acked-By: Vinod Koul --- drivers/dma/imx-sdma.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 9519b41..4174580 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -381,6 +381,7 @@ struct sdma_channel { enum dma_status status; struct imx_dma_data data; struct work_struct terminate_worker; + struct list_head terminated; bool is_ram_script; }; @@ -1041,9 +1042,6 @@ static void sdma_channel_terminate_work(struct work_struct *work) { struct sdma_channel *sdmac = container_of(work, struct sdma_channel, terminate_worker); - unsigned long flags; - LIST_HEAD(head); - /* * According to NXP R&D team a delay of one BD SDMA cost time * (maximum is 1ms) should be added after disable of the channel @@ -1052,10 +1050,7 @@ static void sdma_channel_terminate_work(struct work_struct *work) */ usleep_range(1000, 2000); - spin_lock_irqsave(&sdmac->vc.lock, flags); - vchan_get_all_descriptors(&sdmac->vc, &head); - spin_unlock_irqrestore(&sdmac->vc.lock, flags); - vchan_dma_desc_free_list(&sdmac->vc, &head); + vchan_dma_desc_free_list(&sdmac->vc, &sdmac->terminated); } static int sdma_terminate_all(struct dma_chan *chan) @@ -1069,6 +1064,13 @@ static int sdma_terminate_all(struct dma_chan *chan) if (sdmac->desc) { vchan_terminate_vdesc(&sdmac->desc->vd); + /* + * move out current descriptor into terminated list so that + * it could be free in sdma_channel_terminate_work alone + * later without potential involving next descriptor raised + * up before the last descriptor terminated. + */ + vchan_get_all_descriptors(&sdmac->vc, &sdmac->terminated); sdmac->desc = NULL; schedule_work(&sdmac->terminate_worker); } @@ -2075,6 +2077,7 @@ static int sdma_probe(struct platform_device *pdev) sdmac->channel = i; sdmac->vc.desc_free = sdma_desc_free; + INIT_LIST_HEAD(&sdmac->terminated); INIT_WORK(&sdmac->terminate_worker, sdma_channel_terminate_work); /*