From patchwork Sun Nov 19 11:28:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 166785 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp1604607vqn; Sun, 19 Nov 2023 03:33:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IGuo69+R/pHIt6pDlrtkL+ObOXRzt7oXyNaMfyDbl/nMoK8fkiw6Y5XdJFTtpeveTIeYvKw X-Received: by 2002:a17:90b:1bcc:b0:27d:75f2:a3ee with SMTP id oa12-20020a17090b1bcc00b0027d75f2a3eemr2699823pjb.10.1700393636677; Sun, 19 Nov 2023 03:33:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700393636; cv=pass; d=google.com; s=arc-20160816; b=b1P7cVyqPMNtW2ZECRY/RoMbCuHP5SLLigf1edEnCuDc/MYYXxb5PEu+XwBHdhmWm+ c14jtzBc1ZP4GHU77n47oAAtevkgeVHT+4qroWei3573CaSyskAXMgoQRRXva5clyZHM /cjlIKqdl4srnE0HQv+9H2823WRqiOxtVsxnoI8XlSoSuNLbOBiV2pI0rwqhksPiddK0 JfTdxKNIHkRbr2zLd3WI6r8cBmaTdpZY9VUX2ASRuGhC2UL3mVOXwklq01vtnzUQLzVI 7Puny69FukxvOIA3NmyEELM+T3VrrlQw1Pbc4e1iSCHoW9lBOL6D+eBqZeuE8gGXhbyb dXCg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9sRBm8gY2tDiUYzcClFGE54s4heCXu5xxHjSH1pF67Q=; fh=TkiyChPg6bbF3HR9T06bpNLcepPHbldn/GrIZCqgMvI=; b=f3PSQK2fqcOi+E3VqVXzfdRgL2iyqI3dSlremZ1/ZNZEur69V3uNGlSjv6WdLPYID4 vAeWW/hhLXz7hq+8+xW4PgobVKllPsn/tl1q6ts3xWcyESRwfp15zLU7EzE2fDtGuv2A BBXYZCY333rk30z0l21Wxd1eekBCdsGvBTfZTI45KokLjR7JGzVnP4213nZGVVvPFnmm nOqfqR2a+qfUtBNqPNYXT+JZHeX9rWpARYf1DfPGMw84DBZVmZUvKwI1rm356EZIyOkg 7ezRbLpNUsCbBpNN2IATglSefJoDBvL6MDcTd0RExPk12RXTV/nPQik+8m3i1lKAnqK3 LVlA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kunbus.com header.s=selector1 header.b=XofNqO6P; arc=pass (i=1 spf=pass spfdomain=kunbus.com dkim=pass dkdomain=kunbus.com dmarc=pass fromdomain=kunbus.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kunbus.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id sr8-20020a17090b4e8800b002809a033855si6173553pjb.157.2023.11.19.03.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 03:33:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kunbus.com header.s=selector1 header.b=XofNqO6P; arc=pass (i=1 spf=pass spfdomain=kunbus.com dkim=pass dkdomain=kunbus.com dmarc=pass fromdomain=kunbus.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kunbus.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A14E5802CFEF; Sun, 19 Nov 2023 03:33:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232131AbjKSLdx (ORCPT + 99 others); Sun, 19 Nov 2023 06:33:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231233AbjKSLdf (ORCPT ); Sun, 19 Nov 2023 06:33:35 -0500 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2064.outbound.protection.outlook.com [40.107.104.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67B4A171C; Sun, 19 Nov 2023 03:31:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rp2xRMGjs/OAEPIR4iZshHe4TRW1v14fvnVa9Rsaftbh7ft4DlNWpT8YZsdGAFZD2uYNc0YYiY2E7TVpT1bnfEMclvteirYUivhWBGaGOHBVvZeVH2X6o3ZmsGJw3iOOAWM3+RsMAjwrQsFw0LpmFcEOgVU56ytTrJtS5KE+Tu0WE1R4xQ5WvjZkGpesU931H2D1PW0Lq/ohsrSyK5uUqjiUz+iR0BZJnT7SETMF4IXNWFgtFwGiyS9cOV5vQvTFH6S2YGb8STbrcGhPDlWBGG9p35gs/x68/xNKSqy1pa8zUJlwxaCEqc6KCFzdvMj/PoZabOM3srKHCbe+YOsH2g== 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=9sRBm8gY2tDiUYzcClFGE54s4heCXu5xxHjSH1pF67Q=; b=AZ7Ag5nRr0tyLckH38dbkBC1J+I61gvA34zjA0LoeTXeTw0k98d6cb5tLFpov+RWhsGvxLDUc0TU4ArQJd1u7WcCwbylvr8yDeqt3+iztiJfTf4tsGVq4BvsL/eI4WKKmx1y/FXdmtg2z8CW3u1S1FsgSQo3hmqDKNPBmQHIMmx4mTP4I5sd0jYkb1H5CyOyMu2V4dE4u2pLagtFioVw/ElOdZ/V+rVwAzbslhgswqp0sbvZae97Bve5fZf00S/K8sc74UR7anwMshYZOq2+WmOplCTJbARExHLLB30k52pRXBGPxXgcMgqtIxws9e/B3UzNmTAGyiHZANr2MKgfLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=kunbus.com; dmarc=pass action=none header.from=kunbus.com; dkim=pass header.d=kunbus.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kunbus.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9sRBm8gY2tDiUYzcClFGE54s4heCXu5xxHjSH1pF67Q=; b=XofNqO6PcCF4MmU/CFqn9rx8fA2Z9aHxirsgAb/NJqOt/9Zy1L9S5uTO78yibqKE8Bp0K+mePZoolzFeky2DjI+U+1tis791TT6UaoFQr8wY4Nd3Cc/kujLlVNJuCSBi+S7m7EyENmjzUqiL6t7wy6FS85s/dO/cH8Z6yviCaJk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=kunbus.com; Received: from VI1P193MB0413.EURP193.PROD.OUTLOOK.COM (2603:10a6:803:4e::14) by AM8P193MB1060.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:1e5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.26; Sun, 19 Nov 2023 11:30:02 +0000 Received: from VI1P193MB0413.EURP193.PROD.OUTLOOK.COM ([fe80::653f:d0f3:e7f6:8c06]) by VI1P193MB0413.EURP193.PROD.OUTLOOK.COM ([fe80::653f:d0f3:e7f6:8c06%5]) with mapi id 15.20.7002.025; Sun, 19 Nov 2023 11:30:02 +0000 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org, ilpo.jarvinen@linux.intel.com Cc: u.kleine-koenig@pengutronix.de, shawnguo@kernel.org, s.hauer@pengutronix.de, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, cniedermaier@dh-electronics.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, LinoSanfilippo@gmx.de, lukas@wunner.de, p.rosenberger@kunbus.com, Lino Sanfilippo , stable@vger.kernel.org Subject: [RESEND PATCH v4 6/7] serial: omap: do not override settings for RS485 support Date: Sun, 19 Nov 2023 12:28:54 +0100 Message-ID: <20231119112856.11587-7-l.sanfilippo@kunbus.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231119112856.11587-1-l.sanfilippo@kunbus.com> References: <20231119112856.11587-1-l.sanfilippo@kunbus.com> X-ClientProxiedBy: FR5P281CA0007.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:f2::17) To VI1P193MB0413.EURP193.PROD.OUTLOOK.COM (2603:10a6:803:4e::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1P193MB0413:EE_|AM8P193MB1060:EE_ X-MS-Office365-Filtering-Correlation-Id: ad1d9d0e-d8b0-438a-fea6-08dbe8f2ded8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Sx2pcj8IhFGyLLrJ93U04KCqNpFpRn6F9CjOfv60TqM00A5aLN0cDERetSZrdsPcreArJX3XPOZVx5TC3V2otFjhGZ5eaHNQMpNjWsZXW8SiaaIxsmsJxcd6gTGTqE+DTCvCRn0C57TVRRa2/z+Cie5bko5QpdqPzcPMLBZYMYsoUO62OMxG3KdilArTWrH+Fj6Nl7xNE1hGX8ZoPN9pm1rPgQxU7sUdhF4/5K7g+w265iSQvGbj0EgjJoyNRWEhOtkwtlX4BDB6Dff69vRZuoi7YUvSAp443bzOyh5xDhHTXKOArO3ZC0y/moJ8fCfDmki+L5SL5tAcXImbk1bPDA/3C9I+Tij1nerjeCocYokdGksrYqJuJCLftjsi7GWphzl8ZMEmjsb4W2Sfw8wb7b4wJIYj/WcVxKd81TxMM+v6oKDgret/DZXbBTivxFNHEFDEHtxeqDZvgzP5kNuDz246P/LtHirH4L8CgyC3Cv6264ghiZZ9rksryXftLohY+dmcZM//8teGmKWvGx4j9wHyIIK3N1oarZ4VbRNhZ4OYhy8GBeZPVHAEWxYCh02n X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1P193MB0413.EURP193.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(346002)(136003)(396003)(366004)(39830400003)(376002)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(6506007)(6512007)(52116002)(66946007)(66556008)(316002)(4326008)(8676002)(8936002)(66476007)(6486002)(478600001)(83380400001)(1076003)(2616005)(38100700002)(6666004)(5660300002)(7416002)(2906002)(86362001)(41300700001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tJfAXPFQ9frJgoDsfZKkDxUsfRSudgM6Vyl9ML77X0M1Sm/+8x8G2sEwzdpBF5t3NmfDe3GRvjYnwK3KqxFyOii57nI8HT5EDn7q4QMv0NCMOfmtmYhujwx9J1sBxeuABLp1wef78K41Nw+YqEFfJf+Ej2lzxidaX7hY3HSzywgo44UvZbmo8SPGq9Xt6lB6rDxBbW44KWxdgtreBa2weTt5gwpc6+6+tZmrIuUeFqCtBXLON2Vu3+sHTP8Nf3mFTIVWjr5ONWVljoJOlyiQPmalSyJMaAdN/7lU+4zp+dSK3CVTApEFFkXCP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cA614G5y9N8mrhTKAoDimgBfIqbedFzXfYd48luN0gFBx1hN4cSwnuopX/R7aVKCz/cHD8530Doxk8/NKICfYcFVql7Ibkud3AJYoqIefciYmpgh4vNKq+9NOD1VEWV/jcbSpuW10mgz04OqMYc3jgyZM7y8fWqEPTzt0OxfHyGHjWLgzQtdEEt3qS+IyYQCIwXAH7vNVmUE1gPVykmiA5xDG7SpfDm9vCMx6bW6JjAptFKgNA8O1s2VXy7YOMgMOJmvTW7 X-OriginatorOrg: kunbus.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad1d9d0e-d8b0-438a-fea6-08dbe8f2ded8 X-MS-Exchange-CrossTenant-AuthSource: VI1P193MB0413.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2023 11:30:02.3019 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: aaa4d814-e659-4b0a-9698-1c671f11520b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /Wshz98cV/eg2kskAUluFsjLgwjQEN6fLYnzTLdTFXIVdHr407mDbSZEhGSY/8rLo6Mzdk93h9e3WBES0k7Bhw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8P193MB1060 X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MIME_BASE64_TEXT, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 19 Nov 2023 03:33:55 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782991957726809089 X-GMAIL-MSGID: 1782991957726809089 In serial_omap_rs485() RS485 support may be deactivated due to a missing RTS GPIO. This is done by nullifying the ports rs485_supported struct. After that however the serial_omap_rs485_supported struct is assigned to the same structure unconditionally, which results in an unintended reactivation of RS485 support. Fix this by callling serial_omap_rs485() after the assignment of rs485_supported. Fixes: e2752ae3cfc9 ("serial: omap: Disallow RS-485 if rts-gpio is not specified") Cc: stable@vger.kernel.org Signed-off-by: Lino Sanfilippo --- drivers/tty/serial/omap-serial.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index ad4c1c5d0a7f..d9b2936308c4 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1604,10 +1604,6 @@ static int serial_omap_probe(struct platform_device *pdev) dev_info(up->port.dev, "no wakeirq for uart%d\n", up->port.line); - ret = serial_omap_probe_rs485(up, &pdev->dev); - if (ret < 0) - goto err_rs485; - sprintf(up->name, "OMAP UART%d", up->port.line); up->port.mapbase = mem->start; up->port.membase = base; @@ -1622,6 +1618,10 @@ static int serial_omap_probe(struct platform_device *pdev) DEFAULT_CLK_SPEED); } + ret = serial_omap_probe_rs485(up, &pdev->dev); + if (ret < 0) + goto err_rs485; + up->latency = PM_QOS_CPU_LATENCY_DEFAULT_VALUE; up->calc_latency = PM_QOS_CPU_LATENCY_DEFAULT_VALUE; cpu_latency_qos_add_request(&up->pm_qos_request, up->latency);