Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp463346pxb; Thu, 14 Jan 2021 10:02:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJ2lJythCVzRZ8eiwNguumj3X7Z8hnXeUC2MgLzfBO1SSBGH2rX3QVdx3q/t6PezIG65Am X-Received: by 2002:a17:906:15ca:: with SMTP id l10mr5778954ejd.402.1610647375613; Thu, 14 Jan 2021 10:02:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610647375; cv=none; d=google.com; s=arc-20160816; b=o61BQJXltGoe9hAuJsB7bycp+h7wVLA06+hbrVHMlH1LvplHFBzdYqHAIh8ZLrdc9v lftEz28XKvWfy/Y/BKNWKaezVacF577t4khX1qM9lmtdDkcSD9HIbHJeaD+ICahk3FxO NmwVARzYgCLrcUnR0muh+23uR591+8EPNWg6FqI5+r+vlAPcrlx+yN3FHpnJtyIAmrZU O9hyp4RDacBUhBSLOOOmlpRqHm0B3kzpBzxINLNj8glt3E3pQmbMrbzoNPku2pWPw3Zr VtP3urS6tSGP2nhOs5AjE+k+4Ir61thOz36ChlYbFiual3lX00pM0W4693dajAPq4/1L aYZQ== 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=nA9ujgrs5G6Ki0kOIEBGCjCr64Jvbm9RKSdcjaE7Vz0=; b=dHy1t8t9K/HPlijxIG1rV20wpDyP/9O6jgv/gmW5phBWExJQk/tKNZtL3/eRQLrrXl fASbnjewr7uHy3pAIPjVbN6nOXwaQ5ZrxBtGUY0PxKhF8y8NhYlMt+8S8oAwPZ8lGfKx zzMlozMwYZusit3HtnDAiBdPHqmdwR+RUTezSO4ppoEO+upT9Etfa3K3GHSzfIjK+OZT WFteTy2PrFFaEAO/fqkSlE6GSub87VcWCi+Ae6INhhI70V++GIoRPRm6O+vFlKQHYC9Z tsQadJLIka2nYz3yC9BlB594on9EEq4qdn9dk1kPA3rZ3ZiIc5Vwetlq+LyLTD980CxW o+Ug== 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 kq16si2764203ejb.253.2021.01.14.10.02.30; Thu, 14 Jan 2021 10:02:55 -0800 (PST) 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 S1728725AbhANSBD (ORCPT + 99 others); Thu, 14 Jan 2021 13:01:03 -0500 Received: from netrider.rowland.org ([192.131.102.5]:59093 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1727708AbhANSBD (ORCPT ); Thu, 14 Jan 2021 13:01:03 -0500 Received: (qmail 13388 invoked by uid 1000); 14 Jan 2021 13:00:21 -0500 Date: Thu, 14 Jan 2021 13:00:21 -0500 From: Alan Stern To: Peter Chen Cc: Daewoong Kim , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, allen.lkml@gmail.com, gustavoars@kernel.org, a.darwish@linutronix.de, romain.perier@gmail.com, dvyukov@google.com, andreyknvl@google.com, mathias.nyman@intel.com, gregkh@linuxfoundation.org Subject: Re: [PATCH 1/1] usb: xhci: setup packets don't need DMA mapping Message-ID: <20210114180021.GA1935@rowland.harvard.edu> References: <1610593147-12511-1-git-send-email-daewoong00.kim@lge.com> <20210114050402.GA18650@b29397-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210114050402.GA18650@b29397-desktop> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 14, 2021 at 01:04:02PM +0800, Peter Chen wrote: > On 21-01-14 11:59:07, Daewoong Kim wrote: > > DMA mapping of urb->setup_packet is not necessary for xHCI host > > controllers. The xHCI specification says that Setup Stage TRB includes > > whole Setup Data; therefore, urb->setup_dma will not be used in the xhci > > HCD code. > > > > How about bypass map/unmap operation for xHCI control transfer directly? > > diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c > index 91ab81c3fc79..0a0ab14b7638 100644 > --- a/drivers/usb/host/xhci.c > +++ b/drivers/usb/host/xhci.c > @@ -1374,7 +1374,8 @@ static int xhci_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, > > xhci = hcd_to_xhci(hcd); > > - if (xhci_urb_suitable_for_idt(urb)) > + if (xhci_urb_suitable_for_idt(urb) || > + (usb_endpoint_xfer_control(&urb->ep->desc))) > return 0; Would this affect the map/unmap operations for the DATA packets in a control transfer, along with the SETUP packet? Alan Stern