Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp542393pxb; Thu, 15 Apr 2021 00:13:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+N5ag0rxN14YiBjcFdu9cbu+Oz06aiPH6wE3MgaCV+eNah3lOFtdX89+K3fInPukJy4Es X-Received: by 2002:a50:9faf:: with SMTP id c44mr2409874edf.196.1618470782223; Thu, 15 Apr 2021 00:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618470782; cv=none; d=google.com; s=arc-20160816; b=T2ygan+WZhvWIccG4bXIfrZbcFTosfdbeIkueawInFyHKENRqvueBE3XzwRcbrof8v cewDLInem9Tg4AFmB2E7Ffmuoh/c0SYtgVIJ6pi1q7MQxXDGoEh14h3FLCK0Q3RpoHr7 lAxUSLTMrqnxUA4FajpWGHrjtjhcFaUDJoJMqQL797/iNXF5bzueoz8IS+R7mb697BY8 GhgkdjH4T+LQLSZ3CH53dLAD4w/6JenIYByIZlfl6Updumuqmy9x0k30KVnUO6M7hcQn M0dQ8qiUcYqyB7FmVP6/HfI1MRhfCYEnCnIyFWygx3O48OpbmyRbuza0UZxJvCRFXHsv Jtxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=+9H0bKAnx9cQBA5s/McJpnyim7Uc9dhnMfPi4vnqmPU=; b=bW4HlM/Cmasim0Job49Wwm0sSMaRJj0x2shJP6Gl0va443TT+tlcKpU/LNzI1INL1a l6uBQk4f4uKhgdzJ3E0pxb5hfMQS/qCBqsct9Bv4VUS4M4oWR5pPgeicFCDYmYYpMbOu 0QjvneaN2J1uw1ZwBkt3/SgP0oSXMRiyeJ/dcReuML2JsCUQq+d8eGtw4/Qq/0sNqOtP HVEv51AyqTdrcj7ha1LlMrMDYz/MKmR+optoKjauI6Tvfqqu0JUkv0rpWlPw/qKQxKr9 5iICiWgH5QwXU37g4mYhwuL1AP6KjrkWKgZOFDPpnHFJYTHxMQb49Gbzt7uX6WwHCZqu /VXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@metafoo.de header.s=default2002 header.b=l0V5ycDF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=metafoo.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu23si1305674ejb.669.2021.04.15.00.12.38; Thu, 15 Apr 2021 00:13:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@metafoo.de header.s=default2002 header.b=l0V5ycDF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=metafoo.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231241AbhDOHJ0 (ORCPT + 99 others); Thu, 15 Apr 2021 03:09:26 -0400 Received: from www381.your-server.de ([78.46.137.84]:55908 "EHLO www381.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230481AbhDOHJZ (ORCPT ); Thu, 15 Apr 2021 03:09:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metafoo.de; s=default2002; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=+9H0bKAnx9cQBA5s/McJpnyim7Uc9dhnMfPi4vnqmPU=; b=l0V5ycDFi5UbrKewqM19dWjL2O ziJwTXrgX5kzscFQQA8QVkqt9aHftnCMCt8yhQtfhH2UhtT1SN4TJx4rvfztSmmxeJx22PO6a+rza M5o448qorKXcOWHN9OWi7Tk8tWW26kHIxpCH8G786Y3IlwNqy+SvTJiZJ4KgqEGIYGlU7PjrNInkh VihdhX1qsB4AbHDo2gCVN1P5DU5Y9NxTy/VfiKleyvRTuSNd2YKa2w1zECYZ1dZqbxoOREJ1Agt59 xGaFQL+0n/vjtdxzEqtptokKo3KjV2gUo8iv1hxNlRRov0b7v+/PN8z8OS6jRTN7XM840LcfvoGmj 26wimmJQ==; Received: from sslproxy05.your-server.de ([78.46.172.2]) by www381.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1lWw7X-000D8T-RI; Thu, 15 Apr 2021 09:08:59 +0200 Received: from [2001:a61:2a42:9501:9e5c:8eff:fe01:8578] by sslproxy05.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lWw7X-0001ko-KI; Thu, 15 Apr 2021 09:08:59 +0200 Subject: Re: [RFC v2 PATCH 5/7] dmaengine: xilinx_dma: Freeup active list based on descriptor completion bit To: Radhey Shyam Pandey , vkoul@kernel.org, robh+dt@kernel.org, michal.simek@xilinx.com Cc: dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, git@xilinx.com References: <1617990965-35337-1-git-send-email-radhey.shyam.pandey@xilinx.com> <1617990965-35337-6-git-send-email-radhey.shyam.pandey@xilinx.com> From: Lars-Peter Clausen Message-ID: Date: Thu, 15 Apr 2021 09:08:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <1617990965-35337-6-git-send-email-radhey.shyam.pandey@xilinx.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Authenticated-Sender: lars@metafoo.de X-Virus-Scanned: Clear (ClamAV 0.102.4/26140/Wed Apr 14 13:10:01 2021) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/9/21 7:56 PM, Radhey Shyam Pandey wrote: > AXIDMA IP in SG mode sets completion bit to 1 when the transfer is > completed. Read this bit to move descriptor from active list to the > done list. This feature is needed when interrupt delay timeout and > IRQThreshold is enabled i.e Dly_IrqEn is triggered w/o completing > interrupt threshold. > > Signed-off-by: Radhey Shyam Pandey > --- > - Check BD completion bit only for SG mode. > - Modify the logic to have early return path. > --- > drivers/dma/xilinx/xilinx_dma.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c > index 890bf46b36e5..f2305a73cb91 100644 > --- a/drivers/dma/xilinx/xilinx_dma.c > +++ b/drivers/dma/xilinx/xilinx_dma.c > @@ -177,6 +177,7 @@ > #define XILINX_DMA_CR_COALESCE_SHIFT 16 > #define XILINX_DMA_BD_SOP BIT(27) > #define XILINX_DMA_BD_EOP BIT(26) > +#define XILINX_DMA_BD_COMP_MASK BIT(31) > #define XILINX_DMA_COALESCE_MAX 255 > #define XILINX_DMA_NUM_DESCS 512 > #define XILINX_DMA_NUM_APP_WORDS 5 > @@ -1683,12 +1684,18 @@ static void xilinx_dma_issue_pending(struct dma_chan *dchan) > static void xilinx_dma_complete_descriptor(struct xilinx_dma_chan *chan) > { > struct xilinx_dma_tx_descriptor *desc, *next; > + struct xilinx_axidma_tx_segment *seg; > > /* This function was invoked with lock held */ > if (list_empty(&chan->active_list)) > return; > > list_for_each_entry_safe(desc, next, &chan->active_list, node) { > + /* TODO: remove hardcoding for axidma_tx_segment */ > + seg = list_last_entry(&desc->segments, > + struct xilinx_axidma_tx_segment, node); This needs to be fixed before this can be merged as it right now will break the non AXIDMA variants. > + if (!(seg->hw.status & XILINX_DMA_BD_COMP_MASK) && chan->has_sg) > + break; > if (chan->has_sg && chan->xdev->dma_config->dmatype != > XDMA_TYPE_VDMA) > desc->residue = xilinx_dma_get_residue(chan, desc);