lkml.org 
[lkml]   [2021]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2021-01-14 19:03    [W:0.058 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site