mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
	John.Linn@xilinx.com, sr@denx.de
Subject: Re: [PATCH] Fix Xilinx SystemACE driver to handle empty CF slot
Date: Fri, 6 Mar 2009 09:05:33 -0700	[thread overview]
Message-ID: <fa686aa40903060805i489d8676waad08e8263c02fe@mail.gmail.com> (raw)
In-Reply-To: <20090228204622.29719.55082.stgit@localhost.localdomain>

Oops, sorry Jens.  I forgot to CC: you on this patch.

g.

On Sat, Feb 28, 2009 at 1:46 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
>
> The SystemACE driver does not handle an empty CF slot gracefully.  An
> empty CF slot ends up hanging the system.  This patch adds a check for
> the CF state and stops trying to process requests if the slot is empty.
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
>
>  drivers/block/xsysace.c |   22 ++++++++++++++++++++++
>  1 files changed, 22 insertions(+), 0 deletions(-)
>
>
> diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
> index 381d686..ec5b8ca 100644
> --- a/drivers/block/xsysace.c
> +++ b/drivers/block/xsysace.c
> @@ -489,6 +489,28 @@ static void ace_fsm_dostate(struct ace_device *ace)
>                ace->fsm_state, ace->id_req_count);
>  #endif
>
> +       /* Verify that there is actually a CF in the slot.  If not, then
> +        * bail out back to the idle state and wake up all the waiters */
> +       status = ace_in32(ace, ACE_STATUS);
> +       if ((status & ACE_STATUS_CFDETECT) == 0) {
> +               ace->fsm_state = ACE_FSM_STATE_IDLE;
> +               ace->media_change = 1;
> +               set_capacity(ace->gd, 0);
> +               dev_info(ace->dev, "No CF in slot\n");
> +
> +               /* Drop all pending requests */
> +               while ((req = elv_next_request(ace->queue)) != NULL)
> +                       end_request(req, 0);
> +
> +               /* Drop back to IDLE state and notify waiters */
> +               ace->fsm_state = ACE_FSM_STATE_IDLE;
> +               ace->id_result = -EIO;
> +               while (ace->id_req_count) {
> +                       complete(&ace->id_completion);
> +                       ace->id_req_count--;
> +               }
> +       }
> +
>        switch (ace->fsm_state) {
>        case ACE_FSM_STATE_IDLE:
>                /* See if there is anything to do */
>
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

  reply	other threads:[~2009-03-06 16:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-28 20:46 Grant Likely
2009-03-06 16:05 ` Grant Likely [this message]
2009-03-06 20:46   ` Jens Axboe
2009-03-06 20:56     ` Grant Likely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fa686aa40903060805i489d8676waad08e8263c02fe@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=John.Linn@xilinx.com \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=sr@denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®