Message ID | 20220820125717.588722-20-tudor.ambarus@microchip.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5D2CC32792 for <linux-arm-kernel@archiver.kernel.org>; Sat, 20 Aug 2022 13:07:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mqpkNlTiPs7rv0c3EqO8Fb7UGlzam2tAZN1bxYgPbPo=; b=OcGvvuXZqI9G1+ xi+jnx8SeR/FY5prrn7jHvBJUVWtwGlcGnpNW6C5gfVkpl03wfZOUXUoLWr+NvJ3UwGMK/0rnhQ4X AbwteBJYWb7pLaWcugzgWipyBryZR52O+5wphXRVxcG/BaAIW4h8lzVMcRspTwSXHBzVHjv5VXiIV I+K83u/YWISNSXRRrbfeVDrb84MdAUX25xXD18bU4JUpHAPxTeJgyaEXMfxyxT9JhRa1XfVKP24P2 uaqnj5pyj4R4ssyxWH67t0jcCGfqOh9q2AyKGJWdn9oYNB6kQWKHks/0gYSQe3uY8oR8X7ujFCbfA W2bT47GFnB6mh93MUcEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oPOAo-00AGip-LA; Sat, 20 Aug 2022 13:05:59 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oPO3a-00ACkE-5P for linux-arm-kernel@lists.infradead.org; Sat, 20 Aug 2022 12:58:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1661000310; x=1692536310; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0AgovvAf2oyRX/MLTme3uR4QecLpUDkruVyWCc1dDvg=; b=2HnXYW15TDG6PbL24HnsaU2iRKNzk2NEAr0+nl862OIaqf5dQ/99dZd0 y29KFfI9ivkiWmL5KGap6UTrH4Dq6w+90v6Snnin0DrGW+nV7rGgyJpAI JQs247oKbtZQdAVqgrhCEHCKZXviUEh6NaNM8HcNx76m6Z4G5yxNVbDSJ puDVnXAg7wrhRWKnzOMhFi0KIMuQ+fOaQK6J8LTflIi9wd3oQFfc579BN sSB8dCy1S6lps/UyNXsEtmvTboZDb0mNgnmnoLleic2D84efqktMxQEEe /96Hy6sqgGDF2JNzqZUo4oZhvWfaoOOIwk53mPdJFXKj34IqDJkU0wBEZ w==; X-IronPort-AV: E=Sophos;i="5.93,251,1654585200"; d="scan'208";a="109911618" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Aug 2022 05:58:29 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Sat, 20 Aug 2022 05:58:29 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Sat, 20 Aug 2022 05:58:25 -0700 From: Tudor Ambarus <tudor.ambarus@microchip.com> To: <vkoul@kernel.org>, <peda@axentia.se>, <du@axentia.se>, <regressions@leemhuis.info> Subject: [PATCH 19/33] dmaengine: at_hdmac: Don't allow CPU to reorder channel enable Date: Sat, 20 Aug 2022 15:57:03 +0300 Message-ID: <20220820125717.588722-20-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220820125717.588722-1-tudor.ambarus@microchip.com> References: <20220820125717.588722-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220820_055830_312209_A40F724E X-CRM114-Status: UNSURE ( 9.20 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: tudor.ambarus@microchip.com, linux-kernel@vger.kernel.org, maciej.sosnowski@intel.com, mripard@kernel.org, torfl6749@gmail.com, ludovic.desroches@microchip.com, stable@vger.kernel.org, dmaengine@vger.kernel.org, dan.j.williams@intel.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
dmaengine: at_hdmac: Fix concurrency bugs and then convert to virt-dma
|
expand
|
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 825a29ede35e..1cb0d26d30ed 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -691,6 +691,8 @@ static void atc_dostart(struct at_dma_chan *atchan, struct at_desc *first) channel_writel(atchan, DPIP, FIELD_PREP(ATC_DPIP_HOLE, first->dst_hole) | FIELD_PREP(ATC_DPIP_BOUNDARY, first->boundary)); + /* Don't allow CPU to reorder channel enable. */ + wmb(); dma_writel(atdma, CHER, atchan->mask); vdbg_dump_regs(atchan);
at_hdmac uses __raw_writel for register writes. In the absence of a barrier, the CPU may reorder the register operations. Introduce a write memory barrier so that the CPU does not reorder the channel enable, thus the start of the transfer, without making sure that all the pre-required register fields are already written. Fixes: dc78baa2b90b ("dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller") Reported-by: Peter Rosin <peda@axentia.se> Cc: stable@vger.kernel.org Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Link: https://lore.kernel.org/lkml/13c6c9a2-6db5-c3bf-349b-4c127ad3496a@axentia.se/ --- drivers/dma/at_hdmac.c | 2 ++ 1 file changed, 2 insertions(+)