RE: Patch [1/2] DaVinci CPPI TX DMA tasklet

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

 



As far as I understand, you need to save the toggle bit only after an entire URB transfer is complete. So if we know that we are transmitting 512 * N bytes. If N is even we would know that we don't have to change the data toggle and if it is odd we have to. So, if we start the transfer and the entire urb is transferred without error then this logic would work fine. On a USB endpoint error however, we can check the number of BDs successfully transmitted (by traversing the BD chain) and set the toggle correctly.
Comments? 

>-----Original Message-----
>From: linux-usb-owner@xxxxxxxxxxxxxxx [mailto:linux-usb-owner@xxxxxxxxxxxxxxx]
>On Behalf Of Subbrathnam, Swaminathan
>Sent: Thursday, August 21, 2008 7:28 PM
>To: linux-omap@xxxxxxxxxxxxxxx
>Cc: linux-usb@xxxxxxxxxxxxxxx; felipe.balbi@xxxxxxxxx
>Subject: Patch [1/2] DaVinci CPPI TX DMA tasklet
>
>    Signed-off-by: Swaminathan S <swami.iyer@xxxxxx>
>
>    This patch adds tasklet structures to musb to enable
>    polling for FIFO empty status on the Mentor TX FIFO.
>    This is requried to enable proper functioning of
>    DaVinci CPPI TX DMA when performing Tx transfers.
>
>diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
>index 2096469..804caaf 100644
>--- a/drivers/usb/musb/musb_core.h
>+++ b/drivers/usb/musb/musb_core.h
>@@ -273,6 +273,9 @@ struct musb_hw_ep {
>
> 	u8			rx_reinit;
> 	u8			tx_reinit;
>+#ifdef CONFIG_ARCH_DAVINCI
>+	u8			fifo_flush_check;	/* Check FIFO empty */
>+#endif
> #endif
>
> #ifdef CONFIG_USB_GADGET_MUSB_HDRC
>@@ -331,6 +334,9 @@ struct musb {
> 	struct list_head	in_bulk;	/* of musb_qh */
> 	struct list_head	out_bulk;	/* of musb_qh */
> 	struct musb_qh		*periodic[32];	/* tree of interrupt+iso */
>+#ifdef CONFIG_ARCH_DAVINCI
>+	struct tasklet_struct	fifo_check;	/* FIFO empty check tasklet */
>+#endif
> #endif
>
> 	/* called with IRQs blocked; ON/nonzero implies starting a session,
>diff --git a/drivers/usb/musb/musb_host.h b/drivers/usb/musb/musb_host.h
>index 77bcdb9..29e1863 100644
>--- a/drivers/usb/musb/musb_host.h
>+++ b/drivers/usb/musb/musb_host.h
>@@ -69,6 +69,7 @@ struct musb_qh {
> 	u16			maxpacket;
> 	u16			frame;		/* for periodic schedule */
> 	unsigned		iso_idx;	/* in urb->iso_frame_desc[] */
>+	u8			num_req;	/* Number of active requests */
> };
>
> /* map from control or bulk queue head to the first qh on that ring */
>@@ -89,6 +90,10 @@ extern int musb_hub_control(struct usb_hcd *hcd,
> 			u16 typeReq, u16 wValue, u16 wIndex,
> 			char *buf, u16 wLength);
>
>+#ifdef CONFIG_ARCH_DAVINCI
>+extern void musb_fifo_check_tasklet(unsigned long data);
>+#endif
>+
> extern const struct hc_driver musb_hc_driver;
>
> static inline struct urb *next_urb(struct musb_qh *qh)
>--
>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-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux