From patchwork Wed Aug 3 06:57:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sherry Sun X-Patchwork-Id: 595284 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0173C19F28 for ; Wed, 3 Aug 2022 07:01:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235797AbiHCHBn (ORCPT ); Wed, 3 Aug 2022 03:01:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233892AbiHCHBk (ORCPT ); Wed, 3 Aug 2022 03:01:40 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2069.outbound.protection.outlook.com [40.107.21.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB9FC6463; Wed, 3 Aug 2022 00:01:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I+h+Ifa6w39uq1gahUxyZ5LRXNikMxcDZ6XIDlxa8XgS1uTqZV79QIFoR8r1qxeLXl6ke9RXQvTE0eFbNt76WqLyqt9YR68mLbN8AhkWfzAHtbtfM94xl7qS4VSlnGdA6kWV4qhusCugjemB2/XrEPZI5htnh/hZrWwvZr910hgjUgHXbj1MJDJPdV2uDa8G0GtjREAFY2DHbA2IgDHhsha/2dOHIp77XErtNdzJHHgaL4/S+BucfyiTrl3Ew0IvvzChWI2j0veiPkvNrQpVQ9N1sqHzwYiN5V1yZDfUDdrz4Wviq9kVr3v566oXmk+sKGFKC9p9dbclKx+GdYEi8g== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BslB4pNoOoBbnd+CFDwyLJTW8eORRZAHBqOsZBH7UOo=; b=PV5/VeAJeBSGEpm+DhXk7saW1Krg4FbOWlj1XTPEVy7YLzevdqBJ2EruVsNZrVuSLttp2Tudc3Os5R4/1jyF9jCwJRBnOLc4uajp86gby1GyzyZmHnD98whDETB3VpsF8o0eXz+ya82g4vOMDyo4/2HnjCKrC8nR9V7oMYexNaUtIof9yefGELqAhDzqt0VBHLQtEXvLLuNJhinwVtAlkn8SpOL9KasqXxHMD5EWVqKdwvr1kHJIq/UuZDSMcgKzw+PNRgDAe92gzdJPdfBdi3ARki6GVo4v1PRVl3oaYYiNs+FWpwBKBYQ5kuPU+PYzqSuXAI6/EOCgondBGuGXJA== 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=BslB4pNoOoBbnd+CFDwyLJTW8eORRZAHBqOsZBH7UOo=; b=GgPztku7UT3xgASI6SeN8peMDBlyY3U+UWRH3dv6TP2A45MTDID9VKjVGawvEVuWcZPkl61cYX2AcFJllH+A/h2mqymOd2SL9QWFen7obTx0Ev50QQWQvIP8iH2V/NnG48oeHRqC8xNygVpGYkqtGq1bmRIzBLcEKd73jsrs2gQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8404.eurprd04.prod.outlook.com (2603:10a6:20b:3f8::7) by AS8PR04MB8024.eurprd04.prod.outlook.com (2603:10a6:20b:2a3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Wed, 3 Aug 2022 07:01:36 +0000 Received: from AS8PR04MB8404.eurprd04.prod.outlook.com ([fe80::d547:3040:284e:580c]) by AS8PR04MB8404.eurprd04.prod.outlook.com ([fe80::d547:3040:284e:580c%8]) with mapi id 15.20.5504.014; Wed, 3 Aug 2022 07:01:36 +0000 From: Sherry Sun To: gregkh@linuxfoundation.org, jirislaby@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH] tty: serial: imx: initialize peripheral_config/peripheral_size for sdma config Date: Wed, 3 Aug 2022 14:57:37 +0800 Message-Id: <20220803065737.14752-1-sherry.sun@nxp.com> X-Mailer: git-send-email 2.17.1 X-ClientProxiedBy: SG2PR02CA0006.apcprd02.prod.outlook.com (2603:1096:3:17::18) To AS8PR04MB8404.eurprd04.prod.outlook.com (2603:10a6:20b:3f8::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 006e29f4-982d-42bd-856b-08da751e0160 X-MS-TrafficTypeDiagnostic: AS8PR04MB8024:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /5VF6utvHqAUBO4Aa21fR9eZxzXcoLXDVxzJzHnCUikWhbSoj8wnkAoZRMhOq89U8IjoNXA1JcC6wCkc5RPg/7qOx6V68SkRpfoNlC8q0JP2tEFX6ixJhuiMTixhOTWM3+vaEB6WNoTI0qczV3sgZcreZMPwdf+PnQlGLU2s7ULLP1Qq8ZGlIxJsM7RQnunS5TJDPikxGNEFHwkjszn7Z2rZEwFAanwOdsz81bvZsAf9Qr7xsxWrTy2dvo9v89aCN5V4avtPKlWuZmVOQHRylwzzj3Tjd59IrmjxM88pUTFsmtdYXpeCwMqddECmT4VNemKtH/sbMTFvEckSMc7g9I+/ylk6ZgXrAcoDn1QhvZBuv1PbvsElpFTVfsA9wlpZyOZZPPa0e6jiSbmTpU6J22M1Lh9HRJrPXaCFk2CJKy+Z1X2vUrkx1p4iylzKv9sEaOqvxrNhHHVhRpTPUlwnVfzR1LdsFVOsDZI1befSRvPK65h2KEhNLkgXj+0lqUZfo9fJBOGTVngo9qo0YLmzNSnMzI0UfI/D00vfE530CjvhyK8+KXcU7JCYecQVEvXhbwZ9PKZOa/+fArSHvZi6d8qmY1QCgltHLGvw1N8dtXVOoP5fDWGG3dT/Ut+CP5ZGe9LQtSi64POJ5zjt+6e6f8/6eNZ/s91LldNhNXvQPvC0+nNHYd2n1lAG1tmwhFI8ZXaOTVgEGj/syELynZIFoXKpTTvz2IkOIax2hF99vg1mO8iWOlB8spZUv+up5QLIBIGZNYBwat3R2hGJh+g9a5EMy9357OfZLJH1cf65HonO7rZkwq/eePbLwsfj5omb X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8404.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(366004)(136003)(396003)(376002)(346002)(38100700002)(316002)(38350700002)(44832011)(186003)(36756003)(4326008)(5660300002)(8676002)(66946007)(2616005)(66556008)(66476007)(6506007)(6486002)(41300700001)(2906002)(8936002)(1076003)(86362001)(6512007)(26005)(52116002)(478600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: D6gJAQYM4/PwUciLdvE2Z8aPWHdiu3pf66XitZQceRFOti4OJIuGQ9Ba7/3LebJE0kiZdkLc3mBGAab6Un8tCdEFKFU4DAlCRE9JpIS41J7pQB7gkfCRdIZr8Y20WTUlVcAsOXsTm3325mNXrk9C5hfDyHoVjaX9AbRYV5mR56BL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MAaWAWW2VmKg8cHVV4w1owc8AnZpu8Iq77UPQwKOufKJkz64y9tOJ3JyNAT0hFww8DTHPZvgf+DIWEaLuSQsmEP/Ea1Rt+DFA8ZHn61iBf2kynQb3X8neHt7Eyi0xtCGeJsRR9TPfSVUcTV+OFa6+8JVwvZlXkkFUPy+wOpvQiWzA+n7NiR4peHtXVXX9AG8pckNFhAtP+UngC+nlAJ8QawB5EOula9HXdZJPd81UZ+HtAGOM8V0ssphrQCebuTKCOrf5dJePGUVwwtetWgo5adphFih+iY9ridoRPR99+WRgcRlkjoW1RPUKaGOkT1foYKt2yxi8MHgSKl6vjay9Xyljsaf0QTr9xGj X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 006e29f4-982d-42bd-856b-08da751e0160 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8404.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2022 07:01:36.2198 (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: fzXWPZYj4YX0/hyknuZdDoBNlfD8RMLU4bq5uWpVrTfE4ciyx0ieXdHMi0ZJCn92rni+1AvIFVDkvOhUylmyYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8024 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Since commit 824a0a02cd74 ("dmaengine: imx-sdma: Add multi fifo support") adds the use of dma_slave_config->peripheral_config/peripheral_size to sdma driver, the client drivers like uart need to initialize the peripheral_config/peripheral_size for sdma, otherwise, the random value of local variable slave_config may cause unexpected peripheral_config and make sdma mess up. Signed-off-by: Sherry Sun --- drivers/tty/serial/imx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 522445a8f666..bb8c2a712e94 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1320,6 +1320,8 @@ static int imx_uart_dma_init(struct imx_port *sport) slave_config.src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE; /* one byte less than the watermark level to enable the aging timer */ slave_config.src_maxburst = RXTL_DMA - 1; + slave_config.peripheral_config = NULL; + slave_config.peripheral_size = 0; ret = dmaengine_slave_config(sport->dma_chan_rx, &slave_config); if (ret) { dev_err(dev, "error in RX dma configuration.\n"); @@ -1346,6 +1348,8 @@ static int imx_uart_dma_init(struct imx_port *sport) slave_config.dst_addr = sport->port.mapbase + URTX0; slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE; slave_config.dst_maxburst = TXTL_DMA; + slave_config.peripheral_config = NULL; + slave_config.peripheral_size = 0; ret = dmaengine_slave_config(sport->dma_chan_tx, &slave_config); if (ret) { dev_err(dev, "error in TX dma configuration.");