alistair23-linux/drivers/ata
Tejun Heo c7087652e1 libata-sff: clean up BMDMA initialization
When BMDMA initialization failed or BMDMA was not available for
whatever reason, bmdma_addr was left at zero and used as an indication
that BMDMA shouldn't be used.  This leads to the following problems.

p1. For BMDMA drivers which don't use traditional BMDMA register,
    ata_bmdma_mode_filter() incorrectly inhibits DMA modes.  Those
    drivers either have to inherit from ata_sff_port_ops or clear
    ->mode_filter explicitly.

p2. non-BMDMA drivers call into BMDMA PRD table allocation.  It
    doesn't actually allocate PRD table if bmdma_addr is not
    initialized but is still confusing.

p3. For BMDMA drivers which don't use traditional BMDMA register, some
    methods might not be invoked as expected (e.g. bmdma_stop from
    ata_sff_post_internal_cmd()).

p4. SFF drivers w/ custom DMA interface implement noop BMDMA ops
    worrying libata core might call into one of them.

These problems are caused by the muddy line between SFF and BMDMA and
the assumption that all BMDMA controllers initialize bmdma_addr.

This patch fixes p1 and p2 by removing the bmdma_addr assumption and
moving prd allocation to BMDMA port start.  Later patches will fix the
remaining issues.

This patch improves BMDMA initialization such that

* When BMDMA register initialization fails, falls back to PIO instead
  of failing.  ata_pci_bmdma_init() never fails now.

* When ata_pci_bmdma_init() falls back to PIO, it clears
  ap->mwdma_mask and udma_mask instead of depending on
  ata_bmdma_mode_filter().  This makes ata_bmdma_mode_filter()
  unnecessary thus resolving p1.

* ata_port_start() which actually is BMDMA specific is moved to
  ata_bmdma_port_start().  ata_port_start() and ata_sff_port_start()
  are killed.

* ata_sff_port_start32() is moved and renamed to
  ata_bmdma_port_start32().

Drivers which no longer call into PRD table allocation are...

  pdc_adma, sata_inic162x, sata_qstor, sata_sx4, pata_cmd640 and all
  drivers which inherit from ata_sff_port_ops.

pata_icside sets ->port_start to ATA_OP_NULL as it doesn't need PRD
but is a BMDMA controller and doesn't have custom port_start like
other such controllers.

Note that with the previous patch which makes all and only BMDMA
drivers inherit from ata_bmdma_port_ops, this change doesn't break
drivers which need PRD table.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2010-05-19 13:32:19 -04:00
..
ahci.c ahci: EM message type auto detect 2010-05-14 17:35:51 -04:00
ahci.h ahci: add "em_buffer" attribute for AHCI hosts 2010-05-14 17:35:51 -04:00
ahci_platform.c ahci_platform: properly set up EM messaging 2010-05-14 17:35:51 -04:00
ata_generic.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
ata_piix.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
Kconfig sata_inic162x: inic162x is not dependent on CONFIG_ATA_SFF 2010-05-14 22:38:40 -04:00
libahci.c ahci: add "em_buffer" attribute for AHCI hosts 2010-05-14 17:35:51 -04:00
libata-acpi.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
libata-core.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
libata-eh.c libata: ensure NCQ error result taskfile is fully initialized 2010-04-22 21:59:13 -04:00
libata-pmp.c [libata] Disable R_OK (Early ACK) on SII 3726 PMP 2010-05-14 17:08:02 -04:00
libata-scsi.c libata: kill ATA_FLAG_DISABLED 2010-05-17 22:49:02 -04:00
libata-sff.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
libata.h libata-sff: kill unused prototype and make ata_dev_select() static 2010-05-14 22:38:46 -04:00
Makefile ahci: Add platform driver 2010-05-14 17:08:01 -04:00
pata_acpi.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
pata_ali.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
pata_amd.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_artop.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_at32.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pata_at91.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
pata_atiixp.c pata_atiixp: enable parallel scan 2010-03-01 15:07:01 -05:00
pata_atp867x.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pata_bf54x.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
pata_cmd64x.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_cmd640.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
pata_cs5520.c pata_cs5520: remove dead VDMA support 2009-12-03 15:52:51 -05:00
pata_cs5530.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_cs5535.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_cs5536.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_cypress.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_efar.c pata_efar: Enable parallel scanning 2010-03-01 15:07:21 -05:00
pata_hpt3x2n.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_hpt3x3.c tree-wide: Assorted spelling fixes 2010-02-09 11:13:56 +01:00
pata_hpt37x.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
pata_hpt366.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
pata_icside.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
pata_isapnp.c
pata_it821x.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
pata_it8213.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_ixp4xx_cf.c
pata_jmicron.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_legacy.c pata_legacy: add pointers to QDI65x0 documentation 2009-12-03 16:06:47 -05:00
pata_macio.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
pata_marvell.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_mpc52xx.c pata_mpc52xx: reduce code size by simple change of constant data types 2010-05-14 17:08:02 -04:00
pata_mpiix.c
pata_netcell.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_ninja32.c
pata_ns87410.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_ns87415.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_octeon_cf.c libata: kill ATA_FLAG_DISABLED 2010-05-17 22:49:02 -04:00
pata_of_platform.c
pata_oldpiix.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_opti.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_optidma.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_palmld.c
pata_pcmcia.c pata_pcmcia / ide-cs: Fix bad hashes for Transcend and kingston IDs 2010-05-05 14:48:48 -04:00
pata_pdc202xx_old.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
pata_pdc2027x.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
pata_piccolo.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_platform.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
pata_qdi.c
pata_radisys.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_rb532_cf.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pata_rdc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pata_rz1000.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_sc1200.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_scc.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
pata_sch.c pata_sch: use ata_pci_sff_init_one() 2010-05-14 22:38:38 -04:00
pata_serverworks.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
pata_sil680.c pata_sil680: Do our own exec_command posting 2010-05-14 22:34:30 -04:00
pata_sis.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_sl82c105.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_triflex.c libata: Pass host flags into the pci helper 2010-03-01 14:58:46 -05:00
pata_via.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
pata_winbond.c
pdc_adma.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
sata_fsl.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
sata_inic162x.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
sata_mv.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
sata_nv.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
sata_promise.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
sata_promise.h
sata_qstor.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
sata_sil.c libata: kill ATA_FLAG_DISABLED 2010-05-17 22:49:02 -04:00
sata_sil24.c libata: kill ATA_FLAG_DISABLED 2010-05-17 22:49:02 -04:00
sata_sis.c
sata_svw.c
sata_sx4.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
sata_uli.c libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
sata_via.c sata_via: Delay on vt6420 when starting ATAPI DMA write 2010-03-01 15:19:21 -05:00
sata_vsc.c libata: kill ATA_FLAG_DISABLED 2010-05-17 22:49:02 -04:00
sis.h