Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8083747rwi; Tue, 25 Oct 2022 02:10:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6un2hkLmNIXu9T32FMbtFd95VZnN++hsKwVMdS/dKiGvJxkcCwr844BgKAagEq62Ii+AKo X-Received: by 2002:a05:6402:5409:b0:44f:1e05:1e8 with SMTP id ev9-20020a056402540900b0044f1e0501e8mr34483173edb.373.1666689013626; Tue, 25 Oct 2022 02:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666689013; cv=none; d=google.com; s=arc-20160816; b=sox5qTNdYLKEQAxsO3acJBb3PrndOxJTqUtapQapzL99VEzc+GDKGP/uU024PRgpcF fiGjSJlWDmku/MnljfV5Mf4UizCSYQ6iLNBw3piZGAIW80x2KMZEeIyEcFyNsrBH8C5o sndHATcmLingemkdTwzxi5RXM2FBHJ12/llvlHDkfMz4TTBbeqPWsHRICM0HSLeqXQhK ufu/8MwV5XRxltFY1Na5iHPDpinMnCh0Rt4i7Ty0hWim2lBTFKytZrWg07UwNnTRNswP UlIHa8Mp3SzThSRXo0Z1MSu5a6H+GlYEtbq+gUxSMCix6XGecRBQB/QI7ypLafEnXkF1 TQcg== 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=FR9gdycklEYsEQXBcnBkLdNuDhMCTk+kb2MA7DN0G8M=; b=sFQYOFEpOiIPpXBwwcn3dM416VWCVWZyPuwpLhaKm9Hvgy2rojHlDXiq0ys/q3ePZ/ Q+QxGkuHjUbeQ1ueqFMabs9cNQ1qYr6FSqMA3sYUlKGj2GzFp46Wmydc89cx3v3lAtfG DSMe5vzvYHqLwn5LEIRk/1kLJEocj9tZmG35DIeNzEf9LtvnAmRMSJG2LGB4/15nMNww lFjmmmVtzyShAJuqTl7tnaiu2VkQRb6ytc5vb49eR3qaV1MZuEhBJY6aCzpcyG1vkUJd gYpcuLeWuA319vBT6dbbWO0zTtZ/1RzjU7ohrvFxZbxHwtPYK4VnYygCPB5ipHipR4mn p7wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=PAwd3TXi; 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 gv28-20020a1709072bdc00b0078e0fd161dasi2253514ejc.87.2022.10.25.02.09.48; Tue, 25 Oct 2022 02:10:13 -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=PAwd3TXi; 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 S232091AbiJYJD7 (ORCPT + 99 others); Tue, 25 Oct 2022 05:03:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231951AbiJYJDt (ORCPT ); Tue, 25 Oct 2022 05:03:49 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E0EE15A336; Tue, 25 Oct 2022 02:03:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1666688612; x=1698224612; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ul7BWlxhjD0J6EB9rCSizho6eFo0osfoJ9tcx8Tf/VE=; b=PAwd3TXi78DZ0Buooa/KLIU9o410IN/966q5h9XmmTwo55c6800VtxHy h5c2WDy7wduKDEwxp8VUINAm1yDCPJn3UqnxlBS9iziQlTyQJPynaoOLS xRmoUPqNWlxzyb1L5obZqQHcYdGBLqswBSQXawiuM8wD6z2wlEEU5yGgZ B5BTqxHMXL5HJtmIpzaGaJnCMnM/80xVD5ur879giiiQBdW5wT7kH/ySa gOAHSlab0iwuxV+OZIWjRKRxgtGX+TkhfSd8PpnLBRMHDeyAYAl17reX8 TlmMgmqYE3tHmkeb4N1ABoDIRZkDnuhQ7271LGSwG1fje64YVYSqjAuNO g==; X-IronPort-AV: E=Sophos;i="5.95,211,1661842800"; d="scan'208";a="120221233" 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:03:30 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) 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:03:27 -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:03:25 -0700 From: Tudor Ambarus To: , , CC: , , , , , , , "Tudor Ambarus" , Subject: [PATCH v2 05/32] dmaengine: at_hdmac: Do not call the complete callback on device_terminate_all Date: Tue, 25 Oct 2022 12:02:39 +0300 Message-ID: <20221025090306.297886-6-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: X-Mailing-List: linux-kernel@vger.kernel.org The method was wrong because it violated the dmaengine API. For aborted transfers the complete callback should not be called. Fix the behavior and do not call the complete callback on device_terminate_all. Fixes: 808347f6a317 ("dmaengine: at_hdmac: add DMA slave transfers") 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 | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index cb5522417db6..11816484843e 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -1437,11 +1437,8 @@ static int atc_terminate_all(struct dma_chan *chan) struct at_dma_chan *atchan = to_at_dma_chan(chan); struct at_dma *atdma = to_at_dma(chan->device); int chan_id = atchan->chan_common.chan_id; - struct at_desc *desc, *_desc; unsigned long flags; - LIST_HEAD(list); - dev_vdbg(chan2dev(chan), "%s\n", __func__); /* @@ -1460,15 +1457,11 @@ static int atc_terminate_all(struct dma_chan *chan) cpu_relax(); /* active_list entries will end up before queued entries */ - list_splice_init(&atchan->queue, &list); - list_splice_init(&atchan->active_list, &list); + list_splice_tail_init(&atchan->queue, &atchan->free_list); + list_splice_tail_init(&atchan->active_list, &atchan->free_list); spin_unlock_irqrestore(&atchan->lock, flags); - /* Flush all pending and queued descriptors */ - list_for_each_entry_safe(desc, _desc, &list, desc_node) - atc_chain_complete(atchan, desc); - clear_bit(ATC_IS_PAUSED, &atchan->status); /* if channel dedicated to cyclic operations, free it */ clear_bit(ATC_IS_CYCLIC, &atchan->status); -- 2.25.1