From patchwork Mon Apr 15 12:14:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 162192 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2850281jan; Mon, 15 Apr 2019 05:15:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwT3jEKUXlOtJh+19FjN5rDfpxOH0CtRkPlc05mnWGo//h/PvpgRLYAxK9DJq/3ndP0oFPb X-Received: by 2002:a62:4649:: with SMTP id t70mr75491138pfa.100.1555330537485; Mon, 15 Apr 2019 05:15:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555330537; cv=none; d=google.com; s=arc-20160816; b=fG8bQzenVYTUX9mGGKTWGpH1c0yZB0L3sOKmOQJkd/J99IoKlK6cql6GtcA8ZxTvrd YklR5b+suFkLo/zRU0wzY//sPskR5bwbIQj+FU2wh+fg7DObWQ98uaJs9qwXiWnCyLm8 p78lAVdppIgedzHE3+yrRVmX1pN6MqAfOHkwHzgq+SxrNZ3AiXfisir9Kk0QTdCsywIB 9tGMzwnuHRxiszIrf+a0S2j/dHZlyVQJR1scmwF7zOgBN6wk22qeaJGgasNk44AlCt5o EZ7kEPJSouDRssMeU718JiuA6Dxi4wLkElh1qLZKOwGuLkM7f3yyrZzOe3E1LFzGj+bL uvxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=EPBexP/YCMERN6VOL5fv1yV7pop7BN15G/3B+N0nQ3U=; b=vtxqob+sD95p+or6ucJExdtB6TY28bWtmKaP8CtD3/ZVyFFCpWqYSh+BpdD1nIWw5q Lv511arSU+AY9b10FCxAWfv7hobeatrOU18aW1e5HW0LmnrH69hGP1toGGU7hO9P4hTr 4g3Xi5jvdX3UtXit8xv1zAdwY4OW7FlcCCRHNBc97F1akZMXdFtFfN6wlucOYtGkhHGx qcWD4+vqdZk1zySlfihDCA/96/X9FIWdk8E33tcwSSrT3QWKRLcMg0dBEcFcpb5uWuNs LHUc1QimhPIaeEiFwvlMb6v7nwvFleDdDZ+W5llFPk3CHOjpQdXtNz8DHduwKROn0+m7 7BbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=k0T6x4sW; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s9si34319695pfa.282.2019.04.15.05.15.37; Mon, 15 Apr 2019 05:15:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dmaengine-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=@linaro.org header.s=google header.b=k0T6x4sW; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727496AbfDOMPg (ORCPT + 3 others); Mon, 15 Apr 2019 08:15:36 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:45571 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727505AbfDOMPe (ORCPT ); Mon, 15 Apr 2019 08:15:34 -0400 Received: by mail-pl1-f196.google.com with SMTP id bf11so8459242plb.12 for ; Mon, 15 Apr 2019 05:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=EPBexP/YCMERN6VOL5fv1yV7pop7BN15G/3B+N0nQ3U=; b=k0T6x4sWoWO1mBc+OId0DMBw+LrVnMU9zm0p6EsTYO/gUBNMYZKo11zY+DswnZgNt9 hvgxI0ywLRGa/hlJyBh506+Le5G4rFLeuxya780+q9eWikKxy5O8aa0W/8gUdOOgE+np +FMg36Tr6d8dmrUl4QkCHHOgqLjaCvk6UvWbVIXZXio120GB05/WUAhYgaSyCabsZZei sax3hHlC/z6qHbXVkOmlIz+6SZw+rp4CMc2+cxPc5twLByBb1aPExtKsDBTydLG5yAcB xFDHS8C7Uzmn04mEefA0Xs6oJBmLCpJyJok+fN94irPRBuLhOmGMbLtslyRZj9czrBwD 27Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=EPBexP/YCMERN6VOL5fv1yV7pop7BN15G/3B+N0nQ3U=; b=pVZ21fzG94XV/hZLTLZ+lbHHTqxuGNmBjQr1RcbaXH+M3LNf2jkl9sAC3XCMnkcPye BeytUFm3pS36++EILVPuRVHdQQZyesCTK3HOjVVlXYyZBxX40bULp8VWNrzzOQYXuGvT O32/L6HSyd9TIrn2/RCFUDedu9NA+bCXhDmcA5NsUotbBcUMIMVVBVBv7/xs5BVqRU+6 QrUAyF0ZRGhlJ6In5bVnDGsViq94TgdJdZjFUYLkYaaIK1zthRCq0JJSvUnyGU+cCJ/e 72VsEpSAHQjnp3/azioBGB6YE1aRAVm0pN6CUWQJwiw8EJ0lQdOTpXIQ1D/IH9VkbRR0 1CbQ== X-Gm-Message-State: APjAAAUMOCe4o25kUrZDDfkRroopS+/3ZfSMUT8RJyauelKPFLeImCxW 0H7erQf2GTf+Q2Y/xLoRrLfanw== X-Received: by 2002:a17:902:d701:: with SMTP id w1mr76553552ply.124.1555330533557; Mon, 15 Apr 2019 05:15:33 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id 6sm64157155pfj.95.2019.04.15.05.15.30 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Apr 2019 05:15:32 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org Cc: eric.long@unisoc.com, orsonzhai@gmail.com, zhang.lyra@gmail.com, broonie@kernel.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/7] dmaengine: sprd: Fix block length overflow Date: Mon, 15 Apr 2019 20:14:59 +0800 Message-Id: <93626039ad49c1c9d5726218b060c2267c1779cf.1555330115.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org From: Eric Long The maximum value of block length is 0xffff, so if the configured transfer length is more than 0xffff, that will cause block length overflow to lead a configuration error. Thus we can set block length as the maximum burst length to avoid this issue, since the maximum burst length will not be a big value which is more than 0xffff. Signed-off-by: Eric Long Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.7.9.5 diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index 9f99d4b..a64271e 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -778,7 +778,7 @@ static int sprd_dma_fill_desc(struct dma_chan *chan, temp |= slave_cfg->src_maxburst & SPRD_DMA_FRG_LEN_MASK; hw->frg_len = temp; - hw->blk_len = len & SPRD_DMA_BLK_LEN_MASK; + hw->blk_len = slave_cfg->src_maxburst & SPRD_DMA_BLK_LEN_MASK; hw->trsc_len = len & SPRD_DMA_TRSC_LEN_MASK; temp = (dst_step & SPRD_DMA_TRSF_STEP_MASK) << SPRD_DMA_DEST_TRSF_STEP_OFFSET;