Message ID | 20221107110708.58223-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 l7csp1981257wru; Mon, 7 Nov 2022 03:09:11 -0800 (PST) X-Google-Smtp-Source: AMsMyM6wBmiVjC+/EKGQayxU1fX9qwEKPWQJXuNncr++Ch7o8iN7unOZkX89IDYgt5PUHFgt0eZI X-Received: by 2002:a17:90b:1e08:b0:212:ee11:7b09 with SMTP id pg8-20020a17090b1e0800b00212ee117b09mr67380814pjb.60.1667819351550; Mon, 07 Nov 2022 03:09:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667819351; cv=none; d=google.com; s=arc-20160816; b=Ac6UMmz5zSYTOIgv4KVEwwgoL0aTQoOJtrlU9sj+zKZTaEUiKXtNRFOSdFcF0g7X7T xs9sJiMd2SSE8Op4bvWPZwPa/oa+NDpbYRrUb41W5k+R5zKdqKbnWdYrV86rZ6FprQEe jnw0kAu9ymWfpXGFo3TaQyZUSUXmvHX7mecKQQOkiDuWx2sCNir99OEy5AHFRaZcK29X Pd/JAeEZX6s0oEpVE/eOyQL/Y5jvbytgJKna50gRjYXQANgJihi/46C7po7TdLI6g0tu 5vYMV6dbf3zNt0VaQqemAag5suophG41za/I9DJCIm2d3MgePzPNau7yxot1MCBLzNc/ USeQ== 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=kPXkYWnfxt+7K3+yHadfSSkUCTIxXdAY8xvp8YbtPiY=; b=ZwbM+6EN7mv74KW8vDzrHbAR3wOfzAgPtvocUyWcQH+aZPAune0Xm12kO7RKsje5S3 mAQ/zWb4soD3cpqm/QNC55fVcaX4VH2Y9CD+ZZXfq+KmPePRrGMrCKR4rH0Egwks8+Ys 5XT4/Z0jbO+m2jyeDaedqgcEvBA+HZQSDT1DkalOY75cbw47TzFV36q5k8xQ3Ajf9IQ6 KYBtO+G/exlWgs/IQnizvuoJH/jhCkaucyj/yRT/MWJJcrXlVn0gv8Cvc4XK9dUt3A/q VPaufy9TbYvWwBa/zRZM32WP1nKmJXbkHme+hBU+9tVLnNoU5zRaLlXpQnGVPwtcDcEX lJJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iBAai1hL; 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 y4-20020a170902cac400b00186a3bc939esi8358952pld.211.2022.11.07.03.08.57; Mon, 07 Nov 2022 03:09:11 -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=iBAai1hL; 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 S231540AbiKGLHr (ORCPT <rfc822;hjfbswb@gmail.com> + 99 others); Mon, 7 Nov 2022 06:07:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231518AbiKGLHe (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 7 Nov 2022 06:07:34 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0239618386; Mon, 7 Nov 2022 03:07:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667819253; x=1699355253; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GX897nypwCJ78jjUOfdNotVKqeArdhyavQ6h8PsVU8c=; b=iBAai1hLFbwA3ysMoxykDt0hyJZiRbCzyzWNyAomHd9iwAdfPIpenazq DAJ4xRaUCowz/bCuNKsj+ayqCsQPHwU5eLHsdLPI4J12fu/Cm1tlh0ztK QSDAkQgYXb7v9lj6SuDozCuXagovBnDlqEwUPXqpGTcwy4BKcBwD46JEK ecZuik8nyNhIB2JLA/og0EDA1NXsDBOLadHV8GEycOEf3eXBscNamUU/k 08zrALZsJb3jXpCG6dZaXL0JtegYjufovr9mxUvOgeRtxf50Wm5wUR+zx /sEK8i7wpdDIzcNZl0u6GumAdST+Qhj6EMcRalvEEz+p3wnkKlR6KJG1J A==; X-IronPort-AV: E=McAfee;i="6500,9779,10523"; a="290773043" X-IronPort-AV: E=Sophos;i="5.96,143,1665471600"; d="scan'208";a="290773043" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 03:07:33 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10523"; a="586932381" X-IronPort-AV: E=Sophos;i="5.96,143,1665471600"; d="scan'208";a="586932381" Received: from gschoede-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.46.211]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 03:07:31 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org>, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Heikki Krogerus <heikki.krogerus@linux.intel.com> Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>, stable@vger.kernel.org, Gilles BULOZ <gilles.buloz@kontron.com> Subject: [PATCH 4/4] serial: 8250: Flush DMA Rx on RLSI Date: Mon, 7 Nov 2022 13:07:08 +0200 Message-Id: <20221107110708.58223-5-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221107110708.58223-1-ilpo.jarvinen@linux.intel.com> References: <20221107110708.58223-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?1748835343996356109?= X-GMAIL-MSGID: =?utf-8?q?1748835343996356109?= |
Series | 8250: DMA Fixes | |
Commit Message
Ilpo Järvinen
Nov. 7, 2022, 11:07 a.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>
---
Cc: Gilles BULOZ <gilles.buloz@kontron.com>
drivers/tty/serial/8250/8250_port.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
On Mon, Nov 07, 2022 at 01:07:08PM +0200, Ilpo Järvinen wrote: > 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> > --- > Cc: Gilles BULOZ <gilles.buloz@kontron.com> Maybe instead you can do --cc Guilles ... for entire series (and drop from other commit messages)?
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);