Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4447836imw; Tue, 19 Jul 2022 06:50:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tk2xlDFDmLrgmqhuFki/KznOmSkgpfXXjLJRIveN+oDd+0b6hrenW/AmFOJuXfil0hzH0L X-Received: by 2002:a05:6402:1659:b0:43a:1735:e1ce with SMTP id s25-20020a056402165900b0043a1735e1cemr44553418edx.196.1658238636961; Tue, 19 Jul 2022 06:50:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658238636; cv=none; d=google.com; s=arc-20160816; b=vWLZynkoCFhGGh4NtDp9gixdBNd22XkntDZwLcRKtACtO+R3XDh2BSurjQqa+cg7zZ yTkEvTuoSusXmMGqhS8RDN2FwZJA9T4rjD8Puil3PGAL5kLVQ3ranZYqdQS+IQVBcJRT FHXNJcCREHvdQldim6TkjAvmSPuzRZZAoz1AYvk//BlXyHODbItlsA2h27tOUg7jybPK 4oQTbtd+4w1gaYRFx6SweXZI/B0AGBvbZ5X+0NUDYKZVdMbDT5J3MtGsT38JNCHxPnlm /J2S6k4y9Nu0Sn2vL53Als9U1wxAuMr4dqadvIFjO5PPu2BMcPVtd67ub2MHcqrWafPM JDCg== 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=vwNcjRH+4erP4wtyteJk+Qi4hQX6MiOFktdEKoor1UE=; b=YK77ygw0xsdC1KE2XaLtCe9xpFIf6FWdr5YE/MMSrFw9BdYiEMstdI7W3VkJJijJo9 JuYyd9swrzjLA9/Vnt35QwiMjXk3yUzNF/UnGn0ruJ8h0vg05uruRQxWKFLc83ArxkXQ +8p673EWA1JKdDWHAXxkFBxxAG6tqTC6PIUXoreV2lSsjHXZE6BdDgURNYDDtye/Pevz n+lC5rW2JcLdFSgtPszHTb8OeIQkU6CrB9yJcX5CwPKR84j8X7JIRrDrDEOKL2oEX7FJ fu6eC3dQlPNfzyrO1hbMi04P9TNTG8aaV/dniGTcWElbyw5SzIapnrxy2/oMxpdbJjpz dABw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pInYzlME; 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 sb33-20020a1709076da100b0072b4b303e17si19930639ejc.448.2022.07.19.06.50.11; Tue, 19 Jul 2022 06:50:36 -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=pInYzlME; 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 S240070AbiGSM1N (ORCPT + 99 others); Tue, 19 Jul 2022 08:27:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239593AbiGSMZG (ORCPT ); Tue, 19 Jul 2022 08:25:06 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F30E3509C5; Tue, 19 Jul 2022 05:09:51 -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 ams.source.kernel.org (Postfix) with ESMTPS id 85C78B81B1A; Tue, 19 Jul 2022 12:09:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA0ADC341C6; Tue, 19 Jul 2022 12:09:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658232590; bh=h7JjNDchfBZCJul5brCU/ZWQNoSqPcJ/+4p44Ch7AEs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pInYzlMEra6k7DjBeLJvJayMPcWEWKElzg4Opcy9G7Kc+eNXdP+FQFf61/eHwySXD FLUgY0dmvRfG87Jv25B+8nzHJ5OqvqBHctsm3c4PGpHoapeSBXaqm6kxWE4nSGPhUr CIuZ5GZ/ZPmQtpeU0ZCh+Yjy5kkzJKTuOw+g/IWk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable , Lukas Wunner , =?UTF-8?q?Nuno=20Gon=C3=A7alves?= , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH 5.10 110/112] serial: pl011: UPSTAT_AUTORTS requires .throttle/unthrottle Date: Tue, 19 Jul 2022 13:54:43 +0200 Message-Id: <20220719114637.905796375@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114626.156073229@linuxfoundation.org> References: <20220719114626.156073229@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 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 From: Ilpo Järvinen commit 211565b100993c90b53bf40851eacaefc830cfe0 upstream. The driver must provide throttle and unthrottle in uart_ops when it sets UPSTAT_AUTORTS. Add them using existing stop_rx & enable_interrupts functions. Fixes: 2a76fa283098 (serial: pl011: Adopt generic flag to store auto RTS status) Cc: stable Cc: Lukas Wunner Reported-by: Nuno Gonçalves Tested-by: Nuno Gonçalves Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220614075637.8558-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/amba-pl011.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -1326,6 +1326,15 @@ static void pl011_stop_rx(struct uart_po pl011_dma_rx_stop(uap); } +static void pl011_throttle_rx(struct uart_port *port) +{ + unsigned long flags; + + spin_lock_irqsave(&port->lock, flags); + pl011_stop_rx(port); + spin_unlock_irqrestore(&port->lock, flags); +} + static void pl011_enable_ms(struct uart_port *port) { struct uart_amba_port *uap = @@ -1717,9 +1726,10 @@ static int pl011_allocate_irq(struct uar */ static void pl011_enable_interrupts(struct uart_amba_port *uap) { + unsigned long flags; unsigned int i; - spin_lock_irq(&uap->port.lock); + spin_lock_irqsave(&uap->port.lock, flags); /* Clear out any spuriously appearing RX interrupts */ pl011_write(UART011_RTIS | UART011_RXIS, uap, REG_ICR); @@ -1741,7 +1751,14 @@ static void pl011_enable_interrupts(stru if (!pl011_dma_rx_running(uap)) uap->im |= UART011_RXIM; pl011_write(uap->im, uap, REG_IMSC); - spin_unlock_irq(&uap->port.lock); + spin_unlock_irqrestore(&uap->port.lock, flags); +} + +static void pl011_unthrottle_rx(struct uart_port *port) +{ + struct uart_amba_port *uap = container_of(port, struct uart_amba_port, port); + + pl011_enable_interrupts(uap); } static int pl011_startup(struct uart_port *port) @@ -2116,6 +2133,8 @@ static const struct uart_ops amba_pl011_ .stop_tx = pl011_stop_tx, .start_tx = pl011_start_tx, .stop_rx = pl011_stop_rx, + .throttle = pl011_throttle_rx, + .unthrottle = pl011_unthrottle_rx, .enable_ms = pl011_enable_ms, .break_ctl = pl011_break_ctl, .startup = pl011_startup,