From patchwork Sat Dec 9 12:58:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 752452 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=kunbus.com header.i=@kunbus.com header.b="qksT3Z4z" Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2043.outbound.protection.outlook.com [40.107.7.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3BD41710; Sat, 9 Dec 2023 04:59:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ijlLalFUnd58B664TWlflMLEeLslyOH3d3otA/GuOO1LADVYwdJzpK/ThsU+KLCkh3bja++zbnbJOpqej2Bxf2AzJ/8LVBoZGm4RbGHgPl/C7TzUYWGIHH61LkImFxxeaUE+UDEU7cZBL/DqBHV45ASPo0IA6nb+BdHK6KvgdwwWPo/2m6BrTqJBfzRG+GrzvwqGRLllej+1SoC/mIUCg7WjPigjWmTFx7mP/9NbPuzqSX8J6n7dyiugDlB5ozAR+k1f2+voF2prT5Sv384h0+OlIz9mL+YEEU3qgj2zeRXOw2pEa4cYhhXx7ggmodC6VhAlVpJb0HL+4+NuSpOOuQ== 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=TugaFAE9ED7qPyWXPcQlfTlWcweypeRjV3wLXu4rj4LImE5CCYxWrRPpFnsbUglVolx1zxQt3C6WtTWA1I4dW6OssYXW0m9kHGTFr3Qs1CZ0k1EfjtHXmcZrwhdN5Hg6A8qSloWufIotdJBKaNDeYE+Hw7/wOaKOdKXt8e4UWW9RBoUh9YNIyzRhLfVFsQIfHSGzhhhUFEELmWunBXzNqlGPt5Em8XgzeHzUHJcqIre9sY9c3QX0fKKOYVVEZinaqxjBv32/uppGOM+EF1cwkep4OoJomBDYZVWnqEIttwEOjqYvyLI7FZURhCKVdo79EiLSSbOuYNAsLy6zd0+XGw== 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=qksT3Z4zN12YlmRmem2YRYEX1joJ5sDCl3xYn5KebEQdLop1ztYk7fCfWeOwFiKuyzBydh8fgkCfOM3bK9Jbq1AX67OyvXwY2Yckp5HAha2y66MsslKj5Q5fIqPtMDAEw4y3WtTuoi0SCeHTwMwd4PQdTqtuEiAWahjhhEoNu1M= 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 PR3P193MB0555.EURP193.PROD.OUTLOOK.COM (2603:10a6:102:31::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.29; Sat, 9 Dec 2023 12:59:20 +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.7068.029; Sat, 9 Dec 2023 12:59:20 +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, hugo@hugovil.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: [PATCH v5 6/7] serial: omap: do not override settings for RS485 support Date: Sat, 9 Dec 2023 13:58:35 +0100 Message-ID: <20231209125836.16294-7-l.sanfilippo@kunbus.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231209125836.16294-1-l.sanfilippo@kunbus.com> References: <20231209125836.16294-1-l.sanfilippo@kunbus.com> X-ClientProxiedBy: FR3P281CA0070.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4b::22) To VI1P193MB0413.EURP193.PROD.OUTLOOK.COM (2603:10a6:803:4e::14) Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1P193MB0413:EE_|PR3P193MB0555:EE_ X-MS-Office365-Filtering-Correlation-Id: 4b92f7cf-e711-4323-3316-08dbf8b6a8a6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uocdsEkqgHqFuSPW9Db0ig8290u2cJsSeIQ8+MdrJlNedicYd4ofc+vS+sHO9w5hlubaXkLiBEIM99yOCkKQbsYBGdesGqoWfZW2J2PCU1GLtpyQAmDeiGKpNV6XyXF1PKsmHqav3+pu3n/wBBhL199VtacrAZ6ofdLPBy7JarejIr55TatDv+Ai29dT311fwGn6XVvyadXwB4+f3mRS7IOml04l+bukE/QaJ9NoiRAJqkor0ofyncXHiC71UvLfGQCpNFsY9MXhyEJk/gCbCk7SbO0iJ/pTqon86oL+L5DRV8C2PZSKjXuyW9Wr1SUnMA2F+jKs4s+pa5CALCrix1YANjm2hwZKasb1vLMl2yL/AYidlKhEQwCE6s4ii3BqsWBBIIFM20Q7n8fPgHjKA50xjEqmzaSLbRGdwUalaAphcCRgnSX0/4+XvBWkshcqIEsvZ3kmoLl+K0WkNOlx6RD23rWMlbnBI0bITK7yBVlljvEL4yNrZBre+v0aW5dCef/TYhdY6usjmn8aK4w+NmpxE17T5ybG37wc8E1JWG1Acv+V7qwWEZyFKMi8Xd/+ 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)(39830400003)(366004)(376002)(396003)(346002)(136003)(230922051799003)(186009)(1800799012)(64100799003)(451199024)(2616005)(1076003)(478600001)(6506007)(6666004)(52116002)(6512007)(41300700001)(83380400001)(5660300002)(2906002)(4326008)(8676002)(8936002)(7416002)(6486002)(66946007)(316002)(66476007)(66556008)(38100700002)(86362001)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jBF3AoWOhWizXLv9eydv7WNO1zPuQVG12NhpoN3RyxWyKCH3WraxafTSnOw7D5wz+tKhwCHbDWALIaqCripH0IirovHsRrgW8ZJ+CLElo7u9d7vVvad7qfTnIzmL3+bUtwt/Bg4nAKZRBYcbq/yWzm2Fq6qkTNjmG7j/E5JLfmujdAjBSSPy9yVnYYDMK8qpuApr8HqLA1o77AtzToyZPtoYfeGYBjj7Ox3sTrs8zHzupJYE/BfesAITyc7y0tGsB6zflNyQT8UAdeWAnTZUQyk9il9CKl6kKz4TkwhPlmzZ7OsrTwcO2Enkx9mmCWeMBm3hYRQpGM5QaTDjYt4tyUZTD2oRhu6h6NZi5xF3LULFf1X8GcvLF+RZaWCc18RM7ARLpUVy4RtfEN9Pj4vagXL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gCCbN0g/1nfqJuyDWwJCG/zSA7YyJwoTJKlCvmwbljW9WglvrD3/IuTNEA6W96RF/m9MKBOE5RFiusRPisXMlJCMzIEQDYih+RYpV/8UfOkzQsCDdULCQLc0LudCZ8ctIN/YBySkSo2B9tBBKJtbLCNOvQV/qaT5d8DaiedLzjB X-OriginatorOrg: kunbus.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b92f7cf-e711-4323-3316-08dbf8b6a8a6 X-MS-Exchange-CrossTenant-AuthSource: VI1P193MB0413.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2023 12:59:20.1656 (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: p0C5MMCwIzJn5shFRgodHEu4/CkWsEMAgQyEPFNOdeHMsaKrSzYmgNQwozv/tZsd5d4fmpV7RKHEPUgB2wLvzw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3P193MB0555 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);