Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3362788pxf; Sun, 28 Mar 2021 23:21:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdJ4P7W+QFFsF91tj3CKv7ph6UzOlqzNQGqwCLBOHbzQ9118JyXSXJAHHpa3aVS8zhN8lg X-Received: by 2002:a17:906:39a:: with SMTP id b26mr27602156eja.158.1616998877658; Sun, 28 Mar 2021 23:21:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616998877; cv=none; d=google.com; s=arc-20160816; b=dBJHB8VNnK34Kw1Kdufm2QkM3Goq6QFNtSIckqA/clw+LEFxREm9gYP9Gw0WxTOsKt tb93c1Y8ALep2O7jZWqmn/XcxW4GNCgO2C6Y7gbIpaIzErUGoWG4TYX5ANN6jVMdCBoG uYJrKbrMncrxDXGkWD/g6rpEeFqmYhmsIdNu7PE8fUb/AZqESXC10B3pUDMKiP8muyrB u5DVrCUg64QIslBD7e1wy5+x/6boNVKzKvAvN2BdBlSoC2nd32fCEmL2IFE8WwJRcCQw 9BLIrETcIWsousW7bFDxkOSXUyNo5kANE83iJyjNu5v4sBkcZgUuC75jRDtb0HA1F8jx n++g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=wN86AX0AL29OLPwIG9ZU20t19RPxZeyxI9JgAfB2F1g=; b=WFxOcnUwYGHIbOMrQzfUIPOjT7LDrUUIznibeori2p8UO5QpqXeMPAOMXvOKk+zVZ3 KnYjmN01jMXixT734Bwoo93E7mlWBHQCjbmYEqe+UhddOiI3RYmfMCsxY+AtkqLIOiko WzsHVmA0UNgAy8smMfHWYkych5lOPXVh4aRAsO5AsPRUCOkgjdAY8Nt/CnXeh6wS/YhO RbTmN+4IiM+v2MmvNcHGOdtSZbYPDi2KgyXKp8gfSEaIiJ/gjoQQ92xHDA2VcIqWD7KD vgrEEe9YcKOnPVQRl356rIOe/7lgr9k6d464aCcq5JNgzG4HJ2PAxcwx1bRcGnljk5a4 k3CA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx24si12470527edb.541.2021.03.28.23.20.54; Sun, 28 Mar 2021 23:21:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229689AbhC2GRz (ORCPT + 99 others); Mon, 29 Mar 2021 02:17:55 -0400 Received: from verein.lst.de ([213.95.11.211]:52215 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbhC2GRj (ORCPT ); Mon, 29 Mar 2021 02:17:39 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 80D5868B05; Mon, 29 Mar 2021 08:17:35 +0200 (CEST) Date: Mon, 29 Mar 2021 08:17:35 +0200 From: Christoph Hellwig To: Tao Ren Cc: Christoph Hellwig , Robin Murphy , Felipe Balbi , Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , kernel test robot , Masahiro Yamada , Sasha Levin , Ryan Chen , Thomas Tai , Konrad Rzeszutek Wilk , Benjamin Herrenschmidt , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, Tao Ren Subject: Re: [PATCH] usb: gadget: aspeed: set port_dev dma mask Message-ID: <20210329061735.GA27510@lst.de> References: <20210326070214.6719-1-rentao.bupt@gmail.com> <10920f34-289c-feac-79b6-71bff2aea67d@arm.com> <20210326120526.GA14169@lst.de> <20210327221759.GA2997@taoren-ubuntu-R90MNF91> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210327221759.GA2997@taoren-ubuntu-R90MNF91> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 27, 2021 at 03:17:59PM -0700, Tao Ren wrote: > On Fri, Mar 26, 2021 at 01:05:26PM +0100, Christoph Hellwig wrote: > > On Fri, Mar 26, 2021 at 12:03:03PM +0000, Robin Murphy wrote: > > > This might happen to work out, but is far from correct. Just wait until you > > > try it on a platform where the USB controller is behind an IOMMU... > > > > > > It looks like something is more fundamentally wrong here - the device > > > passed to DMA API calls must be the actual hardware device performing the > > > DMA, which in USB-land I believe means the controller's sysdev. > > > > The shiny new usb_intf_get_dma_device API provides the device to use. > > Thanks Robin and Christoph for the feedback. > > If I understand correctly, usb_intf_get_dma_device API is mainly for usb > host drivers? I just found usb_gadget_map_request_by_dev API: does it > make sense to replace usb_gadget_map_request with > usb_gadget_map_request_by_dev so we can pass the actual DMA-capable > hardware device (aspeed-vhub platform device) to the API? Oh, right you're dealing with a gadget side driver. Not sure about the API there, I'll let the relevant maintainers chime in.