From patchwork Fri Oct 28 16:00:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugeniy Paltsev X-Patchwork-Id: 9402223 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 579D460588 for ; Fri, 28 Oct 2016 16:02:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 488CA2A87E for ; Fri, 28 Oct 2016 16:02:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B6972A882; Fri, 28 Oct 2016 16:02:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E71F62A87E for ; Fri, 28 Oct 2016 16:02:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965744AbcJ1QCi (ORCPT ); Fri, 28 Oct 2016 12:02:38 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9]:57191 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965695AbcJ1QCg (ORCPT ); Fri, 28 Oct 2016 12:02:36 -0400 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 8F28924E0B67; Fri, 28 Oct 2016 09:02:30 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 7C0F2A3D; Fri, 28 Oct 2016 09:02:30 -0700 (PDT) Received: from paltsev-8460-lab.internal.synopsys.com (paltsev-8460-lab.internal.synopsys.com [10.121.14.113]) by mailhost.synopsys.com (Postfix) with ESMTP id 977FAA28; Fri, 28 Oct 2016 09:02:28 -0700 (PDT) From: Eugeniy Paltsev To: dmaengine@vger.kernel.org Cc: linux-kernel@vger.kernel.org, vinod.koul@intel.com, dan.j.williams@intel.com, andriy.shevchenko@linux.intel.com, vireshk@kernel.org, linux-snps-arc@lists.infradead.org, Eugeniy Paltsev Subject: [PATCH v3 3/3] dmaengine: DW DMAC: move "nollp" to "dwc->flags" Date: Fri, 28 Oct 2016 19:00:02 +0300 Message-Id: <1477670402-23943-4-git-send-email-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1477670402-23943-1-git-send-email-Eugeniy.Paltsev@synopsys.com> References: <1477670402-23943-1-git-send-email-Eugeniy.Paltsev@synopsys.com> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add "DW_DMA_IS_LLP_SUPPORTED" flag. Use this flag to get rid of "dwc->nollp" as separate variable. Signed-off-by: Eugeniy Paltsev --- drivers/dma/dw/core.c | 11 ++++++----- drivers/dma/dw/regs.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c index 6281009..98beb16 100644 --- a/drivers/dma/dw/core.c +++ b/drivers/dma/dw/core.c @@ -227,7 +227,7 @@ static void dwc_dostart(struct dw_dma_chan *dwc, struct dw_desc *first) return; } - if (dwc->nollp) { + if (!test_bit(DW_DMA_IS_LLP_SUPPORTED, &dwc->flags)) { was_soft_llp = test_and_set_bit(DW_DMA_IS_SOFT_LLP, &dwc->flags); if (was_soft_llp) { @@ -1265,7 +1265,7 @@ struct dw_cyclic_desc *dw_dma_cyclic_prep(struct dma_chan *chan, unsigned long flags; spin_lock_irqsave(&dwc->lock, flags); - if (dwc->nollp) { + if (!test_bit(DW_DMA_IS_LLP_SUPPORTED, &dwc->flags)) { spin_unlock_irqrestore(&dwc->lock, flags); dev_dbg(chan2dev(&dwc->chan), "channel doesn't support LLP transfers\n"); @@ -1570,11 +1570,12 @@ int dw_dma_probe(struct dw_dma_chip *chip) */ dwc->block_size = (4 << ((pdata->block_size >> 4 * i) & 0xf)) - 1; - dwc->nollp = - (dwc_params >> DWC_PARAMS_MBLK_EN & 0x1) == 0; + if ((dwc_params >> DWC_PARAMS_MBLK_EN & 0x1) != 0) + set_bit(DW_DMA_IS_LLP_SUPPORTED, &dwc->flags); } else { dwc->block_size = pdata->block_size; - dwc->nollp = pdata->is_nollp; + if (!pdata->is_nollp) + set_bit(DW_DMA_IS_LLP_SUPPORTED, &dwc->flags); } } diff --git a/drivers/dma/dw/regs.h b/drivers/dma/dw/regs.h index f65dd10..f50c0fc 100644 --- a/drivers/dma/dw/regs.h +++ b/drivers/dma/dw/regs.h @@ -218,6 +218,7 @@ enum dw_dmac_flags { DW_DMA_IS_SOFT_LLP = 1, DW_DMA_IS_PAUSED = 2, DW_DMA_IS_INITIALIZED = 3, + DW_DMA_IS_LLP_SUPPORTED = 4, }; struct dw_dma_chan { @@ -242,7 +243,6 @@ struct dw_dma_chan { /* hardware configuration */ unsigned int block_size; - bool nollp; /* custom slave configuration */ struct dw_dma_slave dws;