From patchwork Mon Aug 31 16:03:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11745673 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2FBFA913 for ; Mon, 31 Aug 2020 07:50:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 119D4208DB for ; Mon, 31 Aug 2020 07:50:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="CYFaKuJo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728047AbgHaHuq (ORCPT ); Mon, 31 Aug 2020 03:50:46 -0400 Received: from mail-eopbgr140088.outbound.protection.outlook.com ([40.107.14.88]:64790 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725978AbgHaHuj (ORCPT ); Mon, 31 Aug 2020 03:50:39 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YiMrqlDrFpwxg9aMuAoDM7IGPBsUdR/ghR0+mI5CM/lxLDYpEcHj9cT7+0HJjfB5X+9x15RvudpPyIadDE+3baA3eynIcSoRW+cKRBmxDfU0cLguVvy+z38PTZ4czsujJm1j39AoomB805GPbNJ/BZ4PIE4xQLJ4PuN22naLJUXK5U3gJOvhrDIv93zRD3xPuXQxg3EMqAnPFDiwZb8ZDG9jPyncvE2oibM+jur++D/Viy+jskR5uf/x4IBIH20J42o2DpIMe2tYxcxi7lX8nQKrajlQ+5i626y4NOgPie8iwmiHDfzECVdoDp3UbmZw5rVDKA30+znnuRctLGTGKw== 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=0izcWiIsFhbVumJfO4SdrrpucrmDe3nP9In+ncyqnZw=; b=SD2JB0+dTL2awIUI8puGZ52Xiwx2Ybk010IB9f08tfaVuw0yOQcXnjFsCkIwkCqQvtCvFNDs0LgAoVZPop31Uj+EHcPRt6hRHavDeJZH3ofeT/UlcuDunsIx2XKjko9DLBUuSwBrsN/d8fA9zQKhsRM7pPx7km2bFqLwEjGeyhJ2RMhbzZfFZIoYakHYul7c0+l5wyEXWmGj5KZ6meCeokhtzt8kXwUYzIFCFOLMgrV4gdWz1Zl38ICoX64PuilLptoqOxEWlGMIwB3zUoUaQGlHaJGV2JUgvuIx/Yz8KrWa2SD+fx6A49wSYLz+pXPbk5niOc//QU2z+5uelO47yQ== 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=0izcWiIsFhbVumJfO4SdrrpucrmDe3nP9In+ncyqnZw=; b=CYFaKuJotO+p8b2IOi0+Cadwtj6lbTa9Y+uITeyEwa14pm2fdhlasPsmaEIfl1HAi8ooLZkSzkKAjl27qPK7xeqRtXNqyLO89EZ62kc/wqZkYp1fcv2/v8YeVHHW3D/4G/31y7xp8ACQphoEYhZT4SNlN4ejz9l10QWhBKQFfIs= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB5694.eurprd04.prod.outlook.com (2603:10a6:803:e0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19; Mon, 31 Aug 2020 07:50:35 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950%3]) with mapi id 15.20.3326.025; Mon, 31 Aug 2020 07:50:35 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, 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, r.schwebel@pengutronix.de, Benjamin.Bara@skidata.com, Richard.Leitner@skidata.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 v13 01/12] Revert "ARM: dts: imx6q: Use correct SDMA script for SPI5 core" Date: Tue, 1 Sep 2020 00:03:14 +0800 Message-Id: <1598889805-30399-2-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> References: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) 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.67) by SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3326.20 via Frontend Transport; Mon, 31 Aug 2020 07:50:28 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3bce594e-0a2e-4c4b-6bbe-08d84d828aec X-MS-TrafficTypeDiagnostic: VI1PR04MB5694: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr 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: 8MF15f10A1jYEd1UXLDDNafT1cJ6VWudH7QVen97DsS7Qnd9cKop8MTWcqUCgg7OFAtLKUxesQQkoMLITfeAe60anwwPEL0zYx3h9/yVTcNG7wj3uM4GW45nQkZOv4V9Ze1d1IfsAqTBVJXBQjenVAP3NNgorcGvhV8v4RNtBl/9bEPmM6bsbtt1uA5WVF73eDVG9EY/MY/dLl+JO6ArVyY2uu3GRZCPwTXlYmeOh/OFFT/3n7fEx7NhwJHKIoZZJQ+sfb7gzlyHiIgD8HuvB+5xGnKrSzGjPq7qx4T3rViImROoWDZYRtH4ng21/xvnL4QmpeJeTC3GAx3GuYZekVvYT0uowwfbxZlnZ8UoNUpEDlht/bw9W7LQXhLpVjBbgwpgtJzETpEHKO8eqa2s/rDOJt23a+rR2GdHxJC7ji+LVy3EexMRG778csa5RR1VI46yPwz/0oBBVMsBqqo1tkPAwe93QTatTkgObA5NoWE= 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)(396003)(346002)(376002)(39860400002)(136003)(8676002)(2616005)(2906002)(36756003)(8936002)(86362001)(5660300002)(956004)(316002)(26005)(6506007)(478600001)(6666004)(83380400001)(6486002)(7416002)(66476007)(66946007)(66556008)(4326008)(186003)(16526019)(6512007)(52116002)(921003)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: bEYxaLzqfb3tUpwyup1Ze5SsAlC3dEOlUBa7OZZespKvE0UkJ65Z/8CNFVF7JhmsD8qLVig7MIY8NVz1vRoOUjphhNgG8eYBCvJByL68RW9FCu+bKPrPAx6874pd8bsfhTcv4253bRi4toMtUYb8zlJmhDSGXejvOR40Ke+SE5xavQB568MsKtXSr9ibmKvWNRt9bxjW6i1L5r7domSggdx28875qRDVwGbN8QHfzmSo1s0JWF1QgASNsiPFIT06Gd/0gRXHt6fQiUeUv83GfanNUAQ/iM9GTObTEYd/3ZyqZkuCPGfbnGcvAPzKa032zOGwxdXAVq6NY8871fNQ7M7TfwukoYnoWRTjmx/f39tVTwV6Op4nDMSxZn1Methn+2dEWIGuympWG114oUwbqLtHYulXSdnlJFJ3BmrQAUBA137MqxP2O53fYHIWH9wvKXi454t37mCjDG593lDpBbs0HGuazSRVd8+ACpjRPU9ykQj/N/UbkqfamtN3dZDEMCwnWigwSb8ZoZSCi5S91EvoU/HvsCcI10AmdP9vs3qHxVG3cxZlHm+b/kiTyHVP/HG+2VPWm63/vXsKiT4mp75Gziuje/xR9a1uFMA6BDsLL/w/ccxO3RBaXxMRplNZRBiiAXcazYHbIjbjgXisFA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3bce594e-0a2e-4c4b-6bbe-08d84d828aec X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2020 07:50:34.8859 (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: 1N4I9hwS/xb/K1+r5gGeckdYfQN+NnoYh7LPfV0vDHlOhid7ttkZIb+PABnMzvLkFzD3veRIEe9Gcf1g8F8XIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5694 Sender: linux-spi-owner@vger.kernel.org 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 78a4d64..afdd9eb 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 Mon Aug 31 16:03:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11745729 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 113D213B6 for ; Mon, 31 Aug 2020 07:53:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E673A20BED for ; Mon, 31 Aug 2020 07:53:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="scVmhO9P" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728073AbgHaHuv (ORCPT ); Mon, 31 Aug 2020 03:50:51 -0400 Received: from mail-eopbgr140088.outbound.protection.outlook.com ([40.107.14.88]:64790 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727979AbgHaHur (ORCPT ); Mon, 31 Aug 2020 03:50:47 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cs+SFbApOwmcpKNlM8Rg0jLlsFXRVrfZdO87bfSTZuyT91UR2uS9vngB2wRSkuOLAwHQJr1wpouR6e2+l57QJbgYtLkfQf82WRrLYhU9ai75uu0Unx4/fmDn/st4sSV/XVCKNxZC3zIbVhZmCtSQHmiY4dWkHLVtq2cWXYucmrMQ/VZlXTsdVaqG1oVvdZPlM/yADBSNos6NKbiag90lR26HGYBQc3F6Xv7+UWNG0ONqxvQl3Wsb4LK+o4i5qAQAJyv06PCBVHAKW/VPOOqFHLkl4ea23rClXqoF5MFng3y5BUDdBrt7GdOpC+xihh/+oAGRY1wM2or14duahIYAwg== 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=7iM2HUDRzfF9jaEUIMRjB1aJlm2kyt8x/+8OUSJxnmw=; b=U8mgFAOlq4M9dkNasvml98CzKp5EkF97Faw0PKapQE4l6e48tSb/9F7vfJumSF18o+pVXiAvDVhepe8nkd0NQZyvptfnKSCOuXABGYk9bhbBLSU+TnsouxSaOEzzAyQ/zIZct4CjkIEzWO9shvZL2RNYkBYWt6eCS9Lq5IvhmRkvORDsDHfCWT5T2p6QeDpiMkecGlRaHN+/up9+A5kmAuPgJ+f/mzHJfRfOGHhFmuCL3jDdSjHCtCLpN22dA2PkqaKld2JXC6EpfG/wyvoFbDsnNw3Co13JiZfD6Qzb21QaMBgbNQ0DAXvMY/Y8tEnbfe+IQKCGZjJB5CoErDv4Zw== 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=7iM2HUDRzfF9jaEUIMRjB1aJlm2kyt8x/+8OUSJxnmw=; b=scVmhO9PBd77EUddyaDN8FX3dcO6aBxydqfeZcOuq7hnZJGXVy9qL02aXMMbbyTXKYqB8TiOFSVeM6tA015Ciuk4jwCBe6wJgm22BE2ATad8ct4Cv2I+FGfsErG2aUaOI18DAHsOyHyAf/sYx8WnIkjFrUscYBSWcNrcmVKgy2M= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB5694.eurprd04.prod.outlook.com (2603:10a6:803:e0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19; Mon, 31 Aug 2020 07:50:41 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950%3]) with mapi id 15.20.3326.025; Mon, 31 Aug 2020 07:50:41 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, 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, r.schwebel@pengutronix.de, Benjamin.Bara@skidata.com, Richard.Leitner@skidata.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 v13 02/12] Revert "ARM: dts: imx6: Use correct SDMA script for SPI cores" Date: Tue, 1 Sep 2020 00:03:15 +0800 Message-Id: <1598889805-30399-3-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> References: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) 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.67) by SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3326.20 via Frontend Transport; Mon, 31 Aug 2020 07:50:35 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 79b149c4-833d-43a5-83b4-08d84d828eff X-MS-TrafficTypeDiagnostic: VI1PR04MB5694: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr 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: nkBT6xIyQfXJk18R5XS0smbwUOE1Pa4N8i45/1PrZY/yEwJSbBb7/599Scg4/73EJGf2IfoxJBCxCeN3X9sYh6UE3q4yvu9VkhdELxqXpY5MVybzOwWv7ek0Y0nKnv7NUNbYukboVFezuI8EjS074ovNX4psKHMX5LQyNxXWniYCz3Yss/Of4xxlfJYO0+NUU7ACZJDp9g44DAqBym2i/oNfu9+JJ/QbeL+PbxLxgtrEswV0POlhtQ1KkbZE4Xi6oxt3i6GycIECV2c6QFVpLyMDc+zuTCfCi2vN5VikTWh1YJHP/gdTqBtyDXOAnkZKShcyxAV3P311pvFyNWiJWQMSckGvObppgsyaAYZbCAhuqkqC+WHtTPDS8bUat3exBupmpcPCqB9toUF3l9pTsuLIk5/KP11jy1iNrgDwIoTc2OtrbsPZVeKU5eWnmlHubBqtVo0OW3UpBFUyIBcJ+Q== 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)(396003)(346002)(376002)(39860400002)(136003)(8676002)(2616005)(2906002)(36756003)(8936002)(86362001)(5660300002)(956004)(316002)(26005)(6506007)(478600001)(6666004)(83380400001)(6486002)(7416002)(66476007)(66946007)(66556008)(4326008)(186003)(16526019)(6512007)(52116002)(921003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: DDf27H18lsYK9LlfAyvGJh/qJyhpE8NRMR8QMopGEqphbn8bcZldLXLbk7pz3IKqpdqrnDvA7lIjJCgIqYF/JRam/GdZJeAaQlbTlD9u6g2/zZ5PQqRtiBmYX0FDmSYCKIH0dVhuCiRjAsNgJsJiHwc04ToKR4xYjY1QavTMQAVVuI/GmmNwAvYLy533XhgJCf93OxTB8GnlG1ZnqZewnv9GbESU0HMgJUl8i/PX8DcD9un0hgIxCz104GSki0tKOac++UoSHvEYc+s5er3PbNCy4GjfUfF2N/clrU8p0hXoNA5kW08MLURqGLww3YUFbSEQZTWfDh4fslW/SzX14EL1rO2Qo+BamLbla11Ai+ZAAIONBdT4ufstrTMR2ZJ1GSXDmNCh12a+iyqQvaPF4zjhfEHfXjxubS/+OXAc5oHDZKU68BvNLBibdMGj09vstYO6mG54XyEPnrzxcSpjfZFdnagdhjR+GNvAf252VRzlsNeHMWKmQ7lYjsm5ZgU9UG3lV33rb/IXfwQOx6U67QrTQK580MVu09SZWM5F57S3kt8mTlZFlaEFKjus9J5vafFFkH6UQG3R1LrdC9SWTH/79sciGkJJH9QCXXbsCEJMp9m0nFaFjF4MaeIf6ruUMXNwdixsGan6L/Oi1L2msQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79b149c4-833d-43a5-83b4-08d84d828eff X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2020 07:50:41.6120 (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: M60RFKV2Z7WbXQKm9mcyl5D2zLvkDKqQN745inq3NbUfwiuaYbeLIXlv16J5e75PV/clLRqHCprETfs+1zP9WQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5694 Sender: linux-spi-owner@vger.kernel.org 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 de6daa7..f18fee70 100644 --- a/arch/arm/boot/dts/imx6qdl.dtsi +++ b/arch/arm/boot/dts/imx6qdl.dtsi @@ -327,7 +327,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"; }; @@ -341,7 +341,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"; }; @@ -355,7 +355,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"; }; @@ -369,7 +369,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 Mon Aug 31 16:03:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11745725 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 44FE61575 for ; Mon, 31 Aug 2020 07:53:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2BA5B20BED for ; Mon, 31 Aug 2020 07:53:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="RZmjTOt5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728104AbgHaHu7 (ORCPT ); Mon, 31 Aug 2020 03:50:59 -0400 Received: from mail-eopbgr140050.outbound.protection.outlook.com ([40.107.14.50]:27033 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725978AbgHaHux (ORCPT ); Mon, 31 Aug 2020 03:50:53 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ePycxlQb5KsTbK1no4vx9AgcXQF1BG9Mitut4URKuV3vqLKluy2RUVo0mEl7MmPSv6uUvUtxjmtKbmMCUxtfwHiAp2xCJ5DHME9ZJQryIM/67706qqqMsuEl3aGylEMlP2hVrda2lbv5wsSdHx8SqFWIlFmt44eBxXK9R0McUOlxJtbPwcJciFPZn3D6/6sKfmRCdd15nn2JIiTy6QPFiMFSzRYkW3Xk94qt6aar5Llza/Xs1Ty0HNmLFAMfRgceS2ezEPHJH+hT1sAJ5/RvDoYXVn/W8JWm9OKU17Y5TVaFQFF2TI7tQ8f8iEoF/JTRY7dIcxmhIuca26AOCJgXmg== 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=4Q3ARDhbX3rbrZlYek/XpjdKznvOXTWnaLL2FJFyNLI=; b=PlRTG0wIbR6CjrPBNbVxjtEI/buOE+muGZWn5mZWJVDl4fCREkun3/HknQrHtkqYuwXiQkqYcFiGDGThKp8aubkTKTxKanm/LsO6C4biCzvjaa2vISfk3E0QoAbiNe+b1ywuiNtcZzMro3e+iQaExYIQsYdlhAnTSOx0Jm4UdbgJ2WQJ6vWQOjVc5VzKZCF2OEkTEvNTPPlSnOlEN2aj4zTjNQxjqMmjA1T3HYElLJAr88v+80bndQY94hoOxsIF1J7dovcBaDYIfAJlqT1W3D0D33r1i8RrRQkPVu5Gkynm1+RtL0YYJunnxSjoEkmy4bmkqru9Hhxo6mhBlQgY4A== 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=4Q3ARDhbX3rbrZlYek/XpjdKznvOXTWnaLL2FJFyNLI=; b=RZmjTOt5PCfISRIjrKc5zd6rEjX+9j4t1Oj37d34gQ3cFzzI1HlgviBV7jDd7ppxt47mGyftMG+1/jQ6Mcz6dNnys4fJfBSBAiYQEtF4Ik24jz4O0xDnrPPJyyzijTO9LAU90VfxZ/WczRtaMO/AnGU63osxDAmD5N1MZOlBX8s= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB5694.eurprd04.prod.outlook.com (2603:10a6:803:e0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19; Mon, 31 Aug 2020 07:50:49 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950%3]) with mapi id 15.20.3326.025; Mon, 31 Aug 2020 07:50:49 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, 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, r.schwebel@pengutronix.de, Benjamin.Bara@skidata.com, Richard.Leitner@skidata.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 v13 03/12] Revert "dmaengine: imx-sdma: refine to load context only once" Date: Tue, 1 Sep 2020 00:03:16 +0800 Message-Id: <1598889805-30399-4-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> References: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) 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.67) by SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3326.20 via Frontend Transport; Mon, 31 Aug 2020 07:50:41 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: fe0b75cf-4ba5-421d-7c39-08d84d82935d X-MS-TrafficTypeDiagnostic: VI1PR04MB5694: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr 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: shPbDigghUCfhcOGFNdRWdRFF381rzqWiXlaReB/Q4SKls91vsYZXHolRP25+UF4/0/sQxqekpC9vUy7AonITLj+OGDtwPe6RnViN/EeZ3iMuGC+jYLOjCgTokzOHrEFN5GQO7D+9YHDJMUEGw0oga1Yx/YJ5LrahJ8AmZVT4bvCHVfHmOL6K2Z6ua1DxCzTUjRaZM0vIPjfOyTeOu8qqbMVqk/wJIjVrRXSigdvAQob3lgLlOep502du4E6TPiE4fEkKCqFNLktZyL60SMvUQwW2o/kesQfjcmwqQO/s3H+y/dKZPKvp3oqYmqSlPdiEve22Fx3tzr+VEoARfmZ12TO32WsMWpOVyTnZVAe22wayLjjzCmN5pA+5PnveZ0/ 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)(396003)(346002)(376002)(39860400002)(136003)(8676002)(2616005)(2906002)(36756003)(8936002)(86362001)(5660300002)(956004)(316002)(26005)(6506007)(478600001)(6666004)(83380400001)(6486002)(7416002)(66476007)(66946007)(66556008)(4326008)(186003)(16526019)(6512007)(52116002)(921003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: bN5P8KQIxf6qqXWedEYXT+932ldNsSTqbCMo1Es5OWcBe7P5VAFmKU4W1DERylsWCToax6Javz/NAvn0K9akQcfnlXEPvgYMEjQvTECn+VFs440FdECb7zFjFIINz20OAm4Uu4WvJl4Cet+vrFwUB7U8fVhWTxEY0moUYWHAvs5K+gpP2giV8ruJ5jYTMLJtYpVBOPptRn4KNQposqedNbDm56vrZQ1pxSR+zBUn7phYX+bJG2V0nhhK3jc+XEsB5pQKYE9E49081WPwpUJFSiReisCLZiamfVYzivibV2eRg8fC0075YyeeeVs2hpM+bWhrmSGQBRY0mcAbTxqGDvtvhJWTG4Sj/m/LDsttTrJohWP1g+hECX9YSeGcOZ4y64GIuLqpC24HNO9PG2XxZ543NhYSjCFCwxrPLU4NQ0NCkYte4aNQSAw0RI1Jza8DnLE6f/RQpj75bvtFoGgHGxy3ojgYhXZma0CH0O6lH9in9g0MbjyZDVVjraTuprVSnqLwZ4R3ysOO7ccUFnHtttov/E4A0pVn1nfpHyyyLiWPK3QaVLWCpGcRcjRkVWlOtr7/xksd3D4sFa6vuqAVL+CcA3Vdni7vtFdVFNUVF/DzOG26N9y7ioarO4Vs9IPyB3TxPwUorfksQxcdedbAUQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe0b75cf-4ba5-421d-7c39-08d84d82935d X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2020 07:50:48.9158 (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: ByRxUAkJXPGWn+rNsYMezUxOT4KQfnV20cqjQrMME1tb2LNiOrPOwU7iReDDvcqswzw07Cfbi3e6JVGNTDP+Zg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5694 Sender: linux-spi-owner@vger.kernel.org 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 4f8d8f5..22be370 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; }; @@ -986,9 +985,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) @@ -1031,8 +1027,6 @@ static int sdma_load_context(struct sdma_channel *sdmac) spin_unlock_irqrestore(&sdma->channel_0_lock, flags); - sdmac->context_loaded = true; - return ret; } @@ -1071,7 +1065,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) @@ -1339,7 +1332,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 Mon Aug 31 16:03:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11745719 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 012EC1575 for ; Mon, 31 Aug 2020 07:53:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DEAD82100A for ; Mon, 31 Aug 2020 07:53:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="m3l/BF/N" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728150AbgHaHvK (ORCPT ); Mon, 31 Aug 2020 03:51:10 -0400 Received: from mail-eopbgr140050.outbound.protection.outlook.com ([40.107.14.50]:27033 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728033AbgHaHvB (ORCPT ); Mon, 31 Aug 2020 03:51:01 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KpqYOD9jamTZy0532v6ywnwwwWnFkyZPP5/AdtPd7TFAdGdOeEf2u8rE5r6r+nIzJzWCxa61HOMqOHH1dexqE8M1pAQREUEcsqyqT3iQ+PN/iK34UbBW7gUdAqfYrJHjVmptlUHWBDexGyW2RIqym471TjqsKO5al90YT7MvkpniNg5VXn8Ppm+ZUKq2wFn01cG+7MC50jci3J4/bjEyh7VtbKg6R8wsoKLz4hKzn6VE+hrWiU+/dE3aLCbbjFLMrmISt4FiUKvJ2tgeB0xFQ7oZfyjUusf4Ar66r9bMdmmlD7KUJBXMLvsuAKUYSp0X7qRbxJOkopXfgZfkkR6Vvg== 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=Dkg5DnG4yJ94c0pUQ/YYJmVs+9WpM6Ry5D8lwtIxv6Y=; b=BxAOdq81vNLtBhxSy68l+mc4ViHlmdUv5RctJl6VgH2CIbrAcLjjBgMS0OtEdiY6VRCR+mW4GScFfsZGydShvIXijvwxzAxt0JehfVXmyQXjhW3pMwrdFLigKL5O0LOI4qKaOPcpDRKixsbotXKkfN70SnSBJ7dDZ64xWsq44hyIpw8sauWBoOCW7RfS71snjVEiQ3GISH03eRS6+mqbCjbZyP8I5RNsUqMrSDUwoP8hN36HqTYIXXBL0A3CrBiQTKMzJ116cFFFW1DQmSOMlXRVYhV8/i6/L75IXMtFmmSKiDe70Ksxzy7Ol08jjyjFixMiv2r5BADyLirI5q3yvA== 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=Dkg5DnG4yJ94c0pUQ/YYJmVs+9WpM6Ry5D8lwtIxv6Y=; b=m3l/BF/NC83lUISSOxKCA12qwDjbAwzrZV9y6tOJaMuf9fy+nReXoEIU8OMJXamtxmfcCXYID25iZaaChjPFpblaS6UI8+1uBFIMOIdJ7mk39yI9jPI1PWHoOo1++/cE+VvehXapih9+cfzGIpAaZWePs1QK3OKLEtb/GS/TDVU= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB5694.eurprd04.prod.outlook.com (2603:10a6:803:e0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19; Mon, 31 Aug 2020 07:50:56 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950%3]) with mapi id 15.20.3326.025; Mon, 31 Aug 2020 07:50:56 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, 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, r.schwebel@pengutronix.de, Benjamin.Bara@skidata.com, Richard.Leitner@skidata.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 v13 04/12] dmaengine: imx-sdma: remove duplicated sdma_load_context Date: Tue, 1 Sep 2020 00:03:17 +0800 Message-Id: <1598889805-30399-5-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> References: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) 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.67) by SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3326.20 via Frontend Transport; Mon, 31 Aug 2020 07:50:49 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6b1e818c-8c76-41dc-e2f1-08d84d829767 X-MS-TrafficTypeDiagnostic: VI1PR04MB5694: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr 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: i3jN3uMoEAHk3xJVsv/udf7bGqRRmLQF5x679sYhUyAiRHlwmDskbps+TEYehyjtmdmZtrvlQyT2wd633cJqqY2MXG412E+BJjAnEfUypInJkwgzh1ZfIFfp7UpKJTMectRf1o4G6/KoU3BpcnMQdUNgpO0KJnecWYn8YaPx7R99cTq6I/54f+1X611umd5yVayt26xlqc3bJr0Q0BEQTivQQjYA5upXVaI/E9QuPgl87DMzTNwdU30tkMjLBXNNbp9mBJZZ9qt0irGlIkvzBY+gUyaw9MKJFEkJbxYKlr7eOrQ7iQiQjz/qUqbPuuDItgbSkuzSDB+VEAIYekChRHtcHI8pGlU8Icy7OG7i3y4F++L6GKS1oVTvk1DyX86e 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)(396003)(346002)(376002)(39860400002)(136003)(8676002)(2616005)(2906002)(36756003)(8936002)(86362001)(5660300002)(956004)(316002)(26005)(6506007)(478600001)(6666004)(83380400001)(6486002)(7416002)(66476007)(66946007)(66556008)(4326008)(186003)(16526019)(6512007)(52116002)(921003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 46LzD8+/rUb/4lceR6M9brKLhvF4R/anEgAx4RwgZwPU88pVMk82Me+ouDb9kjaDrsOtxCYEZtMny1ASTq8gbllPwGdjnHG/+L80b3wnSGmIDPfxZR9S3rGpeOdK5tuNyaDmxWnYhRwXRIt49ZUhc4rWkRtuo7waLlOvDwNOSmy6HT70LS7CNGAIRIel4WPnkfNBMpeYnDJPCaIc6mUBywYMQnlRJjunya75VhxR3Y/8fkzbwf2zIkxc4E8LbgNGkU/K6xejmFRUp5pySbWU+XRt9dk+5UPTy2mdKJtzTeKWSNSBSvjAs1/RabDEckOdCMzsDZJTF8cxImXGBgn5M30+rt+bJAPFU5yhAmddz8hZdwsXBBED8vBnWBRSwNWf3Ul97XJMZyw3/pNCevN3SA4HkNs3D8lCLybycQ6DO/OqF1+Kv8ZI/CTjJzlWyoKf0v/0lGkcAPlgmrg1bGg33lPyrqEWfvipCWfpNi2VcTp6HoQFNJjH6OROofNjFIQDuAc9zZVcBnp/dnFrTwkAYxfO1t0CtBx419z0U5c6rLJpZRFrVLjM6eXYKbvCvKOPFn0O3sd/GMQjQIMdsJuyIVJG8QCZ0I7FrgIHhoKS+w0y/nWyj/Zx47lnqu+96/wCR2059YWHRR1XOJ4PNnbUDA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b1e818c-8c76-41dc-e2f1-08d84d829767 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2020 07:50:55.8178 (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: N7wqh8GRolEqNJA5q0VtX+aPUTw5rODju7+MHbLP/FdvARXFCNFkG32WLhwYFJ3QmsM4naJuT29vX411wXGwog== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5694 Sender: linux-spi-owner@vger.kernel.org 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 22be370..f899083 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -1139,7 +1139,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); @@ -1179,9 +1178,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 Mon Aug 31 16:03:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11745677 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB877913 for ; Mon, 31 Aug 2020 07:51:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AB9A92100A for ; Mon, 31 Aug 2020 07:51:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="nE7fYMVl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726573AbgHaHvX (ORCPT ); Mon, 31 Aug 2020 03:51:23 -0400 Received: from mail-eopbgr140050.outbound.protection.outlook.com ([40.107.14.50]:27033 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725978AbgHaHvK (ORCPT ); Mon, 31 Aug 2020 03:51:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M3SiIXo+fwazgpKaGvtKgqtABldyxp8WyG6b9hJ+qHKQHrjl0eRXPk+bTHzD+70qm1N5zU5j3JU6pXcK7MNSicj3nBhjP8unqk84YA1glTfaNkhzgA7kwpX/723OQAfHcWhzXvJ0JvQBodirXq5cQXJSB5nS/g87yRI7aiumKdndXuSU0+2izPWixfl21WwUqFNyhy/Z3YhpqLPqjKdKT+fpK7DiK0d6HfUeg9VL36VFxWQ0a0jqXV/sO3HmM57llATVbqN7fdtmepmzsO16MXqE8pHN/hFfuSHqD2PfcgDEXcLK3P/Rcmr82clAFMi/tMwz2Ia+8a1DX6+GO5JZEw== 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=keMsKGCzWbdCUSMdxBfrZoptcRTNH3hg7+HVrE2VXts=; b=JLMk3Xq3UXqmqjto2+/U/875QKRO6SiuNg/RU8U1Z1+miXC8IVWXTyp168FMKKKgER8Th1aD7LNZGTlLn5Qu6d62bRShoO+4QiCxvYbvtLcrWMZPJox/Lm76mllIfpI/3K8y+NTdZP4Y8i901ygD9SJtQJN3PCXbA1W4dBixBpWrGrTkbgCHYV5u1PKeSCI8XeZzri2VNBj3Wx0BtvMZZohEGKjq3KdejgDgwWUZqLPpTzg6oD7UBihIwLaQimIACcJiImA60tfG5qqIFHlFxLk3jZZfUje2NH/EGlstQwcC0UL6WaPn62toLhShR1s9ITCLqsowL4ktfu7Vsy5ILw== 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=keMsKGCzWbdCUSMdxBfrZoptcRTNH3hg7+HVrE2VXts=; b=nE7fYMVlmQbXMwC+raskc39O94p+vjMLMJbKyGw7imSEE3CiSgFaypg77lB4+0g2l7MUity2ZeW+4/LGfRDgsB3Lvqn7pBfNvVsEkNkQNjNcaSL5XQtsAmMXSoqW3lBE5NlLiWN2S8o3xGLZ/ZVtYicLtDHl2FskUwocPcByTvA= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB5694.eurprd04.prod.outlook.com (2603:10a6:803:e0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19; Mon, 31 Aug 2020 07:51:03 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950%3]) with mapi id 15.20.3326.025; Mon, 31 Aug 2020 07:51:03 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, 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, r.schwebel@pengutronix.de, Benjamin.Bara@skidata.com, Richard.Leitner@skidata.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 v13 05/12] dmaengine: dma: imx-sdma: add fw_loaded and is_ram_script Date: Tue, 1 Sep 2020 00:03:18 +0800 Message-Id: <1598889805-30399-6-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> References: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) 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.67) by SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3326.20 via Frontend Transport; Mon, 31 Aug 2020 07:50:56 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a14b2e1d-6209-4049-cad6-08d84d829bbb X-MS-TrafficTypeDiagnostic: VI1PR04MB5694: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr 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: sc3Yx2QyA63LqFHUjkcMaPOeLnL+nYFjMtBpt29+MYEON+rU2wVm6b5emTcxn1YRrB7v48D8h9h4q6IRN8C/fltO53WOohs52DhQsZyIWz29ffUuIaIrN1JFsAEMXYvFyorPvm0zVpcW/RVI7vIGQtkxx0gLTmQF4AC6+RkYtYupL72gZIOmNkiLdkLhL12P8NlBMQjmAwTKx6KPOwZVTCFZ4OOzAf2iiWZjVINbksbm+RSPbWhgJO1P4jdCSuKXIyA1vOCDPVI2Rz3ecEXAzuimpD/RDZqnbqmHrUpWi8ftsuNk1puxuMsnGRNimgdI92aad6fNtkEx7enbdFNUja+G+q71t6BPrrCZHpbbFVAF82A5u8R3iVX1/lKJTWaU 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)(396003)(346002)(376002)(39860400002)(136003)(8676002)(2616005)(2906002)(36756003)(8936002)(86362001)(5660300002)(956004)(316002)(26005)(6506007)(478600001)(6666004)(83380400001)(6486002)(7416002)(66476007)(66946007)(66556008)(4326008)(186003)(16526019)(6512007)(52116002)(921003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: XCYeZ/w7RxmGW42aMpn6JuUhFj0kqyyTgBGug8t8D4uGuaZubPGyBOQpRX0OHAADhVouGzF8W3oBqvVjPZnT0k8ryS1WCFEnJaQ+7kZML3zSUewBs7Zr0KCv7LxeQnbAtbemg3ZuRjJHl5EewASpd8zC8+qWTkQhac7rpnBSj+ipySOwOmviCu10OIGUX+aGOn9aMIOFsAQ6K5ywUJaqSAgGZMHofYXZZkD8jXu1/Q2JC+I52y3ZLAhxbzEpWBt78ZKFB2rsPDl/3vz/0H41JBm1KOLhHuarSvZHmwADZjO+uXdpk+pvqKp+zgcnYgU9sSHfzsNSFt4xZoUCalrNEcf/kF19NdaWi7sXIaghf/95Z/W01gAb5STRugKnQZHMbebAUZD+7M44i7SfGK2J1K2gK3YC5a6NDYr5rM4KA6O+/hC3uGi5fYu/jLafOpDNAf2jIkdkVCwcp9YjpJHyn6/jkkh9Wv+blunr+GbxGbnEE763q1IBjS1wohq8hSUP7Jcmq3E8a4bkW6oyUn0YgIuH03UDSFitELi94wfiRwx8wEm+YAkvEFpN/1jbgvCnd3Zue6TiGTiL/Shz8PQd93scHcA3fF4nmCrOns2DxgkT2YNfsTN2q0hHn0stnZZaGH5nk44tzWz7fBkaYj8urw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a14b2e1d-6209-4049-cad6-08d84d829bbb X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2020 07:51:02.9376 (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: a+aC/+841EYb/VIo++1RRGVZ7xhvs2U2OQ1ypaMYNWdkfkQIlezn+ov1LJhMdSvypXjPujDA+RFwbDecIsJTWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5694 Sender: linux-spi-owner@vger.kernel.org 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 f899083..10214bb 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) @@ -445,6 +446,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, @@ -931,6 +933,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: @@ -945,6 +948,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; @@ -1341,6 +1345,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; @@ -1591,6 +1600,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 * @@ -1770,6 +1781,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 Mon Aug 31 16:03:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11745713 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0326E913 for ; Mon, 31 Aug 2020 07:53:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DF3B320BED for ; Mon, 31 Aug 2020 07:53:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="HW3D6UCp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728184AbgHaHvj (ORCPT ); Mon, 31 Aug 2020 03:51:39 -0400 Received: from mail-eopbgr140050.outbound.protection.outlook.com ([40.107.14.50]:27033 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728033AbgHaHvZ (ORCPT ); Mon, 31 Aug 2020 03:51:25 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QU1AfXyXLszGkI+k9v+s0R/ki6EwGH1DJW12YxfL7dlezIvEt/oa99zBREGFEkBSBGrfmx3lEGAkuWJCvQC0PdG9LPXb+RB4Q7aj8n+Goxn+OL3ZDs5+BxDBkB9tJR9dIgoBJtCUDdHSgS9hjLlaoMt8mObKz3bel3ndpgcp3ZfVUT0xGfb0gottpY+/USd3bVn+kv0lDMDUf4DDTkpA7c/MTHp83NKN5T5sNlf32ArrGT8nb6lOYYvr5icj06Cyd+Jn5C+IlbCUW15t9b8dp/Qp9EBhtXYQfhj6nvLXNxWQDeiI7ih17sLmYmTjapj7WjWt57bYPjr5aL2HnmZP4w== 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=T/sXCZYZqMNc+2wr11POB6/DrTyhYASzg0Y0zEWA+fw=; b=mgaxvCyZ5Bje96l2L+sYufe8X4fcgTpSDxCd0Hv4bHn9nH2DC0L0l9jGZYnPA10XSoScC/MFwACmg8dh7xG2/O1ekpyCC8eavHG2Z1gp6M0JFzSysOQvWWpwZXdPTsbmbnQ2+WEPkmaoT5DaivbR9L27xBdnPwBk32oZoSRWdDmLI6DRD8eYSJjwlM+6DuioX+P3VQolM5LyXRyAQ7fCG3LEXFVVTWkF8E/VHplZlqrT4RB8piH15+yPA2rfBOpw4Qfz6xc9k5pZ8HqXd6tS22WhWXkyiUR7BsQHEQySZls0RDv7t4J9ojcvOBkTfjgu8jR76Hctmk7ntz58kZE/OQ== 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=T/sXCZYZqMNc+2wr11POB6/DrTyhYASzg0Y0zEWA+fw=; b=HW3D6UCpKnJ5bRD3xD+0PnmUgyXsluQy1ONfxD7WQKN2AWR0TU/QxHUnptaiFGUWBt/OL4NteCPpvy+oPj9NhtePNCU+7XdXt+vY5V9ZMlGxjZQFiX8XHCYySgfVG5ugQD+UsdIOz9SXs31hE/mLHagLqAHAfLxTu+tqg2j1zGY= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB5694.eurprd04.prod.outlook.com (2603:10a6:803:e0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19; Mon, 31 Aug 2020 07:51:10 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950%3]) with mapi id 15.20.3326.025; Mon, 31 Aug 2020 07:51:10 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, 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, r.schwebel@pengutronix.de, Benjamin.Bara@skidata.com, Richard.Leitner@skidata.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 v13 06/12] dmaengine: imx-sdma: add mcu_2_ecspi script Date: Tue, 1 Sep 2020 00:03:19 +0800 Message-Id: <1598889805-30399-7-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> References: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) 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.67) by SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3326.20 via Frontend Transport; Mon, 31 Aug 2020 07:51:03 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 4513fa5f-269a-4ed4-aa7e-08d84d829fcd X-MS-TrafficTypeDiagnostic: VI1PR04MB5694: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr 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: z7lRGWNYHi8vA4+pgtABpIgMisbXAFjKvGjlillyK0M4OSHdS0JmIpaskBLlnl3UCes4ElOrDX2qZgeLNfHI4jk6jA1qfSeXIm8X2U1LiOY3RlOXAfalgYNNGtCG6vtXIMH0QxlXthDrNekq8NX28B71f5V3As/k9P7NCmc8DRL988LK7NXlPAFBFUgUUni2p7nR8DYe4MROAVLDxkgUJkclMZiUMxnesPjdkF5gnrl6mlaHURFfKD15dBXrXSYnU9fmQl7cO+BFYHbdeT7D2Sna7jPgnH+TOXxGSHp8QDDDx/8FRKDCV549KeZKeuK/YD+ISij0YQXSkGscKVWLh4+5Rlxsi+OkeS4bbxdght8V4aGBM929Tpr+arU1vifl 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)(396003)(346002)(376002)(39860400002)(136003)(8676002)(2616005)(2906002)(36756003)(8936002)(86362001)(5660300002)(956004)(316002)(26005)(6506007)(478600001)(6666004)(4744005)(6486002)(7416002)(66476007)(66946007)(66556008)(4326008)(186003)(16526019)(6512007)(52116002)(921003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: cIisXd3EcZwhtRxN1D/hiM3qX6q4yaHzvce28p0xyZzQTxew35OHcX3GQ/It3qz6TBokjQXWzi5UjUmStDepY3YKpGCOhY6m6Uf1/52T7jlN7P3r1hiJzK5bOJ/7kBgde/kLV9QfzO2Au+TLPs8CuxA6elBMNORckiT2i1Zy2FJms3/FpDPQqytncI/7u8dxVnwhGlj/qy9omJkIL19Qy/usubqB9TGkZVGI2IJPLVftQ/myXwOODFKvIWt4vCYdM2YjHIVqv8YxxtpbdyZT2hcIh1PSCMa/2rUN9+2ymKN3laqWq6k+zJhkG0GoOolBXnNJhjKLQAZTsEIZEsGK4+IO5v3taRrlFd+1lSbcQZbHTdunsWAgs8dqYpkVb9oN+1Zz/+B5AxdtUZ4C9zo9nAaN02qki/NLPqQuSaKFqGHSUCYaPYUBe7QEDSY4/JR9z4y6yJ8MQ/0Kt5ZblZ9D36ItvTuNcD5JodUDX+mXk+E4Lenurptt7Dxaull4YVTwlFacYBCtc249pYhMuYk/p7WqaarndAydbN1bTiqOUdnHcmlDBTtpNS52BMaxSNfynmKcb+Pd5kVOxIPfmxYHChfa2L3R9Lmz2frlgDr0zvvtxAwMhVdpYAnuMj1iRG9GE9YnVwed0+G98SwCIUa+RQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4513fa5f-269a-4ed4-aa7e-08d84d829fcd X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2020 07:51:09.8886 (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: EkcicUVh4ln94JiOMwC0LpODEsIzkp/O/Bgc4Mhm/N8JANNFW+URqeDqKn4f0uqVq1Zngmf4K9iuieFq4ki69w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5694 Sender: linux-spi-owner@vger.kernel.org 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 --- 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 10214bb..fb522a1 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -924,6 +924,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 Mon Aug 31 16:03:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11745681 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A0A3813B6 for ; Mon, 31 Aug 2020 07:51:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 847F32098B for ; Mon, 31 Aug 2020 07:51:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="svUEepJV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728249AbgHaHvr (ORCPT ); Mon, 31 Aug 2020 03:51:47 -0400 Received: from mail-eopbgr140050.outbound.protection.outlook.com ([40.107.14.50]:27033 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728183AbgHaHvl (ORCPT ); Mon, 31 Aug 2020 03:51:41 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LgypJKlHTr8JLJ7Ls2kp8i7Xf3Ba2Eptgcg7rOpMNOiZyXtb8trAIVD5SnIU4rTadf2pndrLdXeQpYUu2qf+lf81a4gvw80ePtBbYZ0diz62biSGFm0plCTVELAXnTiHVWJifyyU5FoO0QNO/8bjSMxR5BXTVdVNwIHhITUQMmaSAjAigqzzXTK656fe7tHqMBpOZFNePRch2RhtGD+tod2OOTDxRLdqLyatXYLfE0vib6Zewl6zHwI99fcZuezJaKclkUWhkHaIt3Dxp4M3CoWtCVUS4g7RkSyM7WvxG2J81YEm++ULfd/TFZZCGX6auUac7adxL20fD+MUb37Ilg== 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=5E4RXpWtEXH5ZD6hhoNZYGbbhp9YaKb9LOKdxX2N9UA=; b=l44NMjVDG9kAjtHFPTWj8nJoPhhXQZA9dtrm2ZNauz6RiNBcw5zZY3IVK6kJoHklOJLHXsehiCcatFpT9qjX/p+d67qhlcWf3iDykkU1sWpOK/cp8ouX78jUGxtN4OVDz5G65WWNBm7yMqTVlYFD9ijw+78WzPjE8c3HWBBWR/EbujZ5u+jGPOZNNHoGCHDQaZ8iFK2viFwjiwgVuU6ht1Rby2NIAXkdUFX81Ul9qDtgaPK39/57IooZxpZ1ld3/tWS48xBZQpXK2uH2YK4KHFCZwfL/N/DLI2ejIWPo6X2a/bRRImD4xr5Pi3Xb7BeWsbMe9YyvkSrJ1wx2I+O8aQ== 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=5E4RXpWtEXH5ZD6hhoNZYGbbhp9YaKb9LOKdxX2N9UA=; b=svUEepJV7TT7PTBPLU7+Zcme3BAEVDSVegQ6Fog5fD7PY8RnTmMxs48h/9YvgvOjhcTYTO6HL3DfFJwqAe5mlat/QdbWO4fnuL4BX+B6kHiMriVxxFZ/eHk81ZozGTznMOGLSpmjk6zk3QlWC07rklKBaMQ5j9uvG7giP8orXnI= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB5694.eurprd04.prod.outlook.com (2603:10a6:803:e0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19; Mon, 31 Aug 2020 07:51:16 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950%3]) with mapi id 15.20.3326.025; Mon, 31 Aug 2020 07:51:16 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, 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, r.schwebel@pengutronix.de, Benjamin.Bara@skidata.com, Richard.Leitner@skidata.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 v13 07/12] spi: imx: fix ERR009165 Date: Tue, 1 Sep 2020 00:03:20 +0800 Message-Id: <1598889805-30399-8-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> References: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) 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.67) by SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3326.20 via Frontend Transport; Mon, 31 Aug 2020 07:51:10 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3dedc73e-688e-4395-a50a-08d84d82a3d3 X-MS-TrafficTypeDiagnostic: VI1PR04MB5694: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr 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: cTmsN6gzQWv5yRvJPMlxOLHz6NTSMnrR30OcG6zfU/QrWJAr/RQ9e2c+br+n0SjJHFn5Y7Iv6N4TOXD0BMqZ7UNvztiv0EdzbTcMbMx4IGthhMk+i0xiQbPuACz7i2T8VikUBP4oNo6hSYMNFN3HwW941Jq7a9yWf17FbLLFbkPNOOtjq6Gvg2akL10Sf1OcAkp1vqUGyoeIvf/XUGnXFdXmXilBVgVSqRh8KorI+xkZ130VsoW1iV4XRx8c6Mjc70xnTkcxcgL97VJGoSGMu1QDeOKXP4AuoWDTICu51pR/L35ibT4/cjtfm2E9uKktsAmV5uuT12Ugq0rzFTmis7vFbxGlZTljDLGBAGETzbnALbTm8A1OyG/EmsN9128FZGv6IIP9Gbal4J/eBUTgtrzfPUbRiCuj0zJlQe7/G63le4AKHIxd6tnf+Vo1sNeDSh36Q505bT36h5sb6wy2Yg== 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)(396003)(346002)(376002)(39860400002)(136003)(8676002)(2616005)(2906002)(36756003)(8936002)(86362001)(5660300002)(956004)(316002)(26005)(6506007)(478600001)(6666004)(83380400001)(6486002)(7416002)(66476007)(66946007)(66556008)(4326008)(186003)(16526019)(966005)(6512007)(52116002)(921003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 9ukXfdh+AIq0mDlu5z4jQNOqUSq/nmZL86+GMXJ9VVJ4pB/QewOybav3JxIfOSL/RzvHilEBNOFPu5cj60g5vOpBRu+7hKa4u6NU0kORiaX4T4PLjODFcMOZqVz/XhX8w0tmbYCmP32ryPjJDQJA4DISYMr4LZ1qUznAmkceXPzZIq+JIQPRwOM6fdfnmDi3Wznm9I51X+42UGN+JSyMcneBvUFBJfNuamfNmfexkSV9T65GbUAzz65zKvD3OrZYFKR1uv0vQgpbeCi+K5cRsDDSNYUxPhvRJGYFQ5dfagO1XAyeHtGE5A9ageU/rwUr8HYYZNlGMAlsCW7syM1dsBgerDHNITYnR/ZM3SyMfwLWFa2O/QoEMRGsPI8stFTqNF4OmG3AFN+iWnEqCJSQ3NEIuG0LEHBRif00JlrpJFEnVTcvt9YaSaE69SolKYfsx3Uw0+6gV/EiLEFmytnHjX5xmmYNSuZkFglRRTb+x/uUqQTqY/XHD3AtQ59aeEvjmlprG8azlGzTQAvtkb1MrxFdzvYS5vLj8KTQpDJg7cbTJD+1fpn2kohUR0A2MhfpkKURnEHXx/GCLVr29qSMmS6qFbOW5U5dLUcGF4cOsO6+rP1vqLLReUYchFECTdVnNoO++Sgp5oV/1rbzlkGjEw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3dedc73e-688e-4395-a50a-08d84d82a3d3 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2020 07:51:16.5467 (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: RI+g+teCgV/4r873udkr04RMTDU2NtyJho28SohNmGujB3iDH7rwkNkh6WZcwyOa3Pu7wSOyIjwSqWF5Y9rchQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5694 Sender: linux-spi-owner@vger.kernel.org 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 197f606..9edb259 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); @@ -1261,10 +1261,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 Mon Aug 31 16:03:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11745683 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E2767913 for ; Mon, 31 Aug 2020 07:52:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C3ED220E65 for ; Mon, 31 Aug 2020 07:52:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="r8fd0yGM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728183AbgHaHv5 (ORCPT ); Mon, 31 Aug 2020 03:51:57 -0400 Received: from mail-eopbgr140050.outbound.protection.outlook.com ([40.107.14.50]:27033 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728033AbgHaHvu (ORCPT ); Mon, 31 Aug 2020 03:51:50 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O4kUjBRNu3m6/jip7mwakpFtQMPriZGsAw5oVlttiazDjcfrO+kiK6HFETdUx1Fd62+stObbG010IHxRI7Om6mLFWH/xf6dWc1cKMHrbOfes2SHBHZkp+QwG4rEpwwboeQBaBj/xSRUc8eahTdEgWjtS6CkRd4397tPl5369sOgXu4FRKt1sathF5GGu9xGICZe4RCqxkexuGnq6JLefTasd29wQJWAG5YpW5jnMDi4rogfsKa70NBbacn/zULssTsMRaNQYhkjtKJhJcpBMMGrGHj48FyDlhE7Kq2i404XaIyWMgLQrP9S2shqVTKpsVhx0m3NYLR6n634piqeYaw== 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=tRN/aDatBlziT9GOCprDl1KlggU+/D98hqEDzvOveqk=; b=cQI4HMgJfScQb4sRNHCv4vVlIGgRBhd7MEDUeIeBrxUC8Ha2ytNO9vAl9vpdN6oCGR4q1SsdNnry2MvlnsXtlMtnfNWbn2n/NGfn7V3CWtNNifE6ElKguiy0TdoLqcg5Ma+ZuFp8rH8hERxSMOgkbPBNpX8dDwjBBpp7mvzRfowpcAGIdqosbTH7LyC/H4oLNhEU3L+GTGGJxQzaYDDrqSuXeEKNJSVbG3g6AgnatbR8RLn51ZAjX3UgtkjxvQg8Eye07JOPxv4ouKrjFM+OmVAQoJYJ5Z8crz09rPfyMB+8G96srrqEYn1bbXe4GKBsSCNzijzL8y67rkg2voaKNg== 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=tRN/aDatBlziT9GOCprDl1KlggU+/D98hqEDzvOveqk=; b=r8fd0yGM4Di5CcRA1yDdMtVrkKFXv1sCAWPFnHU5yiyDDSae/g1flQfliCmvuuD/+fcuyVlb3LawPtRY8X3CzGipEbow5TfRUjSckDVNc1tEcdFZsf6XGQax61bB60ygEv+oYiz0hEWQ58WqPZcY7adn0KT3bxjxFNr9J5bWyW4= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB5694.eurprd04.prod.outlook.com (2603:10a6:803:e0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19; Mon, 31 Aug 2020 07:51:23 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950%3]) with mapi id 15.20.3326.025; Mon, 31 Aug 2020 07:51:23 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, 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, r.schwebel@pengutronix.de, Benjamin.Bara@skidata.com, Richard.Leitner@skidata.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 v13 08/12] spi: imx: remove ERR009165 workaround on i.mx6ul Date: Tue, 1 Sep 2020 00:03:21 +0800 Message-Id: <1598889805-30399-9-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> References: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) 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.67) by SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3326.20 via Frontend Transport; Mon, 31 Aug 2020 07:51:16 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 40307eee-412b-4c05-f7f1-08d84d82a7c3 X-MS-TrafficTypeDiagnostic: VI1PR04MB5694: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr 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: kMZrYZclqMNZiyJuzp8yYvXyomBEVwrUqPh9hsxvL3cmxNPBLagk5rnHTsY5CX65PA3oEjn1fmFqp9DZwJzOxVa359C5mFCtS58T4KqVhwkLZP+tf5+zZDOUvtm/+51BD9kjDnmaH+34aOWn4+lRNzSdpEsIMgevrAUWTaroNIF8IQsN7k2GMOcLW1YNi7Ywk1eGx9zQsIcjwZQE1oSDWOq8dBPIE9uoLqiRYZ8N44TQyy8HyTm4PUpAQN5ggYLQJ2ruUFR+pu3C4s9ocVHxALpEtUpRxpQTlMmtirB6rKi4HXuaQMyDqtrb3AM11yPzjCARwDvo+emGSBHQx9PjJZRDyp6MvXH4ljfyKQ6PGoCq8JJ5VR48a63qDzcqMkeqRo6S0cLnk0i73XMOxVdm6EsLpTvmNP10rfpSam2RuaKhncZ3JrIAGiGg755x5KQlJg3+W4U/MAumXFyQ4tS7Tw== 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)(396003)(346002)(376002)(39860400002)(136003)(8676002)(2616005)(2906002)(36756003)(8936002)(86362001)(5660300002)(956004)(316002)(26005)(6506007)(478600001)(6666004)(83380400001)(6486002)(7416002)(66476007)(66946007)(66556008)(4326008)(186003)(16526019)(966005)(6512007)(52116002)(921003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 3ju2NT4pfAc/8Ck6KZIXvr+mhGsmyLsUjBTKOuWVsd7UNvq0faHFv27u+i7O1WXnsKVr5/2eXCkJPabw7GANpzfxcu0+1CoU+LAtSLcw5Ceoeg9skWfOD1Oohw5gqe8gTgB0mwtCbKQ9QfcCD2+VC+cIYc5yB7+GmppnRzrepEE/2VwMQTmo7dEdFYERqdfAKN/FJODkWF/JRtVPw7cPrJ4OdwvgVFxNhVsJyO2lmH3yvwdEPSIoUryJOlEfSnADS4kWBpTR9qd87++FrU7PQ0HTcIQVrcSS/C44an+O300pVlMr2KGh67BWHtNHvowlDf0WMUbikGzVFHzNng9nct96tOPHHOjNyV/KKamFbK/MqmDyh/H0fg7mtGjRKo7TuGkuk7Z4WqausOaVrdm1mZMkiZwnb/SqpeBSpyW1DqSKDYj/xYRm2EOUNGEh78ba7+egug6fK9Zqo8TrbFm4pnN4C8fCIiwr/lxn+zdPoA5TI219MV397Mxi2RQLAFiqRjzG8eEX8ytgDh0YpmYHgJUfT92Nw8v5rJSR4BpQDFp8CTynEBgUG5dhNsQliO1y3m+tdHsSUURNAg8ukdsoF7nKs8IloymY1aXZ+1qu0lC/s+9Z924yZZeNUAjafAXwVIbfktu3psaOLbuWdi0RFg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 40307eee-412b-4c05-f7f1-08d84d82a7c3 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2020 07:51:23.1358 (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: N1G8CvMoLugLteUBOXx/VKjSOINBEgTrXuJo4miQrYl3SrNSt1G13jr8D4JejpH3ntyuBxMcU5h/xYFAHTmTIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5694 Sender: linux-spi-owner@vger.kernel.org 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 | 50 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 9edb259..2df2750 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 platform_device_id spi_imx_devtype[] = { { .name = "imx1-cspi", @@ -1042,6 +1080,9 @@ static const struct platform_device_id spi_imx_devtype[] = { .name = "imx53-ecspi", .driver_data = (kernel_ulong_t) &imx53_ecspi_devtype_data, }, { + .name = "imx6ul-ecspi", + .driver_data = (kernel_ulong_t) &imx6ul_ecspi_devtype_data, + }, { /* sentinel */ } }; @@ -1054,6 +1095,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); @@ -1630,7 +1672,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 Mon Aug 31 16:03:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11745687 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 29B8513B6 for ; Mon, 31 Aug 2020 07:52:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0CFA62073A for ; Mon, 31 Aug 2020 07:52:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Y+9szm+c" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728286AbgHaHwL (ORCPT ); Mon, 31 Aug 2020 03:52:11 -0400 Received: from mail-eopbgr140050.outbound.protection.outlook.com ([40.107.14.50]:27033 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728220AbgHaHv6 (ORCPT ); Mon, 31 Aug 2020 03:51:58 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BPIfVh+PcqPFgS4E3PVdHFxKDEaqUZSF/rYFooskQtrEvtxqa3ZHZ+Wc+xJ6c4Sj5V8pZ5Pj6SSfC9WpF7PFvUsCy6NTtrxTQRXHRDPABV/kcrUNnVPaWDan8wiHWA2vyZ+IEm2BPrxwHfN/SGsXt9soS73N+hWAEgDnb3A2OwVYN+PfQqQ215M/xktFXxkFTytSpZIOaUU9RybaHCuUfyVc5SVdoOw1JPQJEZWYKtbVo2GQ/TKxAW44+YDuNZlBCatweI+HSbrlKC/qj2VF+08RRFB6y5cdVHLmRJoYBzWihfw26QY8jDxiiQjPNDl32+VvahQAcEyjTNiG8tgAlQ== 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=SDfHy8Hv7RnomQuRhGndIyDNhmOpj00PCTCtTZJsaoQ=; b=EiXICqGwnoFr08iWTbxa0cf2E0FQTc9KLvfVgHeHdEF+RIZEhTYkUtabUufC44w8ORoEmMgIx9q1Q//dvoVz+E/5NZ0AtnxCTzsa5p2hM/m0lgwqjGKTAGH2VvaNRJXy4KZ6pQCJnQvk3VQS0+xvuPta8hxsNkv+Eg/6SHuNxkec5fNgqA3/3MtblOv0e5jl0+dBTg9Emd3bN7SwCfBtthlt9P1t/Tecje7y51vn2IoPNmemqvr40ZH/h64PvSwz2yaYoNrMm5pbGab95NkDeI7HOUIbi2AO5PSqt7HoEeES7wSBai32tAPQV0E4AQvGD0v4tZATuvpy560uJf63HQ== 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=SDfHy8Hv7RnomQuRhGndIyDNhmOpj00PCTCtTZJsaoQ=; b=Y+9szm+c3643ANcJfTD/rjV0HdVuewR67+0wtDFBqulgaq1fKY7547jFEiVaU+CizL8LrGhzhhxEQS2znTzNyMS8R8gjtbizhAf54sUSm4WZyZoWHqyLocyEm13jULfuvlYt8XEheq9BENiUZbLkVxR6+i5mq210x/WM93YGjDI= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB5694.eurprd04.prod.outlook.com (2603:10a6:803:e0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19; Mon, 31 Aug 2020 07:51:29 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950%3]) with mapi id 15.20.3326.025; Mon, 31 Aug 2020 07:51:29 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, 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, r.schwebel@pengutronix.de, Benjamin.Bara@skidata.com, Richard.Leitner@skidata.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 v13 09/12] dmaengine: imx-sdma: remove ERR009165 on i.mx6ul Date: Tue, 1 Sep 2020 00:03:22 +0800 Message-Id: <1598889805-30399-10-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> References: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) 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.67) by SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3326.20 via Frontend Transport; Mon, 31 Aug 2020 07:51:23 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ccafa2d5-cd22-4d81-3d60-08d84d82abba X-MS-TrafficTypeDiagnostic: VI1PR04MB5694: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr 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: 4zEww/S6gFPspmp1gnyXCEBIVH/9UTmSO7BYhmSjYNzht0iC1p++Ngyi0AfKiL9OkpqouA1eL2LhUsVTMVWgi8fsyH1Ips5gpd8Soz4PEmWykf/ANOcE0P5i6qHxQmDx97XbWonXKCiPITxtIEXLmlQgSQFxV5kw4vaE0X9oGVUqCU9an/jlbfzHewr8Jx6HvWJRoTpdxHS2jsOCxCO6nc69tzV5Lvty1aQLu4gBpyjYkSr3fH0bBu3oKTLpjX2zBvsvpcR5UJpPJ8GvvP7BqINZal1b2tohAlZ0mNphaz4UaHvGCHLaeOjCIK8CUwhBNZ2XwUSawuJKOdO4XKlBHEaTVpAaS4YpNfS21luWl12u0EuvkoVRHla6jXTa3QSxuB3B6DSbIjh4BasFoYt52IZXNHrdnAuj23wiP0c8xQAAeGp8uN6gfvOHpZwAK6LrSmCS8sBVq63Eu6uNLOZC5g== 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)(396003)(346002)(376002)(39860400002)(136003)(8676002)(2616005)(2906002)(36756003)(8936002)(86362001)(5660300002)(956004)(316002)(26005)(6506007)(478600001)(83380400001)(6486002)(7416002)(66476007)(66946007)(66556008)(4326008)(186003)(16526019)(966005)(6512007)(52116002)(921003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: deMQ6budwCANQrSwYG1VwPi32tC4dvOErXGkKX+123GadDd2UAfmvDh0LPriwHWNLgYTD5yZcyaiyckLg8lkqtqHMWcbxzST5yCXDGCzuehGyHGF96FyUfXLVQHeyj4hX16hIeV3ECXltvzyTU9mrFHIYZsGK8TWGHx9owwRRUS43fBnxy2CeOK/1RFTCi0G2fZyP8WJ9d3gSPi/QCQ4tfWbqXTXC0Jc3eMjgDDsgwd+ejKziamvD4JdgESHFY3Y+zdclwkqKs86+esjhKD8Xenx9gi14eT1bCFjHfD+VymIaPKOyWziK4suzMFZ7g9Wfb8h3s5vJIDByaq1M7EJ33XvB5Wc3HzTcIf7YbcIYsHKSpnjihZTti98oropFjH4NwBVpkdltv7hYexuu41dMjTd7b6Loub2+1Ct22xSX/OlVDEaT5L40HiOoHoCHKd6KjKPpjEDrwSjwBqURtyglihAyYcZTZRAlUjcVEW2bR4Ozm1tWSgc5SDKWzEYMd8olrzjar79LdpoKyYyy7/WvBAX4Az3e/gIyQe5fy8uztTdcVw5iKcZWdVREgTv5MZLeDH3mTt/7ywof/OUJeRFDRcv2qDMVErqd0fGOeXT1nLUWghXfkHt7Jre1XQUYCRMEAIwoohbvh6+VyS+AByMrQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ccafa2d5-cd22-4d81-3d60-08d84d82abba X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2020 07:51:29.7750 (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: Kte4/oe8C4piU5f71KGGL6z8oTQSqlkGT5VnMqPhB/OZ6eXXmCkSLTvT5J1H16Yt7IGDdmXwIhp3OORDmyNx4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5694 Sender: linux-spi-owner@vger.kernel.org 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 | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index fb522a1..147ea88 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 { @@ -543,6 +550,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, @@ -591,6 +605,9 @@ static const struct platform_device_id sdma_devtypes[] = { .name = "imx7d-sdma", .driver_data = (unsigned long)&sdma_imx7d, }, { + .name = "imx6ul-sdma", + .driver_data = (unsigned long)&sdma_imx6ul, + }, { .name = "imx8mq-sdma", .driver_data = (unsigned long)&sdma_imx8mq, }, { @@ -607,6 +624,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 */ } }; @@ -1176,8 +1194,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 Mon Aug 31 16:03:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11745697 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1D3F2913 for ; Mon, 31 Aug 2020 07:52:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F2D5120BED for ; Mon, 31 Aug 2020 07:52:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="dR/QKV75" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728327AbgHaHwX (ORCPT ); Mon, 31 Aug 2020 03:52:23 -0400 Received: from mail-eopbgr140050.outbound.protection.outlook.com ([40.107.14.50]:27033 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728033AbgHaHwN (ORCPT ); Mon, 31 Aug 2020 03:52:13 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bp3ceqSN7NnHJf/TA/0AX98hcMReR1cRMoWxybVngKD2sbDE4fy8p7elptTckrgjTY+pe90TH8rDpUY1yVXfvsRa1M/+P8zoHmL7D/K2YPgnEZf+wVwjGPf9phKxHADXtZvQtjlWGWjpLoz3UE0U4MmrIfr0m+0mfbk8C4j6rjJg1L3DoriNLHmGpX5jiufRjYJZmSDF+RP0ekND0EqMvkGnwLcPnqPe9Ko/Gasjno4hn0otbhpKtrkFbSNHRwx6raqkv66iKTIAffK3j9dJYlxUNnW7COrpVVme3xTFDgBshWPrErZUdxYaH0r+hqt/0DZD3uz06RVmt8tCznHM0g== 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=BWs0hpALJidgRtRLInnSNBZ9pD0Yw25kK48miRjYwKP23DeF+xQdxTt7r31/1xyGtmBXqcx0wbL7OPmtRgSLaZu3zHbZwfDzDftcok1KzkDfXc5PjcnKp7jdsUQS1isoILGFsBfyJM82H18P3Pltf3+3E0alWHWVQc1FUeTMZbnTfdu/Vgd08UH3V0apd3fJxYhjcLrw8rJgizi1UpEXlR6BQxptz6v5MIhqojoR2P+oCduZl+RuoyhZ/FzHu9MJVME00IxgfGgb8bdcTIqCRXZGY9IqqILkCSen+XFXAHCKZe2UYDyj9bLV2GRT04c+69iheH00gpHHrQu817X8mg== 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=dR/QKV75NkWmnF0aPoLPqC73WbIpaVRnBnc5HIDAP6rmoYMvHKNyzbw3FQlvPOiK306VloHMGWoyzk+rgqCxXzwUU6iaBnPuJiKL64h66Kj6MmX/ZaOFpAVdiORI+XPuvUzh++HUA8goLQ3Ijg9yS36LMwUelQQNAG0lZxHMcHQ= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB5694.eurprd04.prod.outlook.com (2603:10a6:803:e0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19; Mon, 31 Aug 2020 07:51:36 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950%3]) with mapi id 15.20.3326.025; Mon, 31 Aug 2020 07:51:36 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, 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, r.schwebel@pengutronix.de, Benjamin.Bara@skidata.com, Richard.Leitner@skidata.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 v13 10/12] dma: imx-sdma: add i.mx6ul compatible name Date: Tue, 1 Sep 2020 00:03:23 +0800 Message-Id: <1598889805-30399-11-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> References: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) 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.67) by SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3326.20 via Frontend Transport; Mon, 31 Aug 2020 07:51:30 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0c599e7c-766d-411f-6563-08d84d82afa3 X-MS-TrafficTypeDiagnostic: VI1PR04MB5694: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr 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: L7ynZfizdve848FODTiK6RMjEAdbq7QPBwAGdj5RN0Uu7EmTYKcY3qfeUXXl/F4HdtejYgAJkr4vtvgLnvG+2L9xGT9PDZoJ/oAZBMZpP+xtMe8MxpitlZ9d8lEluHA8/I2eu40lqCVtvHDPoefs8EFo4a1kcD2qXgIKmBRs/5Y4eaxrJpdNjssqDZAUWGPyA6osJZ/1O5oFYZySHIbwbw87WBflmsBXrxLJOaItGuiGDQsylknBSexqtu2pwuiHDoM51LJRba5VKAPIuxb7Cd5DdMH8MbT/L1x9CpgbgiaQx76ZdK+oPCWeieprbl5EjGNm4Q3de99EbJQxP0MRrFu9pxUqllUlM2oM0EQ/C04= 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)(396003)(346002)(376002)(39860400002)(136003)(8676002)(2616005)(2906002)(36756003)(8936002)(86362001)(5660300002)(956004)(316002)(26005)(6506007)(478600001)(6666004)(4744005)(6486002)(7416002)(66476007)(66946007)(66556008)(4326008)(186003)(16526019)(6512007)(52116002)(921003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: hb69lz1rfNcnt6cXEZsR95AiE4QtlDfAeVxwV7rvL+cWQY9pzulNiO/8aCTc1w1fXibpD6hVEq/Rc8QEXWe9X56oShKCFbO2P+yXMipWILlGUdABgeQKAy3WOy9RxnaE+cqIakgCjek9DDThxvuCdUEGYDZi1sdvDCzaOAlhqjv3xXJyyGVp+OH/WzTfbzo3ep8CC5F1PY3FoiDSP4uQ5ycgW/rCFFTge7DAVPuwaJq5VgstTpWo7H+SKUFkBFdA6MBjYqbbXsBV5YPY+j+krdYoUWxurnGI/KBTwAru+yw7uuTMSzBuXMUC2GqwdDGmonMo+SsEWpEWY46VFiGIWMfYuy0vuPIdx6rT43fpi2/hU4zGiYKqeX1/kDtRZ4hUe0DzCfh+lIWJLBIe1XTpvN9IdnkYcSKQw0VJxgqPLPsxV0kTXTLFA5g7TaAYN2B1jkcmAoxzCGO8e4VNbvDFhUeYlEAKUwF3HqnkSDVLmh0DH3GD/r4s+vK2GQlE9QcSPUGaEj+p8nw3P39vNTCDfgz1KECd6oMKeOU/hlcQt4J4jwwNkgLMtoEzGdC2alpHtOe3Flucq3enx9yOg+LblU5OA+WBViz0bmLAmipWtuKCocI9/ENp9xL3B1jqd8ND3/sH+Tm2Z/jK2qTeBsOMOA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c599e7c-766d-411f-6563-08d84d82afa3 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2020 07:51:36.4771 (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: B8KXToMgegLd5J72VvHAGUQ3+uss9JHNilEJDLB9pgur4GxkPzZ0BVyHsTeaSPr4T/BOLPYSKRELYPJp0jj2FA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5694 Sender: linux-spi-owner@vger.kernel.org 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 Mon Aug 31 16:03:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11745705 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C2BF913 for ; Mon, 31 Aug 2020 07:52:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E4DBC2098B for ; Mon, 31 Aug 2020 07:52:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="K1V5nrkc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728310AbgHaHwp (ORCPT ); Mon, 31 Aug 2020 03:52:45 -0400 Received: from mail-eopbgr140050.outbound.protection.outlook.com ([40.107.14.50]:27033 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728220AbgHaHwW (ORCPT ); Mon, 31 Aug 2020 03:52:22 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UIyq0PoZF8UO38Qs4+Hg9ecBK7Db65MYvSPfJix7COpetZlK4odIHg6LHYsnI06tCEd3QGI6Hq+O398XpyleMGflOWrhj1ZyFyac/hLHJ3JKub21dPFETi5mN3FXgIYCrADLHuOPFWjNdFJx2WitGBvm8icamfZHQ9NkhZZBE+uLtVASbCH9LD+uVkxAresxI0Nbwiv2rBAu13PqSH26NcIc5qWI/bWaChcXBgbEHBiXHsrG3nLVwrxxJmGwgU8FOs23WwUeKdAfxcJZB/8D+qMvxIFKHZEv3u7h0iFmNHUZiedOYkPuSF/M9PYUF+ROjWralY767nafoiC4t00sjA== 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=fw6vTorR3E3XAElDzrUJJdF1wDmUb3tjnC2gzeCv5cg=; b=oHFWbLMcq0/3wVlLN5e8zp15cQJyS2fAT1+/cyzy6gT/FyYlRKO157mSlY26jmST58AFze6jeKBgrrZf8vmsxJWWZgGg/DuqW3AA1U7oAbAqSUBXURGiF+SDk3C3lQy1vrFDP4gjqT4Y4bFMMP1v/0L/drt2oKPB2F5VzPO6bzvvuLFN2pKrL1U59NBSIPsoST9z+sejV4u8nZgyi1o7ecslfRmx6JTGA4p8gVViIknGexQ6RbEz0CyZDMgwoliYqY+M87rzp/vkAnENpB8aPBLkHhfU3EmqiO6bWIK708GminltYSC2QljXaBOjJ0mpJ0hWLjDqfpC5D8lQ4gw0CA== 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=fw6vTorR3E3XAElDzrUJJdF1wDmUb3tjnC2gzeCv5cg=; b=K1V5nrkcBWboGff3e5pMS43OznJIVHy+EG+ZAbvNqAL44kxPIZLqoCuM7r8UgoyfFmrnRXGMDXkpfSywd05TVT4PYKz8cAAoeLVxreNdZQkuVWgZH92ePf7lz/atS+JsF/aF72Y52+mF9oxpE0c02OsNtblx5HeP/pJ6rnEDkfM= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB5694.eurprd04.prod.outlook.com (2603:10a6:803:e0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19; Mon, 31 Aug 2020 07:51:43 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950%3]) with mapi id 15.20.3326.025; Mon, 31 Aug 2020 07:51:43 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, 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, r.schwebel@pengutronix.de, Benjamin.Bara@skidata.com, Richard.Leitner@skidata.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 v13 11/12] dmaengine: imx-sdma: add uart rom script Date: Tue, 1 Sep 2020 00:03:24 +0800 Message-Id: <1598889805-30399-12-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> References: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) 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.67) by SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3326.20 via Frontend Transport; Mon, 31 Aug 2020 07:51:36 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e0dee2dd-8ed5-49b8-0097-08d84d82b3a8 X-MS-TrafficTypeDiagnostic: VI1PR04MB5694: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr 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: MotlVVHVIQfpLzvRn8u+dlo3WVEKGXCAr9B7QpMVtvK2bc72AY1xjHrPs9Is7jg4OUw0dJC0B4AbBn/RTWqMy25A2azEhpgEtMzCwsAmJwH2tCCfXlbV8x+wHV5S4IhBXCtUOXwyQQE7QjjLLaMPFhZwjs+MUEI8HLWIQ0wxfwEt0H+h08l99Afa+Nd6GQTPgvNLgf3ER8Wz6DB5zbivXVg2Ear8dXmhpR1jaQOoYVdFFEPROufpQ6WMLD3aHTp0GxZ+P5u/EYN++N7tw+e+M0myk1FF/rCmtnlkLs1Fc9V9Q7NqM9Tmsq8GB/yy++Lu2y9uKDRVxhzvZS8F4SZPkrPyt3fXyh42K7x/2mR4mx7IfrPA7N9lpW+6KKT/BZG4t8c6LhAdjkJHCvGuKnGSeLzIMQAoff3eXv1UC8QYk3JGNL89jzB0q/9t3b279o7TNGpoYlg98H+j0GLPP4wi8A== 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)(396003)(346002)(376002)(39860400002)(136003)(8676002)(2616005)(2906002)(36756003)(8936002)(86362001)(5660300002)(956004)(316002)(26005)(6506007)(478600001)(6666004)(83380400001)(6486002)(7416002)(66476007)(66946007)(66556008)(4326008)(186003)(16526019)(966005)(6512007)(52116002)(921003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: oeaPZilblcZQXXjAt7cNuIHTEgnjrmlXDNkXdFXDin6xcik4FqvGyYpKdc4eieMmOWfUlhb+hVFXZsDfPZdV1IIhxJ8zUztXqjTHz3AjsVLZ38UvqRdax6ljnW/MvJQ1rN1/HiraM6ywm6edrUfr8wfOGF4VGa5ONoR/qF6JZ0Df8zctjx5CgFW6aYEtiLlDOkDqxWU3o4MhEBAcpMTbY2QSqCgAW9QdKiQkfBS0Ojtzw45x16nQJR1HYOByCt9wxvlD4EfUEV5/oMrwW2Z62uO0DnMzgeYGmlNxYIqwdyZcRHKPLZtU2CtUx1dSUYFt4+rR+bJ4uBxSkUqWcAEglIj++bUQgZwVQgGs8GWc+z9vOvpoKb4G0T3Js+42DBKd5Q3atqkPBc5dY55KbzS/+XZTTB4olBCiDdiYoyesK8XSXfEv8FIQoZU0LVPBVwYOljP81u5LiE1wc1szB0F+YUUQHkZXJdFaiSv3lLBj77wlxjbk7cNQPLRBJnOPczelb6JV3/AA4dReYAHOscOl3CUu51QX2If70qCm8A67Pi9F1bAdvT38YU5HqjtqWWdBikhzNncgCeP4s9LLhQrcfOreuByIYxIsNYJPqEh2N36KHcVblPLuxhK4ObtbqFhihbX2KuDbHC1djFOJh6LxtA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0dee2dd-8ed5-49b8-0097-08d84d82b3a8 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2020 07:51:43.0782 (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: tNVcKIutGIZCD2bxfsAln95SsrEoZaFlHWHzeBcGgGC4ipHvZsrg5SIBR+WjeC49w2osbeYPvDfuvZMGm7p7uQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5694 Sender: linux-spi-owner@vger.kernel.org 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 --- 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 147ea88..9bb6270 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -1731,8 +1731,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) @@ -1756,6 +1756,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 30e676b..e12d2e8 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 Mon Aug 31 16:03:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Gong X-Patchwork-Id: 11745709 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BCDB13B6 for ; Mon, 31 Aug 2020 07:53:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EEA562073A for ; Mon, 31 Aug 2020 07:53:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="kvs/V/Of" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728352AbgHaHw6 (ORCPT ); Mon, 31 Aug 2020 03:52:58 -0400 Received: from mail-eopbgr140050.outbound.protection.outlook.com ([40.107.14.50]:27033 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727844AbgHaHwm (ORCPT ); Mon, 31 Aug 2020 03:52:42 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ehHMzt5WjanCjqIR9KoRfN5e1q8UGRdYlTDbLYugKpxCy4CYiwczQpsacP4c96t2Ubdj1CUsJm8ItX5FaJZeSzFTv7H4wxdOfjwRYknm/H8rYf664LRKUU2zV8d65KH/wD9PTqsC2Fc3u759Wv7w27jCsiq+Z3AOaq0NsZlsFngVAhhzuHkT39RUdOAzzj8X8BUBQtk9jfUdRhPtSyXZ7jeiGqUAUMmW+SJusQGj+kSFxaDNKXtGICCU1ru3UNARIECMcSv2fh9JchCRdHm+iGHr68nXOVoSeRHgB1h9Pn4ResgadT8eAZEpdIavTz3oUneArFT77ZoFIeCKZa0yNA== 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=LsjAevpr1iYIElTQ5w3YAoNPjTaoMSMAT5iDRdSZtzU=; b=fwOw6B6S1XQEfO8YkUl4WSpGLJAYTJ+0xVw46geNAA0RRej5z4rgUl68KDTj+vsjcd8yYCKn+bG8+6pdmNDx1XoNS4a6Mri1sllIVb5y+DDpX4XU0eXxmNP3RzzwQNlcFmRnzNeKqDBRxlGOEE//YlHJv1k0WHnbjaSk5Ls+ayTV9lWDqEmHyBoaaxsNpZGA3aOH7YgAuX5Lc4Uku+TAbpVgL/MHIp6W30xzmqqtfmVPpNC6Ib7r+FBjNbodQTKwVOPFdk0iBL80IMraMElZTvTRjzO8dS56pnXpAf153IQErHA0x26SlpysHfCedqMQw3mn5DTzV1KlHAW1mPZPGw== 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=LsjAevpr1iYIElTQ5w3YAoNPjTaoMSMAT5iDRdSZtzU=; b=kvs/V/OfsnQbAR9A01oUPIziikFos5BWkHokcX835axt3vXgGPcwDhEvYobmP0OtQR8eQ5kH/yHYb0OPPCVhrSDOxf19eG7qGqjtXVRRvqSxURCXknEd6iUO/KJ66Sac80rI10Quv+IxWajikbpuII1S16us8tEyngFJfXLgFB0= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=nxp.com; Received: from VE1PR04MB6638.eurprd04.prod.outlook.com (2603:10a6:803:119::15) by VI1PR04MB5694.eurprd04.prod.outlook.com (2603:10a6:803:e0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19; Mon, 31 Aug 2020 07:51:49 +0000 Received: from VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950]) by VE1PR04MB6638.eurprd04.prod.outlook.com ([fe80::ad7f:d95a:5413:a950%3]) with mapi id 15.20.3326.025; Mon, 31 Aug 2020 07:51:49 +0000 From: Robin Gong To: mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, vkoul@kernel.org, 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, r.schwebel@pengutronix.de, Benjamin.Bara@skidata.com, Richard.Leitner@skidata.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 v13 12/12] dmaengine: imx-sdma: add terminated list for freed descriptor in worker Date: Tue, 1 Sep 2020 00:03:25 +0800 Message-Id: <1598889805-30399-13-git-send-email-yibin.gong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> References: <1598889805-30399-1-git-send-email-yibin.gong@nxp.com> X-ClientProxiedBy: SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) 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.67) by SG2PR02CA0104.apcprd02.prod.outlook.com (2603:1096:4:92::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3326.20 via Frontend Transport; Mon, 31 Aug 2020 07:51:43 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: adaeed96-9aeb-4452-bbca-08d84d82b795 X-MS-TrafficTypeDiagnostic: VI1PR04MB5694: X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr 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: o6ChJwAur8QXQvhl13MRCwfhTrONR+ywP0D7vUZvXeBHDpPjIIaBBuX6TA+L1maB5D4dnud9mhjV3bSh82JGITYTc106iTlJ72VrvcopOOB0pS7qTrlhcYbBz7zfd7HvAEDO0r+zSh2aYrcZXh4F85Snxjl8G19bKNCYGd/1GTHiUQxxYgpo4b4xWnyJ1xbA3szVhGE3ZB/cc/6q82sMD9qV8XMH5WmFyZI/Om9n/1AXnMn/ekNqyuIwz4IOfdfzoJX6zdw2IaM4Yq6cSIhiYyEQbUqat6o1N/j/s5uuBMs3UtpJlWXx8clyKivqsRa3RNcFchpqDmxpgoFLPPnWS2EqlcV/vKdVzJzDN63spJoNCciBegJlrB1Tf2NGrrxABSdMn36YjaQ+AEJBfhctxhcVca8VmdmvT61kIBO/9a3RDmaKeBl9E/tYa9fhSwv8JEOGuZYnHWVOOx2W2AOgqw== 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)(396003)(346002)(376002)(39860400002)(136003)(8676002)(2616005)(2906002)(36756003)(8936002)(86362001)(5660300002)(956004)(316002)(26005)(6506007)(478600001)(6666004)(83380400001)(6486002)(7416002)(66476007)(66946007)(66556008)(4326008)(186003)(16526019)(966005)(6512007)(52116002)(921003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 1+ZqAqunm5qB0NJM/BPQBTk5Gvg1htuu1OluJOS9W0rnrvm+pQ5k67+rRx0ELQPDFJ6p7Z2GrgQcaceMDNN6dvlZwZt40fu6OAHhL2T63fEnseVHSaH2QSnblciM3tJtaz7bgOwEY3OZG+OPVrnVXVPeYa5x62IJg+DRDqcj62S4ret/zRVZyxVKunAPHn74IXYk9uIRl/qJspHbu1KvzH4LYNwtA3zT2gYxowFV6gCNmsmYlg31xJiF1Dq+Q6lOsIQiGKCx54Rj9sFiPri9DJe/L7/oR/7ZkU0bm+Q2bVcTR+JpTgn0fzebX1MeOh6vl5p132lAJ/fJ810tbW2I99eFNQOEf+EmOLQT7A50BR7g0kqlaJcB1uIpBbfUcR8Ofvpwdj5EEb6/d1fgREhTvG/WC5ZBvmPv44nHeFxhkjJTwnxaMqVlg6h0F/GUw6ZWOaUJDR+u5tLVelCbecsAOztMtdzrg/ppmWgFPEbXxwl5DjAimPFcPhzHr8hKBHCt/spQc7VqvWveAxD2DnPhSQs6oJ4flDVCZBiSAoqeXSILdVAPXBNlP/dphA6xaqyVc/sYFddb8qeYF/lVNYHzwh60UDOPsCetitl9r8xkCeUkV8DyfJ3KY6P8G+2dvkUiF1DFQJKggljb/2f8xxbNiQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: adaeed96-9aeb-4452-bbca-08d84d82b795 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6638.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2020 07:51:49.6804 (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: xFcnaYsfq+DCRL7/qC2/tBTOohst/Kzd95qHwHa1NyUW8fqs98b/oRVFE2ijCKCWsxDJ+fdf7qCH0d0wRIoXIQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5694 Sender: linux-spi-owner@vger.kernel.org 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 --- 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 9bb6270..2fa8733 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; }; @@ -1076,9 +1077,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 @@ -1087,10 +1085,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) @@ -1104,6 +1099,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); } @@ -2124,6 +2126,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); /*