From patchwork Wed May 3 10:54:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 9709399 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A7BC960351 for ; Wed, 3 May 2017 10:55:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AE6028427 for ; Wed, 3 May 2017 10:55:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8FA9D285E9; Wed, 3 May 2017 10:55:40 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 CB570285E8 for ; Wed, 3 May 2017 10:55:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753699AbdECKzf (ORCPT ); Wed, 3 May 2017 06:55:35 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:9754 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754350AbdECKy5 (ORCPT ); Wed, 3 May 2017 06:54:57 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v43AsA7x017089; Wed, 3 May 2017 05:54:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1493808851; bh=z+WXnoOc+fxidyjVD5BVXhj3owbSBVRi/FgW9JLsLsc=; h=From:To:CC:Subject:Date; b=VG6thRqyt5VH7JYkBDc2+NyIg/4GMGR17f6aanMaYeUKdi63dECEOe4yDMzC2Lq34 DWiwpknFCbBJoC0oOvm8zhzzsB33tVn7FDlBGSW3r9LdTTnWaLLPyPsTDg5oi3+7TQ fZiogQA94Y1sAY7l/6S5MespXU4JwuD0B76mhG4A= Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v43As4Kw015284; Wed, 3 May 2017 05:54:05 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.294.0; Wed, 3 May 2017 05:54:03 -0500 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v43As1pu000436; Wed, 3 May 2017 05:54:02 -0500 From: Peter Ujfalusi To: , , CC: , , , Subject: [PATCH 0/4] usb: musb: tusb6010_omap: Convert to DMAengine Date: Wed, 3 May 2017 13:54:02 +0300 Message-ID: <20170503105406.25125-1-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.12.2 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, With port_window support implemented in DMAengine and the sDMA DMAengine driver, the tusb6010_omap driver can be converted away from the custom legacy omap-dma API to generic DMAengine. The first two patch is to prepare the tusb6010_omap driver for the conversion. The third one adds the needed entries for the dma_slave_map so we can request the DMA channels. This can be reverted when the stack is converted to DT. The last patch does the main work to move the driver to DMAengine API. I have tested the set on top of next-20170503 on Nokia n810 with nfsroot using CDC Ethernet (g_cdc) and copying files with scp to/form my host. To force that the DMA is actually used I have: Since this condition will almost all the time was true - effectively disabling the DMA use. Regards. Peter --- Peter Ujfalusi (4): usb: musb: tusb6010_omap: Create new struct for DMA data/parameters usb: musb: tusb6010_omap: Allocate DMA channels upfront ARM: OMAP2+: DMA: Add slave map entries for 24xx external request lines usb: musb: tusb6010_omap: Convert to dmaengine WIP arch/arm/mach-omap2/dma.c | 24 +++ drivers/usb/musb/tusb6010_omap.c | 342 ++++++++++++++++++--------------------- 2 files changed, 177 insertions(+), 189 deletions(-) diff --git a/drivers/usb/musb/tusb6010_omap.c b/drivers/usb/musb/tusb6010_omap.c index 05aefcad40b5..a5fc2a6bdad3 100644 --- a/drivers/usb/musb/tusb6010_omap.c +++ b/drivers/usb/musb/tusb6010_omap.c @@ -216,8 +216,8 @@ static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz, * use a timer for the callback, but it is unsafe as the XFR_SIZE * register is corrupt, and we won't know if the DMA worked. */ - if (dma_addr & 0x2) - return false; +// if (dma_addr & 0x2) +// return false; /* * Because of HW issue #10, it seems like mixing sync DMA and async