From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9A0E6C61DF4 for ; Fri, 24 Nov 2023 13:17:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:Message-ID: In-Reply-To:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zLVY/lpn7cxsZ5UWs5Ltim2Tht8ACtlSjo2ew52QpVQ=; b=Gdxb4OehxVsnxj GXSqG6hr6XX52/OWwCn2AcffsZ+HO+3q1rvQyxJ/w84WMvNuEpXz8Yc6SqHV8xym/x56SYFL2vYQT KsSIZUKw7YQ575A+6abudKr05CVxY6l2ds0eRinv3RaKXJkrVJcVAVuP75hVfaP2Bb33VpacFZytG 2YknNEqkLXOqrFhmWkAIUUX1neZa+/iIwJ8vwayU+HyUFT1gP0oXw3zbqZDEBByS2boVRZqYh7j59 dO95g0aTLPSI2n2RPp0LVAYuAH5Zz0IY9bKKaii+xRGk/csN/6JEiSDH0AdY8gkEmTx3AmUG/48xq bwLVk2ZeFtuQbSEvWZ7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r6W2u-007Ha4-0H; Fri, 24 Nov 2023 13:16:36 +0000 Received: from mail.pcs.gmbh ([89.27.162.52]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r6W2r-007HZQ-1i for linux-arm-kernel@lists.infradead.org; Fri, 24 Nov 2023 13:16:35 +0000 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 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231124_051633_899664_85694D6C X-CRM114-Status: GOOD ( 24.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tudor.ambarus@microchip.com, linux-kernel@vger.kernel.org, ludovic.desroches@microchip.com, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel