Message ID | 20240105141153.19249-5-l.sanfilippo@kunbus.com |
---|---|
State | New |
Headers | show
Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2060.outbound.protection.outlook.com [40.107.22.60]) (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 23EC92E418; Fri, 5 Jan 2024 14:12:24 +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="hskFSoS1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oIu4ZLUlgMNtn20eAZqPvn9CUZOQvENTPh1uw5WWnG1SKFO65kubymgB1ukY2u8Yl20W3bL6VSy1dqSj4xlB/Joiy7lgJaZ3Q/kjn18zlCtl9g70IqYpxf9FM3enonPd1e0NfuU0JZibdRJ85H7TEwl+C8YlLvpNwj2bHLtxfPZyu4VqNz/KHgV8wUQQM47xwuiB9ULp5HfKYl0/Q/ZSFGAUEQWsRRq5eEw0nzj85nrAIEy5VdN2rJ4h1BWXAHLsCFNyUOWQEw09ugbMh6NulcF3A5H3EQvhYU8lS2hasiKRZzhy/2lkyaXwTLr2COv42Ptd5wC51fZRq1M5vDaH9w== 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=ctoSUvaSE63QhX1RJ/Y+ZsAabtaxgzq3AnK1Gc9jmAU=; b=WY9Utj8zaphMFYCcf9xvn53oVr/J7X9+LgpvPc/jERx+WrT5FXnDGHG174FkGT1/Z3Al2IjfV20Awk0ACpeJOI4xbVabR4EdRF/cPj9vxkEUNsFPhgI80qfLz6fTIBkueumLFZj0FAd6pynVxkUP21O0nF9JgwvBMT4OD+s1FZOhDxKMsEa/KBIeMJrmNwX/c9P6KveyLztLZEl8k3k+fl78+xQwna0tEO3bUQFeS5CILGWfbeiMewPguscQ7ZjpVrQ0g9q2oIJ7BEIemcvYiF9ykf3waiyhAjPMCWF4V/uryatnjTN/b3F4kqJI0eo1FEY+gTPk13d2MzrD3TZkgA== 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=ctoSUvaSE63QhX1RJ/Y+ZsAabtaxgzq3AnK1Gc9jmAU=; b=hskFSoS1sKRoH3JrGD/NrtLM8rNenRjt2qXlsaHxJphpNeJNjN+lhToeGCUMK6SEnEO4HRw8VU42l1p54GwlXfmz3k6kd2VdNR/vDhv7GXnjVZ0bhSXbSwwKIv6BO4nvJqT7gDB6y90FPj9lN6VVP1p4BofVlA2u9svbHMp+Gn8= 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 AM9P193MB1538.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:30a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.16; Fri, 5 Jan 2024 14:12: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.015; Fri, 5 Jan 2024 14:12:14 +0000 From: Lino Sanfilippo <l.sanfilippo@kunbus.com> 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 <l.sanfilippo@kunbus.com>, stable@vger.kernel.org Subject: [PATCH v8 4/7] serial: core: make sure RS485 cannot be enabled when it is not supported Date: Fri, 5 Jan 2024 15:11:50 +0100 Message-ID: <20240105141153.19249-5-l.sanfilippo@kunbus.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240105141153.19249-1-l.sanfilippo@kunbus.com> References: <20240105141153.19249-1-l.sanfilippo@kunbus.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-ClientProxiedBy: FR4P281CA0327.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:eb::11) To VI1P193MB0413.EURP193.PROD.OUTLOOK.COM (2603:10a6:803:4e::14) Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: <linux-serial.vger.kernel.org> List-Subscribe: <mailto:linux-serial+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-serial+unsubscribe@vger.kernel.org> MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1P193MB0413:EE_|AM9P193MB1538:EE_ X-MS-Office365-Filtering-Correlation-Id: 9996ae0f-1580-44d8-c3de-08dc0df85137 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hqOxhL61v9xa51MrUBdeVXgbNudvQcPF0xAoNNw4aeuhMwCLAlryMOJRWkVJcVWmuJZ3PA1EoGfy8Gnln8zFSJbe91K2pf3XQGbhtAlXs5gTaVfJq82Rx85FcxQxRF7KnOtWX5PPI3zGrotYEVdTemcRM7x6yYCHqfpVhwm0sE7NH8u95HDBxpJ73+nZSR2VpZ6YV1dIPZw5VQPepPoD0ITn2WMehD5hTt3EYXTiMQVRTu0ajfFPE5DOn4FBelI7pekQHqTd1GOWVv7iNZFkT7+fRej0mUKsZtbYmDGToY6jGiCck/wKzBBCoz21hvZugxDvp2wP12E9U/DIWldEb9t8TCWYcR9QoCsEcgaiGk2WOyfCHcZoK9CSBq/MRat+TXxiESIPtbWGKDOTCGX546iHWigqyqqrp9h99HjSyDXdvrCRkMAjpyPc7N0TTYab0r0yIQcyqWRLoYwpmlquheBsoUZPxzpxKhlVdn6Hb1xyzmgoJquTOPMikpB4NMJoax3U+QQ6BSVmufNDq1whI+RRWZKzoI3LD4jbpKY0MsCdYBkoGzZ8+KAhAFjmDtIY 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)(376002)(136003)(346002)(396003)(366004)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(36756003)(52116002)(6512007)(478600001)(6506007)(66946007)(66556008)(86362001)(66476007)(6486002)(83380400001)(38100700002)(66574015)(2906002)(6666004)(2616005)(1076003)(7416002)(4326008)(5660300002)(41300700001)(316002)(8936002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?JGUhf7tu6Hq56yawSQ5XZl6MfXAe?= =?utf-8?q?fSpamVjVa21QaIeT0Mpk1F3YszvoGnD9SPMWTZP9Eev9tiUULY8Yx0HJgwWBIyebU?= =?utf-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fTMKmdrVQc6f4d02NM/zxdHRxAJAmyKWgBlOY2UlHGICB5lcYS?= =?utf-8?q?yByl7DVZ/LtI7xB4PWRDhEBddhxm2cP20glSkgDo1bgQX4qZBEt4DgeWhhXqaDtyE?= =?utf-8?q?hdnILSNkfqNz13eR904Mvpse6iHQFZbaCMi7UFRhDyCL2BdYc7JDMHAAJJ6Emn7yR?= =?utf-8?q?SIOTi1zLSggIuz49FL0GpAhHZ+LElU+UfqQ1oCEdON6M9XmlCiGQ3/7U4ulVYILJ+?= =?utf-8?q?LwmS0fmV808NEzaZmH+ADwOp9dwYVBlIfFijlDSW26CfirfUve9ZJ2GorFlkJYFIv?= =?utf-8?q?84i4oAfDD9Fzv3yxnvjSqEcPqCgd+9Gr/XglfukifWinN7ka+UbXtuYARBsYewaxt?= =?utf-8?q?Kh326CDp8uinMZ+n81gOslgnhvxOyWr11SdwLKS1HYdaqn3wMPjQ23kT7HkXp+fca?= =?utf-8?q?pIoYK+973g7RpXuTAFCfM3LpJIIc4mwznJf9K1ZB2Yu2c2O2v/gJNXZ0Hs5Qhg7SQ?= =?utf-8?q?kOyy3XhLbu1coLZJaZzqvLK8StCVSemuIqiQBn+kyWPAJ4C8ExyXGhPTN7ndfXHJd?= =?utf-8?q?YYY8Kl6S3aWn2X6u2tNg3kYTU7wTO11/dyYs+Z0IbPn658gugOzygNbz6IGjkwsQx?= =?utf-8?q?XxrYx6jvB/gbRH3hHwFH7U8Jq4CYICAOw=3D=3D?= X-OriginatorOrg: kunbus.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9996ae0f-1580-44d8-c3de-08dc0df85137 X-MS-Exchange-CrossTenant-AuthSource: VI1P193MB0413.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2024 14:12:14.7121 (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: 2OMxQ1nk6vEfxu5K6lxlHNDF5KU9o0R2FBKnjca4OFlRdjMIV5qs8LSjgPH4Qt4nhZTlOQymbd18bwiUas3W6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9P193MB1538 |
Series |
Fixes and improvements for RS485
|
expand
|
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index f67fb6a04983..28bcbc686c67 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -1469,7 +1469,7 @@ static int uart_set_rs485_config(struct tty_struct *tty, struct uart_port *port, int ret; unsigned long flags; - if (!port->rs485_config) + if (!(port->rs485_supported.flags & SER_RS485_ENABLED)) return -ENOTTY; if (copy_from_user(&rs485, rs485_user, sizeof(*rs485_user)))