Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2543326pxf; Sat, 27 Mar 2021 15:22:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOvB3tQ08ZzT3s17MCLWME7FZBscb9QFWB+nX2LcKWnBjRckIF3LnDlIa72/YbHWYfnts1 X-Received: by 2002:aa7:da06:: with SMTP id r6mr493742eds.86.1616883759120; Sat, 27 Mar 2021 15:22:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616883759; cv=none; d=google.com; s=arc-20160816; b=TKW4PA4zh6WagEvCKplm07Xq5jU+kGsgxYT3/G6iRQm57TruuVgN9cxPWtqB2Z1Iqy OR8IMkwLPVJvzDwbL6EwLPHNHgFcV3g9xvkFXqJYwBSxJK2z3oE/DGfycfwbInuZ/CcO KAZwzELru1/2gWkRxIH9mH6Czj7On97oB0+Y99pXOl4sAOu7XmhxDgE+L1crGYDjb4Oj dyuvb22G7S53gD1Z4oqGZmDABVdEVyRr0bp2/NnDqD3Th3lc/BTwCntKBD7up0FhK0ZS 5jEhJK42nYN5XvGXvykeRvZ0Yr/yysVdAVohGZcHTUrlcPO6CTzZXFwfoJ8LqTdtFaw1 eG8A== 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 :dkim-signature; bh=TfAEx42ev3o6ArqZhaNIyJVqiP9OCV2R4A7TGL7rtCQ=; b=rwNXMvEZaGjkzI9Y2uERofC13VOZ0rnxk4clju+wD+2Q9MSbJ8hgLY/4oFgSzSE53p GLuq5968t2nlLZf1MRQSzA3CxroVJK+afZNGLGalzAgxkf1M7SEcbmXv2NnlgT3246Iz Ddl+N9qpVROH5g0L910XsBP4bcINab8OXrlCqzpdTINPyJdyBAsRxhllJuf/YPvdMarv 3YSHrUI6Ucp/l5MB3/7il0CrcS5ZUpW09tPIMIF4cIKDHHWYyvSHZCMQfsjgQmvOKV1L n8JkJLfsSogCr3gCZuHuvTMyIpWF3y7GJPb/6qeNWggkTzViHSKEIdZxGfz3tfp0sb1d i8qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hEIX0oPf; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si9401056edq.522.2021.03.27.15.21.30; Sat, 27 Mar 2021 15:22:39 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hEIX0oPf; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231145AbhC0WSd (ORCPT + 99 others); Sat, 27 Mar 2021 18:18:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230521AbhC0WSI (ORCPT ); Sat, 27 Mar 2021 18:18:08 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37CEDC0613B1; Sat, 27 Mar 2021 15:18:08 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id w8so4227549pjf.4; Sat, 27 Mar 2021 15:18:08 -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=TfAEx42ev3o6ArqZhaNIyJVqiP9OCV2R4A7TGL7rtCQ=; b=hEIX0oPfFAcrO/k2kHkBhcRtyqj0FD8mWIVQTlxw0OI+uaj1TI1YX6ADQim1U0iOZW GuL0cAthlpIezO6y+IRAKjh6xXQTNQKBxgHSTmG4tnmf78nGsxPtZ3dC2UDFWBAt3eEG rl0eyQgCNjLI9L76/2PPYxRLs9DJkSmB4HB1bjINsGI/kKTUm/NrrypRdfdN7BFwYzF+ jewrygWiUtD/GptSIm9w+FsGIsNA3FMxcua0D1JMHJU+va2wrmTH6l2P8YsydoAkAgmE q4NTr0kcCPcJVnRsSNN+hrlpRL8/QluboOjTnotPEFTSygMmBHUZyPvikhMck07XnRuU doug== 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=TfAEx42ev3o6ArqZhaNIyJVqiP9OCV2R4A7TGL7rtCQ=; b=aqJI+dSAePfxGXKR3YsMtJ0lM/bpDPRgUrl7CSd8HaA71T6jR5v4o4sFJ/NeWVqAi6 ADdDEejgCAUbe9R+TvVkanPk5idFlY/MNUSMj1nVG6gTu1YiMfXFM/Yz+VzySDivwNeP gk9A0XQlj8+N02cv9O1lVdCQ3qO2KBA9Xdtl9l0QQUOIoBw0aXaurYu2FXCRftEeBCKh 2qpSahq4hLZykgZTMgJMnOc9CUgz340URttFDaIftMT5Q9CXsTRKQMKlhvoYx8jYF9v4 PtXLSK25QFANEOeHTNrlR2E80EP8JxeLJ1WHa01Lg55HLff/VL3N+KNdQf4KmAGM6OWM tv3w== X-Gm-Message-State: AOAM530BqUbIxQzX5Yi3L87/3XDgZoVL+gb0b87kPgCVtk8I5wyXXDg8 iVfozL4Fbw5kxq4guqci7DE= X-Received: by 2002:a17:902:ce8d:b029:e4:bc38:c4 with SMTP id f13-20020a170902ce8db02900e4bc3800c4mr21203549plg.48.1616883487619; Sat, 27 Mar 2021 15:18:07 -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 b10sm12555994pgm.76.2021.03.27.15.18.05 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 27 Mar 2021 15:18:07 -0700 (PDT) Date: Sat, 27 Mar 2021 15:17:59 -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: <20210327221759.GA2997@taoren-ubuntu-R90MNF91> References: <20210326070214.6719-1-rentao.bupt@gmail.com> <10920f34-289c-feac-79b6-71bff2aea67d@arm.com> <20210326120526.GA14169@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210326120526.GA14169@lst.de> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Cheers, Tao