8686 with SDIO on AT91SAM9263

Marc Pignat marc.pignat at hevs.ch
Thu Jan 24 02:12:18 EST 2008


Hi!

On Thursday 24 January 2008, Dan Williams wrote:
> On Wed, 2008-01-23 at 19:20 +0100, Hans J. Koch wrote:
> > I made some progress in my attempts to make a Marvell 8686 work on an
> > AT91SAM9263 board. I use latest netdev-2.6.25 plus a patch that solves
> > the modulo-4-problem of the AT91 MCI driver. That patch was recently
> > posted by Marc Pignat on linux-arm-kernel ML.
> > 
> > ATM, firmware is downloaded without problems. But after that, it hangs
> > somewhere in libertas core code. The last thing I see is:
> > 
> > libertas: 00:19:88:05:1c:53, fw 8.73.7p3, cap 0x00000393
> > libertas: Command 28 timed out
> > libertas: requeueing command 28 due to timeout (#1)
> > 
> > This is somewhere in lbs_setup_firmware(), called from lbs_start_card()
> > in libertas/main.c.
> > 
> > Could somebody tell me what the above messages mean?
> > Are there any other users of similar hardware out there?
> 
> It means that the firmware did not respond to the command in the time
> the driver expected it to.  Command 0x0028 is CMD_MAC_CONTROL, which is
> probably coming from lbs_set_mac_packet_filter(), which is called from
> libertas_setup_firmware().
Can you try this patch?
If it says something like "mmc0: Timeout waiting end of packet", then this is
the mci controller state machine that has crashed, and not the 8686.

Regards

Marc

patch-at91-mci-1-timeout:

Detect card or host timeout.

Signed-off-by: Marc Pignat <marc.pignat at hevs.ch>
---


--- a/drivers/mmc/host/at91_mci.c	2008-01-23 15:47:58.000000000 +0100
+++ b/drivers/mmc/host/at91_mci.c	2008-01-23 16:35:10.000000000 +0100
@@ -124,8 +124,34 @@ struct at91mci_host
 
 	/* Latest in the scatterlist that has been enabled for transfer */
 	int transfer_index;
+
+	/* Timer for timeouts */
+	struct timer_list timer;
 };
 
+static void at91_timeout_timer(unsigned long data)
+{
+	struct at91mci_host *host;
+
+	host = (struct at91mci_host *)data;
+
+	if (host->request) {
+		printk(KERN_ERR "%s: Timeout waiting end of packet\n",
+			mmc_hostname(host->mmc));
+
+		if (host->cmd && host->cmd->data) {
+			host->cmd->data->error = -ETIMEDOUT;
+		} else {
+			if (host->cmd)
+				host->cmd->error = -ETIMEDOUT;
+			else
+				host->request->cmd->error = -ETIMEDOUT;
+		}
+
+		mmc_request_done(host->mmc, host->request);
+	}
+}
+
 /*
  * Copy from sg to a dma block - used for transfers
  */
@@ -551,9 +577,10 @@ static void at91_mci_process_next(struct
 	else if ((!(host->flags & FL_SENT_STOP)) && host->request->stop) {
 		host->flags |= FL_SENT_STOP;
 		at91_mci_send_command(host, host->request->stop);
-	}
-	else
+	} else {
+		del_timer(&host->timer);
 		mmc_request_done(host->mmc, host->request);
+	}
 }
 
 /*
@@ -612,6 +639,8 @@ static void at91_mci_request(struct mmc_
 	host->request = mrq;
 	host->flags = 0;
 
+	mod_timer(&host->timer, jiffies +  HZ);
+
 	at91_mci_process_next(host);
 }
 
@@ -915,6 +944,8 @@ static int __init at91_mci_probe(struct 
 
 	mmc_add_host(mmc);
 
+	setup_timer(&host->timer, at91_timeout_timer, (unsigned long)host);
+
 	/*
 	 * monitor card insertion/removal if we can
 	 */



More information about the libertas-dev mailing list