From patchwork Tue Mar 26 14:05:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10871231 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 26DF214DE for ; Tue, 26 Mar 2019 14:05:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1351628E33 for ; Tue, 26 Mar 2019 14:05:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0744C28F2A; Tue, 26 Mar 2019 14:05:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1B9328E33 for ; Tue, 26 Mar 2019 14:05:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726270AbfCZOFe (ORCPT ); Tue, 26 Mar 2019 10:05:34 -0400 Received: from mail-eopbgr700062.outbound.protection.outlook.com ([40.107.70.62]:17088 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726480AbfCZOFd (ORCPT ); Tue, 26 Mar 2019 10:05:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EHLXJ26gVJ64cMNvzsa87uDJ5dDlxPAXpJCGt3cjUl8=; b=Pmt3FNEr8WkaijUicEnbYWvANiKBr0dA//FxIZu2iHugvPCgopdbsteinQoWjfh0OKrNB8Qr8cSvd2bJhjjChorB9giQTK3LE3/vODX22JAWMFcGiTxMCs8vKzDWfYwRivvzNObwjC2wiGcHwD0WHOrCIsbxb3y4XLh6m7RPyjs= Received: from DM6PR03CA0052.namprd03.prod.outlook.com (2603:10b6:5:100::29) by DM5PR03MB3131.namprd03.prod.outlook.com (2603:10b6:4:3c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.14; Tue, 26 Mar 2019 14:05:30 +0000 Received: from BL2NAM02FT014.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::207) by DM6PR03CA0052.outlook.office365.com (2603:10b6:5:100::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1730.18 via Frontend Transport; Tue, 26 Mar 2019 14:05:30 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.55) smtp.mailfrom=analog.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by BL2NAM02FT014.mail.protection.outlook.com (10.152.76.154) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1750.11 via Frontend Transport; Tue, 26 Mar 2019 14:05:29 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id x2QE5TVo027415 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK) for ; Tue, 26 Mar 2019 07:05:29 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Tue, 26 Mar 2019 10:05:28 -0400 From: Alexandru Ardelean To: CC: Alexandru Ardelean Subject: [PATCH V3] dmaengine: axi-dmac: Don't check the number of frames for alignment Date: Tue, 26 Mar 2019 16:05:20 +0200 Message-ID: <20190326140520.28475-1-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(39860400002)(136003)(346002)(376002)(2980300002)(54534003)(189003)(199004)(336012)(486006)(14444005)(476003)(305945005)(7636002)(107886003)(5660300002)(316002)(126002)(2616005)(426003)(44832011)(36756003)(106466001)(16586007)(2351001)(53416004)(50466002)(2906002)(106002)(48376002)(51416003)(6916009)(86362001)(186003)(7696005)(47776003)(356004)(50226002)(6666004)(478600001)(1076003)(77096007)(26005)(8676002)(246002)(8936002)(4326008);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR03MB3131;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9e85cb6d-2d93-466b-700a-08d6b1f41abc X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4709054)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060);SRVR:DM5PR03MB3131; X-MS-TrafficTypeDiagnostic: DM5PR03MB3131: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 09888BC01D X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: uSdsH30Vk4nEH1tyrOzZNps2GOuQsdgqiDvV+573Qx9ff3TT4ubc2hRROxB3eBugna0v8pMFstfKmh2nRE0ZzlZg4utPoAqeD+8oJl3BCtKxzKQCY06M82lQWJq78vWq4JwOb1YO23fSrPQHd7Vm0u4BJVYwC/ywt4sUiV0SJXu3M90uxT4ES/30LhOSnM3tMN0mUepNyJAK5wpUKkQXsnKbx3Qyrh1LfoeCBXd6yDneC29DMYsOI8B9HBZeb1kqoLW6OuBFFFUyBaSjMqdDeLDbJ7CulmKnJZW5ttn1omlXpqJxDgYWpr0i+uvB0f2qNQWX9TjCByYuuedmU0BMhia0f0U0O7ulVYq2RkvRzdDk6P7GY3G652JWrfwzesoriHsAFFG9N4burmHYjpLAQJpJh4C5NTVbE3QLWfqYcR0= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2019 14:05:29.7226 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9e85cb6d-2d93-466b-700a-08d6b1f41abc X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB3131 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In 2D transfers (for the AXI DMAC), the number of frames (numf) represents Y_LENGTH, and the length of a frame is X_LENGTH. 2D transfers are useful for video transfers where screen resolutions ( X * Y ) are typically aligned for X, but not for Y. There is no requirement for Y_LENGTH to be aligned to the bus-width (or anything), and this is also true for AXI DMAC. Checking the Y_LENGTH for alignment causes false errors when initiating DMA transfers. This change fixes this by checking only that the Y_LENGTH is non-zero. Fixes: 0e3b67b348b8 ("dmaengine: Add support for the Analog Devices AXI-DMAC DMA controller") Signed-off-by: Alexandru Ardelean --- Changelog v2->v3: * Fixed typo in `Fixes` commit drivers/dma/dma-axi-dmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c index 0fe3a931d8d5..0e0c457a7b27 100644 --- a/drivers/dma/dma-axi-dmac.c +++ b/drivers/dma/dma-axi-dmac.c @@ -526,7 +526,7 @@ static struct dma_async_tx_descriptor *axi_dmac_prep_interleaved( if (chan->hw_2d) { if (!axi_dmac_check_len(chan, xt->sgl[0].size) || - !axi_dmac_check_len(chan, xt->numf)) + xt->numf == 0) return NULL; if (xt->sgl[0].size + dst_icg > chan->max_length || xt->sgl[0].size + src_icg > chan->max_length)