From patchwork Wed Oct 19 08:23:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4550 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp204445wrs; Wed, 19 Oct 2022 01:46:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM47wehkbboWhQbPd3CnQOIiwJLCLXzg2XYvk+FF4rwfYg7qNSJY2J5YGs3lz5QYHcPgwvLR X-Received: by 2002:a17:902:ec89:b0:185:581a:12 with SMTP id x9-20020a170902ec8900b00185581a0012mr7465261plg.29.1666169156435; Wed, 19 Oct 2022 01:45:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666169156; cv=none; d=google.com; s=arc-20160816; b=KFyuRcwfc+Z0cpAMpljjQUMYYIOGXUJy+0W4Yc1WMDfG4HnPhJYQea0FiCbkRLnT3s gOKhFvIQFG315OS8glB5R+GkWfUlO5yGPuqV9oM9SnyOJHG2Mn+iVr7xbhFFiJVeMctx 0BJk4PNRyH/JA542nZArw0TwF4cXGv9ylxkI8+Kj+P5GCJ5bvMLh/fPjfkZ4es47q08j d1SVuRD7m7rX9eaXgA4A58gduj6AHNUNps9J8K/LdexNgBciEQPK+kcfzsqCv1Qbw9tQ Pqqk0Lv46DFchBvkeFA+gdh3fXiaR5eAU1dXdY8HGNcjZoy2pK4rBBV9g+0EXiJC/Lwq sc5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+WJMoY21gHgtYe+UpW+LrNdAYID8eGsY7oos0RNv37w=; b=A6k2/CV6Z6h99JSwGXCvHjbqpMCg1L927vkdinJop0vMJ/aLMDcknQzHfhd2clYEgF o4lN6XYUNdRFE4LZD8gQ1xMrIoIuldxyquMO8OVbOcZKuNgxoaVv5Ps+MmTydTJAKgqN jhNuKPgvgnZ34fxLF/XgkI0Y79PHvpxNK8bUigng3zHTixvOXZHei7eNDwk4OEeSpVcR m7LunbDVMSwxloZ8ugp+v47YRz/HYM+Ffwx+G65H1Tf8Yq8UFl+TZj1WrM4V688KRpu5 wVFJwaYpLnGr00eRQpfK2ELWQQCdDGFX2TN1blkwakCZOZ3vrnwN+e/1gkxgc+bH7FDc NkIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="HbU/a/B9"; 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=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p6-20020a17090ab90600b001fd9be4fb6csi21579885pjr.39.2022.10.19.01.45.43; Wed, 19 Oct 2022 01:45:56 -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=@linuxfoundation.org header.s=korg header.b="HbU/a/B9"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231421AbiJSIpV (ORCPT + 99 others); Wed, 19 Oct 2022 04:45:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231359AbiJSIoC (ORCPT ); Wed, 19 Oct 2022 04:44:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F7DF82626; Wed, 19 Oct 2022 01:41:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6F265617EF; Wed, 19 Oct 2022 08:41:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80708C433D6; Wed, 19 Oct 2022 08:41:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666168904; bh=gp4XCDaj/ECkiOHH8Oy0tRGOZDp14WeL7Yte4jTXnp8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HbU/a/B9Sh8TRL5rbUpf7/yb3wSwEX496R/J6k1Wf0sS9opVr4fAJab8GjvlBvAxb E074FFMLfgghsZy4WpBcF2PhQHD0xQr/ifUdJzpp+faH8XYm1m4Oo3gR0W8t96Rz1s HMSBP2zv6ehn20aY+oq7Yz3PUcwh0Wkqu1dBhIRI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Golle , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Lukas Wunner Subject: [PATCH 6.0 093/862] serial: ar933x: Deassert Transmit Enable on ->rs485_config() Date: Wed, 19 Oct 2022 10:23:00 +0200 Message-Id: <20221019083254.057777674@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747104989429517059?= X-GMAIL-MSGID: =?utf-8?q?1747104989429517059?= From: Lukas Wunner commit 3a939433ddc1bab98be028903aaa286e5e7461d7 upstream. The ar933x_uart driver neglects to deassert Transmit Enable when ->rs485_config() is invoked. Fix it. Fixes: 9be1064fe524 ("serial: ar933x_uart: add RS485 support") Cc: stable@vger.kernel.org # v5.7+ Cc: Daniel Golle Reviewed-by: Ilpo Järvinen Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/5b36af26e57553f084334666e7d24c7fd131a01e.1662887231.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/ar933x_uart.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/drivers/tty/serial/ar933x_uart.c +++ b/drivers/tty/serial/ar933x_uart.c @@ -583,6 +583,13 @@ static const struct uart_ops ar933x_uart static int ar933x_config_rs485(struct uart_port *port, struct ktermios *termios, struct serial_rs485 *rs485conf) { + struct ar933x_uart_port *up = + container_of(port, struct ar933x_uart_port, port); + + if (port->rs485.flags & SER_RS485_ENABLED) + gpiod_set_value(up->rts_gpiod, + !!(rs485conf->flags & SER_RS485_RTS_AFTER_SEND)); + return 0; }