Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4591503pxj; Wed, 12 May 2021 08:50:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUkLEpcyw7E2COTFazyco+wwTEzX0oWfsLi8L/+M19RTyPRals2BLGMHU8YAw2OQVq876f X-Received: by 2002:a19:c304:: with SMTP id t4mr25183717lff.86.1620834631804; Wed, 12 May 2021 08:50:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620834631; cv=none; d=google.com; s=arc-20160816; b=PLDLhS21XZgNSOd69aQn0gQX8a7vvnJSYqUmtNVqSFHRinLK/2ZldMWIKjAAsVQ0db gOHdcZq77xnhakLcljUdjKzhnbPprSCev9T/vcsLTXrNIOtK2WmCqN5bTrn+glNIL1c5 nBzfwTaWWe0KuX116fudB2UwKaxuLCZbS5xKKJKwBgKuQ4b5z20xuAIni5RvRnCacRYY Bcjjv8iAvlI5vXYppV2VLnS1oLHm0y3/2d2FEkveTvhH89f1LUouENXgRbEoo1LKeZo9 V2LXKGCW061v+cw94kFzPM6/M9jJc6P/cYXg9B+lWxZceWEGnG/l6hru35l5OZ5/7iYQ e63g== 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=qwjTBCrgE1pgBghwDnE15P95ZJm+KWP4zJc/GoLZPkA=; b=C7hfB0APhVTB+jZAzQbUt00z4KOmfWXxLBmAsUaPonahM2IplBd8F1z4I0dwYeUe6G 1Ew7AszIJoR7QVVER7SxRaHGAYaEIPFs1ZHkI+ThG12g3MwJ//Y+cgWAsKQuZCov0duz rp93j80KqDNZI6ewDl3OhUtWsCuXuc4Ui6XcefGYQ4I0K1Arg7R0TKCTkX5ZWityD2R7 Bp5JoknbCsjAUQm15VNzevhWuztV6xjXhU76GX+9ZsbG+HieUevL3tvbgFqLv6RGYWqg ilU95NqG7gYJBuhJkqWOQiZaBZTgBEt0InxPrUPFcTz0Bq/AqERZyTqE5+q4yPTQP551 uc1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tMQ3cnUF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u23si90237ljk.31.2021.05.12.08.49.58; Wed, 12 May 2021 08:50:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tMQ3cnUF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S236088AbhELPpX (ORCPT + 99 others); Wed, 12 May 2021 11:45:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:60504 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234655AbhELPUQ (ORCPT ); Wed, 12 May 2021 11:20:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 65FFF6147E; Wed, 12 May 2021 15:08:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832096; bh=7vFJxsts7R8HfZ9uk8tJK0xDqj5AYJbPncbd5hQb1ig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tMQ3cnUFvlO1Hg8hUqffDoiZ87mbMI1SRuEY4iG15dthe8VS3GNfRyI63kHp/VxhC nOo/2x7rNr9f2FKT/bc7Y5eib+uYkWpanNj0h66P1MXZxnv0kkaLL4MgSEzGEMRs7P TqP977AQWK3SQuRR8lxLTvoGaBRc+lW1SNuh6NEE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Erwan Le Ray , Fabrice Gasnier , Sasha Levin Subject: [PATCH 5.10 139/530] serial: stm32: call stm32_transmit_chars locked Date: Wed, 12 May 2021 16:44:09 +0200 Message-Id: <20210512144824.384193444@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Erwan Le Ray [ Upstream commit f16b90c2d9db3e6ac719d1946b9d335ca4ab33f3 ] stm32_transmit_chars should be called under lock also in tx DMA callback. Fixes: 3489187204eb ("serial: stm32: adding dma support") Signed-off-by: Erwan Le Ray Signed-off-by: Fabrice Gasnier Link: https://lore.kernel.org/r/20210304162308.8984-10-erwan.leray@foss.st.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/stm32-usart.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index c2d87a8a8fe5..a6295897c537 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -290,13 +290,16 @@ static void stm32_usart_tx_dma_complete(void *arg) struct uart_port *port = arg; struct stm32_port *stm32port = to_stm32_port(port); const struct stm32_usart_offsets *ofs = &stm32port->info->ofs; + unsigned long flags; dmaengine_terminate_async(stm32port->tx_ch); stm32_usart_clr_bits(port, ofs->cr3, USART_CR3_DMAT); stm32port->tx_dma_busy = false; /* Let's see if we have pending data to send */ + spin_lock_irqsave(&port->lock, flags); stm32_usart_transmit_chars(port); + spin_unlock_irqrestore(&port->lock, flags); } static void stm32_usart_tx_interrupt_enable(struct uart_port *port) -- 2.30.2