Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1073222rdh; Fri, 24 Nov 2023 04:53:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IE3K3HjK5qfN2VBI10cmHa5ImCUw16aJ8chWMlc/G9LGoPadTiUbHeRRQWEo//msjnyIk7C X-Received: by 2002:a17:902:ea08:b0:1ca:8541:e1ea with SMTP id s8-20020a170902ea0800b001ca8541e1eamr2937707plg.0.1700830413013; Fri, 24 Nov 2023 04:53:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700830412; cv=none; d=google.com; s=arc-20160816; b=LqClMCo3PP9wCsT4rT37mam3W3N7CsLzn40aziYD+j6JKP3Lped+Gvyr/j22lrk0nF 5WvDR1UcBQi6xylTv1UBsI0qPq4S+0tYk0Lnmqa2GQoqAtlWvtIiwgLMpS0tfNOg2N+H Yyuh7Zoh0YLD4VixOwpjX2wHVk2sgCF4LwESI3TZPA2gaqVWoqjjdm38jP/qmGco+iML N/YmlafDPRAouHye5NdmzTAHWOame6wAu/igveyKF2fL6UHtWuBB26a4nhZ1VRqDsDb7 d2uvz9LHdGUOMNvQlLVjx9Z03tVHA4Vf/fGlg671kMgdQZYxyhYWaRiE2gE6ozsAw0xK x/cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5WgnGp8pSNpUaqgl+dA2Df5zzM4FWy08uU+ESye3Mps=; fh=TAS9ynyd57BO1Gy9gg+EzB3tG0TFb3z4tdlPmqqfNMM=; b=ANU+rmephKR56avMOv+FUZIVoaH+a5EMg3Y75RkGxUi7T4ecsAR3/AfzUzvCOgWo+Q J5EYyAViMSssfvJc/mGfnL5klbQFDQKYtJDPxi9cGYeYZBGAlyx/RlZh5W1HBOJV0vB9 BQxr9HJks6E1Wx+eLV/ifmf/CZPRejv3RiwBsE8p8cmzJXdypEywOtHxHCy+E4JLofa8 33Io+rrNckvmjDVelpOZt2l408Y5SDX8jgIIRiHyhcbluHsPZeK5yyu5YAT4S7LaKbuq e/lFkknxYppYJJMHG2X0cyDhy6XDqEp45DnPfPlK6E8mqWKsokZOCTEda50yx3gK9sJU W63w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VZqKYnIU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id g6-20020a170902c38600b001cf67881772si3291111plg.537.2023.11.24.04.53.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 04:53:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VZqKYnIU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 8A5CB822636C; Fri, 24 Nov 2023 04:53:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230433AbjKXMxP (ORCPT + 99 others); Fri, 24 Nov 2023 07:53:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbjKXMxO (ORCPT ); Fri, 24 Nov 2023 07:53:14 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FC68D71 for ; Fri, 24 Nov 2023 04:53:21 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79279C433C7; Fri, 24 Nov 2023 12:53:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700830401; bh=jDYI24ELCvDTS98bS4B1Y7XrA4wLz6GtcIczEr1aodo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VZqKYnIUVvr1DuFPlEOpgbiwKJCCFaOv9LTFqBLeA49yywjaB//k5rEIoc1JXAOsY 2i0pGQMJAXMYKG5I+cdNY2IkGLkKsdXdF+OSrHDGdZf8rAYJzwkbaC1ENFQfHybCXT CytGgpbeaPCx14LaK4fE8BdabYgwAgSUXC6IOnzpZxEw8ikqAwUfT+4keNaPPJ7FPL lGC0q8PKYO1q7bqvLg5drluWEJ+AumO59ntpiiJeMvN6Aq4n90etbh8kgWvIA7lFws 480LN64i6+4az6DfNu3nYKzU3ybINn6hrKWZEXvnnjxkCDqmYOShWEFWVeTyJwxpMD 2yOegHEH77jSQ== Date: Fri, 24 Nov 2023 18:23:16 +0530 From: Vinod Koul To: Thomas Pfaff Cc: ludovic.desroches@microchip.com, tudor.ambarus@microchip.com, nicolas.ferre@microchip.com, linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC 1/2 stable-6.1] dmaengine: at_hdmac: get next dma transfer from the right list Message-ID: References: <15c92c2f-71e7-f4fd-b90b-412ab53e5a25@pcs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15c92c2f-71e7-f4fd-b90b-412ab53e5a25@pcs.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 24 Nov 2023 04:53:30 -0800 (PST) On 14-11-23, 13:22, Thomas Pfaff wrote: > From: Thomas Pfaff > > In kernel 6.1, atc_advance_work and atc_handle_error are checking for the > next dma transfer inside active list, but the descriptor is taken from the > queue instead. Sorry that is not how this works. Please send the patch for mainline and add a stable tag to the patches. They will be backported to stable kernels Also, your patch threading is broken, they appear disjoint and not as a series Thanks > > Signed-off-by: Thomas Pfaff > --- > diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c > index 858bd64f1313..68c1bfbefc5c 100644 > --- a/drivers/dma/at_hdmac.c > +++ b/drivers/dma/at_hdmac.c > @@ -490,6 +490,27 @@ atc_chain_complete(struct at_dma_chan *atchan, struct at_desc *desc) > } > } > > +/** > + * atc_start_next - start next pending transaction if any > + * @atchan: channel where the transaction ended > + * > + * Called with atchan->lock held > + */ > +static void atc_start_next(struct at_dma_chan *atchan) > +{ > + struct at_desc *desc = NULL; > + > + if (!list_empty(&atchan->active_list)) > + desc = atc_first_active(atchan); > + else if (!list_empty(&atchan->queue)) { > + desc = atc_first_queued(atchan); > + list_move_tail(&desc->desc_node, &atchan->active_list); > + } > + > + if (desc) > + atc_dostart(atchan, desc); > +} > + > /** > * atc_advance_work - at the end of a transaction, move forward > * @atchan: channel where the transaction ended > @@ -513,11 +534,7 @@ static void atc_advance_work(struct at_dma_chan *atchan) > > /* advance work */ > spin_lock_irqsave(&atchan->lock, flags); > - if (!list_empty(&atchan->active_list)) { > - desc = atc_first_queued(atchan); > - list_move_tail(&desc->desc_node, &atchan->active_list); > - atc_dostart(atchan, desc); > - } > + atc_start_next(atchan); > spin_unlock_irqrestore(&atchan->lock, flags); > } > > @@ -529,7 +546,6 @@ static void atc_advance_work(struct at_dma_chan *atchan) > static void atc_handle_error(struct at_dma_chan *atchan) > { > struct at_desc *bad_desc; > - struct at_desc *desc; > struct at_desc *child; > unsigned long flags; > > @@ -543,11 +559,7 @@ static void atc_handle_error(struct at_dma_chan *atchan) > list_del_init(&bad_desc->desc_node); > > /* Try to restart the controller */ > - if (!list_empty(&atchan->active_list)) { > - desc = atc_first_queued(atchan); > - list_move_tail(&desc->desc_node, &atchan->active_list); > - atc_dostart(atchan, desc); > - } > + atc_start_next(atchan); > > /* > * KERN_CRITICAL may seem harsh, but since this only happens > -- ~Vinod