1
linux/drivers/ata
Tejun Heo a1efdaba2d libata: make reset related methods proper port operations
Currently reset methods are not specified directly in the
ata_port_operations table.  If a LLD wants to use custom reset
methods, it should construct and use a error_handler which uses those
reset methods.  It's done this way for two reasons.

First, the ops table already contained too many methods and adding
four more of them would noticeably increase the amount of necessary
boilerplate code all over low level drivers.

Second, as ->error_handler uses those reset methods, it can get
confusing.  ie. By overriding ->error_handler, those reset ops can be
made useless making layering a bit hazy.

Now that ops table uses inheritance, the first problem doesn't exist
anymore.  The second isn't completely solved but is relieved by
providing default values - most drivers can just override what it has
implemented and don't have to concern itself about higher level
callbacks.  In fact, there currently is no driver which actually
modifies error handling behavior.  Drivers which override
->error_handler just wraps the standard error handler only to prepare
the controller for EH.  I don't think making ops layering strict has
any noticeable benefit.

This patch makes ->prereset, ->softreset, ->hardreset, ->postreset and
their PMP counterparts propoer ops.  Default ops are provided in the
base ops tables and drivers are converted to override individual reset
methods instead of creating custom error_handler.

* ata_std_error_handler() doesn't use sata_std_hardreset() if SCRs
  aren't accessible.  sata_promise doesn't need to use separate
  error_handlers for PATA and SATA anymore.

* softreset is broken for sata_inic162x and sata_sx4.  As libata now
  always prefers hardreset, this doesn't really matter but the ops are
  forced to NULL using ATA_OP_NULL for documentation purpose.

* pata_hpt374 needs to use different prereset for the first and second
  PCI functions.  This used to be done by branching from
  hpt374_error_handler().  The proper way to do this is to use
  separate ops and port_info tables for each function.  Converted.

Signed-off-by: Tejun Heo <htejun@gmail.com>
2008-04-17 15:44:18 -04:00
..
ahci.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
ata_generic.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
ata_piix.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
Kconfig ACPI: fix ATA_ACPI build 2008-03-18 00:26:07 -04:00
libata-acpi.c libata-acpi: improve dock event handling 2008-03-17 08:26:42 -04:00
libata-core.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
libata-eh.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
libata-pmp.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
libata-scsi.c libata: kill ata_ehi_schedule_probe() 2008-04-17 15:44:16 -04:00
libata-sff.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
libata.h make atapi_dmadir static 2008-02-25 17:29:35 -05:00
Makefile [libata] Add support for the RB500 PATA CompactFlash 2008-03-10 20:54:05 -04:00
pata_acpi.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_ali.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_amd.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_artop.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_at32.c libata: implement and use ops inheritance 2008-04-17 15:44:17 -04:00
pata_atiixp.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_bf54x.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_cmd64x.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_cmd640.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_cs5520.c libata: implement and use ops inheritance 2008-04-17 15:44:17 -04:00
pata_cs5530.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_cs5535.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_cs5536.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_cypress.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_efar.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_hpt3x2n.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_hpt3x3.c libata: implement and use ops inheritance 2008-04-17 15:44:17 -04:00
pata_hpt37x.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_hpt366.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_icside.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_isapnp.c libata: implement and use ops inheritance 2008-04-17 15:44:17 -04:00
pata_it821x.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_it8213.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_ixp4xx_cf.c libata: implement and use ops inheritance 2008-04-17 15:44:17 -04:00
pata_jmicron.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_legacy.c libata: implement and use ops inheritance 2008-04-17 15:44:17 -04:00
pata_marvell.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_mpc52xx.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_mpiix.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_netcell.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_ninja32.c libata: implement and use ops inheritance 2008-04-17 15:44:17 -04:00
pata_ns87410.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_ns87415.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_of_platform.c Rename: linux/pata_platform.h to linux/ata_platform.h 2008-02-06 06:54:17 -05:00
pata_oldpiix.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_opti.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_optidma.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_pcmcia.c libata: implement and use ops inheritance 2008-04-17 15:44:17 -04:00
pata_pdc202xx_old.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_pdc2027x.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_platform.c libata: implement and use ops inheritance 2008-04-17 15:44:17 -04:00
pata_qdi.c libata: implement and use ops inheritance 2008-04-17 15:44:17 -04:00
pata_radisys.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_rb500_cf.c libata: implement and use ops inheritance 2008-04-17 15:44:17 -04:00
pata_rz1000.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_sc1200.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_scc.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_serverworks.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_sil680.c libata: stop overloading port_info->private_data 2008-04-17 15:44:17 -04:00
pata_sis.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_sl82c105.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_triflex.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_via.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
pata_winbond.c libata: implement and use ops inheritance 2008-04-17 15:44:17 -04:00
pdc_adma.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
sata_fsl.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
sata_inic162x.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
sata_mv.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
sata_nv.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
sata_promise.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
sata_promise.h libata annotations and fixes 2008-01-23 05:24:15 -05:00
sata_qstor.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
sata_sil24.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
sata_sil.c libata: implement and use ops inheritance 2008-04-17 15:44:17 -04:00
sata_sis.c libata: implement and use ops inheritance 2008-04-17 15:44:17 -04:00
sata_svw.c libata: implement and use ops inheritance 2008-04-17 15:44:17 -04:00
sata_sx4.c libata: implement and use ops inheritance 2008-04-17 15:44:17 -04:00
sata_uli.c libata: implement and use ops inheritance 2008-04-17 15:44:17 -04:00
sata_via.c libata: make reset related methods proper port operations 2008-04-17 15:44:18 -04:00
sata_vsc.c libata: implement and use ops inheritance 2008-04-17 15:44:17 -04:00
sis.h libata: PATA-mode fixes for sis_sata 2007-07-02 10:17:42 -04:00