linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH libata-dev-2.6:ncq 00/11] libata: new error handling & NCQ generic helpers (review only)
@ 2005-07-07 13:09 Tejun Heo
  2005-07-07 13:09 ` [PATCH libata-dev-2.6:ncq 01/11] libata: implement ata_qc_exec_special() Tejun Heo
                   ` (11 more replies)
  0 siblings, 12 replies; 15+ messages in thread
From: Tejun Heo @ 2005-07-07 13:09 UTC (permalink / raw)
  To: jgarzik, axboe, albertcc, linux-ide

 Hello, Jeff, Jens and Albert.

 This is the second take of generic NCQ completion/error-handling
patchset.  Changes are...

 * Generic special command helper (ata_qc_exec_special) added.  Now
   all internal commands run with timeout (request sense, read log,
   set xfer...)

 * New non-NCQ error handling to make EH paths more unified with NCQ
   case and ATAPI handling less hacky.  Now _all_ errors (NCQ or not)
   except for internal commands are posted to EH thread and handled
   there.  As was in ATAPI EH, all failed qc's are finished by EH
   thread.

 * NCQ helpers can now deal with ATAPI errors.

 This patchset is composed of the following parts.

 patches #01-#03: implement ata_qc_exec_special, new EH framework
		  and new non-NCQ error handling.
 patches #04-#08: implement NCQ helpers and convert & fix AHCI.
 patches #09-#11: misc stuff

 Currently this patchset only converts sata_sil, ata_piix and ahci.
All other drivers won't compile.

[ Start of patch descriptions ]

01_libata_implement-ata_qc_exec_special.patch
	: implement ata_qc_exec_special()

	This patch implements ata_qc_exec_special() function which
	generalizes libata internal special command execution and adds
	timeout.  All internal commands are converted.  Timeout
	constants are added to libata.h and, while at it, removed
	unused ATA_TMOUT_EDD.

02_libata_new-error-handling.patch
	: implement new EH framework and convert non-ncq EH

	This patch implements new EH framework and converts non-ncq EH
	to use it.  Now errors and timeouts are all handled by EH
	handler inside EH thread.

	* All failed commands are posted to EH by using ata_qc_error()
	  without qc-completion.  All timed out commands are posted to
	  EH, too.  On entry to EH handler, all active qc's are either
	  failed or timed out qc's, and they are all.  Also it's
	  guaranteed that once EH is started, only EH can finish or
	  retry it.  Normal or spurious interrupts during recovery
	  don't affect failed qc's.

	* EH handles error and determines whether to retry or fail
	  qc's.  It is responsible for setting error information to
	  notify upper layer if it's gonna fail a command.  (Jeff,
	  this should make implementing error classes you've talked
	  about easier.  All error handling is done inside EH and we
	  can just set sense data appropriately and eh-complete the
	  commands.)

	* After EH is complete, operation resumes.

	The following changes are worth noting.

	* ->eng_timeout renamed to ->error_handler

	* ata_eh_qc_complete(), ata_eh_qc_retry() added

	* __ata_qc_complete() used to deal with resource freeing and
	  completing wait for special cmds.  As this patch removes the
	  only use of __ata_qc_complete(), it's moved into
	  ata_qc_free() and ata_qc_free() deals only with resource
	  freeing.  New __ata_qc_complete() is defined to be used by
	  ata_eh_qc_*() functions (internal use only).

	* After allocated, all commands are either freed with
          ata_qc_free() if it can't be issued or completed with
          ata[_eh]_qc_complete().  No half-completion anymore.

	* As filling upper layer error info is the reponsibility of
	  the recovery handler now, qc->complete_fn() doesn't need
	  drv_stat argument.  Also, as all commands are completed
	  fully at once, there's no need for int return value.  This
	  leaves very little functionality to qc->complete_fn,
	  currently only ATAPI inquiry result tempering.  I think just
	  inlining that part and removing this callback will make the
	  code easier.

	* Although it looks like a lot of changes, from a device's
	  point of view, nothing changes.  Only software structure is
	  changed.

	This patch is separated out only to make changes incremental.
	I haven't really tested this patch alone.  Please test with
	the following NCQ EH patches applied.

03_libata_convert-drivers-to-new-eh.patch
	: convert sata_sil and ata_piix to use new EH

	This patch converts sata_sil and ata_piix to use new EH.

04_libata_implement-sactive.patch
	: implement ap->sactive

	This patch implements generic ap->sactive handling for NCQ
	commands.

05_libata_add-drv_err-to-ata_to_sense_error.patch
	: add drv_err argument to ata_to_sense_error()

	During NCQ error handling, drv_stat and drv_err values are
	obtained from log page 10h.  This patch adds drv_err argument
	to ata_to_sense_error() such that it can be used with values
	obtained from log page 10h.

06_libata_implement-ncq-helpers.patch
	: implement generic NCQ helpers

	This patch implements generic NCQ completion/error-handling
	helpers.

07_libata_convert-ahci-to-new-eh.patch
	: convert ahci driver to use new NCQ helpers

	This patch converts ahci driver to use new NCQ helpers.

08_libata_ahci-stop-dma-before-resetting.patch
	: stop dma before reset

	AHCI 1.1 mandates stopping dma before issueing COMMRESET.  The
	original code didn't and it resulted in occasional lockup of
	the controller during EH recovery.  This patch fixes the
	problem.

09_libata_remove-unused-eh-functions.patch
	: remove unused functions

	This patch removes ata_scsi_requeue(),
	ata_scsi_block_requests() and ata_scsi_unblock_requests().

10_libata_ahci-atapi.patch
	: add ATAPI support to ahci

	This patch adds ATAPI support to ahci driver.  This currently
	doesn't work.  I'll write a reply to this thread to tell more
	about this.  However, it at least shows that NCQ ATAPI error
	handling works.

11_libata_debug.patch
	: debug stuff

	As usual, debug messages and error triggers.

[ End of patch descriptions ]

 Please let me know what you guys think.

 Thanks.

--
tejun


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

end of thread, other threads:[~2005-08-20  6:08 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-07 13:09 [PATCH libata-dev-2.6:ncq 00/11] libata: new error handling & NCQ generic helpers (review only) Tejun Heo
2005-07-07 13:09 ` [PATCH libata-dev-2.6:ncq 01/11] libata: implement ata_qc_exec_special() Tejun Heo
2005-07-07 13:09 ` [PATCH libata-dev-2.6:ncq 02/11] libata: implement new EH framework and convert non-ncq EH Tejun Heo
2005-07-07 13:09 ` [PATCH libata-dev-2.6:ncq 03/11] libata: convert sata_sil and ata_piix to use new EH Tejun Heo
2005-07-07 13:09 ` [PATCH libata-dev-2.6:ncq 04/11] libata: implement ap->sactive Tejun Heo
2005-07-07 13:09 ` [PATCH libata-dev-2.6:ncq 05/11] libata: add drv_err argument to ata_to_sense_error() Tejun Heo
2005-07-07 13:09 ` [PATCH libata-dev-2.6:ncq 06/11] libata: implement generic NCQ helpers Tejun Heo
2005-07-07 13:09 ` [PATCH libata-dev-2.6:ncq 07/11] libata: convert ahci driver to use new " Tejun Heo
2005-07-07 13:09 ` [PATCH libata-dev-2.6:ncq 08/11] libata: stop dma before reset Tejun Heo
2005-07-07 13:09 ` [PATCH libata-dev-2.6:ncq 09/11] libata: remove unused functions Tejun Heo
2005-07-07 13:10 ` [PATCH libata-dev-2.6:ncq 10/11] libata: add ATAPI support to ahci Tejun Heo
2005-07-07 13:30   ` how it's broken Tejun Heo
2005-07-12  6:26     ` Tejun Heo
2005-07-07 13:10 ` [PATCH libata-dev-2.6:ncq 11/11] libata: debug stuff Tejun Heo
2005-08-20  6:08 ` [PATCH libata-dev-2.6:ncq 00/11] libata: new error handling & NCQ generic helpers (review only) 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).