Re: [rfc/rft/patch v2 07/19] usb: musb: gadget: avoid allocating several dma channels

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

 



Felipe Balbi wrote:

From: Arnaud Mandy <ext-arnaud.2.mandy@xxxxxxxxx>

omap3 has a silicon bug where it can't handle dma transfers
concurrently, meaning the dma will get stuck if we try to
use two different dma channels simultaneously.

In order to avoid that bug, let's not allocate more than one
dma channel at a time.

Signed-off-by: Arnaud Mandy <ext-arnaud.2.mandy@xxxxxxxxx>
Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxx>

[...]

diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c
index 5e83f96..9371578 100644
--- a/drivers/usb/musb/musbhsdma.c
+++ b/drivers/usb/musb/musbhsdma.c
@@ -79,23 +79,29 @@ static struct dma_channel *dma_channel_allocate(struct dma_controller *c,
 	struct dma_channel *channel = NULL;
 	u8 bit;
- for (bit = 0; bit < MUSB_HSDMA_CHANNELS; bit++) {
-		if (!(controller->used_channels & (1 << bit))) {
-			controller->used_channels |= (1 << bit);
-			musb_channel = &(controller->channel[bit]);
-			musb_channel->controller = controller;
-			musb_channel->idx = bit;
-			musb_channel->epnum = hw_ep->epnum;
-			musb_channel->transmit = transmit;
-			channel = &(musb_channel->channel);
-			channel->private_data = musb_channel;
-			channel->status = MUSB_DMA_STATUS_FREE;
-			channel->max_len = 0x10000;
-			/* Tx => mode 1; Rx => mode 0 */
-			channel->desired_mode = transmit;
-			channel->actual_len = 0;
-			break;
-		}
+	/* musb on omap3 has a problem with using dma channels simultaneously
+	 * so we will only allocate 1 dma channel at a time to avoid problems
+	 * related to that bug
+	 */
+	for (bit = 0; bit < 1; bit++) {

   All that's well but why the other Mentor DMA implementations should suffer?
And why have a loop if there's only a single iteration?

WBR, Sergei

--
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