Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2252619ybd; Mon, 24 Jun 2019 03:20:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwyxvKzlQg/uapaKSmMn51aHpuIgDEHuvuQuB42h6ARQsPYTMFPlajBHOPxvWIP5Ve6YULa X-Received: by 2002:a63:296:: with SMTP id 144mr32638430pgc.141.1561371653617; Mon, 24 Jun 2019 03:20:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561371653; cv=none; d=google.com; s=arc-20160816; b=oeclWrNtU0ft213Yy8USkXEOIqo91IAQDqnuVobCkO2dLNxER+cYEeXM2gwJPGS+Wb zerpDA9u5tImlMkW24xRu06XXBVHIlynyTYzE39mhEnnl5RTjGhao5LgPCUFljZtWsrF 02Kn6q0jXD+RL1mxHYZYAZHaaiRl8eFWD8yMr20TjZvaZQLHTaDP/bwbLvcX4M03fbnA is/+AV3Qy7lA4yo4NECttrJ7eze1/UjZSurtsAisgO4UlXE8CamLhjIhisw5vG0z6urM YTBBjDLU9ePW9SoV78gqKVs7e3MXnHKZvzYjtywqm81Q4RCABntItmPk4MLp8lYV/uJe y8NQ== 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=StnCX4WDEKyN6DQrKjoBBiOuzEp6Av9gdBYevXFRWuM=; b=SYsMG15FFSzzly8ATytCfCpLc0QScqzqgktgcd3g1RijFs8gssEWRGGUADdsf5y4cC XAGnhqbHnrydF17z7xqD4lJQPrAYWI4rPWKLHwfSiy8zFqLCidNtZuCBH67cpTYENgq8 G9aj1T2dd/yboKOWO2PVbdipJ/15gkcMNRC/ZyetTXCCBnhHGM+4B+IYAZP8OVxpOc6+ CWyWP/wM2NbUtLPkWQAOdXy9d47MnN9QlVEiHp+SszEp6dMm83Mu46d82fmRbxAGiOvU pHJYEVizpo7qMz/kTVq5lJrQTsmhBXN+lfk66EXQn6rflEHHiIiretBSr0iUvqfkKawB oraw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EhZolR4V; 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 62si10507437pgc.47.2019.06.24.03.20.37; Mon, 24 Jun 2019 03:20:53 -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=@kernel.org header.s=default header.b=EhZolR4V; 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 S1730739AbfFXKSj (ORCPT + 99 others); Mon, 24 Jun 2019 06:18:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:53446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729136AbfFXKQB (ORCPT ); Mon, 24 Jun 2019 06:16:01 -0400 Received: from localhost (f4.8f.5177.ip4.static.sl-reverse.com [119.81.143.244]) (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 1688D20645; Mon, 24 Jun 2019 10:15:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561371360; bh=TvvvvmOjybsGV3RcCRc1tF+mAuzADsiX0iej91hyWrQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EhZolR4Vm88H9VNrlmUUFIC0OatwWhtda1w6Uz8kiYsec8J5XYNKLZYyTQvFpJYLn vnttr129luas3pm0bt1uGiUW2pE+RM2UluYGfQrcPRgKvnb56ZYBnkhRYw0h/VoOgD l+Iu+4BkMuOdZm1+d8Zlg9RIVBFdOw4gBar6QrcU= 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 5.1 039/121] dmaengine: sprd: Fix block length overflow Date: Mon, 24 Jun 2019 17:56:11 +0800 Message-Id: <20190624092322.803352022@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190624092320.652599624@linuxfoundation.org> References: <20190624092320.652599624@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit 89d03b3c126d683f7b2cd5b07178493993d12448 ] 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 Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/sprd-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index 0f92e60529d1..a01c23246632 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; -- 2.20.1