linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: libata & scsi rescan.
       [not found]                   ` <20041007171457.B21662@florence.linkmargin.com>
@ 2004-10-07 22:21                     ` Jeff Garzik
  2004-10-07 22:26                     ` Jeff Garzik
  1 sibling, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2004-10-07 22:21 UTC (permalink / raw)
  To: Andy Warner; +Cc: linux-ide, Doug Ledford, linux-scsi

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: libata & scsi rescan.
       [not found]                   ` <20041007171457.B21662@florence.linkmargin.com>
  2004-10-07 22:21                     ` libata & scsi rescan Jeff Garzik
@ 2004-10-07 22:26                     ` Jeff Garzik
  1 sibling, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2004-10-07 22:26 UTC (permalink / raw)
  To: Andy Warner; +Cc: linux-ide, SCSI Mailing List

Also, to avoid scsi_device_lookup(), it may be nice to cache struct 
scsi_device pointer in struct ata_device.

	Jeff




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-10-07 22:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <415DA2C0.3060600@pobox.com>
     [not found] ` <20041001141244.B23006@florence.linkmargin.com>
     [not found]   ` <415DB03E.5090005@pobox.com>
     [not found]     ` <20041004155647.A9589@florence.linkmargin.com>
     [not found]       ` <4161BB01.5080607@pobox.com>
     [not found]         ` <20041006173656.A18221@florence.linkmargin.com>
     [not found]           ` <416496CC.4090105@pobox.com>
     [not found]             ` <20041006214746.A18793@florence.linkmargin.com>
     [not found]               ` <4164B548.7030700@pobox.com>
     [not found]                 ` <4164BDD6.6000404@pobox.com>
     [not found]                   ` <20041007171457.B21662@florence.linkmargin.com>
2004-10-07 22:21                     ` libata & scsi rescan Jeff Garzik
2004-10-07 22:26                     ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).