From patchwork Mon Apr 18 07:53:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 8868551 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 69F959F443 for ; Mon, 18 Apr 2016 07:54:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C3E4A20268 for ; Mon, 18 Apr 2016 07:54:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0D72F20259 for ; Mon, 18 Apr 2016 07:54:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751650AbcDRHyd (ORCPT ); Mon, 18 Apr 2016 03:54:33 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:32325 "EHLO relmlie4.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751402AbcDRHyb (ORCPT ); Mon, 18 Apr 2016 03:54:31 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie4.idc.renesas.com with ESMTP; 18 Apr 2016 16:54:29 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 2F5124C250; Mon, 18 Apr 2016 16:54:29 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 0F741480A4; Mon, 18 Apr 2016 16:54:28 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id EF6B0480A3; Mon, 18 Apr 2016 16:54:28 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id SBV09741; Mon, 18 Apr 2016 16:54:28 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="209161945" Received: from mail-hk2apc01lp0211.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.211]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 18 Apr 2016 16:54:28 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=FtU2ZHSbVVayHIoV1TIEpu3SpNEjUKdb16TU1b4Dvs8=; b=CbF/CKlWElnBre43Cv4qJS5yOnXKRL0Ni0AZEE2h17IqJ0vbDMTcXGq78zQUiULiFT/ybUcsp+9PT8Eim8oIBnF1oiWKjxssIc3D18wzFTd8FmqXFBRzlvXuI/mVaqlSZ9FQiFM7JB143b+akLQ7+g2Lh/MmdbCwBaJ/jpx+BrA= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=renesas.com; Received: from localhost (211.11.155.141) by SG2PR06MB0919.apcprd06.prod.outlook.com (10.162.204.152) with Microsoft SMTP Server (TLS) id 15.1.453.26; Mon, 18 Apr 2016 07:54:26 +0000 From: Yoshihiro Shimoda To: CC: , , , Yoshihiro Shimoda Subject: [PATCH 5/5] usb: renesas_usbhs: use usb_gadget_{un}map_request_by_dev() for IPMMU Date: Mon, 18 Apr 2016 16:53:42 +0900 Message-ID: <1460966022-3444-6-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.1 In-Reply-To: <1460966022-3444-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1460966022-3444-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.141] X-ClientProxiedBy: OS2PR01CA0028.jpnprd01.prod.outlook.com (10.164.161.138) To SG2PR06MB0919.apcprd06.prod.outlook.com (10.162.204.152) X-MS-Office365-Filtering-Correlation-Id: 274fa828-d16a-4e60-b3c6-08d3675eaa03 X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0919; 2:NKkP6VY2PrWlGnrUgSSC0B4CYLPUV7+T+Qc2yvIdg9qwnOzQVtosBC5JRrKRoYmHTMolc/1PwHPEutzwwcgIsyZ0GNoAfUQAVKhPURcRIpLF92RvAFhcZGUHfYdOyVM+2w8ETOsMeoJuj1/nblJ/1Lg3N7+2+ElD1POS3qgXbPliWiY2GK8f7atApuMd9GJj; 3:thNqNjYRFuZsV4uPgFT6k2IxkvfPzfM5n2i04Z4yeBzIJeua0fC/HXeK3KkpLeZKmGCNWmgBtVsBCnCjAnImtA5ateZi6qI+DxxqvAipsC6wsKKmkCZQoGZOi/DaClFL; 25:eiGFGCDTcFUEw5ywsJhMhZNi93kRsyd7vZLo1A5tEmhUrLudgTHcM3Jh/A7JDCGblEvTqxW2HPcYfdM8ZWjVDVttpvBxtntHz7FzwzFPVrMJxXQrW6KKTGrhYyGpUMggnjNVrAN/P+4W8sVfLp9U8j7wiFjKxd6oTz+36nvEgWkSxuKhDTqGH3z5C9SRszGGQH8fvNK4BIKGrIlngLbH3hXJoo3Wcy/BKaKHOetLYc69/D0JPVqkEjdtsbbaw8twdVxuZeONkmYfZFql4xJURNi3CLnU2J1Me4AOEfQtdTOBDZJh7YkthwNi/rfUO/7/Atm50FZ9EgXLk2vSLsbIjA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB0919; X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0919; 20:GuKJFzQHAlnAdURESmYYTGFzSzo6Ar09Kunuf/uMtjSGOe5Lb8Ptq8nc7RCNX82r2aBM4JEaS4avHPW/MtQTZsEz6OZbsTrajrlsSk/tBB8cntozlBMBZNgac8B68fC/+TLFvHKpBnTGdqtweg8hlJ1zMIXI4pNGgDswKWA8dnaK06ONzgRpAVucffD0+mKZoyJ4HcZDvk30A/wCmZ7O1eBBSmqJQiojBYdt30mlbbJYKgXj4eep6n3lnb61Jq+O/83dV1XeMwUNji4gP46GPOxMBu2r8qYpHzLXMwrnA1uLKFFUBCTINEW2WDenFQTyMMXoG7V4swQqnYWtZILyEgIMwZWSfz6G4ybDimEKy70d5NB7OzeiXR8p3NRw3bzPvi3KJGKKjX4PZgb+x+sLyiU4HuYYiy/7i2huyI+/pskbuLA5YlVLBGp2zUPlfgZolxaNIyWN6yozuXBdfH6M1pXXdp3MOubM2k0yI0StMXoa2KubsXgy3rIYL7RH521F; 4:QGReQuk/TYUav01cHiXBCqxzNnqFoBX6p+SKqU+e4Lp2p1OU4eKJKb/b4FTgJTLlnXj0/xXdoS6WDi3R5vdhs+Qb0epI7o9c+BDjEV2E+QcoOT/IaKa4//1vIvacJdPVO9Z5HCwrqE5nS2Dtn4r43szZD10Fh9Uo2aHSZyOLw6w5VyvXJrvzI+H4LXem6ZFGRBuY1JFu5elqGc3DbF5GYvR8Ed/AALJsgPfjlbNSOUqnOvPEAURQGOIBozBmTCzNmUt6vZnONSkMT+zmb3lpq0KwzOxHDI+svQlt7qgaCulFEEBGg/KnIN2XhgDJKpyOvId9mYDzaAz7MPSyfdTkY074s3MeqmM7Xorbq42NXH75BFSwU+xOOnwK+j453/CT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:SG2PR06MB0919; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB0919; X-Forefront-PRVS: 0916FC3A18 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(6009001)(19580405001)(33646002)(229853001)(5008740100001)(19580395003)(50986999)(76176999)(36756003)(1096002)(76506005)(586003)(78352003)(6116002)(2906002)(3846002)(4326007)(2351001)(5004730100002)(42382002)(50226001)(50466002)(5003940100001)(81166005)(2950100001)(4001430100002)(77096005)(189998001)(107886002)(48376002)(92566002)(42186005)(47776003)(66066001)(110136002); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB0919; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SG2PR06MB0919; 23:rnuwTRoidWe6VraOD7AOEn8+AYBpqzTOivpB3gs3j?= =?us-ascii?Q?zpdpALh0gisdJmHueGxxbDgCFqstQYtxgiMIzEL9aOBajmqxepTWVPyRKoQW?= =?us-ascii?Q?a+g4xJBXXDbiaPplSsQIPWyqmwbsB84HiJGK0MVUejBPgBdNCAyT04CQ5JtY?= =?us-ascii?Q?u1IH83dUQ8x9UabE0Qm2Nr/deq3T2zUF02FeeZzsFB5N6WzQQzzrkNZTqm/w?= =?us-ascii?Q?fp9gCjWqLETkCYB/MDYOoOdhnX449QeulJnfocpOkKwRKnt3JrnMzIVbuop4?= =?us-ascii?Q?Zkl1iTEkpU3gMScmm4lXXwpH+fA8LLv+N1Sd9ZsTpcw9g78V8pb6kDe3gmwV?= =?us-ascii?Q?aMDqk0C21mdm1ikutqPI4BcBTFkaTYTnDb+ZiS4j8y3FeZuOVSgme/YAgs0N?= =?us-ascii?Q?z7DnMieC5jZHROgjDpuRzrnzFyKVcWIQ/p0Zzg75wOX/asj9D9eIO2x9qnp6?= =?us-ascii?Q?gLG6Dhf8CZCggR/tfXvq+eUQ8Aa7HorrLmnVUCm9+RRTAnASKnN27mTmHqOC?= =?us-ascii?Q?1z4tvnDOE0peaBoN0G5ScC3O/L41TZcdXVpVZ9fVsxgbK0F74yshDqPgQ4EV?= =?us-ascii?Q?F9VeoPaGZatVmQ4NpmDqDRUG0mKQC/hiBqjxgeifWGJSq/3xlyC/0Z4LE+OV?= =?us-ascii?Q?09WY8y3r+hWR9YJw3OR67FJLXd52ID+i5X46q0c4l9H+uP7hU7j4tw3/o6Hu?= =?us-ascii?Q?sfr9yxGapaGUt71cRO8Qx3JHzhTBwFBbU9cHK4PW7T8wZjnmEGB6EAF/inFa?= =?us-ascii?Q?4XyQRwFcd5pzb3csssYSpdg4BlerZDJc8xrgDHJq8ZeYPgrxgRjhbtxk1gwn?= =?us-ascii?Q?UURfWK928Up+GCYEWWdVyuyBwjh3XIdOsTHTxGHELXYHjn1lmZgpi35a4kwc?= =?us-ascii?Q?FlGOOeHdNzxxAA9thl4Q9JZ+GqwiXdzf2f4WyTeijvh1WevhsbEAV5HYooc6?= =?us-ascii?Q?F/1isHEdKF1TWTU/9M1437M6SsSJwmzSO8owlRohQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0919; 5:iZkLHe5rQlPJkqz5JCMrupDR4y5Orhdqh/MzkRpmVosTatcdHttGeGR72y2xTWDLZNkT6hRV190Hz8qHsY7xzFdwhb+p/G7xy1jNeIU9uZuu+7WBc99jfLgfkvnAByBKgMOt46IWDkIBUQP2YsFJnA==; 24:SVQE2ATvbiFaaIYLbKIglJTYSudso9GgFvMzrI+BhmZB5v8EwUfi9ZV3bjjzJ28tTp+Oul9MJB5PR0g4H3GXZfHA00zWpF7QlwlEqcWzSTM=; 20:K4RAjHChQ98bVQXOPUKqgzvbHOAEQPNSICDW8CF1+SLElSPQAVw6q3HPAB/xyEBKxzRAyhnCh36EfMVXwKwRPU/UaLYjGw3DhAgw08xs2zX0KeeEEf12IeLHaGxSN8hdr77MJ4rnV+EJSrsDmZ9fKIhg+Gu44RV5Qw3L81KENKs= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2016 07:54:26.2890 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB0919 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The previous code could use the first USB-DMAC with IPMMU if iommus property was set into this device node. However, in this case, it could not control the second USB-DMAC with IPMMU because a parameter of IPMMU (micro-TLB id) is different with each USB-DMAC. So, this patch uses the usb_gadget_{un}map_request_by_dev() APIs for IPMMU. (Then, iommus property should be set into USB-DMAC node(s).) Signed-off-by: Yoshihiro Shimoda --- drivers/usb/renesas_usbhs/mod_gadget.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index d701ae6..30345c2 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c @@ -197,8 +197,6 @@ static int usbhsg_dma_map_ctrl(struct device *dma_dev, struct usbhs_pkt *pkt, struct usbhsg_request *ureq = usbhsg_pkt_to_ureq(pkt); struct usb_request *req = &ureq->req; struct usbhs_pipe *pipe = pkt->pipe; - struct usbhsg_uep *uep = usbhsg_pipe_to_uep(pipe); - struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); enum dma_data_direction dir; int ret = 0; @@ -208,13 +206,13 @@ static int usbhsg_dma_map_ctrl(struct device *dma_dev, struct usbhs_pkt *pkt, /* it can not use scatter/gather */ WARN_ON(req->num_sgs); - ret = usb_gadget_map_request(&gpriv->gadget, req, dir); + ret = usb_gadget_map_request_by_dev(dma_dev, req, dir); if (ret < 0) return ret; pkt->dma = req->dma; } else { - usb_gadget_unmap_request(&gpriv->gadget, req, dir); + usb_gadget_unmap_request_by_dev(dma_dev, req, dir); } return ret;