Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4511483rwb; Tue, 6 Sep 2022 08:30:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR4OLScBHgRqH3C3+i5kR3DJVXCq8761nL7wtSTNclbsictjSwlAU1bSPsYJB+/hx0+hGYlm X-Received: by 2002:a17:907:2bd1:b0:73d:d154:8e42 with SMTP id gv17-20020a1709072bd100b0073dd1548e42mr39261721ejc.585.1662478213708; Tue, 06 Sep 2022 08:30:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662478213; cv=none; d=google.com; s=arc-20160816; b=O2YNdugDh/N0MwoJE97UO5iF+zIYgIpa5FW0YZ69MvmRMvenJN3I1dpSh6WKKtV3Dn C3HbhSz9lNMxDsr3Veiap2hv8w+LWQ7e7drvB6B8wEXFwavLhK5zAuj1Pn1efENFrkbs CAZf36349JovNx+5HlMMBTkFEiCQLHiUiPQY/Wiv4dpv6OrnxrpwJsPopbsXXmSFSivm 0TG6ImQqFCCSBxZOdO4ZhTwWfUG8wkuMRJKaORCa4PyCWtmuHNHVHBSp72GJTNZ0KRUo eFb5Q9x2Z3KmCa1v5oCVDEtvdOT67m3cNVDxX6tHO7L2rq9xqgw5vJhQl7+t6Usyehx0 rJoQ== 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=yU0g/Yx7lkWcu8bTYrKhhDpRWaqwfSxFKmoZyVkrMLo=; b=y/iwL5sqkAv/PohkVBsY9Kfla/FhcQuMq3C1nJB+Xn3qr51OdTcw5CeUqnipoFVMzA +9i/wuGcPj5RkpRbPdBKXf8EWNp3/LqnlQv3ZzcMKzCoALLpmQFeuXO7wVeLR5fhyfGc CHUNgLU9FjIZxbVJkAUgy6ZMUR6KJteyVoTyk5ZLk4fmF4b9d8qVGU0r7GkaweMRWBq7 tzJPLuBBZvUAqOXN+tmFO4ik0uCa2lLpiFgARTCTbpV+Qpj4Ko0L1cKCwmHHRtyNNWSW LBQloJ9hZobkKALNJ8AUOqSc3TvJo7RT4Y2YUv3QcC/+tZT6ILKQg2mDw1mewEd6GckY smBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2m03ljIC; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb38-20020a170907962600b00741991009e4si10432512ejc.560.2022.09.06.08.29.48; Tue, 06 Sep 2022 08:30:13 -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=2m03ljIC; 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 S232007AbiIFOGy (ORCPT + 99 others); Tue, 6 Sep 2022 10:06:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241651AbiIFOFJ (ORCPT ); Tue, 6 Sep 2022 10:05:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F050F25D9; Tue, 6 Sep 2022 06:45:05 -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 CAE3861545; Tue, 6 Sep 2022 13:43:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D64A4C433C1; Tue, 6 Sep 2022 13:43:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662471839; bh=sdWFAMpcN5yorQzqBdzYSzjMJ96qWRixtRhe1biD450=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2m03ljICFSoLNYxpjSvI6wwwS5AeNoXk6a0YyWRVaKPLBk3KW1AguF9y5T+dAX07Q g8nUBiJSiaS5C+DNaB5OeMjEYq1xnYcdegJxJOOgwThn7M+PA0TdRb/2Nhu2VxAZlx s0/SOdBqElONisxhFgdlRgWujNlHUSPQbBvX5el8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable , Nicolas Diaz , Shenwei Wang Subject: [PATCH 5.19 056/155] serial: fsl_lpuart: RS485 RTS polariy is inverse Date: Tue, 6 Sep 2022 15:30:04 +0200 Message-Id: <20220906132831.788489767@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220906132829.417117002@linuxfoundation.org> References: <20220906132829.417117002@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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,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 From: Shenwei Wang commit 846651eca073e2e02e37490a4a52752415d84781 upstream. The setting of RS485 RTS polarity is inverse in the current driver. When the property of 'rs485-rts-active-low' is enabled in the dts node, the RTS signal should be LOW during sending. Otherwise, if there is no such a property, the RTS should be HIGH during sending. Fixes: 03895cf41d18 ("tty: serial: fsl_lpuart: Add support for RS-485") Cc: stable Signed-off-by: Nicolas Diaz Signed-off-by: Shenwei Wang Link: https://lore.kernel.org/r/20220805144529.604856-1-shenwei.wang@nxp.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/fsl_lpuart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1381,9 +1381,9 @@ static int lpuart_config_rs485(struct ua * Note: UART is assumed to be active high. */ if (rs485->flags & SER_RS485_RTS_ON_SEND) - modem &= ~UARTMODEM_TXRTSPOL; - else if (rs485->flags & SER_RS485_RTS_AFTER_SEND) modem |= UARTMODEM_TXRTSPOL; + else if (rs485->flags & SER_RS485_RTS_AFTER_SEND) + modem &= ~UARTMODEM_TXRTSPOL; } writeb(modem, sport->port.membase + UARTMODEM);