From patchwork Wed Jan 3 06:18:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 760415 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2081.outbound.protection.outlook.com [40.107.13.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9433F18AEF; Wed, 3 Jan 2024 06:19:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=kunbus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kunbus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=kunbus.com header.i=@kunbus.com header.b="hlRPHxUT" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j/BoAtEo4+jettHSX3QXWeO2bVAO1urqJw+CpulYdsDwZedK5ybV+SM0QvqeHYSsosyo8rgkxMP4kgOYYfBiUkJ4b/abILDGPeZjDL9rOFZdSa1g4H9OHtBne0UrQ+QNVeMQ9eKguJRz9pvYZqeWfpMck5bKcwIyNGKESYBTnSFtrpVa5Ka7c0/svjrbjdbNGW7Flna7tFyIEdphREmJ+5Gkmzrep/5uMXn48xoGNXuLJrDm0iW2vWEsT1vYRpaga0S6ak8Bptw1s9tCLk6CzuVbaXne07nlNMC+7f9rsyDbtvyS8n5kt3L6Ikxb68YH2MYN6MZ/reHTuvqnEs8vEg== 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=6BcGoe+ESDzoCivkDyl+SvQ6vxiyAUtVpHN4Fyf7TKI=; b=Q11JJE0u/SbCoilMzsMC279WfaNtlEqNoVFNNpeyLJ/8ldhz0Sfq2PEdt1l42cdCCEHIIlKFtt6fTaK29ocIn6yi+5WBNiswZQqH0EAQE6vLh7f2wez/mf4JFtxt8Oblf2JZ3ph/UvC6SJfQBQZlGpGhwDeLkCzXnUkQ3gFhbLEjtnrfQmNMwIEH0sO4i9v3K1Bx4erAzi4oZabjkvNQAjYgzy2q896lmP/85QUhGv05pr2NxYlyhwNtIhJZVqaYt4VDpm8WYwieErT9c0U2T57BgYm5EAxZRslQAl4Ny/2Nj6/ZR+/ZjxnDlutXIlJLS6OTezRsos8cmpHMz7D5/g== 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=6BcGoe+ESDzoCivkDyl+SvQ6vxiyAUtVpHN4Fyf7TKI=; b=hlRPHxUTZXM1jLsUtxbGH6StlAXqbRYeDqgOmCTCGw6Kvy3BSB/KAuOiGyFvNjSA1tFRAoJzJu43Z/OozJ/5VCqF/8qCe87kJVAYcXwpK6fflQsw1dPPHHFI+WREp02C1XKxnF87Mv81F9C4VPa8u9vCdxGAPvZQWMzyR2KnuUA= 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 GV1P193MB2245.EURP193.PROD.OUTLOOK.COM (2603:10a6:150:2c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.25; Wed, 3 Jan 2024 06:19:14 +0000 Received: from VI1P193MB0413.EURP193.PROD.OUTLOOK.COM ([fe80::67b0:68bf:2582:19cb]) by VI1P193MB0413.EURP193.PROD.OUTLOOK.COM ([fe80::67b0:68bf:2582:19cb%6]) with mapi id 15.20.7159.013; Wed, 3 Jan 2024 06:19:14 +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, m.brock@vanmierlo.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 v7 7/7] serial: 8250_exar: Set missing rs485_supported flag Date: Wed, 3 Jan 2024 07:18:18 +0100 Message-ID: <20240103061818.564-8-l.sanfilippo@kunbus.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103061818.564-1-l.sanfilippo@kunbus.com> References: <20240103061818.564-1-l.sanfilippo@kunbus.com> X-ClientProxiedBy: FR0P281CA0267.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b5::13) 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_|GV1P193MB2245:EE_ X-MS-Office365-Filtering-Correlation-Id: 5442ca88-43cd-41ab-1b81-08dc0c23e881 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i0i10wbcsseClDcPxXTkxp/eOzY6dlwiOAs0k+BQIj8AUmIg2obd0kyrGUMwwjsG31dn5ymS7u68aaoRjGIVb0+MRI9Nk7cbdyLf3wDbxVCxj90w9tmj4GPGToPeYvLFqsYtU6XRw31oC2ShLehceFSe0f3XZiN7t4ywP2qJYVx7u7ubvmVWpDsHpQ90t3AjNPrUDelzColVcHhB6LPKmEdviHa05n+UdKKybHOHW8gZ4JEXoq+JyQXa8Ucba1tTRaxLUKp+0sZfIIhelh2B2790beSH7x5r7Xud7LuaqQefcG+JJp+7UmQ5z5naFBrMQ1VHtNjZFSB2SD3MZU9p9Z+EwVUTMUqlbxiLb2I6Nzx9dG5Y3FALs1tq7hrc04h73uRjQ5ymzg81oLogmX9sJmmTmHjahIzhhygC2QTDOQIZoawdsFi+YPSzHuLNZwY+cxKKXqCTS0jj+eEldBYQNE2tm8IFp77EkfKz3ZKAehUM/ePoUduO2GjAcAaK7kvFfzV2GU78Boy8j1zJL2vieDnaEdLylpY9VXYV3zHh7UzRVo8VAFGmwxZi0ZDWLFd9H6efcW7ZLQOsExQd9hhvB0x4i0eiIg8n6LFw94BHlBC+d8zQveLHctLgqEScwtnx 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)(396003)(376002)(136003)(39830400003)(366004)(230173577357003)(230273577357003)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(66556008)(66946007)(66476007)(4326008)(478600001)(316002)(8936002)(8676002)(6486002)(83380400001)(6512007)(6506007)(52116002)(1076003)(2616005)(66574015)(7416002)(5660300002)(41300700001)(2906002)(36756003)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?qEBvHWspHtLO2/+rbBN2hO3z+N16?= =?utf-8?q?/vWZJsBwhN1fP1kt5NGschUYMTRslnlXZWypgHkVtAMoW3tklXltMSYOexSBV+HNR?= =?utf-8?q?vDQ4TAiRNG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Q9ZDXOCbYCJDKCO1KUopI3ZTujXdnbEbpDuyhMpMiP3cg8xmYauKvqleidj8?= =?utf-8?q?fQ4DAfYbCjIM2h39ozL8As3bvdiHb4/TKgDNeIYFgsix87X9imbXTOZizmq//TSZe?= =?utf-8?q?aQQ2LCl/xM1dYxhKT4OVsrfi2rMBCZYsXA6uTBBTXDtFrY5HKVoC/HlGscs3F8Ecu?= =?utf-8?q?tRVpRjDtIbet/tVb4bR58LhZK/QGL6gkKZEvuf0SF0034xPLrnisGYoVV28FSKOpL?= =?utf-8?q?WfOcEyGZMhWp9VWxV6/PnCxEXafY8VMYqtV87ntGVe8Mi2E7EgSEnU+9C0Ref9RJE?= =?utf-8?q?jo/BlJDK2N9CUJ4UzOPjkSNUFt9n7zish45l2RR+Sd6WQRRbeNJptvrLOquyMdFRC?= =?utf-8?q?1elsoGDpMUKS8fHS+Ic8s9v+Q/omkKqp1WE3pCR5aqxWPYqGWoNnnFIqmJ+m7vIbW?= =?utf-8?q?Qi2XeUrMxjahiMPfw/Gr/75ZL3wlO5Nio1SR2N1XGknd8CzA09/qPddebYh46HWlQ?= =?utf-8?q?sHZRoB0lqY7F2fzR27hkASn15r+Fzr7dD3NX4c+2hKSGxa5hYltKMjleyzk1DUoTt?= =?utf-8?q?5AFE/29NM+VfxFJMgwKBSHeh4ixuP+sVFw+WjjWx9MlFdmWUKPTW3paE7P5krmqkL?= =?utf-8?q?Ly7jR8C8mxuxBkiQ3Bp6jdcrTqGFxHICw=3D=3D?= X-OriginatorOrg: kunbus.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5442ca88-43cd-41ab-1b81-08dc0c23e881 X-MS-Exchange-CrossTenant-AuthSource: VI1P193MB0413.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2024 06:19:14.5241 (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: ThHwi2955tpYL1VnFuPrqJoY5gVfMa7LI713tMIqHSqQjRm0h1Up4J6qzYhdDE5guumhg+khpNMKXf4g48I5Kg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1P193MB2245 The UART supports an auto-RTS mode in which the RTS pin is automatically activated during transmission. So mark this mode as being supported even if RTS is not controlled by the driver but the UART. Also the serial core expects now at least one of both modes rts-on-send or rts-after-send to be supported. This is since during sanitization unsupported flags are deleted from a RS485 configuration set by userspace. However if the configuration ends up with both flags unset, the core prints a warning since it considers such a configuration invalid (see uart_sanitize_serial_rs485()). Cc: stable@vger.kernel.org Reviewed-by: Ilpo Järvinen Signed-off-by: Lino Sanfilippo --- drivers/tty/serial/8250/8250_exar.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 6085d356ad86..23366f868ae3 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -480,7 +480,7 @@ static int sealevel_rs485_config(struct uart_port *port, struct ktermios *termio } static const struct serial_rs485 generic_rs485_supported = { - .flags = SER_RS485_ENABLED, + .flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND, }; static const struct exar8250_platform exar8250_default_platform = { @@ -524,7 +524,8 @@ static int iot2040_rs485_config(struct uart_port *port, struct ktermios *termios } static const struct serial_rs485 iot2040_rs485_supported = { - .flags = SER_RS485_ENABLED | SER_RS485_RX_DURING_TX | SER_RS485_TERMINATE_BUS, + .flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | + SER_RS485_RX_DURING_TX | SER_RS485_TERMINATE_BUS, }; static const struct property_entry iot2040_gpio_properties[] = {