Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp436797rwa; Sat, 20 Aug 2022 06:45:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR6mATNJtTxXf9lq2Ri1va2Mxc4mHIX9RF8cgr1NKNPjDqtvqmWpZorD/rUQ09ktVnN1PyhB X-Received: by 2002:a65:4bc6:0:b0:428:90d4:b410 with SMTP id p6-20020a654bc6000000b0042890d4b410mr9833876pgr.529.1661003108290; Sat, 20 Aug 2022 06:45:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661003108; cv=none; d=google.com; s=arc-20160816; b=Bth717ttk8hj2ujfJM68nCHLe9+NO9/tImmmqQxywyfAwhptuiGWm3858JCQtcFbca QnCkDbs57IrNFTSGsfR2Iw4Aa4o8NcsulUS6JNR63i3d2YSvQ2H2cVlsYzCDN04GKzs3 sbFIEqiqWTQZzC9tmH368VOYEp3KkzTxBZGZgbouA8rPaSKaNSJRcOjchFBNaBVl+EAt BLs4D0cB+uVJXWaZmAXtlWAFAQhr7A5lzbYvLMvHu+FUqxQTwk9+wP1Ayo06R+lx07/9 AjIDxoNkFSaEhr+jSnWHtqSH+1EltdFQ3+KbvYyu8HNCOOWhAfdoM98TfIFYXm+XEmkZ QhwQ== 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=NHF6xdynAstHJGXNETRzqOk4lSqSngL9ksrrl3qFd80=; b=DhxuWhPFCg4epqhGedQmADiXEC6958NxttQ0SXNarZfsbQTSggKTaYOMWV54VpVok5 r55BXAKVs/G8WjAdsqdEhZJDtjFYZ9XN98OyDpnYGgHsiAikyhPmkuvftWq54mfCB3xH FoHw2lLVY44+ye4ySB2Kmk889tL97x8rCA19xHGlQOwzvc0PYfZKSbMw0C4PIDCo6E2H GJlZRFpHHXFUFksezIF4m8ym032F5nR2n1yznMUNIlnRgSGLgHNiYNdPyGBvjxK4z7S7 zO8v14hmPjMZfRIs1HxO7uEUqRRHw4ya+WLmZ2KfNUrNk9MQTJTL3Wbxe9+OhFG7PHlX zoTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=baxC7uW2; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l187-20020a6391c4000000b00415bfaddcddsi7032488pge.471.2022.08.20.06.44.57; Sat, 20 Aug 2022 06:45:08 -0700 (PDT) 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=@microchip.com header.s=mchp header.b=baxC7uW2; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346716AbiHTM6W (ORCPT + 99 others); Sat, 20 Aug 2022 08:58:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346596AbiHTM6O (ORCPT ); Sat, 20 Aug 2022 08:58:14 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A810B81B35; Sat, 20 Aug 2022 05:57:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1661000274; x=1692536274; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xlw3IdAZ81suDirj3E/spzE89GDrkU0r31oHfF03KfE=; b=baxC7uW2MGKL9MfiOMJmFH4AeKhq0Ci/xdDJXmq33wSj1a1gmrzV7u18 ofkJA09tp9fCUGF0hALFWs+POCDRZIkGWoLaA3a0rTNRvJ4npit7OiXuX hJDjDbhRjpmdlDokohAQtJIhSLiM/f5/jxjZVdKW3OQq2IxLlxPHxYxap +pwK83hUYVeI6anUsSgVxfAzWzLYdNLpjYq4UzHCQNrwL+l832wFRs4XX T4kXgI1mJs/899NcVsi5ODbhD6QOBRJLBDAu3pLdUPK7b7+DVwrDrusrF k8HpPakO6pRArib8W9cxovBq7iMDLX3G/niVgVCEqGYcG9tD3LIEH3IO2 A==; X-IronPort-AV: E=Sophos;i="5.93,251,1654585200"; d="scan'208";a="187325502" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Aug 2022 05:57:52 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) 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:57:50 -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:57:46 -0700 From: Tudor Ambarus To: , , , CC: , , , , , , , , , , Subject: [PATCH 08/33] dmaengine: at_hdmac: Don't start transactions at tx_submit level Date: Sat, 20 Aug 2022 15:56:52 +0300 Message-ID: <20220820125717.588722-9-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 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org tx_submit is supposed to push the current transaction descriptor to a pending queue, waiting for issue_pending() to be called. issue_pending() must start the transfer, not tx_submit(), thus remove atc_dostart() from atc_tx_submit(). Clients of at_xdmac that assume that tx_submit() starts the transfer must be updated and call dma_async_issue_pending() if they miss to call it. The vdbg print was moved to after the lock is released. It is desirable to do the prints without the lock held if possible, and because the if statement disappears there's no reason why to do the print while holding the lock. Fixes: dc78baa2b90b ("dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller") Reported-by: Peter Rosin Signed-off-by: Tudor Ambarus Cc: stable@vger.kernel.org Link: https://lore.kernel.org/lkml/13c6c9a2-6db5-c3bf-349b-4c127ad3496a@axentia.se/ --- drivers/dma/at_hdmac.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index e89facf14fab..b6b1d2dcfc4c 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -1126,19 +1126,11 @@ static dma_cookie_t atc_tx_submit(struct dma_async_tx_descriptor *tx) spin_lock_irqsave(&atchan->lock, flags); cookie = dma_cookie_assign(tx); - if (list_empty(&atchan->active_list)) { - dev_vdbg(chan2dev(tx->chan), "tx_submit: started %u\n", - desc->txd.cookie); - atc_dostart(atchan, desc); - list_add_tail(&desc->desc_node, &atchan->active_list); - } else { - dev_vdbg(chan2dev(tx->chan), "tx_submit: queued %u\n", - desc->txd.cookie); - list_add_tail(&desc->desc_node, &atchan->queue); - } - + list_add_tail(&desc->desc_node, &atchan->queue); spin_unlock_irqrestore(&atchan->lock, flags); + dev_vdbg(chan2dev(tx->chan), "tx_submit: queued %u\n", + desc->txd.cookie); return cookie; } -- 2.25.1