From patchwork Tue Apr 5 09:15:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 8748951 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A6C47C0553 for ; Tue, 5 Apr 2016 09:16:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 11EEB2035D for ; Tue, 5 Apr 2016 09:16:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 542E32034F for ; Tue, 5 Apr 2016 09:16:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932582AbcDEJQb (ORCPT ); Tue, 5 Apr 2016 05:16:31 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:12762 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932156AbcDEJQ3 (ORCPT ); Tue, 5 Apr 2016 05:16:29 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie3.idc.renesas.com with ESMTP; 05 Apr 2016 18:16:27 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 726EB4844F; Tue, 5 Apr 2016 18:16:27 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id 6E4651806F; Tue, 5 Apr 2016 18:16:27 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id 61C0E1800A; Tue, 5 Apr 2016 18:16:27 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac3.idc.renesas.com with ESMTP id UAU15761; Tue, 5 Apr 2016 18:16:27 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="208087356" Received: from mail-hk2apc01lp0215.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.215]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 05 Apr 2016 18:16:26 +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=BAejnyGtyuXlDDKksB6W55BYEypjcSQ6GEl79ICwL/s=; b=nLez+uMqbzf4RCGFFMg9atIQKpgqdhYm5Ga/HWSx9PJlyYhYROPOLRWhLOuas1VgsZeBWvFl/cLt6AuX/ls16FKK51+aNRGGQfMsAiYJjUHAAcMxWuSJT7MiX0fEtSuLDHP+xXhvuwTPOhNcewqOGFRyBxVmt4YpGJ6KVJ3+F7I= 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.144) by HK2PR06MB0915.apcprd06.prod.outlook.com (10.162.246.30) with Microsoft SMTP Server (TLS) id 15.1.447.15; Tue, 5 Apr 2016 09:16:24 +0000 From: Yoshihiro Shimoda To: CC: , , , Yoshihiro Shimoda Subject: [PATCH/RFC 5/5] usb: renesas_usbhs: use usb_gadget_{un}map_request_by_dev() for IPMMU Date: Tue, 5 Apr 2016 18:15:49 +0900 Message-ID: <1459847749-5336-6-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.1 In-Reply-To: <1459847749-5336-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> References: <1459847749-5336-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR01CA0026.jpnprd01.prod.outlook.com (10.164.162.136) To HK2PR06MB0915.apcprd06.prod.outlook.com (10.162.246.30) X-MS-Office365-Filtering-Correlation-Id: b503e57e-94f0-46bf-e35f-08d35d32f620 X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0915; 2:NBZ5KbwW9QM6yHyvDZvS1wTHXDacfnpcQjbJaC1/58X2cIZVxzIguC/r3JhQjdGlTUedgWGVlxpS0Oc/Wui1z61z0y1+E8ko64HU6ARXdzYNvmDDp64XoCvjdaHGrHYzyGF9pmCHy0cH7DZFGQZY5HBO7roKERFY/AXJezXLuRFVaoVr3w9QtV6ScAyciQdn; 3:C+YT55ksEIyRWU6OCuUrYdBQ5ss0s8Jcn5343vhGD2ZuduqooMlo8l8thmfKDhMs7FRkL+i6vNDehcWvL22BiHVFaKYTF1NCKAQavGe0belC3+DbDhuZGs6OSKGpkU3W; 25:1rImsw6CL2x0AyGHzsLHFJQQi87qb7mmwMIlfu60usxFAOeGAgsGNC0Dup0gZWXgHKwYa85VEXf4uknLUwxBrW8QqK7LOphaN7od9nUqnsMPJ29X93IUQfZaBDgKpaIAHde6XmZr1mKqT+K2k5GD3o5aHvTKeDXkV72nE5/IMxifBsJ0oTk8t/l8vVWjbHCOKA5p0PnUmegPYz/49QDIlkDu6He7SsdNFjHjN7/WPQZNg0AX41TsrjI1dlBlqOZy+fOlFA4y7dvRxftvPnNNRWgXkNI9nQ+IDDPIAbKCDJlxrIetyeg5PCK+PaWoN1aWlgX24e0hVRNOLlyMpl60AqoPUwK2wJ/mYTyT7dm+4Xw= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB0915; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0915; 20:QfcUbkTTB73LJiLwPALoprtxJLOO98XYTAvA+5MaRnirRWLrd54QCOlcrkfBSZIYA/ToFQpl38THoiNchqT5CHAr1sKRgy/UCwcSyZ+3Gw6GvVHmxd3t8mQ5WV/CMPE6ZPkOxn0ykRLYPveXfuBBkQDvXqn8m2TSHQV6oyc0dJrZMtEXWwOuabM1kKq1USQhKrTdi5S352Zxw1kt3aKgxAxvXiNL48dGL0XByQpEUZyDNqvXl/tZj9uZFYWb3za4fEHNJ1tilcQu4yh/eV9UjRg+aDXQmwuU0eHaeCb4yYYUpg1HbTjE/jjjldZieXb/49VPkiTe44gdah4gkzPCzytYXYaZy/957pv2GjSd2YvQv+rESnMEXx5uczu8AKZXlOkyjoO+N8llBrKzXsjB5ffPU/wjBrvEJgjy43aaYFGiyp4ge+05MymglbPwAlWCLzXbIy9nMXkg2TClv8oFTc5bQnw2zst8c9b/0gjuc/cGkBzIFUkgOovLpumrSxj2; 4:E+5btUXALHFKEvnnYcxeZ0TDHWDJii7lMzQVUkWkOK1dOP78pNacuEx6fh86/KCJVaqDkUMlSKIztqLP+St28NcK66oeAmsybYRJvCqRXcdtKXU+lghNyTuxWdMinSDgTOt4mLtTkUb8juBRHUYf0ZXeJFboemN50oVdbO0+5ky8MbnXhDkX5qbo+EZepDy96EyhuZweTiEJApcVoVEImGpO8dTqAudAeTjUM77jIc1+QSWK2JkIlbJRhpn21TNkVoZUSkB2rAMTPCWKgIqPhivDFKmYlOx7QbjNUuol5UJealukqJVjJuagRG1iEpyQ5HK+1q/rsuSOR6jHNm7JI2/WF1S4bfsyU5rdIi/1G6ZqhAVBO+yqBrm6btYpgpEs X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:HK2PR06MB0915; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB0915; X-Forefront-PRVS: 0903DD1D85 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6069001)(6009001)(19580405001)(48376002)(92566002)(77096005)(42382002)(33646002)(2950100001)(36756003)(5004730100002)(19580395003)(50466002)(5003940100001)(586003)(81166005)(6116002)(4001430100002)(3846002)(189998001)(107886002)(110136002)(4326007)(5008740100001)(78352003)(2906002)(1096002)(66066001)(42186005)(76176999)(76506005)(50986999)(47776003)(50226001)(2351001)(229853001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB0915; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2PR06MB0915; 23:s7DUqXbVlC8QOOxicD37q9fbXzqrB4F9JOXixZI4i?= =?us-ascii?Q?tZ1KBtHO1AQgUttBu1dWiVD4f48yI0tlYDhSp5zUkVlViG6C+2z1Nb+rO/03?= =?us-ascii?Q?TEp5mXZr3ewJnpBwUGeqWdmH5E4AbenSQbZIRe5iE1v1Yno5hLOVy9W80H2i?= =?us-ascii?Q?8mykmedzIdALlkq0H2fAfgIKqWDt6r1wbWZWRzkPOKIUXzpeECsv71rDxdHF?= =?us-ascii?Q?kLCnOdrEty3hJ70gSimn505Csfw2022UKQ98T1BgREY01xrVyrfweunD0rRQ?= =?us-ascii?Q?hkA9vfTswOogQHzFv+TiwfwtxUxO4+GoVep5/6EFz1WKqd4TCQCEYhUhjO/r?= =?us-ascii?Q?t/BBSYRLopecHmvdFG35pK/KqYhXPbmV/CBwu4rx6yXBaSlz+hr/JDu6w4vJ?= =?us-ascii?Q?0zZSak/Tlk59TadOMJEp3tEZQr7nsnCUqiLbLxW7kn4CyxMpyGe3hCd/AH63?= =?us-ascii?Q?7FtlcCcAS3T0g5IBYodPD4MiqnkADYkKHdRGB5JBc79KnEk6O4RePh7yzfpj?= =?us-ascii?Q?AQUwgcWDBv8xJFI/CDIOOZqZyJRRXie8e05SK39uFQzMJBIIbS5Fr0NCGIyf?= =?us-ascii?Q?rQuT1gE4o/9RcuRpU162JAHR2MgKH5swW4joF4K0pPnp2awEpQGL9SJTyVl9?= =?us-ascii?Q?QvlAPAVaZ1KCiqtDnmr14riylpPrjG4PS9UtdikB3c15OCOrh7vwuWG/+pJX?= =?us-ascii?Q?tXIvLpcQVwEwdrUTjDaRPqYzOd+D7suu3ng1FGH/PsTA0QwYQCijQUxa3G9F?= =?us-ascii?Q?Sw8jzdAGq0T1wi8RVzuUFK/0YypYZZ4K3O/GNWY8+ekxGC3BGVSbNH4x9SSH?= =?us-ascii?Q?/xTSLX9ENh2vHqkDyFYnqb9Io+G8cZFYKai0oeusTy59Bq9d1DlEaA2JNL6Y?= =?us-ascii?Q?uQ7+384BOSJjLzqTxOZDW20v9uLDQ2zn/AOPU9Ut2Y9pz+AwgqooQw/ve/9A?= =?us-ascii?Q?v7DF3nxXxf+o6J7UZ/xvRv6UYqS96/zcHc4fdTZFTuEA8tXzrkSXM0v1dH/7?= =?us-ascii?Q?y7HYVghgSkIBcmvHQJBNVY8?= X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0915; 5:SxzVQZKDnGFiAhs9YG+JxZBQpIRvJKa7MJCFn2Z1PHTxFLHbVnAEsN40YUbiyReT+4IELnNjDVizROiVlWwr+vO9yKt2awGGSUUT0aM9DD6TgloHz7l5/GQRY7Ld8dXEdB5PoHx7XrEaYvPmsKT9TQ==; 24:386zdU1ls/j/Xfj1dUNW8oCsoQFyqrpPNvyswRkPfLXXZyNJzJ05NA37ic0HXnO9OGVqfaAk7r4zP/1oap6MmSaYK+onKPKnNaJJ+PMlie4=; 20:x0hRk0lVzYMAkpFpot5YZIU7MJUviuJ8G+VRH6DCmagf0N2jCj2/UYm/7UO3X6bXffz8YoyLgQUX+lpRB35N1y7YpddXZLn2ABysVn1DZpWeRedpdGDHYMco2M8+wo/9eQ7i/cafrwRqJPp/vHOMZPEpKfc3rc7s3zvncznJHDc= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2016 09:16:24.7220 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB0915 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 0ebc4a9..12db6e6 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c @@ -193,8 +193,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; @@ -204,13 +202,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;