Commit graph

1445 commits

Author SHA1 Message Date
Bartlomiej Zolnierkiewicz 7ef8df81de ppc/sandpoint: remove ppc_ide_md hooks
* Add IDE_HFLAG_FORCE_LEGACY_IRQS host flag for Motorola-Sandpoint platform
  to sl82c105 host driver.

* Disable ide_generic host driver in arch/ppc/configs/sandpoint_defconfig
  and enable sl82c105 one.

* Remove ppc_ide_md hooks from arch/ppc/platforms/sandpoint.c - no need for
  them (sl82c105 host driver takes care of all this setup).

* Then remove no longer needed <linux/ide.h> include.

* Also update arch/ppc/platforms/sandpoint.h.

Unfortunately (unlike lopec's case) sl82c105 host driver was not enabled
in defconfing so there is a funcionality change.

[ Not a big deal since sl82c105 is superior over ide_generic. ]

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:30 +02:00
Bartlomiej Zolnierkiewicz 5510b12557 ppc/lopec: remove ppc_ide_md hooks
* Add IDE_HFLAG_FORCE_LEGACY_IRQS host flag for Motorola-LoPEC platform
  to sl82c105 host driver.

* Remove ppc_ide_md hooks from arch/ppc/platforms/lopec.c - no need for
  them (sl82c105 host driver takes care of all this setup).

* Then remove no longer needed <linux/ide.h> include.

Looking at arch/ppc/configs/lopec_defconfig:

...
CONFIG_IDE_GENERIC=y
CONFIG_BLK_DEV_IDEPCI=y
# CONFIG_IDEPCI_SHARE_IRQ is not set
# CONFIG_BLK_DEV_OFFBOARD is not set
CONFIG_BLK_DEV_GENERIC=y
# CONFIG_BLK_DEV_OPTI621 is not set
CONFIG_BLK_DEV_SL82C105=y
...

there should be no functional changes unless somebody preferred to disable
sl82c105 host driver and use only ide_generic one (but why would anybody
want to do such thing :-).

PS It seems that lopec_defconfig hasn't been updated for ages but if somebody
is going to do it please look into disabling IDE_GENERIC and BLK_DEV_GENERIC
config options.  Thanks.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:29 +02:00
Bartlomiej Zolnierkiewicz 2661b13a21 ppc/mpc8xx: remove ppc_ide_md hooks
* Initialize IDE ports in mpc8xx_ide_probe().

* Remove m8xx_ide_init() and ppc_ide_md hooks - no need for them
  (IDE mpc8xx host driver takes care of all this setup).

* Remove needless 'if (irq)' and 'if (data_port >= MAX_HWIFS)' checks
  from m8xx_ide_init_hwif_ports().

* Remove 'ctrl_port' and 'irq' arguments from m8xx_ide_init_hwif_ports().

* Rename m8xx_ide_init_hwif_ports() to m8xx_ide_init_ports().

* Add __init tag to m8xx_ide_init_ports().

This patch fixes hwif->irq always being overriden to 0 (== auto-probe, is
this even working on PPC?) because of ide_init_default_irq() call in ide.c.

There should be no other functional changes.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Vitaly Bordug <vitb@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:29 +02:00
Bartlomiej Zolnierkiewicz 5c58666fae ppc/pmac: remove ppc_ide_md hooks
* Add pmac_ide_init_ports() helper and use it instead of
  pmac_ide_init_hwif_ports().

* Remove ppc_ide_md hooks - no need for them
  (IDE pmac host driver takes care of all this setup).

* Then remove no longer needed <linux/ide.h> include
  from arch/powerpc/platforms/powermac/pmac.h.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:29 +02:00
Bartlomiej Zolnierkiewicz af007ec6c9 ide-pmac: remove dead code
Remove unused pmac_ide_{check_base,get_irq}() and pmac_find_ide_boot(),
then remove no longer needed ide_majors[] and pmac_ide_count.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:28 +02:00
Borislav Petkov eaec3e7ded ide: use generic ATAPI packet command flags in ide-{floppy,tape}
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:27 +02:00
Borislav Petkov c2b2b29361 ide-floppy: rename end_request handler properly
mv idefloppy_do_end_request -> idefloppy_end_request as is the case with ide-cd

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:27 +02:00
Borislav Petkov 8e55512391 ide-floppy: convert driver to using generic ide_atapi_pc
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:27 +02:00
Borislav Petkov d236d74c0d ide-tape: convert driver to using generic ide_atapi_pc
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:27 +02:00
Borislav Petkov 346331f828 ide-tape: remove atomic test/set macros for packet commands
Removing the atomic tests for pc's is unobjectionable. Since this driver will
probably go to /dev/null soon, the atomic tests for tape->flags are left in
place for there are some situations where they're needed (chrdev DSC handling,
low level pipeline operation and so on). While at it, rename all test/set flag
bit defines explicitly to *_FLAG_* for clarity.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:26 +02:00
Borislav Petkov 03056b909b ide-tape: move all struct and other defs at the top
Bart:
- no need to move defines for tape flags around
  (they are completely rewritten by the next patch)

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:26 +02:00
Bartlomiej Zolnierkiewicz 23579a2a17 ide: remove IDE_*_REG macros
* Add IDE_{ALTSTATUS,IREASON,BCOUNTL,BCOUNTH}_OFFSET defines.

* Remove IDE_*_REG macros - this results in more readable
  and slightly smaller code.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:26 +02:00
Bartlomiej Zolnierkiewicz 7616c0ad20 ide: add ide_atapi_{discard_data,write_zeros} inline helpers
Add ide_atapi_{discard_data,write_zeros} inline helpers to <linux/ide.h>
and use them instead of home-brewn helpers in ide-{floppy,tape,scsi}.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:26 +02:00
Borislav Petkov 3ad6776cca ide-floppy: remove struct idefloppy_id_gcw
Bart:
- minor fixups

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:25 +02:00
Akira Iguchi 3d53ba87f0 scc_pata.c: do setup itself instead of ide_setup_pci_device()
scc_pata has the different BAR configuration and using ide_setup_pci_device()
is inappropriate. 

(ide_setup_pci_device() expects a normal PCI IDE controller with
BAR0..BAR3 either non-existant or being primary/secondary port bases
in I/O space.)

This patch do all needed setup itself instead of calling ide_setup_pci_device().

[bart: minor checkpatch.pl fixes]

Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Signed-off-by: Akira Iguchi <akira2.iguchi@toshiba.co.jp>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:25 +02:00
Bartlomiej Zolnierkiewicz e6bfa38a48 ide: remove ide_init_hwif_ports()
ide_init_hwif_ports() is only used by init_ide_data() now, inline it there.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:25 +02:00
Bartlomiej Zolnierkiewicz 05734266c0 ide: remove init_hwif_default()
init_hwif_default() is only used by init_ide_data() now, inline it there.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:25 +02:00
Bartlomiej Zolnierkiewicz 2304dc6481 ide: remove ->hold field from ide_hwif_t (take 2)
->hold is write-only now, remove it.

v2:
* v1 missed bast-ide, palm_bk3710, ide-cs and delkin_cb host drivers.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:24 +02:00
Bartlomiej Zolnierkiewicz 93de00fd1c ide: remove broken/dangerous HDIO_[UNREGISTER,SCAN]_HWIF ioctls (take 3)
hdparm explicitely marks HDIO_[UNREGISTER,SCAN]_HWIF ioctls as DANGEROUS
and given the number of bugs we can assume that there are no real users:

* DMA has no chance of working because DMA resources are released by
  ide_unregister() and they are never allocated again.

* Since ide_init_hwif_ports() is used for ->io_ports[] setup the ioctls
  don't work for almost all hosts with "non-standard" (== non ISA-like)
  layout of IDE taskfile registers (there is a lot of such host drivers).

* ide_port_init_devices() is not called when probing IDE devices so:
  - drive->autotune is never set and IDE host/devices are not programmed
    for the correct PIO/DMA transfer modes (=> possible data corruption)
  - host specific I/O 32-bit and IRQ unmasking settings are not applied
    (=> possible data corruption)
  - host specific ->port_init_devs method is not called (=> no luck with
    ht6560b, qd65xx and opti621 host drivers)

* ->rw_disk method is not preserved (=> no HPT3xxN chipsets support).

* ->serialized flag is not preserved (=> possible data corruption when
   using icside, aec62xx (ATP850UF chipset), cmd640, cs5530, hpt366
   (HPT3xxN chipsets), rz1000, sc1200, dtc2278 and ht6560b host drivers).

* ->ack_intr method is not preserved (=> needed by ide-cris, buddha,
  gayle and macide host drivers).

* ->sata_scr[] and sata_misc[] is cleared by ide_unregister() and it
  isn't initialized again (SiI3112 support needs them).

* To issue an ioctl() there need to be at least one IDE device present
  in the system.

* ->cable_detect method is not preserved + it is not called when probing
  IDE devices so cable detection is broken (however since DMA support is
  also broken it doesn't really matter ;-).

* Some objects which may have already been freed in ide_unregister()
  are restored by ide_hwif_restore() (i.e. ->hwgroup).

* ide_register_hw() may unregister unrelated IDE ports if free ide_hwifs[]
  slot cannot be found.

* When IDE host drivers are modular unregistered port may be re-used by
  different host driver that owned it first causing subtle bugs.

Since we now have a proper warm-plug support remove these ioctls,
then remove no longer needed:
- ide_register_hw() and ide_hwif_restore() functions
- 'init_default' and 'restore' arguments of ide_unregister()
- zeroeing of hwif->{dma,extra}_* fields in ide_unregister()

As an added bonus IDE core code size shrinks by ~3kB (x86-32).

v2:
* fix ide_unregister() arguments in cleanup_module() (Andrew Morton).

v3:
* fix ide_unregister() arguments in palm_bk3710.c.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:24 +02:00
Bartlomiej Zolnierkiewicz 9a0e77f28b ide: remove obsoleted "idex=base[,ctl[,irq]]" kernel parameters (take 2)
* Remove obsoleted "idex=base[,ctl[,irq]]" kernel parameters
  and update Documentation/ide/ide.txt.

* Remove no longer needed ide_forced chipset type.

v2:
* is_chipset_set[] -> is_chipset_set in ide.c.

* Documentation/ide/ide.txt fix.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:24 +02:00
Bartlomiej Zolnierkiewicz 80aa31cb46 ide: remove CONFIG_BLK_DEV_HD_IDE config option (take 2)
* Remove CONFIG_BLK_DEV_HD hack from init_hwif_default()
  ("hda=noprobe hdb=noprobe" kernel parameters should be used
  instead if somebody wishes to use the old "hd" driver).

* Make CONFIG_BLK_DEV_HD_ONLY config option available also when
  IDE subsystem is used and update help entry.

* Remove no longer needed CONFIG_BLK_DEV_HD_IDE config option.

v2:
* Update documentation to suggest "hda=noprobe hdb=noprobe"
  instead of obsoleted "ide0=noprobe".

* Update Documentation/ide/ide.txt.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:24 +02:00
Bartlomiej Zolnierkiewicz fef39d95ea ide: remove needless CONFIG_BLK_DEV_HD hack from init_hwif()
request_irq() will fail if there is already another IRQ handler
registered and IRQ flags are mismatched.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:23 +02:00
Bartlomiej Zolnierkiewicz f0298512c8 ide-generic: add ide_generic class and attribute for adding new interfaces
* Add ide_generic_sysfs_init() helper registering 'ide_generic' class
  (together with ide_generic_class_release() ->class_release method)
  and use it in ide_generic_init().

* Add "add" class attribute to 'ide_generic' class for adding new interfaces
  (it is intended to be a replacement for obsoleted "idex=base[,ctl[,irq]]"
  kernel parameters).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:23 +02:00
Bartlomiej Zolnierkiewicz f74c91413e ide: add warm-plug support for IDE devices (take 2)
* Add 'struct class ide_port_class' ('ide_port' class) and a 'struct
  device *portdev' ('ide_port' class device) in ide_hwif_t.

* Register 'ide_port' class in ide_init() and unregister it in
  cleanup_module().

* Create ->portdev in ide_register_port () and unregister it in
  ide_unregister().

* Add "delete_devices" class device attribute for unregistering IDE devices
  on a port and "scan" one for probing+registering IDE devices on a port.

* Add ide_sysfs_register_port() helper for registering "delete_devices"
  and "scan" attributes with ->portdev.  Call it in ide_device_add_all().

* Document IDE warm-plug support in Documentation/ide/warm-plug-howto.txt.

v2:
* Convert patch from using 'struct class_device' to use 'struct device'.
  (thanks to Kay Sievers for doing it)

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:23 +02:00
Bartlomiej Zolnierkiewicz 50672e5d74 ide: remove dead/obsolete ->busproc method
->busproc method is used by HDIO_SET_BUSSTATE ioctl but it has no chance
of working as intended (in 2.4.x days) because to issue an ioctl there
is a device node needed and:

- for BUSSTATE_TRISTATE+OFF it is too late (devices are already gone)

- for BUSSTATE_TRISTATE+ON it is too early (devices are not registered yet)

Just remove ->busproc method for now (it was only implemented by hpt366,
siimage and tc86c001 host drivers).

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:23 +02:00
Bartlomiej Zolnierkiewicz 2dde7861af ide: rework PowerMac media-bay support (take 2)
Rework PowerMac media-bay support in such way that instead of
un/registering the IDE interface we un/register IDE devices:

* Add ide_port_scan() helper for probing+registerering devices on a port.

* Rename ide_port_unregister_devices() to __ide_port_unregister_devices().

* Add ide_port_unregister_devices() helper for unregistering devices on a port.

* Add 'ide_hwif_t *cd_port' to 'struct media_bay_info', pass 'hwif' instead
  of hwif->index to media_bay_set_ide_infos() and use it to setup 'cd_port'.

* Use ide_port_unregister_devices() instead of ide_unregister()
  and ide_port_scan() instead of ide_register_hw() in media_bay_step().

* Unexport ide_register_hw() and make it static.

v2:
* Fix build by adding <linux/ide.h> include to <asm-powerpc/mediabay.h>.
  (Reported by Michael/Kamalesh/Andrew).

Cc: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: Michael Ellerman <michael@ellerman.id.au>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:23 +02:00
Bartlomiej Zolnierkiewicz 26042d058b ide: move ide_port_setup_devices() call to ide_device_add_all()
Add ide_cfg_mtx lock/unlock to ide_port_setup_devices() and then move
ide_port_setup_devices() call from init_irq() to ide_device_add_all().

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:22 +02:00
Bartlomiej Zolnierkiewicz 43514ed1ee ide: factor out devices init from ide_init_port_data()
* Factor out devices init from ide_init_port_data() to
  ide_port_init_devices_data().

While at it:

* Add explicit clearing of IDE device structure.

There should be no functionality changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:22 +02:00
Bartlomiej Zolnierkiewicz 71bf9f6fe8 ide: factor out code unregistering devices from ide_unregister()
Factor out code unregistering devices from ide_unregister() to
ide_port_unregister_devices().

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:22 +02:00
Bartlomiej Zolnierkiewicz 5b0c4b30a6 ide: remove IDE devices from /proc/ide/ before unregistering them
IDE devices need to be removed from /proc/ide/ _before_ being unregistered:

* Drop 'ide_hwif_t *hwif' argument from destroy_proc_ide_device()
  and use drive->hwif instead.

* Rename destroy_proc_ide_device() to ide_proc_unregister_device().

* Call ide_proc_unregister_device() in drive_release_dev().

* Remove no longer needed destroy_proc_ide_drives().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:22 +02:00
Bartlomiej Zolnierkiewicz c7f6f21aae ide: factor out cable detection from ide_init_port()
* Factor out cable detection from ide_init_port() to ide_port_cable_detect().

* Move ide_port_cable_detect() call to ide_device_add_all().

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:22 +02:00
Bartlomiej Zolnierkiewicz 8f22a72bf5 ide-acpi: add missing drive->acpidata zeroing
There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:21 +02:00
Bartlomiej Zolnierkiewicz 4f0eee4d87 ide: use ide_find_port() instead of ide_deprecated_find_port()
* Use ide_find_port() instead of ide_deprecated_find_port() in bast-ide/
  palm_bk3710/ide-cs/delkin_cb host drivers and in ide_register_hw().

* Remove no longer needed ide_deprecated_find_port().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:21 +02:00
Bartlomiej Zolnierkiewicz 2625cd52b6 ide: fix ide_find_port()
* Instead of checking for '->io_ports[IDE_DATA_OFFSET] == 0' check for
  '->chipset == ide_unknown' when looking for an empty ide_hwifs[] slot.

* Do ide-pnp initialization after ide-generic when IDE is built-in
  (ide-pnp is the only user of ide_find_port() which needs such fixup).

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:21 +02:00
Bartlomiej Zolnierkiewicz ce9b248bb4 ide-generic: set hwif->chipset
This hwif->chipset fixup is already present in ide_device_add_all()
but for warm-plug support we also need to reserve not currently present
interfaces.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:21 +02:00
Greg Kroah-Hartman a594eeb1a1 IDE: remove ide=reverse IDE core
This option is obsolete and can be removed safely.

It allows us to remove the pci_get_device_reverse() function from the
PCI core.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-18 00:46:20 +02:00
Paul Bolle da19566552 it821x: do not describe noraid parameter with its value
Describe noraid parameter with its name (and not its value).

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-17 01:14:33 +02:00
Sergei Shtylyov b4dcaea36b Pb1200/DBAu1200: fix bad IDE resource size
The header files for the Pb1200/DBAu1200 boards have wrong definition for the
IDE interface's decoded range length -- it should be 512 bytes according to
what the IDE driver does.  In addition, the IDE platform device claims 1 byte
too many for its memory resource -- fix the platform code and the IDE driver
in accordance.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-17 01:14:33 +02:00
Sergei Shtylyov fabd3a223a Au1200: IDE driver build fix
The driver fails to compile with CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA enabled:

drivers/ide/mips/au1xxx-ide.c: In function `auide_build_dmatable':
drivers/ide/mips/au1xxx-ide.c:256: error: implicit declaration of function
`sg_virt'
drivers/ide/mips/au1xxx-ide.c:275: error: implicit declaration of function
`sg_next'
drivers/ide/mips/au1xxx-ide.c:275: warning: assignment makes pointer from
integer without a cast

Fix this by including <linux/scatterlist.h>. While at it, remove the #include's
without which the driver happily builds.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-17 01:14:33 +02:00
Sergei Shtylyov 09a77441f2 Au1200: kill IDE driver function prototypes
Fix these warnings emitted when compiling drivers/ide/mips/au1xxx-ide.c:

include/asm/mach-au1x00/au1xxx_ide.h:137: warning: 'auide_tune_drive' declared 
`static' but never defined
include/asm/mach-au1x00/au1xxx_ide.h:138: warning: 'auide_tune_chipset' declared
 `static' but never defined

by wiping out the whole "function prototyping" section from the header file
<asm-mips/mach-au1x00/au1xxx_ide.h> as it mostly declared functions that are
already dead in the IDE driver; move the only useful prototype into the driver.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-17 01:14:33 +02:00
Sergei Shtylyov c976816b6e siimage: fix kernel oops on PPC 44x
Fix kernel oops due to machine check occuring in init_chipset_siimage() on PPC
44x platforms.  These 32-bit CPUs have 36-bit physical address and PCI I/O and
memory spaces are mapped beyond 4 GB; arch/ppc/ code has a fixup in ioremap()
that creates an illusion of the PCI I/O and memory resources being mapped below
4 GB, while arch/powerpc/ code got rid of this fixup with PPC 44x having instead
CONFIG_RESOURCES_64BIT=y -- this causes the resources to be truncated to 32-bit
'unsigned long' type in this driver, and so non-existant memory being ioremap'ed
and then accessed...

Thanks to Valentine Barshak for providing an initial patch and explanations.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-07 23:30:10 +02:00
Bartlomiej Zolnierkiewicz 7e77718579 ide: use ->ata_input_data in ide_driveid_update()
Use ->ata_input_data method instead of calling ata_input_data() directly.

Currently it matters only for (broken) ide-cris host driver but it may
change in the future.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-02 21:22:05 +02:00
Bartlomiej Zolnierkiewicz 430c5d26ec ide-h8300: 32-bit I/O is unsupported
This host driver doesn't support 32-bit I/O (it sets hwif->INSL/OUTSL
to NULL) so IDE_HFLAG_NO_IO_32BIT host flag needs to be set.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-02 21:22:04 +02:00
Adrian Bunk f743d04dcf ide/legacy/q40ide.c: add MODULE_LICENSE
Now that it can be built modular it needs a MODULE_LICENSE.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-02 21:22:04 +02:00
Adrian Bunk 37c807a2e0 ide/legacy/macide: add MODULE_LICENSE
Now that it can be built modular it needs a MODULE_LICENSE.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-02 21:22:04 +02:00
Adrian Bunk 0c5ec97b30 ide/legacy/falconide.c: add MODULE_LICENSE
Now that it can be built modular it needs a MODULE_LICENSE.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-02 21:22:04 +02:00
Adrian Bunk c5daf1aa20 ide/legacy/buddha.c: add MODULE_LICENSE
Now that it can be built modular it needs a MODULE_LICENSE.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-02 21:22:04 +02:00
Adrian Bunk 6e1d17da7b ide/legacy/gayle.c: add MODULE_LICENSE
Now that it can be built modular it needs a MODULE_LICENSE.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-02 21:22:04 +02:00
Adrian Bunk f95dc32001 ide/h8300/ide-h8300.c: add MODULE_LICENSE
Now that it can be built modular it needs a MODULE_LICENSE.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-02 21:22:03 +02:00
Adrian Bunk b3fa5fab37 ide/cris/ide-cris.c: add MODULE_LICENSE
Now that it can be built modular it needs a MODULE_LICENSE.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-02 21:22:03 +02:00
Adrian Bunk 57ad3ea0c7 ide/arm/ide_arm.c: add MODULE_LICENSE
Now that it can be built modular it needs a MODULE_LICENSE.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-02 21:22:03 +02:00
Adrian Bunk de9facbffe ide/ppc/pmac.c: add MODULE_LICENSE
Now that it can be built modular it needs a MODULE_LICENSE.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-02 21:22:03 +02:00
Adrian Bunk 20e3dd8f37 ide/ppc/mpc8xx.c: add MODULE_LICENSE
Now that it can be built modular it needs a MODULE_LICENSE.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-02 21:22:03 +02:00
Adrian Bunk 776c0bcee6 ide/pci/cmd640.c: add MODULE_LICENSE
Now that it can be built modular it needs a MODULE_LICENSE.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-02 21:22:02 +02:00
Adrian Bunk a62ee64157 ide-pnp.c: add MODULE_LICENSE
Now that it's in an own module it needs a MODULE_LICENSE.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-02 21:22:02 +02:00
Bartlomiej Zolnierkiewicz f367bed005 Revert "ide: change master/slave IDENTIFY order"
This reverts commit b140b99c41.

[ conflict in drivers/ide/ide-probe.c fixed manually ]

It turned out that probing order change causes problems for some drives:

	http://bugzilla.kernel.org/show_bug.cgi?id=10239

Since root causes are still being investigated and are unlikely to be fixed
before 2.6.25 lets revert this change for now.  As a result cable detection
becomes less reliable when compared with 2.6.24 but the affected drives are
useable again.

Reported-by: Richard Genoud <richard.genoud@gmail.com>
Bisected-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-03-29 19:48:21 +01:00
Bartlomiej Zolnierkiewicz ca4e2ab5b2 Revert "ide-tape: schedule driver for removal after 6 months"
This reverts commit d48567dd43.

Borislav is working on ide-tape "light" version instead.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-03-22 16:44:27 +01:00
Bartlomiej Zolnierkiewicz d708c40da8 ide: mark "hdx=remap" and "hdx=remap63" kernel parameters as obsoleted
Mark "hdx=remap" and "hdx=remap63" kernel parameters as obsoleted
(they are layering violation and should be dealt with in the same
 way as done by libata - device-mapper should be used instead).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-03-22 16:40:22 +01:00
Bartlomiej Zolnierkiewicz 15220d9b5a ide: mark "hdx=[driver_name]" and "hdx=scsi" kernel parameters as obsoleted
Mark "hdx=[driver_name]" and "hdx=scsi" kernel parameters as obsoleted
(nowadays device-driver binding can be changed at runtime through sysfs
 and it can also be dealt with using per device driver parameters).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-03-22 16:40:21 +01:00
Bartlomiej Zolnierkiewicz 9c027c684b ide: mark special "ide0=" kernel parameters as obsoleted
Mark "ide0=ali14xx|cmd640_vlb|dtc2278|ht6560b|qd65xx|umc8672" kernel
parameters as obsoleted (per host driver replacements have been available
for a long time).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-03-22 16:40:21 +01:00
Bartlomiej Zolnierkiewicz 37ff9f3953 ide: remove commented out entries from ide_pio_blacklist[]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-03-22 16:40:20 +01:00
Linus Torvalds 6c3c3158a8 IDE: Make taskfile interface more robust wrt unexpected end-of-command
Now that we handle all the special commands using REQ_TYPE_ATA_TASKFILE
rather than using the old REQ_TYPE_ATA_CMD model, we need to also
emulate the lack of full taskfile data that comes with the old command
model (ie when commands are generated with the HDIO_DRIVE_CMD ioctl
rather than using the HDIO_DRIVE_TASK[FILE] ioctls).

In particular, this means that we should handle command completion the
more relaxed way that the old drive_cmd_intr() code did.  It allows
commands to finish early even if they don't use up all the data that we
thought we had for them.

This fixes a regression seen by Anders Eriksson where some SMART
commands sent by smartd would cause a boot-time system hang on his
machine because the IDE command handling code didn't realize that the
command had completed.

Tested-by: Anders Eriksson <aeriksson@fastmail.fm>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Ingo Molnar <mingo@elte.hu>
Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-03-18 21:26:24 -07:00
Randy Dunlap 1c10e93828 ide: update references to Documentation/ide/ide.txt (v2)
Fix all references to Documentation/ide/ide.txt.
Add/update ide/00-INDEX file.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-03-07 21:53:50 +01:00
Peter Teoh 0c6025d444 ide: fix buggy code in ide_register_hw()
Relocating the index to come after finding the hwif pointer.

Signed-off-by: Peter Teoh <htmldeveloper@gmail.com>
Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-03-07 21:53:49 +01:00
Bartlomiej Zolnierkiewicz ef4298d0f0 ide: fix enabling DMA on it821x in "smart" mode
ide_tune_dma() should return '1' if IDE_HFLAG_NO_SET_MODE host flag is set.

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-03-07 21:53:49 +01:00
Bartlomiej Zolnierkiewicz b348487f0d ide-cd: mark REQ_TYPE_ATA_PC write requests with REQ_RW flag
On Thursday 06 March 2008, walt wrote:

> For me, this commit causes the problem it's intended to fix:
> 
> commit 9f10d9ee0a
> Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Date:   Tue Feb 26 21:50:35 2008 +0100
> 
>      ide-cd: fix 'ireason' handling for REQ_TYPE_ATA_PC requests
> 
>      This fixes some hangs caused by not finishing the transfer before ending
>      the request and also makes use of 'ireason == 1' quirk for spurious IRQs.
> 
> When I mount a CD there is a long delay, and I see this error message:
> 
> hdc: ide_cd_check_ireason: wrong transfer direction!
> cdrom: failed setting lba address space
> hdc: status error: status=0x58 { DriveReady SeekComplete DataRequest }
> ide: failed opcode was: unknown
> hdc: drive not ready for command
> <repeated many times>
> 
> When I revert this commit everything works properly again, including
> CD burning.

It turned out that REQ_TYPE_ATA_PC write requests were not marked as such
(the previous commit assumed them to be).

Reported-by: walt <w41ter@gmail.com>
Tested-by: walt <w41ter@gmail.com>
Reviewed-by: Borislav Petkov <petkovbb@googlemail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-03-07 21:53:49 +01:00
Bartlomiej Zolnierkiewicz 204f47c5a5 ide: remove stale comments from ide-dma.c (take 2)
- ide-dma.c is not a separate module

- ide-dma.c is not PCI specific anymore

- DMA is enabled by default nowadays

- link for Intel Zappa BIOS is dead

etc.

v2:
* Some comments should be preserved. (Noticed by Mark Lord)

Cc: Mark Lord <liml@rtr.ca>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-26 21:50:36 +01:00
Bartlomiej Zolnierkiewicz fcac6f87a5 qd65xx: remove commented out code
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-26 21:50:36 +01:00
Borislav Petkov d48567dd43 ide-tape: schedule driver for removal after 6 months
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-26 21:50:36 +01:00
Bartlomiej Zolnierkiewicz d12faa2736 ide-disk: add missing printk() KERN_* levels
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-26 21:50:36 +01:00
Bartlomiej Zolnierkiewicz dbecebca19 ide: fix sparse warning about shadowing 'flags' symbol
drivers/ide/ide.c:801:18: warning: symbol 'flags' shadows an earlier one
drivers/ide/ide.c:732:16: originally declared here

Also fix some whitespace damage while at it.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-26 21:50:35 +01:00
Andreas Schwab bcd88ac3b2 ide-cd: fix CD/DVD burning
Move counting of sense bytes into the transfer loop.

Signed-off-by: Andreas Schwab <schwab@suse.de>
Acked-by: Borislav Petkov <petkovbb@gmail.com>
Cc: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-26 21:50:35 +01:00
Bartlomiej Zolnierkiewicz 9f10d9ee0a ide-cd: fix 'ireason' handling for REQ_TYPE_ATA_PC requests
Pass 'struct request *rq' to ide_cd_check_ireason() from cdrom_newpc_intr()
and use ide_cd_check_ireason() also for REQ_TYPE_ATA_PC requests.

This fixes some hangs caused by not finishing the transfer before ending
the request and also makes use of 'ireason == 1' quirk for spurious IRQs.

Tested-by: Brad Rosser <brad.rosser@gmail.com>
Cc: Borislav Petkov <petkovbb@googlemail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-26 21:50:35 +01:00
Bartlomiej Zolnierkiewicz 788d669736 qd65xx: fix setup of QD6580 Control register
Control register of QD6580 should be setup before probing for devices.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-26 21:50:35 +01:00
Bartlomiej Zolnierkiewicz c53ea18dc2 ide: skip probing port if "hdx=noprobe" was used for both devices on it
* Skip probing port if "hdx=noprobe" parameter was used for both devices on it.

* Obsolete "idex=noprobe" parameter - it only works for ide_generic, cmd640
  and PCI hosts in Compatibility mode (on alpha/x86/ia64/m32r/mips/ppc32).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-26 21:50:34 +01:00
Bartlomiej Zolnierkiewicz cbd34d00af ide: remove redundant comment from ide_unregister()
Identical comment is present in ide_hwif_release_regions() documentation.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-26 21:50:33 +01:00
Sam Ravnborg b66cae7672 hpt366: fix section mismatch warnings
hpt366: fix section mismatch warnings

Fix following warnings:
WARNING: o-sparc64/vmlinux.o(.data+0x195a38): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt370
WARNING: o-sparc64/vmlinux.o(.data+0x195a40): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt370a
WARNING: o-sparc64/vmlinux.o(.data+0x195a48): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt372
WARNING: o-sparc64/vmlinux.o(.data+0x195a50): Section mismatch in reference from the variable hpt37x_info.0 to the variable .devinit.data:hpt372n

Replace a static array with a small switch resulting in
more readable code.
Mark the pci table __devinitconst.

A lot of variables are const but annotated __devinitdata.
Annotating them __devinitconst would cause a section type
conflict error when build for 64 bit powerpc.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-26 21:50:33 +01:00
Borislav Petkov acbe44e627 ide-cd: Enable audio play quirk for Optiarc DVD RW AD-5200A drive
Reported-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-26 21:50:32 +01:00
Rafael J. Wysocki 3a2d5b7001 PM: Introduce PM_EVENT_HIBERNATE callback state
During the last step of hibernation in the "platform" mode (with the
help of ACPI) we use the suspend code, including the devices'
->suspend() methods, to prepare the system for entering the ACPI S4
system sleep state.

But at least for some devices the operations performed by the
->suspend() callback in that case must be different from its operations
during regular suspend.

For this reason, introduce the new PM event type PM_EVENT_HIBERNATE and
pass it to the device drivers' ->suspend() methods during the last phase
of hibernation, so that they can distinguish this case and handle it as
appropriate.  Modify the drivers that handle PM_EVENT_SUSPEND in a
special way and need to handle PM_EVENT_HIBERNATE in the same way.

These changes are necessary to fix a hibernation regression related
to the i915 driver (ref. http://lkml.org/lkml/2008/2/22/488).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Tested-by: Jeff Chua <jeff.chua.linux@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-23 10:40:04 -08:00
Bartlomiej Zolnierkiewicz 2952755ce3 ide: mark "ide=reverse" option as obsolete
- it is valid only if "Probe IDE PCI devices in the PCI bus order
  (DEPRECATED)" config option is used

- Greg needs to remove pci_get_device_reverse() for PCI core changes

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-21 15:27:07 -08:00
Kiyoshi Ueda 14e04c3f6e ide-cd: fix missing residual count setting in DMA mode
This patch fixes the missing residual count setting in DMA mode,
which was introduced during the conversion to blk-end-request.
The residual count could be used by the request submitter.
So if it isn't set correctly, some upper layers does not work.
(e.g. wodim for CD burning.)

The bug is in only DMA mode.
In PIO mode, we are setting the residual count correctly,
so no need to fix.

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Reported-by: Andreas Schwab <schwab@suse.de>
Tested-by: Andreas Schwab <schwab@suse.de>
Tested-by: Laura Garcia <nevola@gmail.com>
Tested-by: Borislav Petkov <petkovbb@googlemail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-19 01:41:26 +01:00
Jan Evert van Grootheest 0e7d8d4802 ht6560b: force prefetch for some devices
Prefetch needs to be set for some ide devices to work when connected to
a ht6560b interface. This was not always done properly, causing a system
with a HD and CD on the primary interface to not work properly. Or, in
effect, hang hard.

This patch forces prefetch on devices before checking whether it
is necessary to change the settings in the interface

This patch should also be applied to 2.4. I don't currently have a
2.4 tree around.

(also change my email address)

Signed-off-by: Jan Evert van Grootheest <janevert@caiway.nl>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-19 01:41:26 +01:00
Jan Evert van Grootheest 1a1990f547 ht6560b can only do up to PIO mode 4
According to the datasheet, ht6560b only supports up to PIO mode 4.

[bart: manually ported it over 2.6.25-rc2]

Signed-off-by: Jan Evert van Grootheest <janevert@caiway.nl>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-19 01:41:26 +01:00
Andrew Smith 84f7e451e9 via82cxxx: add new PCI id for cx700
[bart: manually ported it over via82cxxx changes]

From: Andrew Smith <asmith@tranquility.fsbusiness.co.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-19 01:41:26 +01:00
Bartlomiej Zolnierkiewicz d684b21f89 falconide: locking bugfix
commit 8ac4ce742c ("ide: fix host drivers
depending on ide_generic to probe for interfaces (take 2)") moved probing
to falconide but forgot to take care of Atari specific locking - fix it.

Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michael Schmitz <schmitz@debian.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-19 01:41:25 +01:00
Mikko Rapeli b152fcd341 ide/libata: ST310211A has buggy HPA too
Signed-off-by: Mikko Rapeli <mikko.rapeli@teleca.com>
Tested-by: Bart Champagne <bart@as35701.net>
Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-19 01:41:25 +01:00
Geert Uytterhoeven 899e1bc573 ide: Add missing base addresses for falconide and macide
commit 29dd59755a ("ide: remove ide_setup_ports")
forgot to take into account the base addresses for the CONTROL registers for
falconide and macide, as pointed out by Michael Schmitz.

Falconide was tested on Aranym.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michael Schmitz <schmitz@debian.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-19 01:41:24 +01:00
Bartlomiej Zolnierkiewicz 467390a2a5 ide: remove stale comment from ide-lib.c
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11 00:32:15 +01:00
Bartlomiej Zolnierkiewicz e1771e20c8 ide: fix comment in init_irq()
APUS support is gone...

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11 00:32:15 +01:00
Bartlomiej Zolnierkiewicz 4280094225 ide: ide_init_port() bugfix
On Sunday 10 February 2008, Atsushi Nemoto wrote:
> On Sun, 06 Jan 2008 18:03:10 +0100, Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
> > +	/* reset DMA masks only for SFF-style DMA controllers */
> > +	if ((d->host_flags && IDE_HFLAG_NO_DMA) == 0 && hwif->dma_base == 0)
> > +		hwif->swdma_mask = hwif->mwdma_mask = hwif->ultra_mask = 0;
> 
> It might be too late, but "host_flags && IDE_HFLAGS_NO_DMA" seems
> wrong for me.

Fix regression caused by commmit c413b9b94d
("ide: add struct ide_port_info instances to legacy host drivers").

Reported-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11 00:32:15 +01:00
Bartlomiej Zolnierkiewicz 395d8ef5be ide-disk: fix flush requests (take 2)
commit 813a0eb233
Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Date:   Fri Jan 25 22:17:10 2008 +0100

    ide: switch idedisk_prepare_flush() to use REQ_TYPE_ATA_TASKFILE requests

...

broke flush requests.

Allocating IDE command structure on the stack for flush requests is not
a very brilliant idea:

- idedisk_prepare_flush() only prepares the request and it doesn't wait
  for it to be completed

- there are can be multiple flush requests queued in the queue

Fix the problem (per hints from James Bottomley) by:
- dynamically allocating ide_task_t instance using kmalloc(..., GFP_ATOMIC)
- adding new taskfile flag (IDE_TFLAG_DYN)
- calling kfree() in ide_end_drive_command() if IDE_TFLAG_DYN is set
  (while at it rename 'args' to 'task' and fix whitespace damage)

[ This will be fixed properly before 2.6.25 but this bug is rather
  critical and the proper solution requires some more work + testing. ]

Thanks to Sebastian Siewior and Christoph Hellwig for reporting the
problem and testing patches (extra thanks to Sebastian for bisecting
it to the guilty commmit).

Tested-by: Sebastian Siewior <ide-bug@ml.breakpoint.cc>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Tejun Heo <htejun@gmail.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11 00:32:14 +01:00
Sergei Shtylyov 8e882ba111 ide: introduce CONFIG_BLK_DEV_IDEDMA_SFF option
Introduce new option CONFIG_BLK_DEV_IDEDMA_SFF for non-PCI SFF-8038i compatible
bus mastering IDE controllers (which there are a few known), thus fixing a hack
made for Palmchip BK3710 controller...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Anton Salnikov <asalnikov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11 00:32:14 +01:00
Bartlomiej Zolnierkiewicz 7b56a937a1 bast-ide: build fix
On Saturday 09 February 2008, Adrian Bunk wrote:
> Commit 9e016a7192 causes the following 
> compile error:
> 
> <--  snip  -->
> 
> ...
>   CC      drivers/ide/arm/bast-ide.o
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/ide/arm/bast-ide.c: In function 'bastide_register':
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/ide/arm/bast-ide.c:31: error: 'hwif' redeclared as different kind of symbol
> /home/bunk/linux/kernel-2.6/git/linux-2.6/drivers/ide/arm/bast-ide.c:29: error: previous definition of 'hwif' was here
> make[4]: *** [drivers/ide/arm/bast-ide.o] Error 1
> 
> <--  snip  -->

Remove 'ide_hwif_t **hwif' argument from bastide_register()
(together with write-only ifs[]).

Cc: Adrian Bunk <bunk@kernel.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11 00:32:14 +01:00
Bartlomiej Zolnierkiewicz 31cb212027 ide-tape: remove never executed code
rq->cmd[0] is never set to REQ_IDETAPE_READ_BUFFER so remove
REQ_IDETAPE_READ_BUFFER handling from idetape_create_write_cmd()
and the define itself.

Then remove no longer used idetape_create_read_buffer_cmd()
and IDETAPE_RETRIEVE_FAULTY_BLOCK define.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11 00:32:14 +01:00
Adrian Bunk 56efa7b0e4 ide: fix ide/legacy/gayle.c compilation
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11 00:32:14 +01:00
Borislav Petkov 7eb43fd2fa ide-cd: replace ntohs with generic byteorder macro be16_to_cpu
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11 00:32:13 +01:00
Bartlomiej Zolnierkiewicz eba8ff9461 ide: remove stale version number
On Thursday 03 January 2008, Robert Hancock wrote:

[...]

> How about getting rid of this stupid thing in drivers/ide/ide.c:
> 
> #define       REVISION        "Revision: 7.00alpha2"
> 
> which is used in:
> 
> printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n");
> 
> It's been 7.00alpha2 for god knows how long, so clearly this version 
> number is not useful..

Cc: Robert Hancock <hancockr@shaw.ca>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11 00:32:13 +01:00
Bartlomiej Zolnierkiewicz cfa2771bc5 pdc202xx_old: always enable burst mode
Alan has noticed that distros always enabled burst mode
(+ datasheet confirms that it is the right thing to do).

Thus fix pdc202xx_old host driver to do it unconditionally
and remove no longer needed CONFIG_PDC202XX_BURST option.

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11 00:32:13 +01:00
Bartlomiej Zolnierkiewicz c79b60ddf6 palm_bk3710: use struct ide_port_info
* Factor out cable detection to palm_bk3710_cable_detect().

* Add palm_bk3710_init_hwif() (->init_hwif method implementation).

* Remove needless ->quirkproc initialization.

* Add missing ->pio_mask initialization.

* Use ATA_* defines for setting ->{ultra,mwdma}_mask.

* Add 'struct ide_port_info palm_bk3710_port_info' and pass it to
  ide_device_add().  Then remove open-coded 'hwif' initialization.

Cc: Anton Salnikov <asalnikov@ru.mvista.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11 00:32:13 +01:00
Bartlomiej Zolnierkiewicz c92a7f1d82 palm_bk3710: port initialization/probing bugfix
Probe port _after_ it is fully initialized.

Cc: Anton Salnikov <asalnikov@ru.mvista.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11 00:32:13 +01:00
Bartlomiej Zolnierkiewicz d4452be757 palm_bk3710: fix ide_unregister() usage
Don't set 'restore' flag for ide_unregister() when initializing new
interface.

[ identical change as done to bast-ide/ide-cs/delkin_cb host drivers
  by commit 909f4369bc ]

Cc: Anton Salnikov <asalnikov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11 00:32:12 +01:00
Bartlomiej Zolnierkiewicz 7824bc6b47 palm_bk3710: ide_register_hw() -> ide_device_add()
* Convert palm_bk3710 host driver to use ide_device_add() instead of
  ide_register_hw() (while at it drop doing "ide_unregister()" loop which
  tries to unregister _all_ IDE interfaces if useable ide_hwifs[] slot
  cannot be find).

  [ identical change as done to bast-ide/ide-cs/delkin_cb host drivers
    by commit 9e016a7192 ]

* Rename 'ide_ctlr_info' to 'hw' and 'index' to 'i' while at it.

Cc: Anton Salnikov <asalnikov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11 00:32:12 +01:00
Sergei Shtylyov d30a426dc5 ide: insert BUG_ON() into __ide_set_handler() (take 2)
Replace the check for hwgroup->handler and printk(KERN_CRIT, ...) at the start
of __ide_set_handler() with mere BUG_ON() while removing such from the caller,
ide_execute_command(). Fix up the code formatting, while at it...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11 00:32:12 +01:00
Benjamin Herrenschmidt cb777922c3 cs5520: remove stale comment
Remove stale comment from the cs5520 IDE driver.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11 00:32:12 +01:00
Kiyoshi Ueda 3b0e044d5a ide: another possible ide panic fix for blk-end-request
I have reviewed all blk-end-request patches again to confirm whether
there are any similar problems with the last week's ide-cd panic:
    http://lkml.org/lkml/2008/1/29/140

And I found a possible similar bug in ide-io change:
ide_end_drive_cmd() could be called for blk_pc_request() which could
have bios.  To complete such requests correctly, we need to pass
the actual size of the request.
Otherwise, __blk_end_request() returns 1 because the request still has
bios, and the system will BUG() unnecessarily.

The following patch fixes the bug and should be applied on top of
Linus' git.

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: Borislav Petkov <petkovbb@googlemail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11 00:32:11 +01:00
Sam Ravnborg ec7748b59e ide: introduce HAVE_IDE
To allow flexible configuration of IDE introduce HAVE_IDE.
All archs except arm, um and s390 unconditionally select it.
For arm the actual configuration determine if IDE is supported.

This is a step towards introducing drivers/Kconfig for arm.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Russell King - ARM Linux <linux@arm.linux.org.uk>
Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-09 10:46:40 +01:00
David Howells 1eb1141123 aout: remove unnecessary inclusions of {asm, linux}/a.out.h
Remove now unnecessary inclusions of {asm,linux}/a.out.h.

[akpm@linux-foundation.org: fix alpha build]
Signed-off-by: David Howells <dhowells@redhat.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-08 09:22:30 -08:00
Linus Torvalds 2dd550b90b Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
  ata_piix.c:piix_init_one() must be __devinit
  sata_via.c: Remove missleading comment.
  libata-core: unblacklist HITACHI drives
  sata_nv: fix ATAPI issues with memory over 4GB (v7)
  ata: drivers/ata/sata_mv.c needs dmapool.h
  libata: kill now unused n_iter and fix sata_fsl
  ahci: fix CAP.NP and PI handling
  sata_mv: Support SoC controllers
  Rename: linux/pata_platform.h to linux/ata_platform.h
2008-02-06 10:47:46 -08:00
Adrian Bunk 7b892806b0 cleanup after APUS removal
After the APUS removal, some code can be removed.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Karsten Keil <kkeil@suse.de>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-06 10:41:01 -08:00
Jeff Garzik 0a87e3e92b Rename: linux/pata_platform.h to linux/ata_platform.h
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-02-06 06:54:17 -05:00
Borislav Petkov dfe799364e ide-tape: bump minor driver version
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:55 +01:00
Borislav Petkov 5a04cfa911 ide-tape: cleanup the remaining codestyle issues
... thus decreasing checkpatch.pl errors to 0.

Bart:
- remove needless function prototypes while at it
- remove needless parentheses while at it
- add missing KERN_ level to ide_tape_probe()
- other minor fixups

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:54 +01:00
Borislav Petkov 24d57f8b28 ide-tape: fix syntax error in idetape_identify_device()
Spotted by Sergei Shtylyov.

CC: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:54 +01:00
Borislav Petkov bf6296b688 ide-tape: remove leftover OnStream support warning
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:54 +01:00
Borislav Petkov 9c14576886 ide-tape: collect module-related macro calls at the end
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:54 +01:00
Borislav Petkov c837cfa5b6 ide-tape: include proper headers
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:54 +01:00
Borislav Petkov 1f27e38dd3 ide-tape: remove unused "length" arg from idetape_create_read_buffer_cmd()
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:54 +01:00
Borislav Petkov 71071b8e60 ide-tape: remove struct idetape_id_gcw
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:53 +01:00
Borislav Petkov 3c98bf347d ide-tape: cleanup and fix comments
Also, remove redundant ones and cleanup whitespace.

Bart:
- minor fixups

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:53 +01:00
Borislav Petkov 8d06bfadb4 ide-tape: shorten some function names
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:53 +01:00
Borislav Petkov 97219851b9 ide-tape: remove idetape_increase_max_pipeline_stages()
This function was being used only at one place so fold it in there.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:52 +01:00
Borislav Petkov 54bb2074ce ide-tape: struct idetape_tape_t: shorten member names v2
Shorten some member names not too aggressively since this driver might be gone
anyway soon.

Bart:
- minor fixes

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:52 +01:00
Borislav Petkov 41f81d545b ide-tape: struct idetape_tape_t: remove unused members
- last_frame_position: only being written to once
- firmware_revision, product_id, vendor_id: used once, remove from struct
  idetape_tape_t and deal with them locally
- firmware_revision_num: only written to once
- tape_still_time_begin: completely unused
- tape_still_time: never written to; remove corresponding code chunk
- uncontrolled_last_pipeline_head: only once written to
- blocks_in_buffer: only written to

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:52 +01:00
Borislav Petkov 54abf37e42 ide-tape: remove typedef idetape_chrdev_direction_t
.. and replace it with plain enums.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:52 +01:00
Borislav Petkov a1efc85f0b ide-tape: simplify code branching in the interrupt handler
... by adding a new typedef function pointer idetape_io_buf in order to call
the proper buffer i/o handler depending on the data direction.

Bart:
- move idetape_io_buf before idetape_pc_intr() comment

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:52 +01:00
Borislav Petkov 37016bab60 ide-tape: remove unreachable code chunk
tape->speed_control is set to 1 in idetape_setup(), but, in calculate_speeds()
its value is tested for being 0, 1, or 2. Remove the if-branches where
tape->speed_control != 1 since they are never executed. Also, rename
calculate_speeds() by adding driver's prefix as is with the other function
names.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:52 +01:00
Borislav Petkov a2f5b7f42a ide-tape: remove struct idetape_read_position_result_t
There should be no functional changes resulting from this patch.

Bart:
- remove needless "!!"

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:51 +01:00
Borislav Petkov 8004a8c974 ide-tape: refactor the debug logging facility
Teach the debug logging macro to differentiate between log levels based on the
type of debug level enabled specifically instead of a threshold-based one.
Thus, convert tape->debug_level to a bitmask that is written to over /proc.

Also,
- cleanup and simplify the debug macro thus removing a lot of code lines,
- get rid of unused debug levels,
- adjust the loglevel at several places where it was simply missing (e.g.
  idetape_chrdev_open())
- move the tape ptr initialization up in idetape_chrdev_open() so that we can
  use it in the debug_log macro earlier in the function.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:51 +01:00
Bartlomiej Zolnierkiewicz 64a57fe439 ide: add ide_read_error() inline helper
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:51 +01:00
Bartlomiej Zolnierkiewicz c47137a99c ide: add ide_read_[alt]status() inline helpers
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:51 +01:00
Bartlomiej Zolnierkiewicz 29dd59755a ide: remove ide_setup_ports()
ide-cris.c:
* Add cris_setup_ports() helper and use it instead of ide_setup_ports()
  (fixes random value being set in ->io_ports[IDE_IRQ_OFFSET]).

buddha.c:
* Add buddha_setup_ports() helper and use it instead of ide_setup_ports().

falconide.c:
* Add falconide_setup_ports() helper and use it instead of ide_setup_ports(),
  also fix return value of falconide_init() while at it.

gayle.c:
* Add gayle_setup_ports() helper and use it instead of ide_setup_ports().

macide.c:
* Add macide_setup_ports() helper and use it instead of ide_setup_ports()
  (fixes incorrect value being set in ->io_ports[IDE_IRQ_OFFSET]).

q40ide.c:
* Fix q40_ide_setup_ports() comments.

ide.c:
* Remove no longer needed ide_setup_ports().

Cc: Mikael Starvik <starvik@axis.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:50 +01:00
Bartlomiej Zolnierkiewicz f2694b7e3b ide: remove redundant BUG_ON() from [atapi_]reset_pollfunc()
Same BUG_ON() is present inside ide_set_handler().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:50 +01:00
Bartlomiej Zolnierkiewicz afdd360c95 ide: remove write-only ->sata_misc[] from ide_hwif_t
* Remove write-only ->sata_misc[] from ide_hwif_t.

* Remove no longer used SATA_{MISC,PHY,IEN}_OFFSET defines.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:50 +01:00
Denis Cheng 594765a731 ide-pci-generic: kill the unused ifdef/endif/MODULE code
with module_param macro, the __setup code can be killed now:
	const __setup("all-generic-ide", ide_generic_all_on);

and the module name "generic.ko" is not descriptive to its functionality,
can be changed in Makefile, the "ide-pci-generic.ko" is better.

the ide-pci-generic.all-generic-ide parameter also documented
in Documentation/kernel-parameters.txt

Signed-off-by: Denis Cheng <crquan@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:49 +01:00
Andrew Morton b004223db7 drivers/ide/legacy/hd.c: fix uninitialized var warning
drivers/ide/legacy/hd.c: In function 'hd_request':
drivers/ide/legacy/hd.c:424: warning: 'stat' may be used uninitialized in this function

gcc is being stupid.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:49 +01:00
Andrew Morton 1dcfdf93f6 drivers/ide/ide-acpi.c: fix uninitialized var warning
drivers/ide/ide-acpi.c: In function 'ide_acpi_init':
drivers/ide/ide-acpi.c:175: warning: 'dev_handle' may be used uninitialized in this function

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:49 +01:00
Anton Salnikov 7c7e92a926 Palmchip BK3710 IDE driver
This is Palmchip BK3710 IDE controller support.

The IDE controller logic supports PIO, MultiWord-DMA and Ultra-DMA modes.
Supports interface to Compact Flash (CF) configured in True-IDE mode.

Bart:
- remove dead code
- fix ide_hwif_setup_dma() build problem

Signed-off-by: Anton Salnikov <asalnikov@ru.mvista.com>
Reviewed-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:48 +01:00
Bartlomiej Zolnierkiewicz b2a53bc636 ide-generic: probing bugfix
On Tuesday 05 February 2008, Linus Torvalds wrote:
> 
> On Sat, 2 Feb 2008, Bartlomiej Zolnierkiewicz wrote:
> > 
> > * next part of IDE probing code re-organization saga
> >   (that would be me)
> 
> This seems to cause very irritating and bogus messages for me:
> 
>       Probing IDE interface ide0...
>       Probing IDE interface ide1...
>       ide2: I/O resource 0x0-0x7 not free.
>       ide2: ports already in use, skipping probe
>       ide3: I/O resource 0x0-0x7 not free.
>       ide3: ports already in use, skipping probe
>       ide4: I/O resource 0x0-0x7 not free.
>       ide4: ports already in use, skipping probe
>       ide5: I/O resource 0x0-0x7 not free.
>       ide5: ports already in use, skipping probe
>       ide6: I/O resource 0x0-0x7 not free.
>       ide6: ports already in use, skipping probe
>       ide7: I/O resource 0x0-0x7 not free.
>       ide7: ports already in use, skipping probe
>       ide8: I/O resource 0x0-0x7 not free.
>       ide8: ports already in use, skipping probe
>       ide9: I/O resource 0x0-0x7 not free.
>       ide9: ports already in use, skipping probe
> 
> and that's just totally bogus. It shouldn't even request that region, 
> since it's not been allocated!

The commit 139ddfcab5 ("ide: move handling of
I/O resources out of ide_probe_port()") changed the ordering of hwif->noprobe
check vs ide_hwif_request_regions() call (so that we now reserve I/O regions
before checking for hwif->noprobe).  However ide-generic host driver depended
on hwif->noprobe to be set for skipping probing of empty ide_hwifs[] slots.

Fix it by passing only indexes of non-empty slots to ide_device_add_all()
from ide_generic_init().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06 02:57:48 +01:00
Paulius Zaleckas efad798b9f Spelling fixes: lenght->length
Signed-off-by: Paulius Zaleckas <pauliusz@yahoo.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
2008-02-03 15:42:53 +02:00
Borislav Petkov d59823fa44 ide-tape: remove idetape_config_t typedef
Since this is used only in idetape_blkdev_ioctl(), remove the typedef and make
the struct function-local.

Bart:
- s/sizeof(struct idetape_config)/sizeof(config)/

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:51 +01:00
Borislav Petkov d99c9da215 ide-tape: remove mtio.h related comments
Those are already in mtio.h.

Bart:
- undo 'unsigned int/unsigned long' -> 'uint/ulong' conversion

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:51 +01:00
Borislav Petkov 419d4741ce ide-tape: make function name more accurate
idetape_active_next_stage() was rather ambiguous wrt its purpose. Make that
more explicit and remove superfluous comment.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:51 +01:00
Borislav Petkov fa36625bf7 ide-tape: remove unused sense packet commands.
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:51 +01:00
Borislav Petkov 860ff5ecbf ide-tape: use generic byteorder macros
This is not a network driver.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:50 +01:00
Borislav Petkov 4278c2d5ba ide-tape: remove EXPERIMENTAL driver status
ide-tape has depended on EXPERIMENTAL for ages. Change that since the driver is
being only maintained now.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:50 +01:00
Borislav Petkov 90699ce2b2 ide-tape: use generic scsi commands
Also, remove those which weren't used.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:50 +01:00
Borislav Petkov f011889d1d ide-tape: remove struct idetape_block_size_page_t
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:50 +01:00
Borislav Petkov 323875549f ide-tape: remove structs os_partition_t, os_dat_entry_t, os_dat_t
They seem just to sit there completely unused.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:50 +01:00
Borislav Petkov 3cffb9ce47 ide-tape: remove struct idetape_parameter_block_descriptor_t
Also, shorten function name idetape_get_blocksize_from_block_descriptor() and
move its definition up thereby getting rid of its forward declaration.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:50 +01:00
Borislav Petkov 496b92e65d ide-tape: remove struct idetape_medium_partition_page_t
There should be no functional changes resulting from this patch.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:49 +01:00