Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1970716rwb; Thu, 29 Sep 2022 04:45:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5rs/sbR/TCiL5EHRjE/YmHHO5N+Pza/1HeRM2QtT09HHdmWAm5wZP/HzVKFzC/SxQsDk2b X-Received: by 2002:a17:907:7e83:b0:782:7c78:3828 with SMTP id qb3-20020a1709077e8300b007827c783828mr2449567ejc.7.1664451957813; Thu, 29 Sep 2022 04:45:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664451957; cv=pass; d=google.com; s=arc-20160816; b=ixc4tcMM51ORKHRDeTfK/2TxbqHexaDDAVk5TnS7kndzQndGStbtDuG9aIb90mG0jv VMJR0t3I+SyYeHezWmvvax0HdQNrjZ/AJDEjQk+J/svo9YR9fNyC06Q2zeq2QYVqpCjE d4U3xnn54qCxRgH09AsJB73Y36IcPVpSPLPYjYvcaWgK0F6zzOagQ3KjXUycywWuksIL LTVrUSBxIr1ECepLvWXhM+UnNpMfo16Y1mMrkY5+lWcw6W/ie0fZqq/v3wc/Of6ZxUSl c+RorTsrzhnhv5e6KCi4M6VfoIkmuJ8w0yFXJ4GzHPBgNLAlaGA0gCkxpMRagYPOIh8G AJYQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=YsHVZxI+ciNn3MhgrSb5mh1MXg1iiv23Jy+J70BTmlg=; b=RYHy9TfA/ptt11CNlqt56Y/zAFyaTZvnIUl+PVLbPWukCuDxdQeAjnHo8PWGxTb3Mw Mq6MyLbbIiAF3KW9NYFEcghJ4cqNB1PePseeRopRcbfp4W3GsjGmCrKh8ZuIOG/ApJ9B RwG/ydIluoiPpO1VqrzJG4Tbqxsg59OzMZfxuYfegE/KULpuE6C1XjMcsEn4FJAxHgPC i+/SrKT6hIvyYUvLffxAbw0cUozRru7U1ioXgXGZ7i5huBZW2/CvuGqguxB2HDYW5ZEP TWZ2idRCDenb9GBqqlzgPPtiZGuoboYzgHHXLR5F2bXeJ+OzNaQXcixHTwFXcZp/6P3t uy+g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=jmVSsaG6; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr29-20020a1709073f9d00b00787aef90ff1si3271118ejc.172.2022.09.29.04.45.30; Thu, 29 Sep 2022 04:45:57 -0700 (PDT) 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=jmVSsaG6; 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 S234683AbiI2LKd (ORCPT + 99 others); Thu, 29 Sep 2022 07:10:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232402AbiI2LK2 (ORCPT ); Thu, 29 Sep 2022 07:10:28 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80084.outbound.protection.outlook.com [40.107.8.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1EC96581C; Thu, 29 Sep 2022 04:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ThpZ2px/wSuAhszs+GCAQD86mHZF1UrgGXqLmx8lHWd9Tqh7dBFRud68kHsY5JlQDY42X6au8heTu+QLcrxlvV4LUhqMfLncnsHFO5K+DIj9LEVPm06HwG0lsRvFR0mnC0PdijjIHDTfXSdPowfqUsmrJIDIuS7kNuEmGFKJPGDlKJUrjecHT239byy241pbv60Ifok+fSzJmxadoN3402e84DKowzVMK3mjtfCm86aetCoG7AdApfZHDcPgFF0R4sR59YNjT+6PB8CprMYKwsW+rDMMmG89sFAPGWVN9zWj+lmvXHyQmcqTR4apMLNfwQpB3QZwLRBRdgr8f0Awng== 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=YsHVZxI+ciNn3MhgrSb5mh1MXg1iiv23Jy+J70BTmlg=; b=DFE4ijmeoql8p69It8EldmutUKZEeBbvwCmeId5e+9Gt0wA9VOpHFGiQ8I0I1FPTIW7kXU2ccFevUPAsqOxyOXNuVMYqWcQDvq/tlnguiqqbV6cICe1ikHTsZ5r3xfXmh/cU4QeMGeX3FWLpe/O9EDtXvWU/4Ag7V+FtZOulsx3IAkC9Xs5SSz+UgozWzTMlsQuGPjcmGHnjueWPKW82QlhDuI+WAXieU72/8260m38/JQIkiOMsK4SschXjx4nOJcOR4cK+I73drBayO3FcAC6kVpUKK1cmA8xs3ARiA6ll8YNjFkyDEQ/0WqeNwxOaBSko4xrsBPWSTiBMaxvASw== 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=YsHVZxI+ciNn3MhgrSb5mh1MXg1iiv23Jy+J70BTmlg=; b=jmVSsaG6BWNGMtDnTpSheejd57zgkglea3IkzPOnXHHCAxblgHmSJ7hTAXezc4b/TP1y8Gj5m4Ny6wKjml38GTid/Lqkb8cLhUCquyS3bM0i/WD1PRli5tXRaRar0dXmsFoEMT+WoAbg2gKkrwP2mhWrsKHn/BIzjkPIzkJfl6U= Received: from AS8PR04MB8404.eurprd04.prod.outlook.com (2603:10a6:20b:3f8::7) by DB9PR04MB9497.eurprd04.prod.outlook.com (2603:10a6:10:361::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17; Thu, 29 Sep 2022 11:10:22 +0000 Received: from AS8PR04MB8404.eurprd04.prod.outlook.com ([fe80::121:6a2a:2d4b:cb8a]) by AS8PR04MB8404.eurprd04.prod.outlook.com ([fe80::121:6a2a:2d4b:cb8a%8]) with mapi id 15.20.5676.017; Thu, 29 Sep 2022 11:10:22 +0000 From: Sherry Sun To: =?iso-8859-1?Q?Ilpo_J=E4rvinen?= CC: Greg Kroah-Hartman , Jiri Slaby , Lukas Wunner , linux-serial , LKML , dl-linux-imx Subject: RE: [PATCH] Revert "serial: fsl_lpuart: Reset prior to registration" Thread-Topic: [PATCH] Revert "serial: fsl_lpuart: Reset prior to registration" Thread-Index: AQHY0+EeaAH9c/DrIUi1YG5YmLZWk632OyYAgAAB3mA= Date: Thu, 29 Sep 2022 11:10:22 +0000 Message-ID: References: <20220929085318.5268-1-sherry.sun@nxp.com> <1265873d-28f9-d39c-5cce-858dbed1e8e8@linux.intel.com> In-Reply-To: <1265873d-28f9-d39c-5cce-858dbed1e8e8@linux.intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AS8PR04MB8404:EE_|DB9PR04MB9497:EE_ x-ms-office365-filtering-correlation-id: eb760671-d11a-4b74-33cd-08daa20b340a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: w5dpelV8dFvlnXOY6d83hYgq1msfh7552Xuny1W8LNHpGHDj9hbW0qrt+xRY79V7id6Gzxsf/xzWs+mXRWv8e8WKmQMxNb/FTfr7kozqjXxCEmAbSJDakBA3oZMHDznE9dz1ox2Iuug3a6SfJf9j2oKbe49dG8Fo5eRZb4D8A0x80C+kwSqAOJeVRMWTtozOGvUQ1N79Da7XgUYWJXKGr6J+l9bnH7DEyW7knz5bnJhbB1cU5vsxPF37v/y8jrhEzroYC0Mj9ULL3FeCnb9sdoXbU4eptahtYwlQLZ/F1BZOKBDYqDZqhWAXn/jgLCPTk3USoN+zqqP+5Z2nD1tjGbypizEzraNhV9lOtSegz+QK1ZxSuBgCmfYVL5Ex4vZURpMjlLOooJnj2eajMFlfcZP/XxyMB7+Kzm02pQ8iDV5TiaBvareb094moxfaofo9S3mSiga+dYssC74FRilsDNKB38Jg1jYaSO4RWf0/y023pyebU0SiQb8vWaAsiDhlx0sC4gEzIt+eu10aR63+cWcvYuJic4lWG0Lwvkmfu+htp3JHQTFKtrCi4yNA9QtLqWrKnPPvv1aCjkb2PbSma6LtSW1lI4cQPxpS0ZA6BEPYCOWoKx5UjeW9HjZH82c12qSKSE6unVNIfJKCDfH3wTMdR6lA36A5nQ/GZXGiYju0yi1LQ9kUye0TBbweDeES8YJXMtjA4NDj8F+k+3dLaZVkv5mZZSuMXQ8N4cCyir/f4dyPwlFcJsZRp3V6PwFzZt4Vqd361CpiRO7gujo7Yw== 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)(376002)(366004)(346002)(136003)(396003)(39860400002)(451199015)(71200400001)(2906002)(66446008)(6506007)(7696005)(54906003)(83380400001)(478600001)(38070700005)(38100700002)(33656002)(316002)(122000001)(66946007)(8676002)(76116006)(64756008)(4326008)(66556008)(41300700001)(86362001)(44832011)(55016003)(8936002)(52536014)(6916009)(5660300002)(186003)(66476007)(9686003)(26005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?e+qkrp8mQFXKXZbv3gM6nbswNJJ9vFp25qdpWmL+ADs0y4aRieUxfZChly?= =?iso-8859-1?Q?aBJR2QykQ0MVkwj06AbRD3/NbHZuHQHNl2Pg3myCfUtfM8wmc31IcPlcDg?= =?iso-8859-1?Q?Psdvxw53eoqx3nQT99L9wl3V17TsElHa/4YSE/b9kM5FQ/aj0PHXj57g4d?= =?iso-8859-1?Q?o2sxTE5yvrcguA2Q9RTdfEmivwneBwBLSGKH1IVqnp2LPRVRgf6AuVp2m8?= =?iso-8859-1?Q?H2MkrdYXYKbgDhDNMdlsRVo/Qi8Tpk6lJnEeLn7sGbUHJm0bvfYkUgM7Ij?= =?iso-8859-1?Q?cp0i3dl7eTLLYwdm7j4gHvUhzgbuxCIhPw8jfKjoIylmkMg7uoKQtqdZl5?= =?iso-8859-1?Q?idRUxJlU+aKcpq+hy9mF8PcQjIrJMM62INhexfiJQEpds2FCYpG0n/amYc?= =?iso-8859-1?Q?FwkeciKYzRbXZQXNIdejvjca8CEC0AD19FhRyUPyKlJbKkpEX8AiYle0n8?= =?iso-8859-1?Q?ft+TcOrvhCNJBA6hmaLBg3AFiJs78qA3vz8uw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HCiIxumVtufmirVw+jDPO1WxUecTd1tGxdkNY1eRtl3MjqW/o?= =?iso-8859-1?Q?cXSk69FwP85QF1aLOkPHEstmN71BVnbs7V2zm6Ynu47OYCTew3mdBv11yd?= =?iso-8859-1?Q?pU2+TG87wczC42kYAB41GW/SQP1pfX1J0RVSHgyi19T5qD/Dp1Q+S5IuBo?= =?iso-8859-1?Q?Mb1bHO5/wRhxDmaRBuAORG0fTschCA4bqWxhPyGMjIWCp+RA+skgnPgtK3?= =?iso-8859-1?Q?WVNi/OQxjqJvsPnkLx+SICWzXDsKlR9Rg9?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8404.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: eb760671-d11a-4b74-33cd-08daa20b340a X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Sep 2022 11:10:22.7457 (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: a7+pMj380yTOLb617siI+x0HoPtlj1YODk/Ox0FRtDdppGswzoJmUVyXoUDji4EgmhnvIPkeRODSHJY/exmBpA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9497 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 >=20 > > This reverts commit 60f361722ad2ae5ee667d0b0545d40c42f754daf. > > > > commit 60f361722ad2 ("serial: fsl_lpuart: Reset prior to > > registration") causes the lpuart console cannot work any more. Since > > the console is registered in the uart_add_one_port(), the driver > > cannot identify the console port before call uart_add_one_port(), > > which causes all the uart ports including the console port will be glob= al > reset. > > So need to revert this patch to avoid breaking the lpuart console. > > > > Signed-off-by: Sherry Sun > > --- > > drivers/tty/serial/fsl_lpuart.c | 10 +++++----- > > 1 file changed, 5 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/tty/serial/fsl_lpuart.c > > b/drivers/tty/serial/fsl_lpuart.c index 67fa113f77d4..7da46557fcb3 > > 100644 > > --- a/drivers/tty/serial/fsl_lpuart.c > > +++ b/drivers/tty/serial/fsl_lpuart.c > > @@ -2722,10 +2722,6 @@ static int lpuart_probe(struct platform_device > *pdev) > > handler =3D lpuart_int; > > } > > > > - ret =3D lpuart_global_reset(sport); > > - if (ret) > > - goto failed_reset; > > - >=20 > So the problem with this being so early is uart_console() in > lpuart_global_reset() that doesn't detect a console because sport->cons i= s > not yet assigned? Couldn't that be worked around differently? >=20 > Or is there something else in addition to that I'm missing? >=20 Hi Ilpo, Yes, the root cause of the console cannot work after apply the commit 60f36= 1722ad2 ("serial: fsl_lpuart: Reset prior to registration") is lpuart_globa= l_reset() cannot identify the console port, so reset all uart ports. Actually I've been thinking about any other workaround all afternoon, seems= no other good options to me till now. And after a further check, I think t= he original patch is not needed, as uart_add_one_port() won't open the tty = device, it should be safe to global reset the non-console ports after uart_= add_one_port(). Best Regards Sherry