linux/drivers
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
..
accessibility
acpi ACPI: sleep: eliminate duplicate entries in acpisleep_dmi_table[] 2010-05-11 10:07:53 -07:00
amba
ata libata-sff: clean up BMDMA initialization 2010-05-19 13:32:19 -04:00
atm
auxdisplay
base Revert "memory-hotplug: add 0x prefix to HEX block_size_bytes" 2010-04-09 10:05:33 -07:00
block Merge branch 'for-jens' of git://git.drbd.org/linux-2.6-drbd into for-linus 2010-05-04 08:48:53 +02:00
bluetooth
cdrom
char tty: Fix unbalanced BKL handling in error path 2010-05-13 12:10:56 -07:00
clocksource
connector
cpufreq Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq 2010-04-24 11:35:21 -07:00
cpuidle cpuidle: Fix incorrect optimization 2010-05-09 18:35:36 -07:00
crypto
dca
dio
dma Merge branch 'sh/for-2.6.34' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 2010-05-06 08:37:39 -07:00
edac edac, mce: Fix wrong mask and macro usage 2010-04-30 10:15:39 -07:00
eisa
firewire Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2010-04-22 12:54:54 -07:00
firmware Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-tip 2010-04-07 11:02:23 -07:00
gpio it8761e_gpio: fix bug in gpio numbering 2010-05-11 17:33:41 -07:00
gpu drivers/gpu/drm/i915/i915_irq.c:i915_error_object_create(): use correct kmap-atomic slot 2010-05-11 17:33:42 -07:00
hid HID: fix suspend crash by moving initializations earlier 2010-05-07 23:33:52 +02:00
hwmon Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging 2010-05-11 17:38:04 -07:00
i2c i2c-core: Use per-adapter userspace device lists 2010-05-04 11:09:28 +02:00
ide pata_pcmcia / ide-cs: Fix bad hashes for Transcend and kingston IDs 2010-05-05 14:48:48 -04:00
idle
ieee1394
ieee802154
infiniband Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband 2010-04-09 11:53:06 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2010-05-13 07:28:43 -07:00
isdn Fix ISDN/Gigaset build failure 2010-04-19 11:53:17 -07:00
leds
lguest lguest: stop using KVM hypercall mechanism 2010-04-14 21:43:56 +09:30
macintosh device_attributes: add sysfs_attr_init() for dynamic attributes 2010-04-07 08:38:03 -07:00
mca
md md: restore ability of spare drives to spin down. 2010-05-07 21:10:57 +10:00
media V4L/DVB: pxa_camera: move fifo reset direct before dma start 2010-05-06 19:20:52 -03:00
memstick
message
mfd mfd: Clean up after WM83xx AUXADC interrupt if it arrives late 2010-05-13 12:58:55 +02:00
misc VMware Balloon driver 2010-04-24 11:31:26 -07:00
mmc mmc: atmel-mci: fix in debugfs: response value printing 2010-05-11 17:33:41 -07:00
mtd [MTD] Remove zero-length files mtdbdi.c and internal.ho 2010-05-05 15:25:12 -04:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2010-05-11 10:11:40 -07:00
nubus
of of: check for IS_ERR() 2010-04-28 01:07:29 -06:00
oprofile
parisc
parport
pci Revert "PCI: update bridge resources to get more big ranges in PCI assign unssigned" 2010-05-12 18:39:45 -07:00
pcmcia Merge branch 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2010-05-07 14:11:09 -07:00
platform eeepc-laptop: add missing sparse_keymap_free 2010-04-23 15:23:21 -04:00
pnp Merge branches 'bugzilla-14337', 'bugzilla-14998', 'bugzilla-15407', 'bugzilla-15903' and 'misc-2.6.34' into release 2010-05-06 22:04:31 -04:00
power
pps
ps3
rapidio
regulator regulator: fix enabling regulator issue on max8925 2010-04-28 15:24:34 +01:00
rtc rtc-mxc: multiple fixes in rtc-mxc probe method 2010-04-07 08:38:05 -07:00
s390 [S390] dasd: fix race between tasklet and dasd_sleep_on 2010-05-12 09:32:26 +02:00
sbus
scsi libata: kill ATA_FLAG_DISABLED 2010-05-17 22:49:02 -04:00
serial serial: imx.c: fix CTS trigger level lower to avoid lost chars 2010-05-13 12:10:56 -07:00
sfi
sh
sn
spi omap2_mcspi: small fixes of output data format 2010-04-28 01:25:43 -06:00
ssb MIPS: Fix SSB PCIcore IO resource management 2010-04-12 17:26:14 +01:00
staging Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus 2010-04-30 13:04:14 -07:00
tc
telephony
thermal drivers/thermal/thermal_sys.c: fix 'key f70f4b50 not in .data' in thermal_sys 2010-04-07 08:38:03 -07:00
uio
usb USB: sl811-hcd: Fix device disconnect 2010-04-30 09:25:12 -07:00
uwb
vhost vhost: fix barrier pairing 2010-05-12 18:04:04 +03:00
video fbdev: bfin-t350mcqb-fb: fix fbmem allocation with blanking lines 2010-05-11 17:33:42 -07:00
virtio virtio: Fix GFP flags passed from the virtio balloon driver 2010-04-22 07:34:05 -07:00
vlynq
w1 w1: fix omap 1-wire driver compilation 2010-04-24 11:31:25 -07:00
watchdog watchdog: ep93xx_wdt.c fix default timout value in MODULE_PARM_DESC string. 2010-05-03 08:58:56 +00:00
xen
zorro
Kconfig
Makefile virtio: initialize earlier 2010-05-07 14:01:17 -07:00