Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102167
b: refs/heads/master
c: e181dce
h: refs/heads/master
i:
  102165: a165653
  102163: eed9210
  102159: e2d4f29
v: v3
  • Loading branch information
Marc Pignat authored and Pierre Ossman committed Jul 15, 2008
1 parent 44c7196 commit ec263a4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 80f9254668c63ae73c1359d8de50ad94aa1aa94a
refs/heads/master: e181dce8acab4f7d7c4772d2a8281510d503ab21
35 changes: 33 additions & 2 deletions trunk/drivers/mmc/host/at91_mci.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,33 @@ 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) {
dev_err(host->mmc->parent, "Timeout waiting end of packet\n");

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
*/
Expand Down Expand Up @@ -557,9 +582,10 @@ static void at91_mci_process_next(struct at91mci_host *host)
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);
}
}

/*
Expand Down Expand Up @@ -618,6 +644,8 @@ static void at91_mci_request(struct mmc_host *mmc, struct mmc_request *mrq)
host->request = mrq;
host->flags = 0;

mod_timer(&host->timer, jiffies + HZ);

at91_mci_process_next(host);
}

Expand Down Expand Up @@ -936,6 +964,8 @@ static int __init at91_mci_probe(struct platform_device *pdev)

mmc_add_host(mmc);

setup_timer(&host->timer, at91_timeout_timer, (unsigned long)host);

/*
* monitor card insertion/removal if we can
*/
Expand Down Expand Up @@ -996,6 +1026,7 @@ static int __exit at91_mci_remove(struct platform_device *pdev)
}

at91_mci_disable(host);
del_timer_sync(&host->timer);
mmc_remove_host(mmc);
free_irq(host->irq, host);

Expand Down

0 comments on commit ec263a4

Please sign in to comment.