Re: [PATCH 1/1] usb: xhci: setup packets don't need DMA mapping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux