From patchwork Thu Nov 10 08:17:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sherry Sun X-Patchwork-Id: 18007 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp15796wru; Thu, 10 Nov 2022 00:20:21 -0800 (PST) X-Google-Smtp-Source: AMsMyM5mkmb7SEGZjEE4KfODmjHkyiHXnsliLebMkDQGMw4L4lTOc+nTZeNmVWGNmY5oXTRAN580 X-Received: by 2002:a17:906:8a47:b0:7a3:86dd:d33b with SMTP id gx7-20020a1709068a4700b007a386ddd33bmr60194936ejc.67.1668068421224; Thu, 10 Nov 2022 00:20:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668068421; cv=pass; d=google.com; s=arc-20160816; b=Kka4rwgsrA2+R7lszT3kPvB4HEbdRm6SzyU//BkqhYGXD0oa5L/CCe/QUcj4M306gg u1Si7GZDOGCe36CX7nidjnOQYCHKEyQtaDgSCrg8dYcsmaFtNRDk8RrIuVUr9IaZ2JuU 3DFG4JrWA6NQ6zcSfHYpLDRlXwvs5XwRRpd/OGd0ULK0oOBQUJlZV1Pf9ttojQ/CJljJ E28m+pgUeS8xWAENuj3lOyvloZExggZ5j1BQYXzkm9RfsIdsO/4oY2uQ3lgwPyf5SNoK wGDqO5j782w9cV1hhGS7rYzzjm2tPtqNYogNl6oMFBKJSWIrT0It/Mmtgdu5sXUKbJ/S qa9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=A4FQxESk5pKaJX5lvN/J1P5Y3Ce1qRahLhmanTMKkcc=; b=nirWpB2phSxEPze878mjjDXjyx1UbtylUXIiIPis7XxbxLM9x7HqOTKoiiK/WAL1+w Yfk+8DONYmgZYNwD708CurItdvrXp6S+hH3PSEoUzedjDGBuae27pGLNH2l0juLH6zRb JYbipIBiDLMC6ye1oJj2pi5udeB3R7gN7IInoYoxGgP0hUz78tNlT3EkIJE6o3iqRHVL tCH3YV22gDguUkP176iKxNtk2jycgp2dfMX8W7F1kR6fQ7bV6IWnAJENy3Y6QnVmw0Mk 7qynck1z6PPGotCNN2B0XPsN2ou/rlVsqchgeN/XEvkt6WMgmCOUNllj++MDA6sSN0TD CZug== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=iVtolKHt; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xa7-20020a170906fd8700b007ae9bc0b98asi2971037ejb.484.2022.11.10.00.19.57; Thu, 10 Nov 2022 00:20:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=iVtolKHt; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232807AbiKJITb (ORCPT + 99 others); Thu, 10 Nov 2022 03:19:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232667AbiKJIT3 (ORCPT ); Thu, 10 Nov 2022 03:19:29 -0500 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20049.outbound.protection.outlook.com [40.107.2.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDAD7184; Thu, 10 Nov 2022 00:19:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nNQYQCuQ/DIcpmibweJfnvsuGtudUsUEA5RN5sd3vPSYeeiGMhqaUEAVHDkbmZCtkbwv3fZCJXOpk0xArlRmLb3meDnD2lBL+fVvhqHOkqDvmdPf1adxHWar3SabEINx6hpJ3wLAErYdFhaYQX9X8sGlEhpN8aNucsFaZ01HvtIl6/j+pDnG6J4VkB2oDNi2ou+uCF8RzCQFqpzTB0rl4eta5smx1C/LsRvwV/Ww5mpze2EL/7X04Xyn9vH0HQE+MDp9e7tIsC6GuQCalxdEiSjMfGtPLzAfTRuOU0m9W7n7mqEoHLZoir5TkXF48FLNoiJfKvaDk5NVnQVZovexNw== 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=A4FQxESk5pKaJX5lvN/J1P5Y3Ce1qRahLhmanTMKkcc=; b=drnM7GQlbYQcJPlJT8pL31E1eu28+BzRK1EYfsY53X4zd9bgZDWp/TupvsrQIsTvATW061MaxP6zdZAQL6wBO0C6SsU5amcgKmSJACdqkdmGicyfJgzbn6QImBzWUDz6oJKSIqZkFpZg+jHEy6h468LizJc2+/naCJaC7S6lUu+z3DIjfyznfFRXCn/7SFaMUpsf6z0vRlvpeS+mCqlifqKqxVDCSt3T50IT2WKJuAFzh6dXPXyU/K5hHLG/RTRoxMMr8/H/iExh7PG2HFWYTzSrBpcumdvYuwlqEe+ZfNSTw5Z+Imyni78iTM1JOPwHV0934etE4hFrvpCWaov8fw== 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=A4FQxESk5pKaJX5lvN/J1P5Y3Ce1qRahLhmanTMKkcc=; b=iVtolKHtSdOvpE2XTdAg4nAJzQmIYLwTgMg7iUhLgFts2ARr592DrmIE4UVgkYfsYK90ZeAPxGsqEhKEeoWivgyhbTe7XfP/tWDIIJnmUVxMvm5VgLnQh4DWN1DsQ4O10JwtYNn3ATevm2jUCHdrmMdJ9XJy2LdAoq+KghAN3A8= 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 AS8PR04MB8916.eurprd04.prod.outlook.com (2603:10a6:20b:42f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.24; Thu, 10 Nov 2022 08:19:26 +0000 Received: from AS8PR04MB8404.eurprd04.prod.outlook.com ([fe80::71f1:f7bb:5039:e55d]) by AS8PR04MB8404.eurprd04.prod.outlook.com ([fe80::71f1:f7bb:5039:e55d%3]) with mapi id 15.20.5791.027; Thu, 10 Nov 2022 08:19:26 +0000 From: Sherry Sun To: gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: michael@walle.cc, jingchang.lu@freescale.com, tomonori.sakita@sord.co.jp, atsushi.nemoto@sord.co.jp, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH V2 1/5] tty: serial: fsl_lpuart: only enable Idle Line Interrupt for non-dma case Date: Thu, 10 Nov 2022 16:17:24 +0800 Message-Id: <20221110081728.10172-2-sherry.sun@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221110081728.10172-1-sherry.sun@nxp.com> References: <20221110081728.10172-1-sherry.sun@nxp.com> X-ClientProxiedBy: SI2PR02CA0022.apcprd02.prod.outlook.com (2603:1096:4:195::23) To AS8PR04MB8404.eurprd04.prod.outlook.com (2603:10a6:20b:3f8::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8404:EE_|AS8PR04MB8916:EE_ X-MS-Office365-Filtering-Correlation-Id: 25ea8836-57b0-4aa9-b7b6-08dac2f4478a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: weO/wPziSfOtd0Km01oxbtNtR3sgWfCGceoHpW/JSFLULi2txgzjfMnnILsE9jZQn/T3BwQgjPonU7D1heN3+6NZwm1OxfYTXZ5oTBr1WMEmqqZUF7OQUixLok23+tqKZkO/rprU2GBFXbUlmlZ/tOtzhyoT4+9nYNTifp00G5dC10GU9WbMrojH6JjJExAJRh9UexWDbYV3YBzLSvqlSKiph1jYulWIDtQWGLWwZuXHyQtGQbzquP2TqxXHoHtSSQdYH+MybCZhNAVP7VWxQh2V3UPrh0aY17Gt6ZNvdubWWp+q2kC8faUkuM/WnQVk/cUkvA74MKbi2qprbsKVjI9/QLFK+784r2rjal39NnfpfNiYYj3K+Z2ph2VAUkEngx7slSvUgkMrc+Fn+Ke+BNLU9Itv/6lB9g1pCezP3jOLAE6qDYoGeer16cQ063ITb+Ol0ZOmscqORECyUXO1RieDh0lJpdC4N8rx0Rf2AgKbV60stniyKVIHnOakxVrzrEwhJm10By3Gl3ga7fB3vpU26Az/SHCuYPO2qhBmPsiBpBvTmQALVBH6R0v4P1Ls6FUhHI0rmI5onyeNZsP08HwTEsekIEcqsN+dNdh+0NnwwSONkqlSLhZDiwVmAHxAnVY02N0pnfqK10AoITHakdcmkSKhQCEQe7w474Zd8A0231Doq4rGq9WbzUwQIs9jXslkUuTPZcqmSiZMu40vAt1Iu+jJ7oxgpX6W/9vHq8RBZaUWTEeRAfZEvTYplwJk7B7tPfrQ3ByY8lrg9AyppA== 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:(13230022)(4636009)(396003)(346002)(366004)(136003)(376002)(39860400002)(451199015)(6506007)(38100700002)(38350700002)(36756003)(86362001)(26005)(2906002)(478600001)(186003)(41300700001)(6512007)(316002)(66476007)(6486002)(44832011)(66556008)(83380400001)(66946007)(8936002)(2616005)(1076003)(52116002)(8676002)(5660300002)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZUQY/HrqE549TQ3wgXR6NEKNQwbBvoPqHS6EUExfFQmJC77vCZt46XZoEY104+3IT2ib2i3akZEhD8+QUI35/beJgUFO1oqGSF9yFLVAC7ld3IDkMjFvQj0OEKJPANJLxshxx4dEthii5m4uXJKzQN0t8jO0YI35+ofTabXDhMB8w9xoCOWrQaPiP0wbctk0mTBOtGzN6NArzubWs6jsLGr4mJOISecLCuKw/nS1lIYQrl/DJWEehV9FTv6ArrFLO5BtnjBmjGozt376nWx/aB19d+/6pSVqiNpWPoOKJfBaOzFbPLx6/3GWAAc/wwPqg2bgP24dHaSAZbR5Kyriu+zUONQGudA0OIghu34sjEmZOFCEMtfWxKiKmEA1XFc5u3Ll5lCMFWTWPLRxVCHkg3GMN+VFhZs3YKBMtqHtHShpqGNTM2fKcsfVW5qsJCBt1Gg7yxfioegl1nevurSX3IgvvHnB1iSoRDgUrk0PbyiDv4AvJSXUYW/viOPBKSo6tu9ysy3YmXRIB1PYTRFSA+DiI4QPKn7KygoyYcoSaf5d7T7Ktz5gik2ZT7AyRyl5T3V1OVnnSa40WY5wdAPZJMqAcJATB/vih9OKMAM76RLAW2FMjds+vdVyLfuKBU238Yfe3FQB8tHwpmi4kmhFd8/AnMGga68MMsnhSIJcbSkagrIjjNzt5IF7YCvPo9Du1R79NxXq7mSCFCi/9n4PSKjYQeQfNmU1kDKkh6smWXV88EhS6Rsc+8rszR43Ht3oA7f5BKqO2cdWuj9rGSKQMzBVKbIQDLaTPVJbtyO3AHfxKJgLTunGqpxqjZjiGs7sZXkUiLT8ueYnE+3/1jn5xHe/zi1TtEzdDxFJKPCprHAMOhS+LyWCMZCL36aJpmsqVYkiIoRhuyvBif5zPksDKagKiVimtuyDwS02bk0hL+fE5XseWJ2yVaoMpO9Vyuvazjdp8jjXxVzbTwsObgaHiBm6X41qYhRoXwclnJrjbiD5vrslgdXa3qQk4VgGWF2HkRm8sm33GxS75nRf7Jj2N/Xb0hI0MxGVeas1L+h8SNiDpPVCJqgSq/bhQzZWIKZhCxI+vM4+1B5WGVTYPK1y4NTcThRpcch6N8rimtUCMzDRKSX59FuOlydKmgk67ZWlkxvkmycxUBkBsO0nztt8kjBOlvp2/CIelKb927YlcstWvlRTg2d1RXl4fSf/tgMTxZ1w/QJlLDo+7KZrae8CCR8sL4+2XdXFDpXwzkaDjEiMvEt4VQzrBroVHUO+rm6n2mxemQDmToaJmnp7Xh8G3vxKhUtInVcrWuAbAB47TMbiJvQN6jE+UUyvcpyXlmo5eiEvmNV6kAuT2/KahrqyUZD8yVDIUU92hiUAmhSaXjRj9aaklCrsB/5IcsOjNKOYXzxzE7z6dB3ZcnGB6E44OQy8Wj4dvR8WKERJQu2atah2eMuX8CGfHKeuUrX5B/gBcjuGCuYVjALeIvuy2yZQYvzISIuvVWwgkh7cwvwtaV8TCLAoFR3yhRveq1WDj6aFGAPxQIbnjoW+MTz+RlavuUZYtKIaKGvLW0IKSyX/g6ULwBW0oh2W0LeAIhGBHnXA X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25ea8836-57b0-4aa9-b7b6-08dac2f4478a X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8404.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2022 08:19:25.9115 (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: AmUIDmVCSy6QvaT0qMbDf+/5dEFEo9ZsdEYXB7syAHj06bKZjbj3a0g9oHz+Q3hgyUHYecuuZVoEp1FPvZSA9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8916 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749096513144183091?= X-GMAIL-MSGID: =?utf-8?q?1749096513144183091?= For the lpuart driver, the Idle Line Interrupt Enable now is only needed for the CPU mode, so enable the UARTCTRL_ILIE at the correct place, and clear it when shutdown. Also need to configure the suitable UARTCTRL_IDLECFG, now the value is 0x7, represent 128 idle characters will trigger the Idle Line Interrupt. Signed-off-by: Sherry Sun --- Changes in V2: 1. Use FIELD_PREP() and GENMASK() for easy access to UARTCTRL_IDLECFG fields as suggested by Ilpo. --- drivers/tty/serial/fsl_lpuart.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index bd685491eead..a8f8e535077a 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -179,7 +179,7 @@ #define UARTCTRL_SBK 0x00010000 #define UARTCTRL_MA1IE 0x00008000 #define UARTCTRL_MA2IE 0x00004000 -#define UARTCTRL_IDLECFG 0x00000100 +#define UARTCTRL_IDLECFG GENMASK(10, 8) #define UARTCTRL_LOOPS 0x00000080 #define UARTCTRL_DOZEEN 0x00000040 #define UARTCTRL_RSRC 0x00000020 @@ -1506,7 +1506,7 @@ static void lpuart32_setup_watermark(struct lpuart_port *sport) ctrl = lpuart32_read(&sport->port, UARTCTRL); ctrl_saved = ctrl; ctrl &= ~(UARTCTRL_TIE | UARTCTRL_TCIE | UARTCTRL_TE | - UARTCTRL_RIE | UARTCTRL_RE); + UARTCTRL_RIE | UARTCTRL_RE | UARTCTRL_ILIE); lpuart32_write(&sport->port, ctrl, UARTCTRL); /* enable FIFO mode */ @@ -1530,7 +1530,8 @@ static void lpuart32_setup_watermark_enable(struct lpuart_port *sport) lpuart32_setup_watermark(sport); temp = lpuart32_read(&sport->port, UARTCTRL); - temp |= UARTCTRL_RE | UARTCTRL_TE | UARTCTRL_ILIE; + temp |= UARTCTRL_RE | UARTCTRL_TE; + temp |= FIELD_PREP(UARTCTRL_IDLECFG, 0x7); lpuart32_write(&sport->port, temp, UARTCTRL); } @@ -1669,7 +1670,7 @@ static void lpuart32_configure(struct lpuart_port *sport) } temp = lpuart32_read(&sport->port, UARTCTRL); if (!sport->lpuart_dma_rx_use) - temp |= UARTCTRL_RIE; + temp |= UARTCTRL_RIE | UARTCTRL_ILIE; if (!sport->lpuart_dma_tx_use) temp |= UARTCTRL_TIE; lpuart32_write(&sport->port, temp, UARTCTRL); @@ -1770,7 +1771,7 @@ static void lpuart32_shutdown(struct uart_port *port) /* disable Rx/Tx and interrupts */ temp = lpuart32_read(port, UARTCTRL); - temp &= ~(UARTCTRL_TE | UARTCTRL_RE | + temp &= ~(UARTCTRL_TE | UARTCTRL_RE | UARTCTRL_ILIE | UARTCTRL_TIE | UARTCTRL_TCIE | UARTCTRL_RIE); lpuart32_write(port, temp, UARTCTRL); From patchwork Thu Nov 10 08:17:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sherry Sun X-Patchwork-Id: 18008 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp15904wru; Thu, 10 Nov 2022 00:20:40 -0800 (PST) X-Google-Smtp-Source: AMsMyM65Ob7oHi2kRYLOoR0/1UJ5YTgGoP+2XmTvNCFPFk/rlY9SzhhwOuEctsl6cDuuxZBJCWSA X-Received: by 2002:a17:906:4bc7:b0:78d:f2d8:4623 with SMTP id x7-20020a1709064bc700b0078df2d84623mr2484086ejv.274.1668068440143; Thu, 10 Nov 2022 00:20:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668068440; cv=pass; d=google.com; s=arc-20160816; b=CrVgjLhfMTWbjyT1RYvCT0CKBmG2Ol0l5AH0TdCRzp/aN1XigRnPJS4ZWfJPE5gBpm QtATfmsuw6XO03WsvV9xDwIJXzjX4g9QSdamr/AIC1E0R/7iFHPT6qo7CufzCpAc8N8k 2P2jkv77lPXFhmzQsSLnkItWOnzUvfT7DQslJsav2vJ9beO7EN0vt+27DwuwlgyGwL6x 8dzEKnX5HIoItPYHqnPToSmvwAOx3yUgjyUbeOFbhdOJsW4rb0ApIo3Ymz2KMjDhyL1j 1jFteoCG0yr/OT38Dew3JuodqHaUIWskNykVzcyXJbtfzPqGukNX8ubPfo0dTy39TOAU 6gvw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=LTC+t8kYf0GC0OzkqBvmE0A8XCc6Lso/PN9oSUIcjho=; b=MebI0W6SqcINsimU5YItdiiUi0ZDKbw8pHYlCyp7XS4DjOUsVq61GcmcaD9rv+Ip5a 4RCWwaZ8lPrjedkPgR4i7oklhqBswbbezKj508/4uZW/N/2YUlvKX5XDp3mFrNaTTqdj V2cBxI79DV2u6mFWCRTgNCPgY3ZKbKTwEwnt9SnSN/ZMP2n/B6dYKbwPJPKhR7GvOabI Uj2h0vNTPQeHLriMlQHNaPhlq6RkjFBBfzPIr+7qH4JVlnzU/Q36cNWb7/N3qtNKmLkN j0LDHOY8CICpiObDLnBcaUDuA9rFYGSg27rg4GCC7Naq7Yp+zO2fbOO161n/XcFAeZz5 tvkQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=H0pSQmtb; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd10-20020a170907628a00b007ae199ea55asi19301278ejc.817.2022.11.10.00.20.16; Thu, 10 Nov 2022 00:20:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=H0pSQmtb; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232823AbiKJITs (ORCPT + 99 others); Thu, 10 Nov 2022 03:19:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232927AbiKJITk (ORCPT ); Thu, 10 Nov 2022 03:19:40 -0500 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20067.outbound.protection.outlook.com [40.107.2.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9C8E2250A; Thu, 10 Nov 2022 00:19:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MGb5zzfb54gQDTXVDRWZktmk1YnJvJ5SSFI2dTEJ20e8DP9NiaUm9ophCNl+x8tDlEEOr3oLQ98n7KerYJaegHgPJncn56Javf8eDD9Ybv4DzR9t+4NdrbHb6BayphOLwzuo+cC/GSIZFFC76Hy/rbrqzmMxJyiZ9UlgstTkESd3J9Hs9uY0rLqnzXzbvgIHpWAU9ESrXORFNMTITR6ZLqPATUdIi7VSIq3bFfvQxQ/Z7VRVI2arPFQI6bIU9JfeSQeSlaxWIXS7RZFJFui9kIeGvdLFy31712omwnmu+rBbA2ARVwlKqKvgbCDdlXUxmqlKnAnEOyXi42KZr5hPTQ== 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=LTC+t8kYf0GC0OzkqBvmE0A8XCc6Lso/PN9oSUIcjho=; b=mo5ErY5Aa19YxuvNWlb/+42VNgEIMm51KMgZSyeBsY4SR4IVEffmTwgibkVfYyzJiV8z2wV6bBZ+IttV+YXzQ6aX9KNNRea1eygdgURoqS+7vKnVK++8cNSiy446cZAhN/u6kzMWS+VgWu7z/Qt0RjTij02g1HXz9KlM+c0YO+KHalxkCI7pGdhKrDcPgQpicAr+p33/Qa1xemceJRmEL1bjesM+J3OAAL3dioPtfHG2SQbslWa3GvEIqMogF0XlKkcvOzFEW3aXtC1y2ys3piNMKtrgaY1Y830WwNc+duamqhVVeEm/kqvbnUzPEmnHf1CvGvS+0GRdHJeSa/R3Fw== 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=LTC+t8kYf0GC0OzkqBvmE0A8XCc6Lso/PN9oSUIcjho=; b=H0pSQmtbASDTA7yDGA+A9owUyPsCXkRs8ELtsqdrKH31k7eqYEmtsMbQcq+z1KM33q23GAQYiquMeqyksjajnErVBlfIAX9Cw59NTEyZCF5R9tiOLREpgnre2ZSHWZwIJVgAlOsBO5MtIpPPPpmoh2QYZgiZm/kTv1hxQEOLp9M= 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 AS8PR04MB8916.eurprd04.prod.outlook.com (2603:10a6:20b:42f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.24; Thu, 10 Nov 2022 08:19:30 +0000 Received: from AS8PR04MB8404.eurprd04.prod.outlook.com ([fe80::71f1:f7bb:5039:e55d]) by AS8PR04MB8404.eurprd04.prod.outlook.com ([fe80::71f1:f7bb:5039:e55d%3]) with mapi id 15.20.5791.027; Thu, 10 Nov 2022 08:19:30 +0000 From: Sherry Sun To: gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: michael@walle.cc, jingchang.lu@freescale.com, tomonori.sakita@sord.co.jp, atsushi.nemoto@sord.co.jp, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH V2 2/5] tty: serial: fsl_lpuart: clear UARTCTRL_LOOPS in lpuart32_shutdown() Date: Thu, 10 Nov 2022 16:17:25 +0800 Message-Id: <20221110081728.10172-3-sherry.sun@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221110081728.10172-1-sherry.sun@nxp.com> References: <20221110081728.10172-1-sherry.sun@nxp.com> X-ClientProxiedBy: SI2PR02CA0022.apcprd02.prod.outlook.com (2603:1096:4:195::23) To AS8PR04MB8404.eurprd04.prod.outlook.com (2603:10a6:20b:3f8::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8404:EE_|AS8PR04MB8916:EE_ X-MS-Office365-Filtering-Correlation-Id: e38b3dd6-c20d-4ebe-90db-08dac2f44a26 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jUVAAbfLKDws/ncQMLRNe6gEGy9HQqhhYczVqWcmlN3O4MQPCykhmA89RTys2rWdqOd6Ar4Ef2/pm1hDU3IhWaIaNVPfvXTqYEt0f0mhaMZ9W5M+Wlu3QPJCrcXikfBiJWedry7lV+iEh56vUtk+Mv6biat+/MA0+mdTWCZYswfRxlQsNtUZNjBjQHlcRRNpyrfngP7a7uvjr1vmRPq35z90JqZ7FslZAyt0OvGUTdzXPysm+TmvBlggWNhfLcMrXJEJlKgj2zYoqsE9iVWuJ6Gqsy701yOxdB4UUVta9qX7aM7SEFKSXx9MTXEyaMyKEvxs6PflyGhtIrkSBFyH8xNfd38GNS7j4rv9iYE9eWzWZkcW2gMPOQ0rHQRxs0jnrnupR0aI9HjSCZR/Ha2T+gZnEmGSu3Q0LdB8AwYqW+DDGgHY+RE9sfwTiXhKI30/uI64v4GELogXiIMbUZiuLF9Qw5PlgX7q1LJpfoJjEyxZE6R95OPWLU0R02yOiDmpj3usNxlB9teEWkHqQ/wcvZb0Zun7XpWEM424S/gcFt88o0JYUfeiWgRQy/P+X+sIWvXV6LfqB4f3MzHTUqPDdQZ22IIXtvnc4S7Bo0UbiPgJVVtKlVPlBwhbxDYScsKCUhdNmNOvVpL/tDNaxeiGQUv4DOCH4QeVdPjpbzvdqE2Jv6NcnTvZb6Sm/rXHSwzMJ/Fsv7NeZ+OQ+qTHEoUzNdOCeV2xB0RTs5mkPmIL1N0A10xJkWSqoA8Z/D+BpY/j9Cwz4WLJ9PQctoVQlBMSag== 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:(13230022)(4636009)(396003)(346002)(366004)(136003)(376002)(39860400002)(451199015)(6506007)(38100700002)(38350700002)(36756003)(86362001)(26005)(2906002)(478600001)(6666004)(186003)(41300700001)(6512007)(316002)(66476007)(6486002)(44832011)(66556008)(83380400001)(66946007)(8936002)(2616005)(1076003)(52116002)(8676002)(5660300002)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: R8yDWxF3W0+DoATY3hGoMWcyGloDd/28xfuho8AOT1btLeZtKz+9OxlFEfNja5+mPrDp1Pg31+M8AfXCkkypCOtXnm+oK57DuDNtr5J1fIfA9fh3xoRuPZfY7WsXb/hVWEg69rUCl47/iC7m7B6Mbvb4ABeKgZbOU2bOP/gyNkBFk+5dCaFgE0G7T6s49E47xhPnRZZMO/lyUnMwsRIPLU0VmJLHuL/TwrX2quF24/OWS6OdPQ6TrsPUMaVpKCT2D/vtt0PFXvQvSnSrlJomFhUWD3zT5FCTzRYxfhTwD87CbVCn3zdwbWccQR1lFrGp9JinRmvffecYz57SR7BfDJweFukvg3VtCQ1nJDk7VY90Y4PekSYDj/Kvk6x2L8DoVTIGs+YvRwqH7oTVAuRaUCzLTORToYAxUV4ct6dZHgM73+E6fRGY4u2mt5NmCmYsnWV4F8JU8/mL7dyw9APlxvS//85M00wV+LCaikwhDapmrn8TJ7uu+Ax9jW6KF+NkUqrbzEpey5ybtkpvXxc4Hx+/vOs3ltjyfSAMYZK9myKJnZleB+pxRWXLMSgTlj1i/q05pZzAWs8ril51knwnb2nKryN1ccEbka9YtlzhPCYlTKfTEW3DsgQ25IYyJQKIFVja/gdRJ8xflpk2kmkjDUuB1ayHyrRMMPO+PinJ+j2ZP7qzHKj08S7SW8HraWjJq5sjHjCjfGPBtGwx8edYlu1p5kdYatqtdHMtFAkJt8tZYhrJWG/BgVlJLuuE4fvul3Ibn2Ftb+zum2DoiApb3oNEAycV2yUccMU1MZHBeTBO1C5XK4HdcxU5lOQJYE7ndc1jSae6dhiiuVu9yYEj2LXc3+SOtbOd/QM6J8V3tXoynjCrALFddttqbG41SkV8J5FzlDpAY+v2AYoxA6QY5fqAmQcwU69Jvi3lM2xg/dhwzIXMnAPFmAj8tYGCwrQQ4tZySmIwZIxaN3j4b2klD/ZGTUMLRgTtG87l4Mm9s2yO8GSfObYZKY97Gwst+Wlj6BLYvBi3zdDmr/SWSciRiHzKuPPYCf83eSj3Voio5Vn98gY0J6vPgTPuxDPItmFZQ1X1IhxNqJ07jAx2eB5CwT1dPFLu8VLHgHu68qGP324ShBDXTIyU93VhaKkmrGmkn+wbHMiOFf+V1rCjRYxX9uOlb4Yink3ICQx0sivixEjaYRbUnMge9X/rbbLjSo2TXdG5mzYYKyM8+u6S1XLdWP9ojqtDscDFFyjy55fOvawk68fYHS6xM9coPl2ojvFgIoeHdwJTZU3OCGnI+PW/T/3StaDCz6meGjdt7cW6F/7hTpWnRd5J/FxDDtHfLQeBGjTKS8BHO1RTUvoRckEPDo4HZYNozZ/NVg3MN3xVQVTWdOmVJINRrcwlIHKzjDoogHGnY7ihHtQuPyjZ1VDcDXebNU4ZxWg1lV8mp/j91UQcC7To+IeJpRzuGvIe4c1r1yue3nbQz+Mc+T/NB7JnMsqhqdDlQQL/IgQpwKlW8bOCWTsb6joM1cAF3xDfpJXXXXQxY468Lof6b6WZiqE9ERZWlR/tsfEe9PaIF9xLSSX9rcl/P0no079Y4XlePlvt X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e38b3dd6-c20d-4ebe-90db-08dac2f44a26 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8404.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2022 08:19:30.1614 (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: jGL3OvEMcd+JPbAoGrgagw4Oil6yG/2+ATLXznxrD5me06rjk6FnhQWS62yHq8WVtd8Ni30Huo71ODqihi72jA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8916 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749096532655186938?= X-GMAIL-MSGID: =?utf-8?q?1749096532655186938?= UARTCTRL_LOOPS bit is set in lpuart32_set_mctrl() for loopback mode, but nowhere clear this bit, it should be cleared when closing the uart port to avoid the loopback mode been enabled by default when reopening the uart. Fixes: 8a0c810d94f0 ("serial: fsl_lpuart: add loopback support") Signed-off-by: Sherry Sun --- Changes in V2: 1. Split one patch into four smaller patches to improve the commit messages and add Fixes tag as suggested by Ilpo. --- drivers/tty/serial/fsl_lpuart.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index a8f8e535077a..dbf8cccea105 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1772,7 +1772,8 @@ static void lpuart32_shutdown(struct uart_port *port) /* disable Rx/Tx and interrupts */ temp = lpuart32_read(port, UARTCTRL); temp &= ~(UARTCTRL_TE | UARTCTRL_RE | UARTCTRL_ILIE | - UARTCTRL_TIE | UARTCTRL_TCIE | UARTCTRL_RIE); + UARTCTRL_TIE | UARTCTRL_TCIE | UARTCTRL_RIE | + UARTCTRL_LOOPS); lpuart32_write(port, temp, UARTCTRL); spin_unlock_irqrestore(&port->lock, flags); From patchwork Thu Nov 10 08:17:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sherry Sun X-Patchwork-Id: 18011 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp16665wru; Thu, 10 Nov 2022 00:22:51 -0800 (PST) X-Google-Smtp-Source: AMsMyM5yd83OjeezOpZbMF7S0SfarLrPgvUGK6TjLIPihDtN1kK1Bndw2GlMDhL0576aJbaPj35+ X-Received: by 2002:a17:907:175a:b0:7ad:d408:3a2b with SMTP id lf26-20020a170907175a00b007add4083a2bmr2442383ejc.280.1668068571290; Thu, 10 Nov 2022 00:22:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668068571; cv=pass; d=google.com; s=arc-20160816; b=LPhcg8N+UsHGkWCG8lY5eD0KnIpG6aZdJ55ByV651Kke8BmWrQrSrYrJYQUCLLXwoB OcW7VYFOss8FJdlMAahrZzWI3cjShx04Jdn1+SZYEjFUqft7OFgXiu7QviKC08SRY8Md EyE6mJKxbghu34TUgIY9ilk629+8KaFIPAIqOhPAhYJNp1R+0uO6EzRrfdkvCVyixV1h Rn2iuyghoqNhy4dBGrgfxbxPXZYvuMX3/qogYLZCDcB/Nc84LAHEW5JL7p3Qw+JQnFOn 4PzhQvdQBeWF+AhYM7hD3AN0dVJJ0o5HkiBJ7D9Su4vqqByWFuEq0d5spG+rlqRpjW1M Kryw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=9EjuuTwodrodUQEQw5TynfSdu/nznMkw0PI9L48mWiE=; b=N99mX2tYk0CzkbZJxWLl4NZa/1aWTrf10Ob1+mnFKHzHO7CoJZzoO3AbOq4e47IFmD e/Oq8Cqm+tgnNx5Fh2O295OXeMsrKna/ZzxRB316kZ7x0D+KgJY3QyaF4XqbounaG7V0 sIFv4oG98nneOSp+bDmRi1GJTw/9JzMEk6V3M3CLJnZwcYw4FuwFTroTr4MESlkEneHB que2grEaAWYD0LG+SsPyaN6jwgp1DIDriNNXUn40uIvgV2O1Qu5ZQXDywE/ReDFr9uJr vcltePR+RyCzGcZKAUT7IVSmvINIDGZSmUKB3uIsSmQiv38S64GgO33hLiwKdwyTVzUJ n/6g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=M5ualja9; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h1-20020a056402094100b0045d4015cdcesi16726380edz.51.2022.11.10.00.22.27; Thu, 10 Nov 2022 00:22:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=M5ualja9; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232954AbiKJITy (ORCPT + 99 others); Thu, 10 Nov 2022 03:19:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232871AbiKJITn (ORCPT ); Thu, 10 Nov 2022 03:19:43 -0500 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20044.outbound.protection.outlook.com [40.107.2.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A05562CDF1; Thu, 10 Nov 2022 00:19:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wzkz3CAPhqk1Nm/xzDCOuCQkOLQngFbPE42p7X5aZ6LdpGwiDeniHyrmTAn8DN1BcnK6vKA3kn//RLX1VJv/nyZCPeQROrX6aCgNccbLm2wKdxIF9mxPIqzmYIQN3UuCiMb3ao8IojldLrxFelxtfpx8SXsCwrmBykBrdmgzpxVmvsQjRCH6NQCx7Bj2v9jKTVmZ3xX0Of03gJoc/2ZZah5yU+YimYDnWJQqucc9mRabq72+ru0tcQR8i9eti6+B32lZu8VJq9Pyd3yUurWzr+4TLbnLcBwNxv2uDXSPsKdbL//R+Y/sih3qAw4/2mpzv66B1khzjWWSOd7oQSt73Q== 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=9EjuuTwodrodUQEQw5TynfSdu/nznMkw0PI9L48mWiE=; b=hVWoFqrgAtVb5a/HVV3R5NK8i2b+9U5kj5z+Bd1r6U9yKqSP/oSCjUpQ9WATuoDXO1tK5wzZBpbIl0PbX9Y8G920N90pqSzkrsvYLsyAkufMkFzrvBigpADNGwdgIMwtMlH7XWKbTxvS9U8fi/L+MF2qpcVmj45iOGqn/v0s+6W3atYl39pQhunHXVCgQmNTaTYYylfCHfuRPHi68a/oF8E9Kg3My44a9zdxDJrGvWI8zpa6T47sVYBa1WhhiiS2V/VDfFGwxBmCKcyRHIprqQrDuX4WHN6H7Qhc6+7mXrho+JMh3YnOxzfSopOVV15zjQfL+uF0tRI2m86iDTkwjA== 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=9EjuuTwodrodUQEQw5TynfSdu/nznMkw0PI9L48mWiE=; b=M5ualja9UjAtym8AHRIK7vGf4VUonQ8yvmdrzrczvZ0bFZgeE93Ob07Gm3Jd3fufZci49M65PX/12kexAoKy+OxLBSVtDlqqYH8BfS/QS4MgeL5rqBWwPh8o1MAgNHT6AJn1vCk3VC9smBKVL1neoMzU4JvzBo6dKM69kfU8LYU= 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 AS8PR04MB8916.eurprd04.prod.outlook.com (2603:10a6:20b:42f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.24; Thu, 10 Nov 2022 08:19:34 +0000 Received: from AS8PR04MB8404.eurprd04.prod.outlook.com ([fe80::71f1:f7bb:5039:e55d]) by AS8PR04MB8404.eurprd04.prod.outlook.com ([fe80::71f1:f7bb:5039:e55d%3]) with mapi id 15.20.5791.027; Thu, 10 Nov 2022 08:19:34 +0000 From: Sherry Sun To: gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: michael@walle.cc, jingchang.lu@freescale.com, tomonori.sakita@sord.co.jp, atsushi.nemoto@sord.co.jp, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH V2 3/5] tty: serial: fsl_lpuart: clear UARTMODIR register in lpuart32_shutdown() Date: Thu, 10 Nov 2022 16:17:26 +0800 Message-Id: <20221110081728.10172-4-sherry.sun@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221110081728.10172-1-sherry.sun@nxp.com> References: <20221110081728.10172-1-sherry.sun@nxp.com> X-ClientProxiedBy: SI2PR02CA0022.apcprd02.prod.outlook.com (2603:1096:4:195::23) To AS8PR04MB8404.eurprd04.prod.outlook.com (2603:10a6:20b:3f8::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8404:EE_|AS8PR04MB8916:EE_ X-MS-Office365-Filtering-Correlation-Id: e646b902-f2c7-4f83-df96-08dac2f44cac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9lQo/tUfgBM970hFvDUXR0jeWkYjG3T4S2M+HRJTFEiYFFw+V9Bcjw9mT4BIy1PKC9kDmosCBWtf8VrPUUg/Iyu3gs+vM8tVOGuDNqJK/MBhIjkunh8r2pNToFTi7fj1HbSaIS1E2eE4MxT856DbQOhKdzeka0mvs4SwaM9cC3X+HPZBBg+A+3IVbBr9mOR9Gxhe91Fefa3UAann/LEFgFxRRSXjRryHzyJkTK9no7NP1pPIeXo6VhWcvgcX2HJZy1id0JZL/XfNbpnWjpdGwcAlngFFylrnAOQvk+1Vr3n1WpG5wjmnFnCON+tGFHgn7raRo/MNroybcT99ySyraWdaQFBIa3iAad3vcYtzFikQll62qM3+NiLRNihbNkjaSiJiEr8aI+u2ZBh/bH5xGfchS7o5prGakv4LV5/od4Fh0CXg8tT6q6/uMSZ1WTS9IZVTftEKNLwajUbZQ69KEEGlk6RNuNKXP/rmgUEymPGMloUFbm/EXaoILvE4/bsR3m9ASzCObADyLiGlYf+8hwSZaX5PM76akn0ZFLQEFL+Th3cRrPCXEzdfXlhQhJP+Wwu1Izm7KsYio5GNlwMek1fsgY68v3IrMMdroJvtTLSC9OqcQpT6hIrRaICYpa2Z6t0u6531+7BaozGVFRRDirZii0mjRSJKBgtb/Kh52sKBCq8Dt0L4u3o0ecb9ghFOkjvCgTFDDM2NerTm3appXbmv6FsFBQr1Qd0P4RoBwUvQWCeMPoCrKI77fm6LTS79MyZ50UP6tZJDax6Yi9p1iQ== 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:(13230022)(4636009)(396003)(346002)(366004)(136003)(376002)(39860400002)(451199015)(6506007)(38100700002)(38350700002)(36756003)(86362001)(26005)(2906002)(478600001)(6666004)(186003)(41300700001)(6512007)(316002)(66476007)(6486002)(44832011)(66556008)(4744005)(83380400001)(66946007)(8936002)(2616005)(1076003)(52116002)(8676002)(5660300002)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UG57a6tGWjoYVbceMVgEgj3oKlRUEIAWP19RVKjWAeByAwveBOpNZGcXGwi1hJzeQmPL6gj67zGeoPVKOLhZxWBptAKl2R0TW52jztCV+Gguz9v9sVKbBx1t4N13pbbca0ZzkMc1Wzq48WWFwGJQwuNANaXuban+07TQKKnotz8xd1vFMCN+/kkxudvM9Ut/8dpSF9KADegTkZ81aHWFIIr5Gk4Fl5oJwgki5K7+cEEwT2u7ZigPT9DfQi/uKN28gqnacIOBHP89z6nUpjEUvW5AxnGoopWxVq1GjY81ZOfggu8ui0nbrsvOCK4GFnljIUCIeyxlaC64fKD8XSOKlMGPYeNv4Znpd9XnONzfIm2dNcvu+LbwzU65YEdcDGXoE7+Yvk99Qdn0ail1OVmSWs38rxE4ERgz/kYjpqy8EplK8pbcxYmQ6QrlBCfmXV69SdqG1mnbnlBsWg9lft68U21nd/XpHOxMrRJ43Mtn1c1q/l6i3o6fA0Q8UuQnKLTbVxCUXlcCktWzPdRf4Ax79ManVgCRd7H6Terpcr7RoeSIkjpn20wvGzHkJBpw5e+7yciERVLehJ+B4m2nnE2n0GRC9bzmcNYbp/JcgXkE5R1t3fYsAsOZYfI7//zT7ep6txSoVKrZ7AGut32OBmrY+qzAX0eVIBXZyd2lDqcgjxozxYhb75NokArt1FpYX98ktE/GPZaM8tvMSnueGGghpnDONcYnsQHPRdtCO4JvoV+6V1/elm2lT/vuFMm40sQ0o5STTnCQC9EXLZMlOENQ8LzC+1l1jXrhOKWkA37iEO1BQgMAzzES2QVVn8xOet4Wc5cUviSdy0ceq8nGo+jLBEzUW0hxbMqwHeWeCZ23lDSp8yWFxEM/hu+IFgWHKvNsTmakFw8NF20xeUROb1dxWyDiScA9/MLz3ogDw8jsArMA+xEo90ooTS2Ot6Zzlxk0nfs+ZxDm/yrYsZyrwJ0ELekC//2umzKnRipKJBgd4sYiqMgcHFFEOJeVagh7ZyXooq46MlVDPBNANJfeeZL/Q8MyhMKYkPOR7cmTKL+Yzof/3I5Fr3Yf4m/YSi8DmmPuErbg0GI4eJqZBMhEcj8OIh3lXpUmIru+wSmkSVg94RnfipVEJyE54VbEWxOKCxapSSukCgCUroTG1kms4BRtqgGo6p28aTn0GhnYwlOrTJGgyoXp1kx9N+RDEQ8TE9BUfO8tp4H3llG2223h43PHPdrE8Wfn3w+CPmxkxl2KjKxQrwNQkTx+lw5KvezpJ+MdrKvx+5sPyuL4pF+aLUgwGTmoXpHz8nBk/xGNi6CnDa981FFx3S7I1oLp1BHFxGJytMk1TL2BnhEN35i4D+eF8QcygFjXVIvT/iNUxy9j/LR2wG4uqmRMKPbsXQ7lf8Jv3CyfIygYc1tLaGq+0qnqYBT2pCT+AuO4OMEQ1V9YJuVhA5vlGCyjxkaASE5dpNJLu2C5S2kzEdg0IN7IvTLntRNkLmfbtT7/SAr6MX77KzCj4WJzb7go+qp0ZAtttgl4mDR2YRi6Y5lCmwuOC7ZRFTLacZwKRStnc69SsULFH9qh9yht0y0o5bz1/nscwS51 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e646b902-f2c7-4f83-df96-08dac2f44cac X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8404.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2022 08:19:34.3365 (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: JzelXD2jU/BKMFImohJPpFuoJFJmWFoCG+0yp0Z3t+cHQKqvEj2tnDjYRKuKZ+Zdx3Q0XxSq3Gtf8HuS3cZIDw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8916 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749096670438999331?= X-GMAIL-MSGID: =?utf-8?q?1749096670438999331?= UARTMODIR register is configured in lpuart32_set_termios() according to the termios flags, but nowhere clear it, should clear it when shutdown the uart port. Fixes: 380c966c093e ("tty: serial: fsl_lpuart: add 32-bit register interface support") Signed-off-by: Sherry Sun --- Changes in V2: 1. Split one patch into four smaller patches to improve the commit messages and add Fixes tag as suggested by Ilpo. --- drivers/tty/serial/fsl_lpuart.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index dbf8cccea105..a6f7b056d57b 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1775,6 +1775,7 @@ static void lpuart32_shutdown(struct uart_port *port) UARTCTRL_TIE | UARTCTRL_TCIE | UARTCTRL_RIE | UARTCTRL_LOOPS); lpuart32_write(port, temp, UARTCTRL); + lpuart32_write(port, 0, UARTMODIR); spin_unlock_irqrestore(&port->lock, flags); From patchwork Thu Nov 10 08:17:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sherry Sun X-Patchwork-Id: 18009 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp16070wru; Thu, 10 Nov 2022 00:21:11 -0800 (PST) X-Google-Smtp-Source: AA0mqf5CSv9j0z8tmQotjzAqDtUEvmS4T4Ww8k4R8NRWEiEB96UIp3rrY1YwaBzq08NwjPS/BEUw X-Received: by 2002:a17:906:359a:b0:7ae:9bc0:b94d with SMTP id o26-20020a170906359a00b007ae9bc0b94dmr3434842ejb.447.1668068471372; Thu, 10 Nov 2022 00:21:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668068471; cv=pass; d=google.com; s=arc-20160816; b=sBFuDBuClb1KPoaW9PtQgnr5iNTs1tdyLYrQN5Vl0FmyDlWsWoACOTa0vk/lfDUgix OAA6ZlLtGnJOICfmktDh2U4e2g0ob9VUbHtxdU8MKX0WBhU5nhwqtohPNHJxoj/D7wqy U2UU03T5UZzxCjPa0PAIidPZUfqY2Gkn/s+ym3Bv7yzaP6ig3k5QQWjA9xkxPvqTxEje zHmkq8e7iy1rU1ULMncLBbS62GSEcK5t35YoIZzdXA5FeYxBX47k4857wlDPH3hwoCT3 9DqeKKlHN2P8SDVXxCAgnpwjSDwvB5TwsUIVzaE3eEYLbzya4Iy79FuJ96vYwn1WtKps k+pQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=4b1Y2EtQ2iAPh+mxExuyLOBHsj0n9gfMEGVN1y2L238=; b=ofMFaC9X6v5kyeJgn4piVbZPfmD6kU9wsfXwZmjon1SW+N4tZvMNPkhnvl9bDGJ00E Z32JPxmzQDV5O63mu4RmGt+bs2OMk90+x+UfFldwsrJ6ZJGRQqp59T3o8DgLFtlcO56N lNkjl/jxgOALrOw36izfA709WE/2Fp4wJDIgvSBsuVEWFFH1xu4reBv/JPnmzH9xh2NB xJAXMGdLmRncO5o66EqLWDL5SO26nkbnR+36afI3uTTmzQMK57UI8Mvm2kPAWJ0MBeS4 YDyRw3Lq+2+2kIym5QTQ72IYouqLv/4CivRRmTjTsbasUAbj0q/58XLu0OahdLU+tC3p ICEg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=FMfNT7sK; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h18-20020aa7c612000000b00458cd6f8506si15483710edq.173.2022.11.10.00.20.47; Thu, 10 Nov 2022 00:21:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=FMfNT7sK; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232762AbiKJIUM (ORCPT + 99 others); Thu, 10 Nov 2022 03:20:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232924AbiKJITq (ORCPT ); Thu, 10 Nov 2022 03:19:46 -0500 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20077.outbound.protection.outlook.com [40.107.2.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADD3B184; Thu, 10 Nov 2022 00:19:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kzGg2HBlficf2FnJvSxnWmjYHY3NxtlBA+ci4xuGNArUi+GiaoBJVqTfzSTOttCf4/tET7SbYPLnxx29Q7Mtt5cfPXWWc9SdmoOEOqM/mQAbwo7Mop7EcRHjBnnbgeNh2vh8+iWfLsYrc5eoEOrrT4dxzFykB9GgyjPlttyjwAvABhGzNdN48vgBva7Seg9vcXV62hanX1GDjj1LxQHH6IfSq95J2qKAW1L4AvnNg0gEzSze2Oyxxgl468i+st9Shms8w/0PIkOyXG8A/G114+n1AZKe83/dt5kIpzU6tEVpSPZcm033RZ2Ou/WUxiCxwR3hlz5pv6PHNxPtgELy8Q== 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=4b1Y2EtQ2iAPh+mxExuyLOBHsj0n9gfMEGVN1y2L238=; b=nCYDMxPqzqGworexcjWEC4pVvYNgG5FRfre8Z0EJR43hpW1gx3k6RprhE60JnHPdMxocFXC3JrWQkH0QiBI+cZAUA4v7V6MQzIxBslsONiuwiISAyxExJOzpLx92/1U90YbDLh+KEeYfpn3JubY/AdwlfLcNzyLDHOvrviocWbLcqISbJZl6grSWkDpMm1Vlqd+SEe93iRfoEzzBoyYhoh904vbP1JFTVXjj9IJuXFul1ALyDNF6SX79QdRLRX4fTxDvfx43RMjOxqbTv/ec4XRkDbWzsCFgnoU2JaygR2jjgKtTmlAKKom9r7l0am82J6fc7Hpj7ITqP9EBgaSRjg== 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=4b1Y2EtQ2iAPh+mxExuyLOBHsj0n9gfMEGVN1y2L238=; b=FMfNT7sKpheeU+2wJO4y2PHRSQKI5C2hYItg4bwQUjCXsJGVvvgzdgcZ0nlBuGALH5a/9lHGntSb5EoN0eTLiIFclkM1aUDQh8qYHy+WKyaA+N6CSuj91e4fEogYHAhddmD/xXyib1yttRSmRRYrhDj+du8qmW+kAV5gV/c7he0= 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 AS8PR04MB8916.eurprd04.prod.outlook.com (2603:10a6:20b:42f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.24; Thu, 10 Nov 2022 08:19:39 +0000 Received: from AS8PR04MB8404.eurprd04.prod.outlook.com ([fe80::71f1:f7bb:5039:e55d]) by AS8PR04MB8404.eurprd04.prod.outlook.com ([fe80::71f1:f7bb:5039:e55d%3]) with mapi id 15.20.5791.027; Thu, 10 Nov 2022 08:19:39 +0000 From: Sherry Sun To: gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: michael@walle.cc, jingchang.lu@freescale.com, tomonori.sakita@sord.co.jp, atsushi.nemoto@sord.co.jp, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH V2 4/5] tty: serial: fsl_lpuart: disable Rx/Tx DMA in lpuart32_shutdown() Date: Thu, 10 Nov 2022 16:17:27 +0800 Message-Id: <20221110081728.10172-5-sherry.sun@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221110081728.10172-1-sherry.sun@nxp.com> References: <20221110081728.10172-1-sherry.sun@nxp.com> X-ClientProxiedBy: SI2PR02CA0022.apcprd02.prod.outlook.com (2603:1096:4:195::23) To AS8PR04MB8404.eurprd04.prod.outlook.com (2603:10a6:20b:3f8::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8404:EE_|AS8PR04MB8916:EE_ X-MS-Office365-Filtering-Correlation-Id: cf058292-f10e-47bf-c8e8-08dac2f44f67 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jXtlI2wg/0XOeBWBKlfxDeOSnM2q+nQo5GObqF+tG5IlXUkRXXEUVYZRXnhnmb87XxWSnY+ISYHMkAQMxd9b3j9ljcK8FChXc3WxEGykoHCf0SxxKp9SkVKhZU1tdmVZ7b5pi7J73cePcC6Iv5gNlGxMJV01jKI4JKD8zNz5JYIrOVZJ4541xZ2lVzy8n6Lrnp5XCh8k1hfLqYaRHuy8NtWlwFZDAT7SOVuHsxebXV30iAhJi/64SncBNb9w5ToxcFv8vM891CW3+P+PJ0w+0l9fc4FGDO0Gqx3Wi/Qu2aW72m2536Kwj8Oh/fPz7TnVIzEdUIBG87y9h1PGEqvmOgGlwJYtIHBG6+U0oBWy1CPNtOCkjpgdI2VUFmGrxuXeqTk9IAxRV8yJh3M0DL0hy1d+LOpFJ+fJhhwl9VejPJZh8NLp2VncYskvL45Mrf/pR9yAkI4oe4ikf7oFq6jWiOfy5Cpmz/Hm489wT7RR9HMscy+IzHu1r9AB/9gquTBdKm4RZ/XsDaRfJgZ5mRxYhRO33C3g1nEUJISpEc8zz9SJeHCc854KWssRL++9wwpUEwWj0UsxorSvdCuTLtFv0pRI9kc8SRSx2uLXHfoNUxYIhA6TKX44nRTE5TMHA02CSzDChTsWJgxNIL/Xl34nrYvBQCobxcxfyv4U50SbhDwz2JXbQ3VGdF6Zs+M6/2O5kan6o0ugW0rXRIMwLqPkQ9wkCwbeh1HL8aw7r9bFpakDUt++V0jOe5Q2X8W8hfj2qlj1/K0SmcfxnV8G8lEnLw== 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:(13230022)(4636009)(396003)(346002)(366004)(136003)(376002)(39860400002)(451199015)(6506007)(38100700002)(38350700002)(36756003)(86362001)(26005)(2906002)(478600001)(6666004)(186003)(41300700001)(6512007)(316002)(66476007)(6486002)(44832011)(66556008)(83380400001)(66946007)(8936002)(2616005)(1076003)(52116002)(8676002)(5660300002)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hLD4upmXYB3a6iRcnIxQ0O3+Zkb1kgD/37njQosPgJBez7vivlX512kDtER1WPdyruoFiwf99TlNUlMV5LNbR4VxjtoiFjxaJGyV2ra7UJmFs1CU6sbGO8i6ikXI1smjuSWeLzZa8xBTUNPu1Oi6qDi5KkVWwrWXUtEroGq2PQYdiSspXA0fsi7d7DiyfvrBU+KPWwvfaLObJEPv05L1VrtgaT78HV8edX0aPg3CAWyO8rlWl0WjIP9CufVPa1Op1ci26m5Q0+NkHe9XdmOwitD5d/9uE4rEcr/JT/jGnAlqDdV4KQ23KCqXIQGxe98cw/hr1+CId8jqlCBSfxnxkafiFPonAGZVSiMGrrF9GUzVJTHI0Iw0TMPK6DYOCPJ0S2qvbY2N+RArCcSO4iSjkQ+4hH8jVyZqVoqARKhjU9nCbT1sNY2wMbQK62NMf5TkOuGGSIvfQiTfutxAyK4F2dRqauVkx7b8mHu0m8MMQ9MgnuWxwUBjPTy3egzx73xHhSHcJiU1glBGD/kIeuUemTJG8raayEJMU+t4trkMnVNj0Hj6kUWmqZm4x6xuCp9SH7R0u4Si8764GMYjP224FQb55bBxCNrBlkhQgtZ+4BZj3Jor2uXAvZPpOBrcN2ZBv4G5fTjzrHb2JRIqLdqvdrDyrJHAL+gIPuOL4EjYvR7PNNRZYILfy9/OQaaFsgrn2tHKqM7zXadVkOji8ai1C5b/xmGzRG8rUmMW6zGd/5d5yVVaWfL1lE9IIlvlwFHxz1J5IN3jTl6xmqgC3TMZyrfB0NB8rMPsAo05oT9D0NEfcvBXyerWnBM4n0qAxWFWCtcDFND2W+ImA289v6pAhjF/4jU1oP3k0yTdRbX4iWAk61rNZjmPyBt5PgxNU6fowL9CAVNRntAqk0YHRSqCmX/jgpPNhNTrbwmIxUdbcxJtsY0YlT9Qz8clM8OpFbSiMjylaEzs48gIOB84NBRUzcIBXqB8MkhsuYk7UAipm5YBYaA5RoszznzytPwhmt0HbFL4Uk8CF9+A19kw0PWAr1roV9Ehs2ID+0zKhKSGbwslUroCYRmRm3migwAYdXsHcOPtf+KStnoWKVvt+gF4FouGdLnHcjH5ulVTnwNQaRQwsaJWAmKc5d+i3GO1Ga/fH/mqYxOvNgouqc08a9nztMOzQYHj5Ln6V/N3OQ2r3dkJi2uBdalFvfYcoaiirLyT4C0LH7xweq9JuFq2vzNhqK2ecfqFIGV5dGp5DXNKuwFFGu55j5vOAWg/QbRlZACc1lPJSdNpY5nD06KbU67jvGzWrLO2G1y+miNSsGBfFTKUaqlv6cwrrCNLJx/rdM3e9rZgGl6aqDBtqafeUzaAHv6pDaWN8VluvBHAkB919bvV7lMeLHWOvsXyXsQxJPhLu8+xOVddFwAYhwi5ymxiXq1wESYIMoQwuhP2tJYtv71OxHaRSiafiZnxI33oAmb8wOjuUNcuQ58u5wmKgSKQ+mndm5yWh78uRo+YLoG9Mb+D9QA0qhLM883XOv8t+9rK/9dmEpEpEXw/uLWoQHXoqR0O83diLGhCvNYKJwLG7IaNAxfk7ou8XP578nVaJr7m X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf058292-f10e-47bf-c8e8-08dac2f44f67 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8404.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2022 08:19:38.9950 (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: w8otUT0GgzDNZQdYGJyYu7/fHYsbDDEcphAlMx6geJ3CrULfSE/d/R8d5QZrBrTosu8w5EC/kzPmKvN/cjZyVg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8916 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749096565828510673?= X-GMAIL-MSGID: =?utf-8?q?1749096565828510673?= UARTBAUD_RDMAE and UARTBAUD_TDMAE are enabled in lpuart32_startup(), but lpuart32_shutdown() not disable them, only free the dma ring buffer and release the dma channels, so here disable the Rx/Tx DMA first in lpuart32_shutdown(). Fixes: 42b68768e51b ("serial: fsl_lpuart: DMA support for 32-bit variant") Signed-off-by: Sherry Sun --- Changes in V2: 1. Split one patch into four smaller patches to improve the commit messages and add Fixes tag as suggested by Ilpo. --- drivers/tty/serial/fsl_lpuart.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index a6f7b056d57b..c297be11422a 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1769,6 +1769,11 @@ static void lpuart32_shutdown(struct uart_port *port) spin_lock_irqsave(&port->lock, flags); + /* disable Rx/Tx DMA */ + temp = lpuart32_read(port, UARTBAUD); + temp &= ~(UARTBAUD_TDMAE | UARTBAUD_RDMAE); + lpuart32_write(port, temp, UARTBAUD); + /* disable Rx/Tx and interrupts */ temp = lpuart32_read(port, UARTCTRL); temp &= ~(UARTCTRL_TE | UARTCTRL_RE | UARTCTRL_ILIE | From patchwork Thu Nov 10 08:17:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sherry Sun X-Patchwork-Id: 18010 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp16351wru; Thu, 10 Nov 2022 00:21:52 -0800 (PST) X-Google-Smtp-Source: AMsMyM4z711YMAkCCl4sjUxFHzmzq1fp7TB9jjBeaVVJk+STKQ8ai9PBUe2pkyizC/icrjIOZMwA X-Received: by 2002:a50:fc03:0:b0:461:5d8d:5811 with SMTP id i3-20020a50fc03000000b004615d8d5811mr63222329edr.351.1668068512680; Thu, 10 Nov 2022 00:21:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668068512; cv=pass; d=google.com; s=arc-20160816; b=d/KDAsGVF0Kl9ZdNvtzbc1hvWj+G74yHX3paNOwImCu/FKTOCRm+GFD+AJ+0fh2dhh 1w3izsfQYj4ajDNzwej0qcrFoNzzbWqGBsiMiO0Y3Ivl4skqmsZ6x4S5KgG84U0/hoHk gbfGjd0W/Z/tGMhyLPv+E+oClkqMhKRw/UHx/XvEv1PuXU5XTAh7SSq8/AIq8yxzupb2 JHUrrxxnenQvtvQo0JpCEzUk5GsRP7bKRjcLDdizkiV4MriHwCMZ4Eluy//Dw7sJR4uL DQz/TZr07C1WLcjW6DvqwwJa6XZtiPclu2c6uBrevaw4iXELcjT5h1nqDGLtEzj4dh3S Ihqg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=bQXL2N906k3sFWdrlevmLB9Q8PfPWCNhkMThpmZaRek=; b=sQHPFHKAC/uWwgzyDSTyAd0Qqnyb8l9KARhjtL8leZK/0lJ6Q5KZbE8N6Qq5HYKLab V9hogY17mBdAKdjspTiU04SI5Mapq3alp8U2WlELaEn+AWKR5h8cwm4BHPRMBzcLetli 4ckxX1EkTJgdwsFcMMSTcrzBwkWCld/rIQeEmQWx3A1NYdDaWABkQu/on7ZYtEf+MbYX EbtBabHUXz25y59irIIEoH43k2gMoQQIL5sOFJOZbBMmK+4YrOSZxhMVkoXmoxDHFu6/ aQwuqt+fhZF8M3t+yK3gTlObl5XkqgMjoaKb4UveRnk8rMaDcLbLASFAq3w2K//q4M2i 0u5w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=BEStmd7j; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb11-20020a170907960b00b007317274bb0dsi19371136ejc.979.2022.11.10.00.21.29; Thu, 10 Nov 2022 00:21:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=BEStmd7j; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232951AbiKJIUS (ORCPT + 99 others); Thu, 10 Nov 2022 03:20:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232800AbiKJITs (ORCPT ); Thu, 10 Nov 2022 03:19:48 -0500 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80042.outbound.protection.outlook.com [40.107.8.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D1482250A; Thu, 10 Nov 2022 00:19:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZzmJwIfDa27+1xMZFTqpSrGuKvXLE87vCDm7zJQQIQPWg48WH+g8snEQRVc1neUTejlvn/W8VtfmofZx5UQTEbDQ2dJ6KPXUtASZIpzOR+3B3tn57FMMXY/SrLQ6u+Kj2qqsyxg9p3aTWW55uaKC91Xdx+ZgXKOjUuJjKhca3VlnblbACecWweAxLMfIFIEmShnDH4RWOzaW/Hi5hEtEk8Qlt3+jmtLLNX8ABMl45K5rXHBIcIF0Hsx3+0Z4ZLJqNV5eLoNdNZPfn/sDUctCwKRjTJA2apRqvLRjQYoK9P/fmwzQYcrLDyDvLQdU9ND9nL7xTrfk7xHen1EsWGXWBg== 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=bQXL2N906k3sFWdrlevmLB9Q8PfPWCNhkMThpmZaRek=; b=YxqvrCTnlhYkY3i2VFkS5gC5JWW1E3eD0zMsWd30YjWKSUXifzibbKOjgUWQgs6gvSLAK7XGZ8OKWMvxX6cFPHxqn9hH42zEgOkdLrPvNbSdYsT12PLiwzELZJyyWztPSle+OUtWI5xCVUA8oPiV+81VNR5vQycSRuUv84GLBGBSQhhvkPT0cvKPYtzpr2Ti9cWrWZ+0mNBaeDcTB54EsLhIKhQGNYzGmc7xirz7JYsQP0wuWnRrtgWDE5xnb7hd/gZ7KHZbZXtv9hOswU/96R2mrB3E1kwR9WAa4zeeIFAOHnZtzYx3txIZTdQswgfDS+aOoOXoJMo57tfm9BuVpA== 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=bQXL2N906k3sFWdrlevmLB9Q8PfPWCNhkMThpmZaRek=; b=BEStmd7jGcuBQ0gyZrqYZotvIZuOhd4NoXW/4cNgd9j9NOXf0fAveY0vR1U/7pPpXod+U2lOq0OwRyGA8/wKDl9su70HAZDGP0YeIHxXukkmsmyJ+EyH7XNxPZfL2f5eawRgip3ALf4bVChoZVvUZJnb/42Tn83tWfNSWqgXHz0= 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 AM8PR04MB7923.eurprd04.prod.outlook.com (2603:10a6:20b:24b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.22; Thu, 10 Nov 2022 08:19:43 +0000 Received: from AS8PR04MB8404.eurprd04.prod.outlook.com ([fe80::71f1:f7bb:5039:e55d]) by AS8PR04MB8404.eurprd04.prod.outlook.com ([fe80::71f1:f7bb:5039:e55d%3]) with mapi id 15.20.5791.027; Thu, 10 Nov 2022 08:19:43 +0000 From: Sherry Sun To: gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: michael@walle.cc, jingchang.lu@freescale.com, tomonori.sakita@sord.co.jp, atsushi.nemoto@sord.co.jp, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH V2 5/5] tty: serial: fsl_lpuart: clear LPUART Status Register in lpuart32_shutdown() Date: Thu, 10 Nov 2022 16:17:28 +0800 Message-Id: <20221110081728.10172-6-sherry.sun@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221110081728.10172-1-sherry.sun@nxp.com> References: <20221110081728.10172-1-sherry.sun@nxp.com> X-ClientProxiedBy: SI2PR02CA0022.apcprd02.prod.outlook.com (2603:1096:4:195::23) To AS8PR04MB8404.eurprd04.prod.outlook.com (2603:10a6:20b:3f8::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8404:EE_|AM8PR04MB7923:EE_ X-MS-Office365-Filtering-Correlation-Id: ac1aa27e-ab9e-4fbf-56ce-08dac2f451eb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5dxaHll0OG0FcEPAj4XUcQHX2Ow3CC8k3kkE1VBQN9owgNljtta7w1bYuIfYROcnTdU5OdJ01o61vsLAdsOM1PuxdMp5RqzIb/7tMBDa7T7U7nsaueQwztmVCWBZeuF6IOj3/S5h5qYtKG9rrCysVKM9s3YJnY77XtFwfwwVctQfV3TvHqqiJJogtsb4y5ElRLDlaRGzQyU0G8HHjup/9Vl9bmeopPenr5yOL6oLbWWp+f1k/cpzFGwtkLWP1DEdjcUQQ0S252CsBxIB/0n00ctuQYmn7mA0ng7RdOq37F0+TJGFlFX0zQSUO9YGf1YDTmSIv98eaXVNxt+ReaHATcK2H1qbtmLIvTXprf8F0lNWvD2qiHgEYYCpZS68+sxxnm79tiYocFTDZ8AXHKUSIdwR3OAe+inYGa3NMH9scxKy21OPJRvuksDZ7ky2yQXXuvenwRl0BTq1Lps9kGTeCDRdTb2ORbt1vCL1DfaNhYxl9lHp+hY1FyFAX+1mbFZ6e1DIE/d3mpyHa+kcmysZgagGhduqigb64/a2Z8NAjaBZH1TYTrckq6fHLXik8ytg6YKh6Jwo0bDJmjNeuRYmAA3JJ9gxVgdxQiaonnohrb24sUI1wbCF8m+JTzPb8kyaNbwGf1iAzj178u7VnHhBNaUveOYM50303VjJDnJkyYrJbsQYWlhtQPTwjnYm3kvrVG18ohEfXtk2uMlSbOYojvSXiLeVkhVTzONw8WQKP7XhwomnDxYXa+yi4J1o8lTIL4xfHF0CLlxi/N+t5E7EUw== 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:(13230022)(4636009)(366004)(39860400002)(346002)(376002)(396003)(136003)(451199015)(66946007)(4326008)(8936002)(66556008)(66476007)(316002)(8676002)(2616005)(86362001)(44832011)(38350700002)(1076003)(38100700002)(5660300002)(6512007)(41300700001)(6666004)(26005)(2906002)(83380400001)(478600001)(6486002)(6506007)(186003)(52116002)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1g0zNDY6hdxJXBFYIhaDopPkSeN/i4Ch2x2tYstajYw7bLTZmoXQcw6b2Bs+HR+TGpS+DYpwJBVuXNhNljzCzkhFHlUVaHCoBzhaIHqy9taCX6fQhcTYr/NON+5QM4xjbzsQroPnDlsA1jhzFZypeldIjwekvn05Egyx5f0WgcE47TTMPzwWWZ6GZDQEdVXr5WOk3mJL8bJRmlctaBEjWdMBctg8hwEDbib/bHRmPbxDrYwv1kfRDETrrz1OaFHB+nkzBbtqeVYQ2SQ0yAPZYyodbAV9F0WRJvdfTtBwadtKpoV79jIRsFHkYcyrZAAiY4Jr01bUoCkSAYYpYu5rJrxbZy48k4kTGOYTRqRSHKRQEswEECMew/dodC95AxwqAfpetBVCmeKjRvsZ9o6UF21ou7AoIYb93cv93mE39Kyq9/hasr+L+iyh78aj8BKLOzMJHfynTURwWxro22dKnZ6VVj+swE4YAktw74FZqZqoYzHRAY7LX4tmlgT6K+PESli5qEuLnF8dBt1aCtdFRW1jsXrPpGG6Gw+MK+UZJ2QmuFsjgeFA7XYB3TcMIPGCu6VSAQdtnqxfJpLJELQdSXGCiy7SneYBsOE8shWeFpfIm+q8NQ2a2oor3fMB2mpAliTK6eYchR88YTUoV9htUZx586oLQ+y1wmJVqycIkK7agKcdltHop22SBEmCL2Z6PxYwwpECWmzloh3ieeREz45HGW8fqjMm/x79Rv+U0kk32mWuIi6YflOWEkonTDbVmjR8nI+KnCoU2LFAU0h28jXB0ITPlFBaFGuIyzD9v6CEZ6h4uds8yVUjLxfmD9Scv5rb+Fqbrj9xXrtt8Gnnwz0TqL1BPA7FY8mItC/+xJQgLwBMmmNfidSSnbIcq7tbzv0lB0fvYMd9r0jajuJQnWvzayWStiRynfB+E/aLMIx/QbYwDjRG33cbQzNh/A3OkbpPxSldlN8yW5oDnAAyrBKVizBYuYM9vObHr0zxDRehRSbn8fuuBfM24ED82amc8Gojv1GnGKGc1GZX5Q0M3RXKhmGFci0vGjuuuhpcixhOZh6XaeNkgfhtCbTcoLWfmhG0cfHyeCNpSmG3cxeRE6LDs6q6Y6kinrpWwHNgxhv1bwINlS6BBX3XmzHvN9T9yy3qyqLNu3VOmhtzdlsYvtnCQxIrMiTPjgNDe7qvXW1uOIT2+VTptYNjuY0tDIVFP/tlEM76gOyIdVFIv1MBoqWitTVPUndJe8L/6l9o8CNZWXnkp/uwqAb0fnTutpcAAM95APjHQjCR4FT/Vtnojm/5Pe5woYyKSwZpuNPvcgpEjSX25EwsiNvzgotF2wpJTrb0FD1zylHcOZcnKtYCuKRpJuphkZeJkGbczBXSJoSE3/HqnBptGA/8ZdE1Q/aDnn01ZNcCuwX8umoZOdQYlU5QsgIq7lhjfUaG6p/VPWdv4IWTP6btcxByR2wjRuUn3w2QxQpT9J0ialpkecoJvz9sLSxHGnRxR0MBSkDfRU3IWpcJl7pewGfSk3Wx8MZVmN89lODFOk32K0Dd0gQILoXuJM/0jTTpCcUZDZd89SNAqY8XBLvAMY5raMZdCpBl X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac1aa27e-ab9e-4fbf-56ce-08dac2f451eb X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8404.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2022 08:19:43.1188 (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: X6WS36qGXD4QWjswYPTz3Z3XkJmgIfkITtPxGeYR8a0NwNVGmgOPNPJwgiPeqwaSajZV6wzyWF50JzMIyTTwuw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7923 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749096608670837371?= X-GMAIL-MSGID: =?utf-8?q?1749096608670837371?= The LPUART Status Register needs to be cleared when closing the uart port to get a clean environment when reopening the uart. Fixes: 380c966c093e ("tty: serial: fsl_lpuart: add 32-bit register interface support") Signed-off-by: Sherry Sun --- Changes in V2: 1. Split one patch into four smaller patches to improve the commit messages and add Fixes tag as suggested by Ilpo. --- drivers/tty/serial/fsl_lpuart.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index c297be11422a..75162c4784dd 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1769,6 +1769,10 @@ static void lpuart32_shutdown(struct uart_port *port) spin_lock_irqsave(&port->lock, flags); + /* clear statue */ + temp = lpuart32_read(&sport->port, UARTSTAT); + lpuart32_write(&sport->port, temp, UARTSTAT); + /* disable Rx/Tx DMA */ temp = lpuart32_read(port, UARTBAUD); temp &= ~(UARTBAUD_TDMAE | UARTBAUD_RDMAE);