Received: by 10.192.165.156 with SMTP id m28csp823128imm; Wed, 11 Apr 2018 07:49:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx49SX+A/u9TKnQ/XAp/9c+ypfT3Cs6yiQE3Ezmtksfl3LDK560QcQYJCOgQaqmXa1gWxZ6Ad X-Received: by 2002:a17:902:6b49:: with SMTP id g9-v6mr5464845plt.75.1523458150354; Wed, 11 Apr 2018 07:49:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523458150; cv=none; d=google.com; s=arc-20160816; b=gjKTSIWkuCOrdrrTXWPQSu7KJ/pKOA9YPoDmhtnSgfIE0TErT5ToHy4yGm8U9GET2T KWuaPPyjHC5rghbyKp8SndOvFpKVi5D9BEThtsDVfiWRCLKgkEE/6sdmgwzzlcao/yhV qm2EZdr11TEfLrm7ArbFIQj1nF0TSOrhCTqzsNQ5WlLHK5QcDc15G4RXoR0AryzgKCIR 1iwT/IGTxjQjkMDpGMX6qbIzjhAIqpej6lJhJfv5YjpPihm5she7Tn3E8gbDGDSIlRy0 7VXOMuXMl0Lfa7LhZwXUj3UqQYwTOp5TQupMba0RS1oSu+cn1GbIeRfyeDo4tm6j1uE5 48IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=XwMSVU+5zxZ6XnA/xTX3rTpNG7EZF+ya29ab17whdXA=; b=SAzaFcLnyUrTncW8LlR2MNy5bHozGWfkfZc2Kejp7ExMUZ/W+cz2ntbQ82xZiACEzT rT19QPkZY7tbyM4ow+Hm5RJ5KzholNxQQIP+HZvlxrySz5ET2uvcMQ6Fn9/lEjY4NmuL 5ortSw1zHUKpkD3yuSg9RCTdniatJPlUB53fLInhKTXIExskgOY1G8IVLDoVjGsxS02Z LeMLlYnNfMrdIQfocfg8+GseI3DtFgJJ1M2mBRAxVZM/S3fi3MmAZXlifnY+hr9vKOgk vt8LSVuxnV6rR2v36H4hkpVmnVKg06DfY8419+wobnMf1ro7/edN3Q00gy6uJjJCg9sb PNJw== ARC-Authentication-Results: i=1; mx.google.com; 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 b31-v6si1298573pla.170.2018.04.11.07.48.33; Wed, 11 Apr 2018 07:49:10 -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; 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 S1753655AbeDKOpF (ORCPT + 99 others); Wed, 11 Apr 2018 10:45:05 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:49281 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753077AbeDKOpC (ORCPT ); Wed, 11 Apr 2018 10:45:02 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w3BEdQ2H015749; Wed, 11 Apr 2018 16:44:43 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2h9fwqsgme-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 11 Apr 2018 16:44:43 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 3FADD46; Wed, 11 Apr 2018 14:44:42 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node2.st.com [10.75.127.14]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 203802AC9; Wed, 11 Apr 2018 14:44:42 +0000 (GMT) Received: from localhost (10.75.127.47) by SFHDAG5NODE2.st.com (10.75.127.14) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 11 Apr 2018 16:44:41 +0200 From: Pierre-Yves MORDRET To: Vinod Koul , Maxime Coquelin , Alexandre Torgue , Dan Williams , "M'boumba Cedric Madianga" , , , CC: Pierre-Yves MORDRET Subject: [PATCH v2 1/2] dmaengine: stm32-mdma: align TLEN and buffer length on burst Date: Wed, 11 Apr 2018 16:44:38 +0200 Message-ID: <1523457879-9869-2-git-send-email-pierre-yves.mordret@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523457879-9869-1-git-send-email-pierre-yves.mordret@st.com> References: <1523457879-9869-1-git-send-email-pierre-yves.mordret@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG6NODE2.st.com (10.75.127.17) To SFHDAG5NODE2.st.com (10.75.127.14) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-11_07:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Both buffer Transfer Length (TLEN if any) and transfer size have to be aligned on burst size (burst beats*bus width). Signed-off-by: Pierre-Yves MORDRET --- Version history: v1: * Initial v2: --- --- drivers/dma/stm32-mdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c index daa1602..fbcffa2 100644 --- a/drivers/dma/stm32-mdma.c +++ b/drivers/dma/stm32-mdma.c @@ -413,7 +413,7 @@ static u32 stm32_mdma_get_best_burst(u32 buf_len, u32 tlen, u32 max_burst, u32 best_burst = max_burst; u32 burst_len = best_burst * width; - while ((burst_len > 0) && (tlen % burst_len)) { + while ((burst_len > 0) && (((tlen | buf_len) & (burst_len - 1)) != 0)) { best_burst = best_burst >> 1; burst_len = best_burst * width; } -- 2.7.4