From patchwork Tue Nov 6 05:01:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 150242 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3458015ljp; Mon, 5 Nov 2018 21:02:14 -0800 (PST) X-Google-Smtp-Source: AJdET5dWdWaD4ipUzjP+QdKyKDe13VHD1ci6ocOrU9TblxfnbPNKm7BiIBUDSCROvf08qs+aFCev X-Received: by 2002:a63:d441:: with SMTP id i1-v6mr3838726pgj.31.1541480534096; Mon, 05 Nov 2018 21:02:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541480534; cv=none; d=google.com; s=arc-20160816; b=Bir/OWzOSom0binpMc4lyUiBVk7J5C1UoVWs1Ihh0Io7cQXwLw961f5FAv1GA5Pn8U OTV6rn3YriWzEsia+0sBFunx8VHF9XYeTqc4+Ijcm2rIcPxbUFjMS0Dwet+EER76olQA SocKMBqQLsUNSh1j1DCrvdNBmAWidBE0CEqzinOWMHsE5NTNOaxUALKPk71fIOtUyL5f 8/P7RZK2nLbb6JqIKtc0CdrNcLzmJKORjkxAKJHr1rTvUkM5H5fS8rFzzTcInSgMlc2c rbGUP/2p0eUymS9Afka5ykJRc+ABLNry0640w5E1laOV5h62ux6On0yU9q76fQnfwmdn wjhw== 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=Ipu0OKiVTAGWTLE4fg/nM2ymSy+8y5EVSd0lvjhlhp8=; b=pA5Q+n2+haTzspPorBVLs74PdryJv0DJVFiobOb1UcsIidaNm2/tiP9EcWJ7bycyRh ytzSQ0QoeMrkfhMRXp4VwpV6Ew2hyk7OduSdaNeQPK3q1zJdtB7L+TSsdBd1As6yrDqx y71c/OMDVhYr6l7R88kAg0ksIhVD0KJaqGRTKuT8YfgK3WLmPLMJAe6mATwQQSSaT8mR sOJQP6azxcHVcjHoqmm1Evc4wgGHyQ04vILywx//ofuXnzcRVNrIwS+5fUcMl9dOGmdG jOZ8WrTk71TXMOT7XWnsG1AzbOzGv0ox0FzAGej6/odJe3JoZz6nIyLD55q1hnGs8gsc Riyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gutae7G7; 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 w7-v6si44787070pgh.131.2018.11.05.21.02.13; Mon, 05 Nov 2018 21:02:14 -0800 (PST) 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=gutae7G7; 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 S1729852AbeKFOZb (ORCPT + 32 others); Tue, 6 Nov 2018 09:25:31 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:40509 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729794AbeKFOZb (ORCPT ); Tue, 6 Nov 2018 09:25:31 -0500 Received: by mail-pl1-f194.google.com with SMTP id q19-v6so2579118pll.7 for ; Mon, 05 Nov 2018 21:02:09 -0800 (PST) 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=Ipu0OKiVTAGWTLE4fg/nM2ymSy+8y5EVSd0lvjhlhp8=; b=gutae7G74a5xWjvogNtC3uF7yCVomb6SNDj4i/rOZwIqyQrrPMcLKpUVx0rsnX15Ju kE3KVj6sicYEePLve7JYvmafJCZsUduo0QgnTSQFHG2AvthQXdg3uIeN7/WCdzg61MOC MlSY9nCD6TpzzC31M86yCd7b1Xa81FTIzHdoM= 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=Ipu0OKiVTAGWTLE4fg/nM2ymSy+8y5EVSd0lvjhlhp8=; b=FHRu2RaHfNhOfxaoBm1wxElg6JRsBZ/GJ3Xn5ZCLGjlSwdTEY7nc0WwFIy0fD1LDeM xPANDb4IWwxoKoAE3Ychs2Dbfzv82g/lA6NOTpwMNT/ERgxKHqkovmCW6xinlAeAQNm8 O9A0Bss6K7AEx+Tf+aeCOfkK7Xv+gvIto6F8OSPK/LygSVDT1ElnVer07UBGBpE1aFjE shNVmAb9hOQuOTPgfN4WJ/fH9dpKIhlqHLrSUDBt5G6Y7cs29E+RGT4Hntq66q47vrZY 2hniYaX2E2jwbhaZIUUmdt50mcg3nctMYbsYWM2qQ+Z6g0lVn2kK+735embwbOiKonAc tANQ== X-Gm-Message-State: AGRZ1gIPAiTodEn1L5ukZko0qtJ7uPFFhUQFFKCAi/iQ3Vrl0QJ8Jh1z bNgzQZcK+3bmWKXFxuLt/I5kEQ== X-Received: by 2002:a17:902:4222:: with SMTP id g31-v6mr24679107pld.236.1541480528979; Mon, 05 Nov 2018 21:02:08 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id o7-v6sm55735416pfb.23.2018.11.05.21.02.06 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Nov 2018 21:02:08 -0800 (PST) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org, eric.long@unisoc.com Cc: broonie@kernel.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH 3/7] dmaengine: sprd: Fix the last link-list configuration Date: Tue, 6 Nov 2018 13:01:33 +0800 Message-Id: <95cbea4b835bb2689036afe78ff0b2239a24f352.1541480353.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 We will pass sglen as 0 configure the last link-list configuration when filling the descriptor, which will cause the incorrect link-list configuration. Thus we should check if the sglen is 0 to configure the correct link-list configuration. Signed-off-by: Eric Long Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 1.7.9.5 diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index 4f3587b..e6a74dc 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -697,7 +697,8 @@ static int sprd_dma_fill_desc(struct dma_chan *chan, hw->cfg |= SPRD_DMA_LINKLIST_EN; /* link-list index */ - temp = (sg_index + 1) % sglen; + temp = sglen ? (sg_index + 1) % sglen : 0; + /* Next link-list configuration's physical address offset */ temp = temp * sizeof(*hw) + SPRD_DMA_CHN_SRC_ADDR; /*