[libata sata_sil24] cleanups: use pci_iomap(), kzalloc()

* libata will soon move to iomap, so we should use
  pci_iomap() and pci_iounmap().
* Use kzalloc() where appropriate.
[libata sata_nv] cleanups: convert #defines to enums; remove in-file history
[libata sata_nv] eliminate duplicate codepaths with iomap

eliminate a bunch of
	if (mmio)
		writel()
	else
		outl()

code with the pci_iomap() and io{read,write}{8,16,32}() interface.
[libata sata_uli] kill scr_addr abuse

sata_uli was storing PCI config addresses in a variable intended for
port addresses, a variable soon to become void __iomem *.

Update the driver to store the SCR address, found in PCI config space,
in the driver-private data area.
[libata] Move some bmdma-specific code to libata-bmdma.c

No code changes, just moving code between files.
[PATCH] libata: implement ata_unpack_xfermask()

Implement ata_unpack_xfermask().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
[PATCH] libata: add per-dev pio/mwdma/udma_mask

Add per-dev pio/mwdma/udma_mask.  All transfer mode limits used to be
applied to ap->*_mask which unnecessarily restricted other devices
sharing the port.  This change will also benefit later EH speed down
and hotplug.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
[PATCH] libata: make per-dev transfer mode limits per-dev

Now that each ata_device has xfer masks, per-dev limits can be made
per-dev instead of per-port.  Make per-dev limits per-dev.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
[PATCH] libata: check if port is disabled after internal command

libata core is being changed to disallow port/device disable on lower
layers.  However, some LLDDs (sata_mv) directly disable port on
command failure.  This patch makes ata_exec_internal() check whether a
port got disabled after an internal command.  If it is, AC_ERR_SYSTEM
is added to err_mask and the port gets re-enabled.

As internal command failure results in device disable for drivers
which don't implement newer reset/EH callbacks, this change results in
no behavior change for single device per port controllers.  For
slave-possible LLDDs which disable port on command failure, (1) such
drivers don't exist currently, (2) issuing command to the other device
of once-disabled port shouldn't result in catastrophe even if such
driver exists.  So, this should be enough as a temporary measure.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
[PATCH] libata: implement ata_dev_disable()

This patch implements ata_dev_disable() which prints a warning message
and takes @dev offline.  Currently, this is done by explicitly
incrementing dev->class with case-by-case warning messages.  Giving
user clear indication when libata gives up will be more important as
libata will be doing more retries.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
[PATCH] libata: use ata_dev_disable() in ata_bus_probe()

We may or may not disable a device after ata_dev_configure() fails.
Kill 'not supported, ignoring' message in ata_dev_configure() and use
ata_dev_disable() in ata_bus_probe().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
[PATCH] libata: make ata_set_mode() responsible for failure handling

Make ata_set_mode() responsible for determining whether to take port
or device offline on failure.  ata_dev_set_xfermode() and
ata_dev_set_mode() indicate error to the caller instead of disabling
port directly on failure.  Also, for consistency, ata_dev_present()
check is done in ata_set_mode() instead of ata_dev_set_mode().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
[PATCH] Make libata not powerdown drivers on PM_EVENT_FREEZE.

At the moment libata doesn't pass pm_message_t down ata_device_suspend.
This causes drives to be powered down when we just want a freeze,
causing unnecessary wear and tear. This patch gets pm_message_t passed
down so that it can be used to determine whether to power down the
drive.

Signed-off-by: Nigel Cunningham <nigel@suspend2.net>

 drivers/scsi/libata-core.c |    5 +++--
 drivers/scsi/libata-scsi.c |    4 ++--
 drivers/scsi/scsi_sysfs.c  |    2 +-
 include/linux/libata.h     |    4 ++--
 include/scsi/scsi_host.h   |    2 +-
 5 files changed, 9 insertions(+), 8 deletions(-)
Signed-off-by: Jeff Garzik <jeff@garzik.org>
[PATCH] libata: add ata_dev_pair helper

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
[libata] export ata_dev_pair; trim trailing whitespace

Mostly, trim trailing whitespace.

Also:
* export ata_dev_pair
* move ata_dev_classify export closer to ata_dev_pair export
[PATCH] libata: ata_scsi_queuecmd cleanup

Encapsulate part of ata_scsi_queuecmd so that it can be
reused by future SAS patches.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
[PATCH] libata: ata_scsi_ioctl cleanup

In preparation for SAS, kill some unnecessary code in ata_scsi_ioctl
to find the ATA port and device given the scsi_device. Neither local
is used in the function.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
[PATCH] libata: Remove dependence on host_set->dev for SAS

Remove some of the dependence on the host_set struct
in preparation for supporting SAS HBAs. Adds a struct device
pointer to the ata_port struct.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
[PATCH] Yet more rio cleaning (2 of 2)

- Remove more unused headers
- Remove various typedefs
- Correct type of PaddrP (physical addresses should be ulong)
- Kill use of bcopy
- More printk cleanups
- Kill true/false
- Clean up direct access to pci BARs

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] deprecate the tasklist_lock export

Drivers have no business looking at the task list and thus using this lock.
 The only possibly modular users left are:

 arch/ia64/kernel/mca.c
 drivers/edac/edac_mc.c
 fs/binfmt_elf.c

which I'll send out fixes for soon.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>