linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Some questions about new EH in libata
@ 2006-08-22  4:54 Fajun Chen
  2006-08-22  5:10 ` Tejun Heo
  0 siblings, 1 reply; 8+ messages in thread
From: Fajun Chen @ 2006-08-22  4:54 UTC (permalink / raw)
  To: linux-ide; +Cc: jgarzik, htejun

Hi Folks,

I just upgraded to the libata with new EH and I have some questions
about the new error handler:
1. In several occasions, I saw a port being disable, under what kind
of conditions will new EH disable a port?
2. For user space program, is there any way to checked the state of a
port/drive? I noticed that dmesg has some printout but that could be
wiped out by other traces or errors.
3. Does libata allow user space code to reset host/bus/drive or only
libata itself has the privilege? I tried sg reset IOCTL interface on
SATA Sil3124, it seems not working.
4. How to reenable a port/drive after it's disabled without rebooting?
Any API or command from user space?

Thanks,
Fajun

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

* Re: Some questions about new EH in libata
  2006-08-22  4:54 Some questions about new EH in libata Fajun Chen
@ 2006-08-22  5:10 ` Tejun Heo
  2006-08-22 15:40   ` Fajun Chen
  2006-08-29  0:51   ` Fajun Chen
  0 siblings, 2 replies; 8+ messages in thread
From: Tejun Heo @ 2006-08-22  5:10 UTC (permalink / raw)
  To: Fajun Chen; +Cc: linux-ide, jgarzik

Fajun Chen wrote:
> Hi Folks,
> 
> I just upgraded to the libata with new EH and I have some questions
> about the new error handler:
> 1. In several occasions, I saw a port being disable, under what kind
> of conditions will new EH disable a port?

After EH fails to recover a device.  It usually takes three recovery 
trial failures.

> 2. For user space program, is there any way to checked the state of a
> port/drive? I noticed that dmesg has some printout but that could be
> wiped out by other traces or errors.

Hmmm... Not yet.

> 3. Does libata allow user space code to reset host/bus/drive or only
> libata itself has the privilege? I tried sg reset IOCTL interface on
> SATA Sil3124, it seems not working.

No, that doesn't work but issuing userscan forces libata to reset the 
channel.

> 4. How to reenable a port/drive after it's disabled without rebooting?
> Any API or command from user space?

You can use SCSI userscan interface.

Regards.

-- 
tejun

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

* Re: Some questions about new EH in libata
  2006-08-22  5:10 ` Tejun Heo
@ 2006-08-22 15:40   ` Fajun Chen
  2006-08-22 15:51     ` Tejun Heo
  2006-08-29  0:51   ` Fajun Chen
  1 sibling, 1 reply; 8+ messages in thread
From: Fajun Chen @ 2006-08-22 15:40 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide, jgarzik

Hi Tejun,

Could you please elaborate all the conditions triggering the error
handling? I know that command failure or HBA error can trigger EH, but
does EH schedule any routine error checking autonomously? The
particular scenario I am looking at is if a drive is moved away from
interface mode (through back door noninterface command) for some time
then move back, will EH detect and declare it as an interface error?

Thanks,
Fajun

On 8/21/06, Tejun Heo <htejun@gmail.com> wrote:
> Fajun Chen wrote:
> > Hi Folks,
> >
> > I just upgraded to the libata with new EH and I have some questions
> > about the new error handler:
> > 1. In several occasions, I saw a port being disable, under what kind
> > of conditions will new EH disable a port?
>
> After EH fails to recover a device.  It usually takes three recovery
> trial failures.
>
> > 2. For user space program, is there any way to checked the state of a
> > port/drive? I noticed that dmesg has some printout but that could be
> > wiped out by other traces or errors.
>
> Hmmm... Not yet.
>
> > 3. Does libata allow user space code to reset host/bus/drive or only
> > libata itself has the privilege? I tried sg reset IOCTL interface on
> > SATA Sil3124, it seems not working.
>
> No, that doesn't work but issuing userscan forces libata to reset the
> channel.
>
> > 4. How to reenable a port/drive after it's disabled without rebooting?
> > Any API or command from user space?
>
> You can use SCSI userscan interface.
>
> Regards.
>
> --
> tejun
>

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

* Re: Some questions about new EH in libata
  2006-08-22 15:40   ` Fajun Chen
@ 2006-08-22 15:51     ` Tejun Heo
  0 siblings, 0 replies; 8+ messages in thread
From: Tejun Heo @ 2006-08-22 15:51 UTC (permalink / raw)
  To: Fajun Chen; +Cc: linux-ide, jgarzik

Fajun Chen wrote:
> Hi Tejun,
> 
> Could you please elaborate all the conditions triggering the error
> handling? I know that command failure or HBA error can trigger EH, but
> does EH schedule any routine error checking autonomously? The
> particular scenario I am looking at is if a drive is moved away from
> interface mode (through back door noninterface command) for some time
> then move back, will EH detect and declare it as an interface error?

What do you mean by moving away from interface mode?  Do you refer to 
transfer mode?  libata doesn't do any autonomous EH.  Unless command 
fails or host reports exception (phy status change, etc...), EH won't 
kick in except for one case - it snoops cache on/off and schedule EH to 
revalidate device and configure SCSI dev accordingly.

-- 
tejun

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

* Re: Some questions about new EH in libata
  2006-08-22  5:10 ` Tejun Heo
  2006-08-22 15:40   ` Fajun Chen
@ 2006-08-29  0:51   ` Fajun Chen
  2006-08-29  2:16     ` Tejun Heo
  1 sibling, 1 reply; 8+ messages in thread
From: Fajun Chen @ 2006-08-29  0:51 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide, jgarzik

On 8/21/06, Tejun Heo <htejun@gmail.com> wrote:
> Fajun Chen wrote:
> > Hi Folks,
> >
> > I just upgraded to the libata with new EH and I have some questions
> > about the new error handler:
> > 1. In several occasions, I saw a port being disable, under what kind
> > of conditions will new EH disable a port?
>
> After EH fails to recover a device.  It usually takes three recovery
> trial failures.
>
> > 2. For user space program, is there any way to checked the state of a
> > port/drive? I noticed that dmesg has some printout but that could be
> > wiped out by other traces or errors.
>
> Hmmm... Not yet.
>
> > 3. Does libata allow user space code to reset host/bus/drive or only
> > libata itself has the privilege? I tried sg reset IOCTL interface on
> > SATA Sil3124, it seems not working.
>
> No, that doesn't work but issuing userscan forces libata to reset the
> channel.
>
> > 4. How to reenable a port/drive after it's disabled without rebooting?
> > Any API or command from user space?
>
> You can use SCSI userscan interface.
>
Is this a scsi command? I looked at scsi spec and haven't found it
yet. I know how to initiate user scan from proc or sysfs, but there is
no way to know the result of user scan through proc or sysfs.  I'm
looking for a way to check when a pata drive is back online after a
power cycle. May I issue userscan periodically until its result
indicates pata drive is available?

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

* Re: Some questions about new EH in libata
  2006-08-29  0:51   ` Fajun Chen
@ 2006-08-29  2:16     ` Tejun Heo
  2006-08-29 15:51       ` Fajun Chen
  0 siblings, 1 reply; 8+ messages in thread
From: Tejun Heo @ 2006-08-29  2:16 UTC (permalink / raw)
  To: Fajun Chen; +Cc: linux-ide, jgarzik

Fajun Chen wrote:
>> You can use SCSI userscan interface.
>>
> Is this a scsi command? I looked at scsi spec and haven't found it
> yet. I know how to initiate user scan from proc or sysfs,

Yeap, that's what I meant.

> but there is
> no way to know the result of user scan through proc or sysfs.  I'm
> looking for a way to check when a pata drive is back online after a
> power cycle. May I issue userscan periodically until its result
> indicates pata drive is available?

Hmmm.. When new devices are attached, hotplug events are generated.  I 
think that's the only way to get any result back, so when it fails, 
there's no indication.  Periodically repeating userscan request should 
be fine although it may result in an extra reset after successfully 
detecting the device.  That shouldn't hurt too much.

-- 
tejun

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

* Re: Some questions about new EH in libata
  2006-08-29  2:16     ` Tejun Heo
@ 2006-08-29 15:51       ` Fajun Chen
  2006-08-29 16:00         ` Tejun Heo
  0 siblings, 1 reply; 8+ messages in thread
From: Fajun Chen @ 2006-08-29 15:51 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide, jgarzik

On 8/28/06, Tejun Heo <htejun@gmail.com> wrote:
> Fajun Chen wrote:
> >> You can use SCSI userscan interface.
> >>
> > Is this a scsi command? I looked at scsi spec and haven't found it
> > yet. I know how to initiate user scan from proc or sysfs,
>
> Yeap, that's what I meant.
>
> > but there is
> > no way to know the result of user scan through proc or sysfs.  I'm
> > looking for a way to check when a pata drive is back online after a
> > power cycle. May I issue userscan periodically until its result
> > indicates pata drive is available?
>
> Hmmm.. When new devices are attached, hotplug events are generated.  I
> think that's the only way to get any result back, so when it fails,
> there's no indication.  Periodically repeating userscan request should
> be fine although it may result in an extra reset after successfully
> detecting the device.  That shouldn't hurt too much.
>

I assume that alt status register will be updated when pata/sata is
back online. So as an alternative and less invasive way, could I check
alt status register and start user scan only if device is ready on alt
status register? libata has ata_altstatus() function, is it available
to user space? If not, may I expose it? I'm looking for a way to check
device registers without side effects.

Thanks,
Fajun

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

* Re: Some questions about new EH in libata
  2006-08-29 15:51       ` Fajun Chen
@ 2006-08-29 16:00         ` Tejun Heo
  0 siblings, 0 replies; 8+ messages in thread
From: Tejun Heo @ 2006-08-29 16:00 UTC (permalink / raw)
  To: Fajun Chen; +Cc: linux-ide, jgarzik

Fajun Chen wrote:
> I assume that alt status register will be updated when pata/sata is
> back online. So as an alternative and less invasive way, could I check
> alt status register and start user scan only if device is ready on alt
> status register? libata has ata_altstatus() function, is it available
> to user space? If not, may I expose it? I'm looking for a way to check
> device registers without side effects.

You can't use alt status that way.  Not all controllers have them and 
even those which do show different behaviors over hotplug/unplugs.

Hmmm... maybe making userscan synchronous is the correct way to do it. 
I'll give it some thoughts.

-- 
tejun

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

end of thread, other threads:[~2006-08-29 16:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-22  4:54 Some questions about new EH in libata Fajun Chen
2006-08-22  5:10 ` Tejun Heo
2006-08-22 15:40   ` Fajun Chen
2006-08-22 15:51     ` Tejun Heo
2006-08-29  0:51   ` Fajun Chen
2006-08-29  2:16     ` Tejun Heo
2006-08-29 15:51       ` Fajun Chen
2006-08-29 16:00         ` 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).