From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752559AbbBSHyY (ORCPT ); Thu, 19 Feb 2015 02:54:24 -0500 Received: from mail-ig0-f173.google.com ([209.85.213.173]:36695 "EHLO mail-ig0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752186AbbBSHyX (ORCPT ); Thu, 19 Feb 2015 02:54:23 -0500 MIME-Version: 1.0 In-Reply-To: <20150218150216.GE32600@odux.rfo.atmel.com> References: <1423387744-2410-1-git-send-email-torfl6749@gmail.com> <1423387744-2410-2-git-send-email-torfl6749@gmail.com> <20150218150216.GE32600@odux.rfo.atmel.com> Date: Thu, 19 Feb 2015 08:54:22 +0100 Message-ID: Subject: Re: [PATCH 1/2] dma: at_hdmac: Fix calculation of the residual bytes From: Torsten Fleischer To: Torsten Fleischer , nicolas.ferre@atmel.com, dan.j.williams@intel.com, vinod.koul@intel.com, linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Ludovic, >> >> transfer 1: residue = 975584 >> transfer 2: residue = 1048380 >> > > You're right about these points. Good job. I think it should be sent to > stable if it can be applied properly. > > For multilines comments, please follow the coding rule > /* > * my > * comments > */ > thanks for the hint. I will fix this in the next version of the patch. >> + /* cookie matches to the currently running transfer */ >> + ret = desc_first->total_len; >> + >> + if (desc_first->lli.dscr) { >> + /* hardware linked list transfer */ >> + >> + /* Calculate the residue by removing the length of the child >> + * descriptors already transferred from the total length. >> + * To get the current child descriptor we can use the value of >> + * the channel's DSCR register and compare it against the value >> + * of the hardware linked list structure of each child >> + * descriptor. */ >> + >> + dscr = channel_readl(atchan, DSCR); >> + >> + /* the first descriptor is currently in work */ >> + if (desc_first->lli.dscr == dscr) >> + return ret; >> > > Why returning total_len in this case? I think you can return a more accurate > value as you do for the last descriptor. > Good point. I will add a calculation for the first descriptor. Regards Torsten From mboxrd@z Thu Jan 1 00:00:00 1970 From: torfl6749@gmail.com (Torsten Fleischer) Date: Thu, 19 Feb 2015 08:54:22 +0100 Subject: [PATCH 1/2] dma: at_hdmac: Fix calculation of the residual bytes In-Reply-To: <20150218150216.GE32600@odux.rfo.atmel.com> References: <1423387744-2410-1-git-send-email-torfl6749@gmail.com> <1423387744-2410-2-git-send-email-torfl6749@gmail.com> <20150218150216.GE32600@odux.rfo.atmel.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hello Ludovic, >> >> transfer 1: residue = 975584 >> transfer 2: residue = 1048380 >> > > You're right about these points. Good job. I think it should be sent to > stable if it can be applied properly. > > For multilines comments, please follow the coding rule > /* > * my > * comments > */ > thanks for the hint. I will fix this in the next version of the patch. >> + /* cookie matches to the currently running transfer */ >> + ret = desc_first->total_len; >> + >> + if (desc_first->lli.dscr) { >> + /* hardware linked list transfer */ >> + >> + /* Calculate the residue by removing the length of the child >> + * descriptors already transferred from the total length. >> + * To get the current child descriptor we can use the value of >> + * the channel's DSCR register and compare it against the value >> + * of the hardware linked list structure of each child >> + * descriptor. */ >> + >> + dscr = channel_readl(atchan, DSCR); >> + >> + /* the first descriptor is currently in work */ >> + if (desc_first->lli.dscr == dscr) >> + return ret; >> > > Why returning total_len in this case? I think you can return a more accurate > value as you do for the last descriptor. > Good point. I will add a calculation for the first descriptor. Regards Torsten