2008-06-05 21:06:29

by Pierre Ossman

[permalink] [raw]
Subject: Re: [PATCH 8/9] au1xmmc: abort requests early if no card is present

On Mon, 19 May 2008 10:08:04 +0200
Manuel Lauss <[email protected]> wrote:

> From ec41439903048bf98e301dbd03426c63156ebc0e Mon Sep 17 00:00:00 2001
> From: Manuel Lauss <[email protected]>
> Date: Sun, 18 May 2008 15:52:43 +0200
> Subject: [PATCH] au1xmmc: abort requests early if no card is present
>
> Don't process a request if no card is present.
>
> Signed-off-by: Manuel Lauss <[email protected]>
> ---
> drivers/mmc/host/au1xmmc.c | 7 +++++++
> 1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c
> index be09a14..0b30582 100644
> --- a/drivers/mmc/host/au1xmmc.c
> +++ b/drivers/mmc/host/au1xmmc.c
> @@ -689,6 +689,13 @@ static void au1xmmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
> host->mrq = mrq;
> host->status = HOST_S_CMD;
>
> + /* fail request immediately if no card is present */
> + if (0 == au1xmmc_card_inserted(host)) {
> + mrq->cmd->error = -ETIMEDOUT;
> + au1xmmc_finish_request(host);
> + return;
> + }
> +
> if (mrq->data) {
> FLUSH_FIFO(host);
> ret = au1xmmc_prepare_data(host, mrq->data);

You should use -ENOMEDIUM for this case.

Rgds
Pierre


Attachments:
signature.asc (197.00 B)

2008-06-06 07:17:54

by Manuel Lauss

[permalink] [raw]
Subject: Re: [PATCH 8/9] au1xmmc: abort requests early if no card is present

Hi Pierre,

On Thu, Jun 05, 2008 at 11:05:52PM +0200, Pierre Ossman wrote:
> On Mon, 19 May 2008 10:08:04 +0200
> Manuel Lauss <[email protected]> wrote:
>
> > From ec41439903048bf98e301dbd03426c63156ebc0e Mon Sep 17 00:00:00 2001
> > From: Manuel Lauss <[email protected]>
> > Date: Sun, 18 May 2008 15:52:43 +0200
> > Subject: [PATCH] au1xmmc: abort requests early if no card is present
> >
> > Don't process a request if no card is present.
> >
> > Signed-off-by: Manuel Lauss <[email protected]>
> > ---
> > drivers/mmc/host/au1xmmc.c | 7 +++++++
> > 1 files changed, 7 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c
> > index be09a14..0b30582 100644
> > --- a/drivers/mmc/host/au1xmmc.c
> > +++ b/drivers/mmc/host/au1xmmc.c
> > @@ -689,6 +689,13 @@ static void au1xmmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
> > host->mrq = mrq;
> > host->status = HOST_S_CMD;
> >
> > + /* fail request immediately if no card is present */
> > + if (0 == au1xmmc_card_inserted(host)) {
> > + mrq->cmd->error = -ETIMEDOUT;
> > + au1xmmc_finish_request(host);
> > + return;
> > + }
> > +
> > if (mrq->data) {
> > FLUSH_FIFO(host);
> > ret = au1xmmc_prepare_data(host, mrq->data);
>
> You should use -ENOMEDIUM for this case.

Didn't know it existed, consider it changed.

Thanks!
Manuel Lauss