From patchwork Fri May 12 13:57:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 9724243 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 85BFF600CB for ; Fri, 12 May 2017 13:59:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84C5F28824 for ; Fri, 12 May 2017 13:59:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7990728828; Fri, 12 May 2017 13:59:53 +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 04C2C28824 for ; Fri, 12 May 2017 13:59:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932548AbdELN7C (ORCPT ); Fri, 12 May 2017 09:59:02 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:62780 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757436AbdELN7B (ORCPT ); Fri, 12 May 2017 09:59:01 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v4CDvu6e002590; Fri, 12 May 2017 08:57:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1494597476; bh=wRrxTrlFgqOoQrE16ywqp1JCdmKzHtbFRPra391Bv8w=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=kGUDcsceQrmqgnLblllL61Hg34EKSz3Tav7u02Bijshm0Ykm5iZWi5DL/E8f2fRBD +pm/huFPMDyLc3Avh30VIz4/ak6if/fGPXs9FIUABz656RPe+rxqi5Ou4+NhXV0Qks i3A7rcEykUlCYhQ9wRaiZmD3NWaSeTcRrNdyAimM= Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v4CDvpBC002208; Fri, 12 May 2017 08:57:51 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Fri, 12 May 2017 08:57:50 -0500 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v4CDvfEN023184; Fri, 12 May 2017 08:57:49 -0500 From: Peter Ujfalusi To: , , , CC: , , , Subject: [PATCH v3 2/9] usb: musb: Add quirk to avoid skb reserve in gadget mode Date: Fri, 12 May 2017 16:57:45 +0300 Message-ID: <20170512135752.1800-3-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170512135752.1800-1-peter.ujfalusi@ti.com> References: <20170512135752.1800-1-peter.ujfalusi@ti.com> 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 For tusb6010 the DMA functionality only possible if the buffer is 32bit aligned (SYNC access to FIFO) since with ASYNC access the TX/RX offset registers will corrupt eventually. The MUSB_G_NO_SKB_RESERVE will set the quirk_avoids_skb_reserve flag in usb_gadget struct to provide correctly aligned buffer. Signed-off-by: Peter Ujfalusi Tested-by: Tony Lindgren --- drivers/usb/musb/musb_core.c | 3 +++ drivers/usb/musb/musb_core.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 870da18f5077..87cbd56cc761 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -2224,6 +2224,9 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) musb->io.ep_select = musb_flat_ep_select; } + if (musb->io.quirks & MUSB_G_NO_SKB_RESERVE) + musb->g.quirk_avoids_skb_reserve = 1; + /* At least tusb6010 has its own offsets */ if (musb->ops->ep_offset) musb->io.ep_offset = musb->ops->ep_offset; diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index 3e98d4268a64..9f22c5b8ce37 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -172,6 +172,7 @@ struct musb_io; */ struct musb_platform_ops { +#define MUSB_G_NO_SKB_RESERVE BIT(9) #define MUSB_DA8XX BIT(8) #define MUSB_PRESERVE_SESSION BIT(7) #define MUSB_DMA_UX500 BIT(6)