Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2765292imj; Mon, 11 Feb 2019 08:08:40 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib2/KPFuZyWlptLrCIfj7iMdZYXVC0VG+Ck9td7FHol6UWNaLbdExHGyC2hPm7E70FzKpxB X-Received: by 2002:a17:902:b48d:: with SMTP id y13mr6218934plr.273.1549901320805; Mon, 11 Feb 2019 08:08:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549901320; cv=none; d=google.com; s=arc-20160816; b=Am0sPsqKVCVyFisEyGwrd6PIDgixl0RsG9LyoIicncYsnsx8FdfR8iWxZIc2jbCENu n6DN2/uIv8yZ+Ez/THCOTTl0i3WoZzHW4BIb18xwDsym6AhGNOH6jkTsAK+sbRfk8sWz zU1e0BKCJ/eSoWnqbSp9LFIVJ+8kocjlNAGv3239wNUEwj478eBZ/8eRKuqyp8hAhbG5 qZtSPACmveaUKDfgoHG5rMIZq6mHDCwSwkfYedxO3QzRw8ox7p1bM7GuoagXFcdo+EF9 35XDdGElGMYXxzzJY+uERIHEuqsZhO9Kk0cL2tYjMX8vfQUPsuYpLJXYCQ7hrq1Uh5vU OMXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=usp+WYhoQa1ymbf5iPtlOhda9Tnagjvlf2hW6d9Uypg=; b=hlZ+z5Or98jZJ4tsakgqbhx5peyJrO5lA6rpaZ/JH1oTLGSTSF/xYD9sspMBcb7tzq ajwpUoApdat1kOS6PuNhb6HtsXXyfT7fG01oFCD4l6DGqk9ZxWuQuRa4Upr9Ridbd1Qz ejsEhCvDHfPh1PEosGq33frFoDzHONiSKtJnA4AqNR++ZyPoBU45ZJ1GKUzfAp/nJPFJ ic1+f0U1ZMbqeVlDoSSurwRqFCLuJ6AWbeN5v+sGKCEfniHng+MO21a1hSd0n+UARFdJ jvoKaNJCoHhI6RCmQfv7+VrxBpIwILN/YTqXtDynLBZbHOYICcFSrcnNbUpyPcpj2d2E gvwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xlM1fYor; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 61si10799605pld.347.2019.02.11.08.08.25; Mon, 11 Feb 2019 08:08:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xlM1fYor; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729402AbfBKQHP (ORCPT + 99 others); Mon, 11 Feb 2019 11:07:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:60686 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729599AbfBKO0q (ORCPT ); Mon, 11 Feb 2019 09:26:46 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6FFBA2075C; Mon, 11 Feb 2019 14:26:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895205; bh=JHrtO8YYj9rEMaelhl0TXT4fFarwcLZvC0ec4gef+Rc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xlM1fYorNbT/xV9+ArdVhkytMeTXkRHCej0C3cLQQQMbVd6+sR40O9Xe4E5nHpoT5 kXYZRS29CjdX9fZe+uS9izzojGZBFintDWG3OFN6PLash9Xuv/t2mFF57Z5g5y2nUk 2Otv31L94BhVijdZcPqvrhGvicQOJ1H6/WM2R2Nw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Long , Baolin Wang , Vinod Koul , Sasha Levin Subject: [PATCH 4.20 111/352] dmaengine: sprd: Support DMA link-list cyclic callback Date: Mon, 11 Feb 2019 15:15:38 +0100 Message-Id: <20190211141852.856303902@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 97dbd6ea02beb3a7027c158e0a110b5095268d59 ] The Spreadtrum DMA link-list mode is always one cyclic transfer, so we should clear the SPRD_DMA_LLIST_END flag for the link-list configuration. Moreover add cyclic callback support for the cyclic transfer. Signed-off-by: Eric Long Signed-off-by: Baolin Wang Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/sprd-dma.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index 38d4e4f07c66..f7da9ab31b7c 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -450,7 +450,7 @@ static irqreturn_t dma_irq_handle(int irq, void *dev_id) struct sprd_dma_desc *sdesc; enum sprd_dma_req_mode req_type; enum sprd_dma_int_type int_type; - bool trans_done = false; + bool trans_done = false, cyclic = false; u32 i; while (irq_status) { @@ -465,13 +465,19 @@ static irqreturn_t dma_irq_handle(int irq, void *dev_id) sdesc = schan->cur_desc; - /* Check if the dma request descriptor is done. */ - trans_done = sprd_dma_check_trans_done(sdesc, int_type, - req_type); - if (trans_done == true) { - vchan_cookie_complete(&sdesc->vd); - schan->cur_desc = NULL; - sprd_dma_start(schan); + /* cyclic mode schedule callback */ + cyclic = schan->linklist.phy_addr ? true : false; + if (cyclic == true) { + vchan_cyclic_callback(&sdesc->vd); + } else { + /* Check if the dma request descriptor is done. */ + trans_done = sprd_dma_check_trans_done(sdesc, int_type, + req_type); + if (trans_done == true) { + vchan_cookie_complete(&sdesc->vd); + schan->cur_desc = NULL; + sprd_dma_start(schan); + } } spin_unlock(&schan->vc.lock); } @@ -674,9 +680,6 @@ static int sprd_dma_fill_desc(struct dma_chan *chan, /* link-list configuration */ if (schan->linklist.phy_addr) { - if (sg_index == sglen - 1) - hw->frg_len |= SPRD_DMA_LLIST_END; - hw->cfg |= SPRD_DMA_LINKLIST_EN; /* link-list index */ -- 2.19.1