Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4590127pxj; Wed, 12 May 2021 08:48:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCpEu8sptTwzovZTJWVzAAVovnEK5wUWueJb3MsKP1cHtOiBFRLEA3xtXv/Xxa2adnuM85 X-Received: by 2002:a50:fc91:: with SMTP id f17mr44125855edq.23.1620834531310; Wed, 12 May 2021 08:48:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620834531; cv=none; d=google.com; s=arc-20160816; b=T2MZgAU85iBIrANHzTSGQVM6XPxvRwDX9ITay6cS4CFK2qufswTzeBXM/sU2CinzcE CjhqdeIxb5/BUrWj1RCNWraTADMcPZTuxvlo9Qd5gwtTLaBS/Hy/wgV7ISJHFpyabNDt NhK9838g7ZmBIsvQ2Gu4QHjZfkL3CoM6Mic9VfvY3Dyq6mewBfAKYQ4c1gwacFI4YApU zkNIq1FeOSikcHnA0iWKrl4DiTfIyER9oxf3v5OvCUzsjuppIuuHgeAiJ2inlqMBJOqd plqvD8TfGWVFakc6rZnoPmbDoyYjrBW7o7wwc9IfwSQvjIFpH7B6mgUtne6BeVVmvMyH ZqFg== 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=xR647knQfzGUZ+n97QB04TlBY0KI5DDOMcrqPGj3osA=; b=pUge/F02DSXN/pXBoJPR2Mi1wzQZzzFGsEnoW6BLlqRCAAwXkfoAS/qrsfNrasi+ct C2A6G7PizUmQBRRqoWHduLARzQ2bUMAsNVB6xw2aRnf4aYHANc8cLWUDklyxxJWEv2cI O9IN1VFzqj/yAbaxz9kM9HyIj4JOOvRHnQgHrRNOKjzd7Y2e/vx+JxLN+jgX5ohpDVVy YAZSwUVptqwIi6Fb8eZvUpnm3H5C1Ekd6OFAP5747UxXZpbegO5lT/Dt4lkJy0QzwipM X7cSauU1AjukwoCdIPFqO3xYwiQHApLwBzFOtYR6usMTOlo5+ZF5Z3schnO7tggAQQc6 8Mmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=c7CH8FOY; 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 r15si8192edo.469.2021.05.12.08.48.04; Wed, 12 May 2021 08:48:51 -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=c7CH8FOY; 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 S232394AbhELPne (ORCPT + 99 others); Wed, 12 May 2021 11:43:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:59196 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233846AbhELPTH (ORCPT ); Wed, 12 May 2021 11:19:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 03E20619A8; Wed, 12 May 2021 15:07:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832077; bh=1EU/S4DKdxK4bC4Ueq9ZlLV5redgJacoyvV2gblYSXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c7CH8FOYGg2npHr5SZXtJGZMUohxZVcohhcg5yNGniQnd6YESMH3YWBCWiPKnX+Il J0txfHOMoln+pwvtmuM1XlR4atQmNEC5CyiyX3+3FDjKoYepzKRxJg6PfTitruUixn rj0qb83pr0bnfXc/tyGs3YogiMofsa22ykSbN38U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Erwan Le Ray , Sasha Levin Subject: [PATCH 5.10 132/530] serial: stm32: fix startup by enabling usart for reception Date: Wed, 12 May 2021 16:44:02 +0200 Message-Id: <20210512144824.156967745@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 f4518a8a75f5be1a121b0c95ad9c6b1eb27d920e ] RX is configured, but usart is not enabled in startup function. Kernel documentation specifies that startup should enable the port for reception. Fix the startup by enabling usart for reception. Fixes: 84872dc448fe ("serial: stm32: add RX and TX FIFO flush") Signed-off-by: Erwan Le Ray Link: https://lore.kernel.org/r/20210304162308.8984-3-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, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 1f7fe285bb1f..909a0d991ba1 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -633,6 +633,7 @@ static int stm32_usart_startup(struct uart_port *port) { struct stm32_port *stm32_port = to_stm32_port(port); const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; + const struct stm32_usart_config *cfg = &stm32_port->info->cfg; const char *name = to_platform_device(port->dev)->name; u32 val; int ret; @@ -657,7 +658,7 @@ static int stm32_usart_startup(struct uart_port *port) } /* RX FIFO enabling */ - val = stm32_port->cr1_irq | USART_CR1_RE; + val = stm32_port->cr1_irq | USART_CR1_RE | BIT(cfg->uart_enable_bit); if (stm32_port->fifoen) val |= USART_CR1_FIFOEN; stm32_usart_set_bits(port, ofs->cr1, val); -- 2.30.2