linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* SCSI layer a stumbling block for true SATA hotplug
@ 2005-07-16 23:14 Lukasz Kosewski
  2005-07-17  0:01 ` Joe Scsi
  2005-07-17  1:53 ` Tejun Heo
  0 siblings, 2 replies; 3+ messages in thread
From: Lukasz Kosewski @ 2005-07-16 23:14 UTC (permalink / raw)
  To: linux-scsi; +Cc: jgarzik

Hello all,

I'm currently working on a project to get a true disk-hotplug subsystem 
working in libata, experimenting with Promise SATA150 Tx2 Plus and 
SATAII150 Tx2 Plus controllers.

I am very near a 'beta' release of my patches to this mailing list, 
however, I have hit a stumbling block in the SCSI layer, which I'm 
hoping someone can give me good suggestions for resolving.

The situation is as follows:
-> I unplug a disk from my controller.
-> An interrupt fires off telling me I've unplugged a disk.
-> I acknowledge the interrupt, add an entry to my workqueue to handle 
the bottom half.
-> Bottom half kicks in, I need to call "scsi_remove_device" in order to 
purge the information about this disk from the system.

HOWEVER, "scsi_remove_device", through a chain of functions, ends up 
calling sd_shutdown, which attempts to synchronize the SCSI cache for my 
disk.  Well... bad plan, I've just unplugged the disk, it's gone.

So the system gets dazed and confused and locks up, timing out waiting 
for the disk which isn't there.

If anyone has a suggestion as to a good (ie. acceptable by all parties) 
solution to this problem, I'd love to hear it.

Thanks in advance,

Luke Kosewski

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

* Re: SCSI layer a stumbling block for true SATA hotplug
  2005-07-16 23:14 SCSI layer a stumbling block for true SATA hotplug Lukasz Kosewski
@ 2005-07-17  0:01 ` Joe Scsi
  2005-07-17  1:53 ` Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Scsi @ 2005-07-17  0:01 UTC (permalink / raw)
  To: Lukasz Kosewski; +Cc: linux-scsi, jgarzik

How does hot unplugging work  now for fibre channel?

It seems this must already be a solved problem.

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

* Re: SCSI layer a stumbling block for true SATA hotplug
  2005-07-16 23:14 SCSI layer a stumbling block for true SATA hotplug Lukasz Kosewski
  2005-07-17  0:01 ` Joe Scsi
@ 2005-07-17  1:53 ` Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2005-07-17  1:53 UTC (permalink / raw)
  To: Lukasz Kosewski; +Cc: linux-scsi, jgarzik

  Hi, Lukasz.

Lukasz Kosewski wrote:
> Hello all,
> 
> I'm currently working on a project to get a true disk-hotplug subsystem 
> working in libata, experimenting with Promise SATA150 Tx2 Plus and 
> SATAII150 Tx2 Plus controllers.
> 
> I am very near a 'beta' release of my patches to this mailing list, 
> however, I have hit a stumbling block in the SCSI layer, which I'm 
> hoping someone can give me good suggestions for resolving.
> 
> The situation is as follows:
> -> I unplug a disk from my controller.
> -> An interrupt fires off telling me I've unplugged a disk.
> -> I acknowledge the interrupt, add an entry to my workqueue to handle 
> the bottom half.
> -> Bottom half kicks in, I need to call "scsi_remove_device" in order to 
> purge the information about this disk from the system.
> 
> HOWEVER, "scsi_remove_device", through a chain of functions, ends up 
> calling sd_shutdown, which attempts to synchronize the SCSI cache for my 
> disk.  Well... bad plan, I've just unplugged the disk, it's gone.
> 
> So the system gets dazed and confused and locks up, timing out waiting 
> for the disk which isn't there.
> 
> If anyone has a suggestion as to a good (ie. acceptable by all parties) 
> solution to this problem, I'd love to hear it.

  AFAIK, lldd (libata in this case) should be ready to handle/fail 
requests until the removal is complete.  As device hot-unplugging can be 
initiated from different layers, upper layer currently depends on lldd 
to handle such cases.  On detecting device removal, mark the device gone 
inside libata and fail all commands afterward until actual removal is 
complete.  That should do and, IIRC, what other drivers do.

-- 
tejun

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

end of thread, other threads:[~2005-07-17  1:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-16 23:14 SCSI layer a stumbling block for true SATA hotplug Lukasz Kosewski
2005-07-17  0:01 ` Joe Scsi
2005-07-17  1:53 ` Tejun Heo

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).