From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2341C433DB for ; Wed, 31 Mar 2021 03:49:09 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8B3FC61983 for ; Wed, 31 Mar 2021 03:49:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B3FC61983 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=phdNplD8dcu1CeEBhulOFHY1Swkn16vXj/MJ36sFWAg=; b=a8NIsbJn75rkv1tHkzXKg8/TU qWwEDi7eqxEMdv6VK44bLl4nZsTx1EVMjK6AJGb/dRnnjA3p2fp0Gnywo408RvU7sHSEK0fl/BHaf QhIe6MK0WGgLslgwxiWbb0gQAHiytOB3nd+8HHzUj1kHUJ+/PVMcn4Qu215NLg5aprePjkXCvSua2 doI1DsTfPdVFNHsSjnOzV2EYHrWL1iNjX1lMMWt2emO5gmYGEvXbifulckIkBKfG7MEkX5sgyxa9e L/chdyiUsPi03jqnGMZ/bP3rWNvdxrzu5Cu3/HnE5OXWkxq2p1M/1ikSu7+YOVFtpZ9vgDUD4v4P8 AksTkimkw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lRRp9-005Q8c-JR; Wed, 31 Mar 2021 03:47:19 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lRRp2-005Q6u-8l for linux-arm-kernel@lists.infradead.org; Wed, 31 Mar 2021 03:47:14 +0000 Received: by mail-pg1-x535.google.com with SMTP id k8so4057540pgf.4 for ; Tue, 30 Mar 2021 20:47:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=U0ybPJ4IUj7A9WiPX6++C9vlgGXr5Xx8nEXJ1UKkhm8=; b=Ovm3ccj1Gkreg3858fKpv3NAk23NEwwFzrJg8scUGuiVgd/lWz9MV0+716OM+d2wFf gtcf02bbchFFt2TP6DA8kMYhX7viY9Wew0V1iC3mcNZRAsp513LCmXMy4CZpIzn0KkE1 qbNcE8wQd5P7SSBE1YJfEaMYr0t5Hxlrj4wFiH4lpRQgLugscp24O73O7B5pWaqjbUfi XRYzC5hNE/RECINx2jT9IsZ4mb5J9PkMW5QUXqwUj2d++OodhwmXi4501PPLOUokfDua c1CMXcXooDtcBxA8ELHbVp4w1hQfej39OQU9Zi7FgudIQSmHLNFBdGKBVycCiXOWx/s3 GRkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=U0ybPJ4IUj7A9WiPX6++C9vlgGXr5Xx8nEXJ1UKkhm8=; b=J3oCIZltE0H6m4gISH2d2cjbYDLUlWi+KpnrfDhLDXGQ0AJczY89yVp2caE0SMrtp6 ANnpBBa9NJLvUaZLGHrSpOIjuozQpBTTh2A5LSx2dVqpu/cGb3iK7X2vZM1j4scuByxs nTHKeOJCIqF5lGN9pSj6c7kJiQz8Dz8fxZcRcho5c53mjdUy6fFtzn5Nk7jm7fs6UDRa NXjnxTh/WfgPhd6WKnjdUYLCXeT6RrDNYCgN/B448zV3IFthEiagUSUT+bsVQt8NloA0 kFtRm4fkF7E/f3T2yk9NjqPL2tF/ZmV95bebLEUUzYavjLEKWN9k3ZhbH/axnEp2/g1K oHtw== X-Gm-Message-State: AOAM531MjKdSLlB4wNF4LkrtW+KjahVK+0mGm9TP4+1bPE2bREjq55aw RLS5tS9Sji/vS5QgelVhEtA= X-Google-Smtp-Source: ABdhPJyauHHwpjyiuukvlQwcFr75L5EGfWTiT3+42JyY+XkZ0d42RuforqZEr35yuq0JFRrmYydfXQ== X-Received: by 2002:a65:53c8:: with SMTP id z8mr1284073pgr.340.1617162429825; Tue, 30 Mar 2021 20:47:09 -0700 (PDT) Received: from taoren-ubuntu-R90MNF91 (c-73-252-146-110.hsd1.ca.comcast.net. [73.252.146.110]) by smtp.gmail.com with ESMTPSA id j3sm407019pfc.49.2021.03.30.20.47.07 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Mar 2021 20:47:09 -0700 (PDT) Date: Tue, 30 Mar 2021 20:47:02 -0700 From: Tao Ren To: Christoph Hellwig Cc: 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: <20210331034701.GA3185@taoren-ubuntu-R90MNF91> References: <20210326070214.6719-1-rentao.bupt@gmail.com> <10920f34-289c-feac-79b6-71bff2aea67d@arm.com> <20210326120526.GA14169@lst.de> <20210327221759.GA2997@taoren-ubuntu-R90MNF91> <20210329061735.GA27510@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210329061735.GA27510@lst.de> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210331_044712_473549_DF17856E X-CRM114-Status: GOOD ( 25.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Mar 29, 2021 at 08:17:35AM +0200, Christoph Hellwig wrote: > 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. Given this is not the right path, I will drop the patch and work out a new fix soon (by calling usb_gadget_map_request_by_dev, and with modified subject). Cheers, Tao _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel