From patchwork Mon May 6 07:28:31 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: 163387 Delivered-To: patch@linaro.org Received: by 2002:a92:3d95:0:0:0:0:0 with SMTP id k21csp1538901ilf; Mon, 6 May 2019 00:29:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqytvtHeX8OLNvbspH6jC5ylazClypA1/JRnu0kAmMOstkd+atZ9S3IOAZflz1bvSVpGljAQ X-Received: by 2002:aa7:810e:: with SMTP id b14mr32225940pfi.112.1557127746363; Mon, 06 May 2019 00:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557127746; cv=none; d=google.com; s=arc-20160816; b=AcOTLnpL/Vj4EqXIKYd6/Bb1Iyk/OasjW+SwB8YRhCXxBxFtZYAAN914NqOdjZlTqs L33353nAoHGxAez9YavuNHCgYghLg56lxEo2+4AWlnVwf6rTbX0Dft960Owik5Wj4y9F vhhIkOpkqHgvkBBjXDKADm0S1AJcA8CC8EDAV9lh0bsUZOz6CsaJghr4AKLf34aTM3yL PvoLkwdByAB/mBfwJi0pPiKfQ47C1PPFAC78JvO18f3ZEdo4TughmpOc40cBm8HtH4sp XOq3TDV/1hhVM6X8CVDFySORXSDQe7MFhSe07AvJzi1PPJMPh7rtkpkx3LwsDjgpDMcl kxOA== 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=+ZQ7qGOLCohxzfhci4Colal/Wo1QqAxCtZ4JkQsFwsU=; b=XPTldiIiyw8vfhB6XURknIbuPzgn5uC3zH8fN9yqP22c/SlDnVSwvs9sXx6//7Jmli sLyWNbCVh5BgV3JPZd1U2z2gXDBYFuPYQF8RkG0cjd7nD+8mhb5NjUW3BK1YycP6Hehn +6zcczkBdE5dH5+J0aeo7JuuEbkiXttdH4W1E3ev6URB/3tWq7vlidSPK9cgxjF9KN6d SIhpmuE5fYRoYVBWQI754gD+iqhPFOpoxvhKSZ6xg4+P1zqsF9MSwfLN7a9mfW4ypkxy uhO45WTV2DCQTf0c+xFPwv/l5BLLID+gkkhq2Mt8uJsOkzGpoCRMGI1WI7M7+87kO+EN uLjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m2MNCVwU; 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; 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 g6si15245332pgi.21.2019.05.06.00.29.06; Mon, 06 May 2019 00:29:06 -0700 (PDT) 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=@linaro.org header.s=google header.b=m2MNCVwU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726447AbfEFH3F (ORCPT + 30 others); Mon, 6 May 2019 03:29:05 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:32993 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725836AbfEFH3E (ORCPT ); Mon, 6 May 2019 03:29:04 -0400 Received: by mail-pg1-f193.google.com with SMTP id h17so56214pgv.0 for ; Mon, 06 May 2019 00:29:03 -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=+ZQ7qGOLCohxzfhci4Colal/Wo1QqAxCtZ4JkQsFwsU=; b=m2MNCVwUhd8v/6Vi+YLmIm4RORKUiK2+BdHKTpNvCPAn0wxJbDla+fHvLPcWFxF24t T84EOuE6HFY1fWHQmAWxAqsqCJE28N/Q0G7KNTmeQMle8HgYrJSPmR5KWP3wr/cLnM1j /c0f7R2vJZshddyoxk2SyPRQECINjDxmV9fqQncGVl/QA9GvfeiJszqIDU4dgDaaIQaI WQrX8pw24wULbhMr1vlYfJW2Et9TjSTQaAOJsfn6a/mZ/NWRPupVVl3sEhHeRAs3cufW Ifjyz6nHqboVfhQov7y4HniXpqwS8tdMWA3pnpWPwTtmvsy43maQ5kGmZOYGwavkSJLB ta6g== 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=+ZQ7qGOLCohxzfhci4Colal/Wo1QqAxCtZ4JkQsFwsU=; b=U2775Aa8A4E920TzqnnttAfbMQmQn6aIwWzYWdqgCYPnltOJEiXRpLphnu0iuny1u2 91H9ttAzUYttqo1qJoqmh7YVm6V7eXF0S+wTvtOax9xAgStfbvMQWN0EON0xQ7VUdfj7 eG+4VAxhoT2l66HxKOI686Vx8XzdHQpRQNR7dqM7DLFdzVDc4eVEd/YmPQ0I9PXUwzuF 73MQ7z5aMU4sxVQyJQ+RdePiN1f/ioL65jqwJLmpiMQbsGPiKLxgnXfkYZ6f/ABFAY80 5tb/TJaAk2NhzgauAJMKGi0m5zv2sAD6AcdbVx306D62mjMrpqcWpA6L878C3GliPBiM mfXg== X-Gm-Message-State: APjAAAXjQcPv7jh/JKFDQMQkFfODCTiAd24l76RdjmVeKdM9uqLAtVPj YbCSfqAI1oCp+EgfBzbLcRqffu220nLgMA== X-Received: by 2002:a63:1a03:: with SMTP id a3mr1369341pga.412.1557127743650; Mon, 06 May 2019 00:29:03 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id w38sm21700894pgk.90.2019.05.06.00.29.00 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 May 2019 00:29:03 -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, vincent.guittot@linaro.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/6] dmaengine: sprd: Fix block length overflow Date: Mon, 6 May 2019 15:28:31 +0800 Message-Id: <8f9a1748488e9d890995c158375482285253cc46.1557127239.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 0f92e60..a01c232 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;