All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Andy Warner <andyw@pobox.com>
Cc: linux-ide@vger.kernel.org, Doug Ledford <dledford@redhat.com>,
	linux-scsi@vger.kernel.org
Subject: Re: libata & scsi rescan.
Date: Thu, 7 Oct 2004 18:21:11 -0400	[thread overview]
Message-ID: <20041007222111.GA20023@havoc.gtf.org> (raw)
In-Reply-To: <20041007171457.B21662@florence.linkmargin.com>

On Thu, Oct 07, 2004 at 05:14:57PM -0500, Andy Warner wrote:
> Jeff Garzik wrote:
> > BTW, the SiI folks recommend a debounce timer.
> 
> OK, got that. No problem, queue_delayed_work() and some
> state handles that. Now I've got the following issue,
> calling scsi_remove_device() seems to try and flush
> the disk - not a very productive operation:
> 
> <drive removed>
> ata1: drive not present
> Synchronizing SCSI cache for disk sdb: 
> ATA: abnormal status 0x7F on port 0xF8A3EC87
> ATA: abnormal status 0x7F on port 0xF8A3EC87
> ATA: abnormal status 0x7F on port 0xF8A3EC87
> ata1: command 0xea timeout, stat 0x50 host_stat 0x0
> 
> <drive re-added>
> ata1: drive present
>   Vendor: ATA       Model: ST3160023AS       Rev: 3.17
>   Type:   Direct-Access                      ANSI SCSI revision: 05
> SCSI device sdb: 312581808 512-byte hdwr sectors (160042 MB)
> SCSI device sdb: drive cache: write back
> ATA: abnormal status 0xFF on port 0xF8A3EC87
> ATA: abnormal status 0xFF on port 0xF8A3EC87
> ata1: command 0x25 timeout, stat 0x50 host_stat 0x1
>  unknown partition table
> Attached scsi disk sdb at scsi14, channel 0, id 0, lun 0
> Attached scsi generic sg2 at scsi14, channel 0, id 0, lun 0,  type 0
> 
> 
> I'm not too concerned about the errors when the drive
> appears yet, but trying to access the disk that just
> vanished is never going to work well. Am I missing
> something ?

(you should probably CC linux-scsi@vger.kernel.org as well, when
mentioning SCSI-related stuff)

I've seen this behavior before.  It's weird, but we must deal with it
anyway because

Since scsi_remove_device() must be called in process context, there will
ALWAYS be a window where a command could get issued.  Therefore, we must
create and set a "device is gone" flag in our local structures, and
check that in the queuecommand handler.

You must also make sure to clean up any currently-executing commands
properly, when a device is removed.

	Jeff




  reply	other threads:[~2004-10-07 22:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-01 17:39 libata & scsi rescan Andy Warner
2004-10-01 18:32 ` Jeff Garzik
2004-10-01 19:12   ` Andy Warner
2004-10-01 19:30     ` Jeff Garzik
2004-10-04 20:56       ` Andy Warner
2004-10-04 21:05         ` Jeff Garzik
2004-10-06 22:36           ` Andy Warner
2004-10-07  1:07             ` Jeff Garzik
2004-10-07  2:47               ` Andy Warner
2004-10-07  3:17                 ` Jeff Garzik
2004-10-07  3:49                   ` Andy Warner
2004-10-07  3:59                     ` Jeff Garzik
2004-10-07  3:53                   ` Jeff Garzik
2004-10-07 22:14                     ` Andy Warner
2004-10-07 22:21                       ` Jeff Garzik [this message]
2004-10-07 22:25                       ` Jeff Garzik
2004-10-08  2:48                         ` Andy Warner
2004-10-08 15:56                         ` Andy Warner
2004-10-07 22:26                       ` Jeff Garzik

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=20041007222111.GA20023@havoc.gtf.org \
    --to=jgarzik@pobox.com \
    --cc=andyw@pobox.com \
    --cc=dledford@redhat.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.