linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Tejun Heo <htejun@gmail.com>
Cc: linux-ide@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>,
	SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] libata error handling fixes (ATAPI)
Date: Tue, 15 Nov 2005 06:02:58 -0500	[thread overview]
Message-ID: <4379C062.3010302@pobox.com> (raw)
In-Reply-To: <4379B28E.9070708@gmail.com>

Tejun Heo wrote:
> My RFC was written *after* the patches to ease the reviewing/integration 
> process.  Well, that was the intention.  I understand your point but I 
> think that EH needs some big changes, so it might be beneficial to 

Agreed, libata EH still needs a lot of work.  ATA device error handling 
could better, ATA bus and PCI bus errors need to be handled a lot 
better, etc.


> establish some consensus such that other developers can do stuff that 
> can be accepted.
> 
>>
>> The current feeling is that we should move away from complex 
>> dependencies on the SCSI EH layer, and do all our own error handling 
>> (perhaps in ata_wq).  This will allow use of libata as a block driver.
>>
> 
> For departure of libata from SCSI, I was thinking more of another more 
> generic block device framework in which libata can live in.  And I 
> thought that it was reasonable to assume that the framework would supply 
> a EH mechanism which supports queue stalling/draining and separate 
> thread.  So, my EH patches tried to make the same environment for libata 

A big reason why libata uses the SCSI layer is infrastructure like this. 
  It would certainly be nice to see timeouts and EH at the block layer. 
  The block layer itself already supports queue stalling/draining.


> so that it doesn't have to be changed drastically later.  All those 
> glueing codes were separated in one or two functions.
> 
> The point I'm trying to make here is not that my EH design should be 
> accepted or anything but that without established consensus it's very 
> difficult for contributing developers like me to develop substantial 
> part for libata.
> 
> One more thing that bothers me is that even with splitted patches and 
> detailed document, I couldn't get a discussion started on the mailing 
> list.  No discussion, no consensus.  I think we need to improve things 
> on this front.

Honestly there isn't a ton of discussion beforehand about anything in 
libata :)  It's mainly just like Linux itself...  no roadmap, its more 
just about what patches are accepted.  The consensus is the code.  I 
have a general idea of where I want libata to go, in my mind, but that 
picture is very rough and fuzzy :)  I let evolution sort out the details.

Speaking specifically, changes to libata's error handling should have 
very practical, observable effects.  Error handling code paths are 
travelled so infrequently by users, that changes for the general purpose 
of "improve something ugly" are not interesting.  Changes which address 
problems people are seeing in the field are top priority:

* kicking the device with SRST, if it continues to signal BSY.  If that 
fails, do a hard reset with SATA COMRESET or <some hardware-specific 
method>.  Note we really really really want to prefer SRST to other 
methods of reset, as SRST is much nicer to the device, and gives the 
device the opportunity to flush its writeback cache.

Note that some hardware may prefer that you use a hardware-specific 
method of issuing SRST, so that it can reset internal state machines 
along with actually issuing the SRST to the device.  This probably means 
a new protocol, ATA_PROT_SRST (which aligns nicely with SCSI SAT spec).

* retrying rather than cancelling commands that fail due to pci/dma/crc 
error.  some hardware (PCI IDE BMDMA) indicates DMA/PCI errors via 
timeout.  Other hardware is nicer, and indicates such via interrupt.

This may involve exporting scsi_eh_finish_cmd() and 
scsi_eh_flush_done_q(), and un-exporting scsi_finish_command().  Hence 
my reluctance to expand the use of scsi_finish_command(), which is 
really inadequate for our purposes.

This is also necessary for NCQ error handling.

* better use of SError.  some vendor drivers read+write SError on every 
disk transaction, but I think that's overkill.  Reading SError to check 
for errors, against a stored mask, might not be a bad idea.

* longer term:  add logic to "downshift" UDMA mode and/or SATA speed, if 
CRC/DMA errors persist.

I'm much less inclined to take patches which don't make progress towards 
any of these IMO critical areas of EH importance.

	Jeff



  reply	other threads:[~2005-11-15 11:03 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-14 19:57 [PATCH] libata error handling fixes (ATAPI) Jeff Garzik
2005-11-15  7:41 ` Tejun Heo
2005-11-15  9:28   ` Jeff Garzik
2005-11-15 10:03     ` Tejun Heo
2005-11-15 11:02       ` Jeff Garzik [this message]
2005-11-15 12:00         ` Jens Axboe
2005-11-15 18:25           ` Mike Christie
2005-11-15 18:41             ` Jens Axboe
2005-11-16 12:40               ` Jens Axboe
2005-11-16 12:56                 ` Jeff Garzik
2005-11-16 13:13                   ` Jens Axboe
2005-11-16 13:23                     ` Jeff Garzik
2005-11-16 13:31                 ` Jeff Garzik
2005-11-16 13:47                   ` Jens Axboe
2005-11-16 15:04                 ` Bartlomiej Zolnierkiewicz
2005-11-16 15:31                   ` Jens Axboe
2005-11-16 16:06                     ` Bartlomiej Zolnierkiewicz
2005-11-16 17:10                       ` Jens Axboe
2005-11-16 19:11                         ` Bartlomiej Zolnierkiewicz
2005-11-16 19:22                           ` Jens Axboe
2005-11-16 19:45                             ` Jens Axboe
2005-11-16 19:46                             ` Bartlomiej Zolnierkiewicz
2005-11-16 19:55                               ` Bartlomiej Zolnierkiewicz
2005-11-16 20:02                                 ` Jens Axboe
2005-11-16 20:23                                   ` Bartlomiej Zolnierkiewicz
2005-11-16 20:40                                     ` Jens Axboe
2005-11-19 10:55                       ` Christoph Hellwig
2005-11-19 13:27                         ` Jens Axboe
2005-11-15 13:43     ` Tejun Heo
2005-11-15 14:11       ` Jeff Garzik
2005-11-16  3:04         ` Tejun Heo
2005-11-16  3:18           ` Jeff Garzik
2005-11-16  3:48             ` Mark Lord
2005-11-16  3:58               ` 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=4379C062.3010302@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=htejun@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@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 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).