Message ID | 20221108121952.5497-5-ilpo.jarvinen@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2669435wru; Tue, 8 Nov 2022 04:22:34 -0800 (PST) X-Google-Smtp-Source: AMsMyM7Ihl9tuEkHts0HI7AllkNuzqLsF118d/isk7dnfBJHmdDjPOOq+lQk3uAbC5XuWujhEyTB X-Received: by 2002:a17:90a:2a02:b0:214:247a:c185 with SMTP id i2-20020a17090a2a0200b00214247ac185mr35674578pjd.226.1667910153918; Tue, 08 Nov 2022 04:22:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667910153; cv=none; d=google.com; s=arc-20160816; b=xEP51o9fGWmnymUG/53AmG5fAdH0Qd0mO5QsOhNHhkonhudUlAMwDX+ZdebxKDfDS0 tj4kGl4COr07E21KkmYiCxxNxR4JUxNkZAe9ry7ay+uhId6Oe7GY7xuYB5t0Ha74Ctis E7WHhSlQ7t9QOSXs4Oyc4IWDBcPpfBdkpITKqRTS7RgNZicVgDAc7OXTlsCmxtplDR+A x4TOBftvyZB+5NQ0VHpt2YEo4T4S5QaWcZhyoDNLBperKR/4+t9x1NY2O/AfRGzb2Bo4 wn4a8ZI6ngrnBgF/dbw3PdwP7zBAyo0ACOBtrKAsiHtWDWh7QfvNhkiQabhu17kj5maF IDUg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1PxHXRMNjUMWZSw+qMolAXh2UxgPNLnzfxX/TwzlKBE=; b=RxQi1+HRgEnkAjgodxK3pfxOlddk578scUjQltj9414UIfPTm3kq7i/A1qF4Qwydk5 EKv2rUZjK+GGX2FOKzgnzg3EybOrAZB+lWRS2Tn5hf73SSB6T5i/7Dntnsi8QvQiA5kW S4xX1ybL64M0uAm4752aPkqNbGJ4HIqCAdZR4s9Z3S66bUlQVIMXjzIXli2hzySUlvcg buMfKibRJBwtxtMqiG1aZPSOdB6AI3bsa1jzl6tNDTRI7q9dDMXLlzh2Dn0TsR+Bv22F 48XgczmdA2Ad9MU2tzzdl1ImvdeQ25RIOmpfFs5ecx07glfowfVorqJ+E9FIPpwB2igR o/BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=S04avOY4; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d16-20020a170903231000b0017840d9d42esi16356822plh.582.2022.11.08.04.22.21; Tue, 08 Nov 2022 04:22:33 -0800 (PST) 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=@intel.com header.s=Intel header.b=S04avOY4; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234179AbiKHMUg (ORCPT <rfc822;hjfbswb@gmail.com> + 99 others); Tue, 8 Nov 2022 07:20:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234153AbiKHMUa (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 8 Nov 2022 07:20:30 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0795F17A9E; Tue, 8 Nov 2022 04:20:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667910026; x=1699446026; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vkqZhcPnjGQqDiDQpqIE/N5L7Qt+GaZklcF5cPF1GxM=; b=S04avOY4z2fnKV5eQWl0ii4kD8D9lSBAvdVDho6Sp2LRdnlQxYIaxhNR VKR0Y6QSg37RtQvWqHGEP/nXVWvJN/OQybpjj1yeJb85HKc26reGl9G9Z oCd5lQ9pKgNI5EVZkhRylc9Dit+qIrZYbywfdvkqXMybaxFo7Zuu0mVe8 4kMRtV1f8OKc9E4swrC3LVnaJFxNtTig1sCl+HP1CP6O519XM+nP9Wjq0 9u17JZnqq6gD0+91fcjTff3Xn44mzNSqeHBQjfwELGEDmo+oRfjcwFR5M CckDC/TJRKKGiX56E1QVQrz82rf2ylyFGRPYnWbqjFTdhC4WHkCOG82Kc g==; X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="374951476" X-IronPort-AV: E=Sophos;i="5.96,147,1665471600"; d="scan'208";a="374951476" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 04:20:25 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="741932231" X-IronPort-AV: E=Sophos;i="5.96,147,1665471600"; d="scan'208";a="741932231" Received: from ppkrause-mobl.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.249.44.73]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 04:20:23 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> To: linux-serial@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Heikki Krogerus <heikki.krogerus@linux.intel.com>, linux-kernel@vger.kernel.org Cc: Gilles BULOZ <gilles.buloz@kontron.com>, =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>, stable@vger.kernel.org Subject: [PATCH v2 4/4] serial: 8250: Flush DMA Rx on RLSI Date: Tue, 8 Nov 2022 14:19:52 +0200 Message-Id: <20221108121952.5497-5-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221108121952.5497-1-ilpo.jarvinen@linux.intel.com> References: <20221108121952.5497-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748930557445205484?= X-GMAIL-MSGID: =?utf-8?q?1748930557445205484?= |
Series | 8250: DMA Fixes | |
Commit Message
Ilpo Järvinen
Nov. 8, 2022, 12:19 p.m. UTC
Returning true from handle_rx_dma() without flushing DMA first creates
a data ordering hazard. If DMA Rx has handled any character at the
point when RLSI occurs, the non-DMA path handles any pending characters
jumping them ahead of those characters that are pending under DMA.
Fixes: 75df022b5f89 ("serial: 8250_dma: Fix RX handling")
Cc: <stable@vger.kernel.org>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/tty/serial/8250/8250_port.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 92dd18716169..388172289627 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1901,10 +1901,9 @@ static bool handle_rx_dma(struct uart_8250_port *up, unsigned int iir) if (!up->dma->rx_running) break; fallthrough; + case UART_IIR_RLSI: case UART_IIR_RX_TIMEOUT: serial8250_rx_dma_flush(up); - fallthrough; - case UART_IIR_RLSI: return true; } return up->dma->rx_dma(up);