[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210114180021.GA1935@rowland.harvard.edu>
Date: Thu, 14 Jan 2021 13:00:21 -0500
From: Alan Stern <stern@...land.harvard.edu>
To: Peter Chen <hzpeterchen@...il.com>
Cc: Daewoong Kim <daewoong00.kim@....com>,
linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
allen.lkml@...il.com, gustavoars@...nel.org,
a.darwish@...utronix.de, romain.perier@...il.com,
dvyukov@...gle.com, andreyknvl@...gle.com, mathias.nyman@...el.com,
gregkh@...uxfoundation.org
Subject: Re: [PATCH 1/1] usb: xhci: setup packets don't need DMA mapping
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
Powered by blists - more mailing lists