Re: [PATCH] usb: xhci: Rename xhci_queue_xxx_tx() to xhci_queue_xxx_urb()

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

 



Hi David,

This patch is fine in general, however I can't seem to get it to apply.
I tried 3.12, 3.13-rc4, and my for-usb-next-queue branch, and `git am`
failed on all three kernels.  Can you rebase this against either
3.13-rc4 or my for-usb-next-queue branch?

Thanks,
Sarah Sharp

On Wed, Nov 13, 2013 at 05:01:46PM -0000, David Laight wrote:
> The xhci_queue_bulk_tx() function is used for both OUT and IN
> transactions, but the name implies that it is only used for transmits.
> Rename it to xhci_queue_bulk_urb() to avoid any confusion.
> 
> Similarly rename the functions for ctrl, intr and isoc URB.
> Rename the existing xhci_queue_isoc_tx() to write_isoc_trbs() to allow
> consistent naming.
> 
> Signed-off-by: David Laight <david.laight@xxxxxxxxxx>
> ---
>  drivers/usb/host/xhci-ring.c | 16 ++++++++--------
>  drivers/usb/host/xhci.c      |  8 ++++----
>  drivers/usb/host/xhci.h      |  8 ++++----
>  3 files changed, 16 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
> index 8bce4c3..45a4cde 100644
> --- a/drivers/usb/host/xhci-ring.c
> +++ b/drivers/usb/host/xhci-ring.c
> @@ -3146,7 +3146,7 @@ static void giveback_first_trb(struct xhci_hcd *xhci, int slot_id,
>   * (comprised of sg list entries) can take several service intervals to
>   * transmit.
>   */
> -int xhci_queue_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
> +int xhci_queue_intr_urb(struct xhci_hcd *xhci, gfp_t mem_flags,
>  		struct urb *urb, int slot_id, unsigned int ep_index)
>  {
>  	struct xhci_ep_ctx *ep_ctx = xhci_get_ep_ctx(xhci,
> @@ -3174,7 +3174,7 @@ int xhci_queue_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
>  				urb->dev->speed == USB_SPEED_FULL)
>  			urb->interval /= 8;
>  	}
> -	return xhci_queue_bulk_tx(xhci, mem_flags, urb, slot_id, ep_index);
> +	return xhci_queue_bulk_urb(xhci, mem_flags, urb, slot_id, ep_index);
>  }
>  
>  /*
> @@ -3228,7 +3228,7 @@ static u32 xhci_v1_0_td_remainder(int running_total, int trb_buff_len,
>  	return (total_packet_count - packets_transferred) << 17;
>  }
>  
> -int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
> +int xhci_queue_bulk_urb(struct xhci_hcd *xhci, gfp_t mem_flags,
>  		struct urb *urb, int slot_id, unsigned int ep_index)
>  {
>  	struct xhci_ring *ep_ring;
> @@ -3370,7 +3370,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
>  }
>  
>  /* Caller must have locked xhci->lock */
> -int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
> +int xhci_queue_ctrl_urb(struct xhci_hcd *xhci, gfp_t mem_flags,
>  		struct urb *urb, int slot_id, unsigned int ep_index)
>  {
>  	struct xhci_ring *ep_ring;
> @@ -3557,7 +3557,7 @@ static unsigned int xhci_get_last_burst_packet_count(struct xhci_hcd *xhci,
>  }
>  
>  /* This is for isoc transfer */
> -static void xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
> +static void write_isoc_trbs(struct xhci_hcd *xhci, gfp_t mem_flags,
>  		struct urb *urb, int slot_id, unsigned int ep_index)
>  {
>  	struct xhci_ring *ep_ring;
> @@ -3702,11 +3702,11 @@ static void xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
>  /*
>   * Check transfer ring to guarantee there is enough room for the urb.
>   * Update ISO URB start_frame and interval.
> - * Update interval as xhci_queue_intr_tx does. Just use xhci frame_index to
> + * Update interval as xhci_queue_intr_urb does. Just use xhci frame_index to
>   * update the urb->start_frame by now.
>   * Always assume URB_ISO_ASAP set, and NEVER use urb->start_frame as input.
>   */
> -int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags,
> +int xhci_queue_isoc_urb(struct xhci_hcd *xhci, gfp_t mem_flags,
>  		struct urb *urb, int slot_id, unsigned int ep_index)
>  {
>  	struct xhci_virt_device *xdev;
> @@ -3762,7 +3762,7 @@ int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags,
>  			urb->interval /= 8;
>  	}
>  
> -	xhci_queue_isoc_tx(xhci, mem_flags, urb, slot_id, ep_index);
> +	write_isoc_trbs(xhci, mem_flags, urb, slot_id, ep_index);
>  	return 0;
>  }
>  
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 4f378f3..076292f 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -1302,7 +1302,7 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
>  		spin_lock_irqsave(&xhci->lock, flags);
>  		if (xhci->xhc_state & XHCI_STATE_DYING)
>  			goto dying;
> -		ret = xhci_queue_ctrl_tx(xhci, GFP_ATOMIC, urb,
> +		ret = xhci_queue_ctrl_urb(xhci, GFP_ATOMIC, urb,
>  				slot_id, ep_index);
>  		if (ret)
>  			goto free_priv;
> @@ -1323,7 +1323,7 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
>  					"not having streams.\n");
>  			ret = -EINVAL;
>  		} else {
> -			ret = xhci_queue_bulk_tx(xhci, GFP_ATOMIC, urb,
> +			ret = xhci_queue_bulk_urb(xhci, GFP_ATOMIC, urb,
>  					slot_id, ep_index);
>  		}
>  		if (ret)
> @@ -1333,7 +1333,7 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
>  		spin_lock_irqsave(&xhci->lock, flags);
>  		if (xhci->xhc_state & XHCI_STATE_DYING)
>  			goto dying;
> -		ret = xhci_queue_intr_tx(xhci, GFP_ATOMIC, urb,
> +		ret = xhci_queue_intr_urb(xhci, GFP_ATOMIC, urb,
>  				slot_id, ep_index);
>  		if (ret)
>  			goto free_priv;
> @@ -1342,7 +1342,7 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
>  		spin_lock_irqsave(&xhci->lock, flags);
>  		if (xhci->xhc_state & XHCI_STATE_DYING)
>  			goto dying;
> -		ret = xhci_queue_isoc_tx_prepare(xhci, GFP_ATOMIC, urb,
> +		ret = xhci_queue_isoc_urb(xhci, GFP_ATOMIC, urb,
>  				slot_id, ep_index);
>  		if (ret)
>  			goto free_priv;
> diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
> index 03b5f56..6be20c5 100644
> --- a/drivers/usb/host/xhci.h
> +++ b/drivers/usb/host/xhci.h
> @@ -1818,13 +1818,13 @@ int xhci_queue_vendor_command(struct xhci_hcd *xhci,
>  		u32 field1, u32 field2, u32 field3, u32 field4);
>  int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, int slot_id,
>  		unsigned int ep_index, int suspend);
> -int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
> +int xhci_queue_ctrl_urb(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
>  		int slot_id, unsigned int ep_index);
> -int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
> +int xhci_queue_bulk_urb(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
>  		int slot_id, unsigned int ep_index);
> -int xhci_queue_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
> +int xhci_queue_intr_urb(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
>  		int slot_id, unsigned int ep_index);
> -int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags,
> +int xhci_queue_isoc_urb(struct xhci_hcd *xhci, gfp_t mem_flags,
>  		struct urb *urb, int slot_id, unsigned int ep_index);
>  int xhci_queue_configure_endpoint(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,
>  		u32 slot_id, bool command_must_succeed);
> -- 
> 1.8.1.2
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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

  Powered by Linux