Message ID | 20221025090306.297886-21-tudor.ambarus@microchip.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 l7csp892334wru; Tue, 25 Oct 2022 02:09:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4BIdjELj3rGjwKLjnXIfKWspJLZZ9oDtuNphmqXQgABOEqcrZPyJn3oY+Qht1E/goZs1pP X-Received: by 2002:a50:fe99:0:b0:45c:329a:40f6 with SMTP id d25-20020a50fe99000000b0045c329a40f6mr34602658edt.425.1666688945433; Tue, 25 Oct 2022 02:09:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666688945; cv=none; d=google.com; s=arc-20160816; b=Hxfl1oAlVBlBBr55NxNx0pyNEuXS1OsjyqiP5V6lVnlOXjGktwzqevCr1CIdr08bBs ALtF6nS6FE1mt9YR99biPNRfymXSMKWDN8QbJ14nCfoami+tKGcbgoOIyAAxtrQiCVZy 9wM1RPUarSxXnI2O+jmi4NYwuhbItkkDUTke9vCWQrEYv70CyOeX4pUnaqA5iMSeQ/N1 DouY2mRCa4hBhf8AF/pKsJXKaMsdWmWRuIqyumoMFzkGeIeEFcJdvYVzI2vDPsgQLCZe yWhDKliroABeAbX3Q822KoghTJV1QEmpywFGVT05MiJ88BJigJSJrnCSqLMzrp6Mw1sB VMug== 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=bv/UP5vpl1vkf1HqDqTA+z1vTF/0R7C7rKbnM/RGAik=; b=m5QxykKvDhkdT9cwLQgZb89uE+gmoL6Id9YWWiXWppmL8yscuUarfrKn8ziSEMecq2 Sa4aMin+mI4/OcsiImZK4JyyAJaEd5eiT9JxAVd0rZs2/KX7sgNWzX9899OJ+z9DU2/g kifLMnl0ka/pUaJpJOQcLZsYucgo47VpO970GURo0AMdL7zDpQwzEjgTPEDtAQVmxrk2 j8LWHWUSQ13qNxXwmu9+r16y+fggZR10ZE7uLtCriTkyR4VMtyCUHpLji0ltDZaifQAu tGgOmTyCaVisiUwfsXNui/1g4XKAZzWYa2AC8LQSr92s09suKZuXBrRCQjD843dV+vXW EQwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="OYICH/C2"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv12-20020a17090760cc00b0077951929340si1195837ejc.271.2022.10.25.02.08.38; Tue, 25 Oct 2022 02:09:05 -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="OYICH/C2"; 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 S231994AbiJYJHe (ORCPT <rfc822;lucius.rs.storz@gmail.com> + 99 others); Tue, 25 Oct 2022 05:07:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231854AbiJYJFw (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 25 Oct 2022 05:05:52 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57E1515A96B; Tue, 25 Oct 2022 02:04:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1666688659; x=1698224659; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DNAY7VAtyOz7UkqIW9MBLxULwOivUa2HVnvrZrgiFrY=; b=OYICH/C2KwsBGeRh/T1EfGzYWxhQkjVFIw6vMjF2t3U2YITja9hgOVlz He5zfm/usiSSxpbT5dzRv++37X1epaW1u86+vRcBuJsDTgqoVXakn3lIt BdjwV/0AeST65geSuJd3hjr3whxPTNQ9fVHX6GD9rtUFog1TGYVzdadbA l9VcLB5p/QRvrISV7k2RwkGPJVP7A7chiZOTEAW3/rpIisltb6albCFdA nAWb8nK3U9gY4pvgXsQnmclhC+ehJBPwujWRIspvUzn+wZ6m8fb7Kzhar ruEGIvwGGZ2dXACjYgUmXx5LJF65wKVZ1KsCqKx9xQF1M/6CblrpDHjGZ g==; X-IronPort-AV: E=Sophos;i="5.95,211,1661842800"; d="scan'208";a="120221361" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 25 Oct 2022 02:04:18 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) 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; Tue, 25 Oct 2022 02:04:12 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Tue, 25 Oct 2022 02:04:09 -0700 From: Tudor Ambarus <tudor.ambarus@microchip.com> To: <vkoul@kernel.org>, <peda@axentia.se>, <du@axentia.se> CC: <maciej.sosnowski@intel.com>, <nicolas.ferre@microchip.com>, <mripard@kernel.org>, <torfl6749@gmail.com>, <linux-kernel@vger.kernel.org>, <dmaengine@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, "Tudor Ambarus" <tudor.ambarus@microchip.com> Subject: [PATCH v2 20/32] dmaengine: at_hdmac: s/atc_get_bytes_left/atc_get_residue Date: Tue, 25 Oct 2022 12:02:54 +0300 Message-ID: <20221025090306.297886-21-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221025090306.297886-1-tudor.ambarus@microchip.com> References: <20221025090306.297886-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.9 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,URIBL_BLOCKED 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?1747650027514537214?= X-GMAIL-MSGID: =?utf-8?q?1747650027514537214?= |
Series |
dmaengine: at_hdmac: Fix concurrency bugs and then convert to virt-dma
|
|
Commit Message
Tudor Ambarus
Oct. 25, 2022, 9:02 a.m. UTC
Use dmaengine terminology and rename the method to better indicate what it
does: it gets the residue value which will be later on set with
dma_set_residue().
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
drivers/dma/at_hdmac.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index e2c46f32b284..6c328cd16983 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -308,15 +308,15 @@ static inline u32 atc_calc_bytes_left(u32 current_len, u32 ctrla) } /** - * atc_get_bytes_left - get the number of bytes residue for a cookie. + * atc_get_residue - get the number of bytes residue for a cookie. * The residue is passed by address and updated on success. * @chan: DMA channel * @cookie: transaction identifier to check status of * @residue: residue to be updated. * Return 0 on success, -errono otherwise. */ -static int atc_get_bytes_left(struct dma_chan *chan, dma_cookie_t cookie, - u32 *residue) +static int atc_get_residue(struct dma_chan *chan, dma_cookie_t cookie, + u32 *residue) { struct at_dma_chan *atchan = to_at_dma_chan(chan); struct at_desc *desc_first = atc_first_active(atchan); @@ -1471,10 +1471,7 @@ atc_tx_status(struct dma_chan *chan, return dma_status; spin_lock_irqsave(&atchan->lock, flags); - - /* Get number of bytes left in the active transactions */ - ret = atc_get_bytes_left(chan, cookie, &residue); - + ret = atc_get_residue(chan, cookie, &residue); spin_unlock_irqrestore(&atchan->lock, flags); if (unlikely(ret < 0)) {