static inline int tusb_omap_use_shared_dmareq(struct tusb_omap_dma_ch *chdat)
{
u32 reg = musb_readl(chdat->tusb_base, TUSB_DMA_EP_MAP);
+
if (reg != 0) {
DBG(3, "ep%i dmareq0 is busy for ep%i\n",
chdat->epnum, reg & 0xf);
else
transfer_len = len;
+ if (len < packet_sz)
+ packet_sz = transfer_len;
+
if (dmareq_works()) {
ch = chdat->ch;
dmareq = chdat->dmareq;
DBG(3, "could not get dma for ep%i\n", chdat->epnum);
return FALSE;
}
+ if (tusb_dma->ch < 0) {
+ /* REVISIT: This should get blocked earlier, happens
+ * with MSC ErrorRecoveryTest
+ */
+ WARN_ON(1);
+ return FALSE;
+ }
+
ch = tusb_dma->ch;
dmareq = tusb_dma->dmareq;
sync_dev = tusb_dma->sync_dev;