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: 688493 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3t57nv5fxxz9ssP for ; Sat, 29 Oct 2016 03:02:59 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c09cQ-0002xD-0d; Fri, 28 Oct 2016 16:02:58 +0000 Received: from smtprelay4.synopsys.com ([198.182.47.9] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c09cF-0002h5-3w for linux-snps-arc@lists.infradead.org; Fri, 28 Oct 2016 16:02:49 +0000 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161028_090247_439838_B601F700 X-CRM114-Status: UNSURE ( 9.17 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -3.3 (---) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-3.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [198.182.47.9 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.47.9 listed in list.dnswl.org] -1.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-snps-arc@lists.infradead.org, vinod.koul@intel.com, vireshk@kernel.org, linux-kernel@vger.kernel.org, dan.j.williams@intel.com, andriy.shevchenko@linux.intel.com, Eugeniy Paltsev MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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;