Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1094803rdh; Fri, 24 Nov 2023 05:16:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IEC21z4VRlTGbiBYGmLAUBDQAOVELl8YS6csLDgjZOMtktxaTRaehaLCVsiYO3gybqqV/2P X-Received: by 2002:a05:6808:124e:b0:3af:639d:ead6 with SMTP id o14-20020a056808124e00b003af639dead6mr3263721oiv.36.1700831815150; Fri, 24 Nov 2023 05:16:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700831815; cv=none; d=google.com; s=arc-20160816; b=e4bASbM68WWgj7idu3I/HN8Q9mhOJGK7jjYUkK6PcmQrC95nF+C/LGVWK9EU8RflTX rdLbeUgO83ImuoPSukCqDKrddKCXL+bfwQ+NiLQGMbrQ4xKKbtL2wCfMHJtZDIHLcP5a WAJRpYBJGV/w/Vv1U8sYA6gEwoyWRo3ZQ726PRepe7b5ygkshTbsx0OxCof2yqlrAfGL XKjPp38w91uLt9cL3qlF5OCX19f2f7gKAUlh6s9W0OMMsv77xVJe2QszV9dzxTsspEm8 TQQrJkC/U8WFrlhndYCICVSssCycvtLvTjfgCCEFPk/A+3v6vt/EBHcc/oVrvfM8D8t0 nGFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date; bh=bFHaZCPSidIwixCwiyNts5EvhH5SPZ0TSZOnDDvYgjI=; fh=osFiwsdRJ4Vw+OBg/Jfst6xQq+vIo5dAXTsIiYSy2rY=; b=xmzoYuRjxFJjzKXoyZlNaCfbrUuUByvXTMFtzWZme1D7/IsnakWl5kGfVSCi0Cw2jZ noVFt2FOKVUWCK3StoJzpiw20svIf6OVG5P1Zur19cCkKZwsoHNZgG9Qm+n9kcjJtovU k3Q0BSB5Li519aqFExmZdykZsMUqV+zoFo9eZzPw1q7TBmU5J0G/OeWZxT4UDy/2gpjy QD7/EFIzrUcwgJE6unWcMBCm5RFg7PxZjBbSCKXllIJ5T4JfE2FTn/X2HEoW4ZdiGzRJ RADVSpOp6Vj78Q2XdHkmW0UpBerQEDeEBByAAlBgTGljHPhxXhsh6cNX0Lu7e9tU9x3C y/uA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id gs7-20020a0568083c8700b003b8402d57a0si1448888oib.174.2023.11.24.05.16.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 05:16:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 43B168047DA3; Fri, 24 Nov 2023 05:16:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230433AbjKXNQg (ORCPT + 99 others); Fri, 24 Nov 2023 08:16:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230406AbjKXNQe (ORCPT ); Fri, 24 Nov 2023 08:16:34 -0500 Received: from mail.pcs.gmbh (mail.pcs.gmbh [89.27.162.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BBFCD71; Fri, 24 Nov 2023 05:16:39 -0800 (PST) Received: from mail.csna.de (mail.csna.de [89.27.162.50]) by mail.pcs.gmbh with ESMTPA ; Fri, 24 Nov 2023 14:16:19 +0100 Received: from EXCHANGE2019.pcs.ditec.de (mail.pcs.com [89.27.162.5]) by mail.csna.de with ESMTPSA (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256) ; Fri, 24 Nov 2023 14:16:18 +0100 Received: from EXCHANGE2019.pcs.ditec.de (192.168.8.214) by EXCHANGE2019.pcs.ditec.de (192.168.8.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Fri, 24 Nov 2023 14:16:19 +0100 Received: from lxtpfaff.pcs.ditec.de (192.168.9.96) by EXCHANGE2019.pcs.ditec.de (192.168.8.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42 via Frontend Transport; Fri, 24 Nov 2023 14:16:19 +0100 Date: Fri, 24 Nov 2023 14:16:19 +0100 From: Thomas Pfaff To: Vinod Koul CC: , , , , , Subject: Re: [PATCH RFC 1/2 stable-6.1] dmaengine: at_hdmac: get next dma transfer from the right list In-Reply-To: Message-ID: References: <15c92c2f-71e7-f4fd-b90b-412ab53e5a25@pcs.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-KSE-ServerInfo: EXCHANGE2019.pcs.ditec.de, 9 X-KSE-AntiSpam-Interceptor-Info: white sender email list X-KSE-AttachmentFiltering-Interceptor-Info: protection disabled X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 24.11.2023 11:04:00 X-KSE-BulkMessagesFiltering-Scan-Result: protection disabled X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, 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 howler.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 (howler.vger.email [0.0.0.0]); Fri, 24 Nov 2023 05:16:52 -0800 (PST) Thank you for your answer. I was marking the patches as RFC and for stable 6.1 only. Between 6.1 and mainline, at_hdmac was ported to use virt-dma, there is no possibility for my patches to go to mainline and being backported. Most likely they are no longer needed in recent kernels. Kind regards, Thomas On Fri, 24 Nov 2023, Vinod Koul wrote: > 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 > >