Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4474463imw; Tue, 19 Jul 2022 07:17:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tSxbumXHievuQZRWvdzHn0HwfMwPD+rJqGIROT2FqhWPxPqbCOETZ+RGx+k4JmFCXOuBgm X-Received: by 2002:a17:906:4fd5:b0:72e:ce13:2438 with SMTP id i21-20020a1709064fd500b0072ece132438mr28783134ejw.175.1658240261725; Tue, 19 Jul 2022 07:17:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658240261; cv=none; d=google.com; s=arc-20160816; b=LChaqgoefjwlw1Qwz4BL4MLGmxjshONqTzTwcXpgsGGu757J9HQxhmB+lmh8IBADn9 euA6EM/C/7XbbLLbrzGmRi3BQJJSJNQY8m/4IoSipC4iZArfsAgEahHXcgGEBlyNaqKv Z2XljeHwamYHi1dP5848uR8AkbO0jzi9u2EkLkrENj+8u7wTTDIuUJXnSCBbC6GwvpFx SfVXVjJvVZKs5T2JLsIwFeAOA/o9tMOtbgqtm0rv+RH5C00vNbRB0ANEp+0AR6SSe6co oVfOggC9raTr9ytH/VrpDDEurMzVQ7Dt91KzYsKGvHCUlGq9PUXAhxc+Hke2y3H0bTWX klSg== 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=CoA0DPD3nvvNYfbSLYRg5dX+ICtu4nAS8p7GHyf+AMw=; b=P7iPfiFMYcfNkM9noQlDACHjiIZKmVSZ/5H06G5ikkG65lwTQl+Hl16Zcj40qflFSI YpHfyL7NNggjoad0h7r5NqurWceDKSdJ6rLRbrf55Xkcb7F0UgPAgTHVCvhQDDq0Hwv+ vSRuoNnnrdQTbAlGyQ3LOBGnMSg1ypop64+n4CvBUpDo4oOMulM3GhD5SbsT/Cl9UCsj +oGEOZnljZR3QEvgpBIootclTr34LPOFPHBqUp5R0Kezzjh+OvpmNWzGEXlz7w/zhjKI 9Xn7rk+/Nv/Haqh3CaYgq8E4zI8R1VxJFlE4RvwB8yvgq6iuU8a+8n/WvKsBt81OqxUb Ux7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DO1VbNjd; 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 j19-20020a1709066dd300b006feb76dbd51si17407741ejt.289.2022.07.19.07.17.14; Tue, 19 Jul 2022 07:17:41 -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=DO1VbNjd; 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 S243409AbiGSNMI (ORCPT + 99 others); Tue, 19 Jul 2022 09:12:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237103AbiGSNK7 (ORCPT ); Tue, 19 Jul 2022 09:10:59 -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 9D37BBE9FF; Tue, 19 Jul 2022 05:29:12 -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 68E53B81B36; Tue, 19 Jul 2022 12:29:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7945C341CB; Tue, 19 Jul 2022 12:29:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658233749; bh=UP3Lic+jp34ATbqPhzcUBziTW/x8lbvrWY43VZs5Jl4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DO1VbNjdoRmCXeloJntQT5ORwzz1Xah+u5hVpMLfeaP5op327EyPFN0SrW+Gr18bN xsbivJZITfrwl34DiYGXXNqb3GuvPz7RkNefVZxVc1m0lviUPkBAuh9ZLZQI7VuKIF 05g35W/kc1CK7HXMamNo1o/BGkaRa8HlqC3hHlPk= 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.18 228/231] serial: pl011: UPSTAT_AUTORTS requires .throttle/unthrottle Date: Tue, 19 Jul 2022 13:55:13 +0200 Message-Id: <20220719114732.825824668@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114714.247441733@linuxfoundation.org> References: <20220719114714.247441733@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 @@ -1339,6 +1339,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 = @@ -1760,9 +1769,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); @@ -1784,7 +1794,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) @@ -2211,6 +2228,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,