Commit Graph

690 Commits (55b951e7e6b9f983286c40925e340124d79bb0f7)

Author SHA1 Message Date
Bartlomiej Zolnierkiewicz 807b90d0be ide: add IDE_HFLAG_NO_{IO32_BIT,UNMASK_IRQS} host flags
* Use the same bit for IDE_HFLAG_CS5520 and IDE_HFLAG_VDMA host flags
  (both are used only by cs5520 host driver currently).

* Add IDE_HFLAG_NO_IO32_BIT host flag and use it instead of ->no_io_32bit
  ide_hwif_t field.

* Add IDE_HFLAG_NO_UNMASK_IRQS host flag, then convert dtc2278 and rz1000
  host drivers to use it.

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:40 +01:00
Bartlomiej Zolnierkiewicz 909f4369bc ide: fix ide_unregister() usage in host drivers
bast-ide.c/ide-cs.c/delkin_cb.c:

* Don't set 'restore' flag for ide_unregister() when initializing new
  interface.

rapide.c/ide-pnp.c/ide-cs.c/ide_platform.c/au1xxx-ide.c/delkin_cb.c/scc_pata.c:

* Don't set 'init_default' and 'restore' flags for ide_unregister() when
  removing interface.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:39 +01:00
Bartlomiej Zolnierkiewicz 9e016a7192 ide: add ide_deprecated_find_port() helper
* Factor out code for finding ide_hwifs[] slot from ide_register_hw()
  to ide_deprecated_find_port().

* Convert bast-ide, ide-cs and delkin_cb host drivers 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).

This patch leaves us with only two ide_register_hw() users:
- drivers/macintosh/mediabay.c
- drivers/ide/ide.c

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:39 +01:00
Bartlomiej Zolnierkiewicz f82c2b1719 ide: add 'init_default' and 'restore' arguments to ide_unregister()
* Add 'init_default' (flag for calling init_hwif_default()) and 'restore'
  (flag for calling ide_hwif_restore()) arguments to ide_unregister().

* Update ide_unregister() users to set 'init_default' and 'restore' flags.

* No need to set 'init_default' flag in ide_register_hw() if the setup done
  by init_hwif_default() is going to be overridden by ide_init_port_hw().

* No need to set 'init_default' and 'restore' flags in cleanup_module().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:39 +01:00
Alan Cox 1bee4d1dce pdc202xx_old: remove surplus initialiser
Bart:
- drive-by CodingStyle fixups

Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:38 +01:00
Bartlomiej Zolnierkiewicz 78829dd922 ide: remove needless includes from PCI host drivers
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:33 +01:00
Bartlomiej Zolnierkiewicz bfa14b42a3 ide: add ->cable_detect method to ide_hwif_t
* Add ->cable_detect method to ide_hwif_t.

* Call the new method in ide_init_port() if:
  - the host supports UDMA modes > UDMA2 ('hwif->ultra_mask & 78')
  - DMA initialization was successful (if hwif->dma_base is not set
    ide_init_port() sets hwif->ultra_mask to zero)
  - "idex=ata66" is not used ('hwif->cbl != ATA_CBL_PATA40_SHORT')

* Convert PCI host drivers to use ->cable_detect method.

While at it:

* Factor out cable detection to separate functions (if not already done).

* hpt366.c/it8213.c/slc90e66.c:
  - don't check cable type if "idex=ata66" is used

* pdc202xx_new.c:
  - add __devinit tag to pdcnew_cable_detect()

* pdc202xx_old.c:
  - rename pdc202xx_old_cable_detect() to pdc2026x_old_cable_detect()
  - add __devinit tag to pdc2026x_old_cable_detect()

Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:31 +01:00
Bartlomiej Zolnierkiewicz c413b9b94d ide: add struct ide_port_info instances to legacy host drivers
* Remove 'struct pci_dev *dev' argument from ide_hwif_setup_dma().

* Un-static ide_hwif_setup_dma() and add CONFIG_BLK_DEV_IDEDMA_PCI=n version.

* Add 'const struct ide_port_info *d' argument to ide_device_add[_all]().

* Factor out generic ports init from ide_pci_setup_ports() to ide_init_port(),
  move it to ide-probe.c and call it in in ide_device_add_all() instead of
  ide_pci_setup_ports().

* Move ->mate setup to ide_device_add_all() from ide_port_init().

* Add IDE_HFLAG_NO_AUTOTUNE host flag for host drivers that don't enable
  ->autotune currently.

* Setup hwif->chipset in ide_init_port() but iff pi->chipset is set
  (to not override setup done by ide_hwif_configure()).

* Add ETRAX host handling to ide_device_add_all().

* cmd640.c: set IDE_HFLAG_ABUSE_* also for CONFIG_BLK_DEV_CMD640_ENHANCED=n.

* pmac.c: make pmac_ide_setup_dma() return an error value and move DMA masks
  setup to pmac_ide_setup_device().

* Add 'struct ide_port_info' instances to legacy host drivers, pass them to
  ide_device_add() calls and then remove open-coded ports initialization.

Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:31 +01:00
Bartlomiej Zolnierkiewicz b4d1c73dcd atiixp/cs5535/scc_pata: fix "idex=ata66" parameter handling
Don't override the cable type if the "idex=ata66" parameter was used.

While at it:

* atiixp.c: factor out cable detection to atiixp_cable_detect() from
  init_hwif_atiixp().

* cs5535.c: pass 'ide_hwif_t *hwif' instead of 'struct pci_dev *dev' to
  cs5535_cable_detect().

* scc_pata.c: factor out cable detection to scc_cable_detect() from
  init_hwif_scc() and remove incorrect comment.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:29 +01:00
Linus Torvalds 215e871aaa Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6: (64 commits)
  PCI: make pci_bus a struct device
  PCI: fix codingstyle issues in include/linux/pci.h
  PCI: fix codingstyle issues in drivers/pci/pci.h
  PCI: PCIE ASPM support
  PCI: Fix fakephp deadlock
  PCI: modify SB700 SATA MSI quirk
  PCI: Run ACPI _OSC method on root bridges only
  PCI ACPI: AER driver should only register PCIe devices with _OSC
  PCI ACPI: Added a function to register _OSC with only PCIe devices.
  PCI: constify function pointer tables
  PCI: Convert drivers/pci/proc.c to use unlocked_ioctl
  pciehp: block new requests from the device before power off
  pciehp: workaround against Bad DLLP during power off
  pciehp: wait for 1000ms before LED operation after power off
  PCI: Remove pci_enable_device_bars() from documentation
  PCI: Remove pci_enable_device_bars()
  PCI: Remove users of pci_enable_device_bars()
  PCI: Add pci_enable_device_{io,mem} intefaces
  PCI: avoid save the same type of cap multiple times
  PCI: correctly initialize a structure for pcie_save_pcix_state()
  ...
2008-02-02 14:29:33 +11:00
Benjamin Herrenschmidt 0948391641 PCI: Remove users of pci_enable_device_bars()
This patch converts users of pci_enable_device_bars() to the new
pci_enable_device_{io,mem} interface.

The new API fits nicely, except maybe for the QLA case where a bit of
code re-organization might be a good idea but I prefer sticking to the
simple patch as I don't have hardware to test on.

I'll also need some feedback on the cs5520 change.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:27 -08:00
Bartlomiej Zolnierkiewicz 9d501529b6 ide: make probe_hwif() return an error value
Make probe_hwif() return an error value.

While at it:

* Remove comment about MAX_DRIVES == 2 limitation (it is not special to
  probe_hwif(), it is a general assumption taken by a lot of IDE code).

* Rename probe_hwif() to ide_probe_port().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01 23:09:36 +01:00
Bartlomiej Zolnierkiewicz 58f189fccc ide: delete filenames/versions from comments
Delete filenames/versions from comments.

I'm leaving decisions about adding DRV_VERSION defines and MODULE_VERSION()-s
to maintainers of the respective drivers.

While at it:

* Remove unused VERSION define from ide.c.

* Remove unused/stale DRV_VERSION define from au1xxx-ide.c.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01 23:09:33 +01:00
Bartlomiej Zolnierkiewicz 36501650ec ide: keep pointer to struct device instead of struct pci_dev in ide_hwif_t
Keep pointer to struct device instead of struct pci_dev in ide_hwif_t.

While on it:
* Use *dev->dma_mask instead of pci_dev->dma_mask in ide_toggle_bounce().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01 23:09:31 +01:00
Bartlomiej Zolnierkiewicz f6fb786d6d ide: use ide_destroy_dmatable() instead of pci_unmap_sg() (take 2)
Use ide_destroy_dmatable() in:
* ide-dma.c::ide_build_dmatable()
* sgiioc4.c::sgiioc4_build_dma_table()
* pmac.c::pmac_ide_{build,destroy}_dmatable()

There should be no functionality changes caused by this patch.

v2:
* pmac.c build fix from Andrew Morton.

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01 23:09:31 +01:00
Bartlomiej Zolnierkiewicz 2be564b034 piix: remove stale comments
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01 23:09:30 +01:00
Bartlomiej Zolnierkiewicz 4166c1993b ide: add IDE_HFLAG_NO_DSC host flag
* Add IDE_HFLAG_NO_DSC host flag for hosts that doesn't support DSC overlap.

* Set it in aec62xx (for ATP850UF only) and hpt34x host drivers.

* Convert ide-tape device driver to check for IDE_HFLAG_NO_DSC flag.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01 23:09:30 +01:00
Bartlomiej Zolnierkiewicz 8ac2b42a45 ide: add IDE_HFLAG_CLEAR_SIMPLEX host flag
* Rename 'simplex_stat' variable to 'dma_stat' in ide_get_or_set_dma_base().

* Factor out code for forcing host out of "simplex" mode from
  ide_get_or_set_dma_base() to ide_pci_clear_simplex() helper.

* Add IDE_HFLAG_CLEAR_SIMPLEX host flag and set it in alim15x3 (for M5229),
  amd74xx (for AMD 7409), cmd64x (for CMD643), generic (for Netcell) and
  serverworks (for CSB5) host drivers.

* Make ide_get_or_set_dma_base() test for IDE_HFLAG_CLEAR_SIMPLEX host flag
  instead of checking dev->device (BTW the code was buggy because it didn't
  check for dev->vendor, luckily none of these PCI Device IDs was used by
  some other vendor for PCI IDE controller).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01 23:09:30 +01:00
Bartlomiej Zolnierkiewicz 993da8f9ea amd74xx: remove amd_ide_chips table
* Remove no longer needed assertion from amd74xx_probe().

* Factor out cable detection for AMD7409 to amd7409_cable_detect() and for
  chipsets >= AMD7411 to amd7411_cable_detect().

* Use dev->vendor and dev->device instead of amd_config->udma_mask when
  selecting cable detection method and checking for broken FIFO support in
  init_chipset_amd74xx().

* Remove no longer needed AMD_BAD_FIFO define.

* Add 'swdma' parameter for setting .swdma_mask to DECLARE_AMD_DEV() macro.

* Add 'udma' parameter for setting .udma_mask to DECLARE_{AMD,NV}_DEV() macro.

* Keep a copy of a current amd74xx_chipsets[] entry in amd74xx_probe()
  in order to fix ->swdma_mask on early AMD7409 revisions and ->udma_mask
  on Serenade mainboards.

* Remove no longer needed fixups from init_chipset_amd74xx()
  and AMD_CHECK_{SWDMA,SERENADE} defines.

* Move printing banner message from init_chipset_amd74xx() to amd74xx_probe(),
  also remove incorrect comment while at it.

* Use hwif->ultra_mask instead of amd_config->udma_mask in amd_set_drive().

* Add 'udma_mask' argument to amd_set_speed() and pass UDMA mask from
  amd_set_drive() instead of using amd_config->udma_mask.

* Move amd_config->base from AMD_* defines to users of these defines and add
  0x40 the defined values.  Then add amd_offset() inline helper for selecting
  offset from 0x40 base (needed for nVidia controllers) and finally use it in
  amd_set_speed(), amd7411_cable_detect() and init_chipset_amd74xx() instead
  of amd_config->base.

* Remove no longer needed AMD_BAD_SWDMA define, ->{swdma,ultra}_mask setup
  from init_hwif_amd74xx(), amd_{config,chipset} variables and amd_ide_chips
  table.

* Fix init_chipset_amd74xx() comment.

* Bump driver version.

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01 23:09:30 +01:00
Sergei Shtylyov ecf3279639 ide: ide_setup_dma() assumes 8 ports
According to http://marc.info/?l=linux-ide&m=114346138611631, the drivers must
always register 8 DMA ports with ide_setup_dma(), so its last argument is not
needed. While at it, kill some useless parens in that function...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01 23:09:30 +01:00
Sergei Shtylyov 4e5a68aeb6 trm290: cannot call ide_setup_dma()
The TRM-290 chip is *not* SFF-8038i compatible and therefore can *not* call
ide_setup_dma() -- fix this and also cleanup the code a bit...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01 23:09:29 +01:00
Bartlomiej Zolnierkiewicz 63c4467805 cmd64x: remove /proc/ide/cmd64x
This belongs to user-space (and only if really needed).

   text    data     bss     dec     hex filename
   3874     180      28    4082     ff2 drivers/ide/pci/cmd64x.o.before
   2231     180       0    2411     96b drivers/ide/pci/cmd64x.o.after

Additionaly to being bloat the code reported incorrect UDMA modes for
the reserved values of UDIDETCR0/1 registers.

Also while at it remove unused CNTRL_DIS_RA0/1 defines.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-26 20:13:09 +01:00
Bartlomiej Zolnierkiewicz ade2daf9c6 ide: make remaining built-in only IDE host drivers modular (take 2)
* Make remaining built-in only IDE host drivers modular, add ide-scan-pci.c
  file for probing PCI host drivers registered with IDE core (special case
  for built-in IDE and CONFIG_IDEPCI_PCIBUS_ORDER=y) and then take care of
  the ordering in which all IDE host drivers are probed when IDE is built-in
  during link time.

* Move probing of gayle, falconide, macide, q40ide and buddha (m68k arch
  specific) host drivers, before PCI ones (no PCI on m68k), ide-cris (cris
  arch specific), cmd640 (x86 arch specific) and pmac (ppc arch specific).

* Move probing of ide-cris (cris arch specific) host driver before cmd640
  (x86 arch specific).

* Move probing of mpc8xx (ppc specific) host driver before ide-pnp (depends
  on ISA and none of ppc platform that use mpc8xx supports ISA) and ide-h8300
  (h8300 arch specific).

* Add "probe_vlb" kernel parameter to cmd640 host driver and update
  Documentation/ide.txt accordingly.

* Make IDE_ARM config option visible so it can also be disabled if needed.

* Remove bogus comment from ide.c while at it.

v2:
* Fix two issues spotted by Sergei:
  - replace ENOMEM error value by ENOENT in ide-h8300 host driver
  - fix MODULE_PARM_DESC() in cmd640 host driver

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-26 20:13:07 +01:00
Bartlomiej Zolnierkiewicz 8ac4ce742c ide: fix host drivers depending on ide_generic to probe for interfaces (take 2)
* Add mpc8xx_ide_probe() to mpc8xx.c and call it from probe_for_hwifs().

* Convert ide_arm, ide-cris, ide-h8300, ide-pnp, buddha, falconide, gayle,
  macide, q40ide, cmd640 and mpc8xx host drivers to use ide_device_add().

  This removes dependency on ide_generic for these drivers so update
  ide/Kconfig accordingly.

v2:
* ide_arm build fix (s/ide_device_idx/ide_device_add/)
  (Thanks to Christoph Lameter <clameter@sgi.com> for reporting the problem).

Cc: Mikael Starvik <starvik@axis.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-26 20:13:06 +01:00
Bartlomiej Zolnierkiewicz cbb010c180 ide: drop 'initializing' argument from ide_register_hw()
* Rename init_hwif_data() to ide_init_port_data() and export it.

* For all users of ide_register_hw() with 'initializing' argument set
  hwif->present and hwif->hold are always zero so convert these host
  drivers to use ide_find_port()+ide_init_port_data()+ide_init_port_hw()
  instead (also no need for init_hwif_default() call since the setup
  done by it gets over-ridden by ide_init_port_hw() call).

* Drop 'initializing' argument from ide_register_hw().

Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-26 20:13:06 +01:00
Bartlomiej Zolnierkiewicz 57c802e84f ide: add ide_init_port_hw() helper
* Add ide_init_port_hw() helper.

* rapide.c: convert rapide_locate_hwif() to rapide_setup_ports()
  and use ide_init_port_hw().

* ide_platform.c: convert plat_ide_locate_hwif() to plat_ide_setup_ports()
  and use ide_init_port_hw().

* sgiioc4.c: use ide_init_port_hw().

* pmac.c: add 'hw_regs_t *hw' argument to pmac_ide_setup_device(),
  setup 'hw' in pmac_ide_{macio,pci}_attach() and use ide_init_port_hw()
  in pmac_ide_setup_device().

This patch is a preparation for the future changes in the IDE probing code.

There should be no functionality changes caused by this patch.

Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: Jeremy Higdon <jeremy@sgi.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-26 20:13:05 +01:00
Bartlomiej Zolnierkiewicz 8f8e8483f6 sgiioc4: always init hwif->io_ports
'if (hwif->io_ports[IDE_DATA_OFFSET] != cmd_base)' is always true.

Cc: Jeremy Higdon <jeremy@sgi.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-26 20:13:05 +01:00
Bartlomiej Zolnierkiewicz f01393e48c ide: merge ->fixup and ->quirkproc methods
* Assign drive->quirk_list in ->quirkproc implementations:
  - hpt366.c::hpt3xx_quirkproc()
  - pdc202xx_new.c::pdcnew_quirkproc()
  - pdc202xx_old.c::pdc202xx_quirkproc()

* Make ->quirkproc void.

* Move calling ->quirkproc from do_identify() to probe_hwif().

* Convert it821x_fixups() to it821x_quirkproc() in it821x.c.

* Convert siimage_fixup() to sil_quirkproc() in siimage.c, also remove
  no longer needed drive->present check from is_dev_seagate_sata().

* Convert ide_undecoded_slave() to accept 'drive' instead of 'hwif'
  as an argument.  Then convert ide_register_hw() to accept 'quirkproc'
  argument instead of 'fixup' one.

* Remove no longer needed ->fixup method.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-26 20:13:03 +01:00
Bartlomiej Zolnierkiewicz 15ce926ada ide: merge ->dma_host_{on,off} methods into ->dma_host_set method
Merge ->dma_host_{on,off} methods into ->dma_host_set method
which takes 'int on' argument.

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-01-26 20:13:03 +01:00
Bartlomiej Zolnierkiewicz f37aaf9ede ide: move drive->using_dma check to callers of ->dma_host_on method
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-26 20:13:02 +01:00
Bartlomiej Zolnierkiewicz 8ae60e34dd atiixp: remove ->dma_host_on and ->dma_host_off methods
* Enable/disable UDMA in atiixp_set_dma_mode().

* Remove no longer needed atiixp_dma_host_{on,off}() and save_mdma_mode[].

* Bump driver version.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-26 20:13:02 +01:00
Bartlomiej Zolnierkiewicz 4a546e046d ide: remove ->ide_dma_on and ->dma_off_quietly methods from ide_hwif_t
* Make ide_dma_off_quietly() and __ide_dma_on() always available.

* Drop "__" prefix from __ide_dma_on().

* Check for presence of ->dma_host_on instead of ->ide_dma_on.

* Convert all users of ->ide_dma_on and ->dma_off_quietly methods
  to use ide_dma_on() and ide_dma_off_quietly() instead.

* Remove no longer needed ->ide_dma_on and ->dma_off_quietly methods
  from ide_hwif_t.

* Make ide_dma_on() void.

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-01-26 20:13:01 +01:00
Bartlomiej Zolnierkiewicz e5efba3328 sgiioc4: add ide_toggle_bounce() calls
Add ide_toggle_bounce() call to ->ide_dma_on/->dma_off_quietly
methods so they match generic __ide_dma_on()/ide_dma_off_quietly().

Tested on Altix by Jeremy.

Acked-by: Jeremy Higdon <jeremy@sgi.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-26 20:13:00 +01:00
Bartlomiej Zolnierkiewicz 8704de8f29 cy82c693: add ->set_dma_mode method
* Fix SWDMA/MWDMA masks in cy82c693_chipset.

* Add IDE_HFLAG_CY82C693 host flag and use it in ide_tune_dma() to
  check whether the DMA should be enabled even if ide_max_dma_mode()
  fails.

* Convert cy82c693_dma_enable() to become cy82c693_set_dma_mode()
  and remove no longer needed cy82c693_ide_dma_on().  Then set
  IDE_HFLAG_CY82C693 instead of IDE_HFLAG_TRUST_BIOS_FOR_DMA in
  cy82c693_chipset.

* Bump driver version.

As a result of this patch cy82c693 driver will configure and use DMA on
all SWDMA0-2 and MWDMA0-2 capable ATA devices instead of relying on BIOS.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-26 20:13:00 +01:00
Bartlomiej Zolnierkiewicz a530201afe cy82c693: correct DMA modes clipping
* Mask device DMA masks by ATA_{S,M}WDMA2 in cy82c693_ide_dma_on().

* Remove clipping of DMA modes by id->tDMA in cy82c693_dma_enable():
  - id->tDMA may not be defined on newer devices
  - id->vendor6/id->tDMA word is in LE endianness
    (cy82c693 seems to be Alpha specific though)

* Bump driver version.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-26 20:13:00 +01:00
Bartlomiej Zolnierkiewicz aea5d37560 ide: (hopefully) fix VDMA for CS5520
* Set the correct hwif->dma_base for the second channel in
  ide_get_or_set_dma_base().

* Remove DMA enable code from cs5520_set_pio_mode(), this can
  be handled by the generic ->dma_host_on method now.

* Add VDMA check to ide_config_drive_speed().

* drive->using_dma was never enabled since cs5520 host driver's
  ->ide_dma_on method overrided the generic ->ide_dma_on (so
  __ide_dma_on() was never called, drive->using_dma was never set
  and VDMA was never used since it depends on drive->using_dma).

  Fix it by using ->dma_host_on method instead of ->ide_dma_on
  (also add matching ->dma_host_off method).

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-26 20:12:59 +01:00
Bartlomiej Zolnierkiewicz 7b971df185 serverworks: cleanup ->set_dma_mode method
IDE core guarantees that ->set_dma_mode will be called only
for DMA modes set in SWDMA/MWDMA/UDMA masks.

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-01-26 20:12:59 +01:00
Bartlomiej Zolnierkiewicz 08590556d6 sl82c105: remove no longer needed ->selectproc method
* Program register 0x40 in sl82c105_resetproc().

* Remove no longer needed sl82c105_selectproc() and pci_set_drvdata() calls.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-26 20:12:59 +01:00
Bartlomiej Zolnierkiewicz 6ae8b1efcc sl82c105: program DMA/PIO timings in ->dma_start/->ide_dma_end
* Program DMA timings in sl82c105_dma_start() (->dma_start method)
  before starting DMA transfer.

* Add sl82c105_dma_end() (->ide_dma_end method) to switch back to
  PIO timings when DMA transfer is complete.

* In sl82c105_set_pio_mode() program timings regardless of ->using_dma
  setting and in sl82c105_set_dma_mode() only cache the new timings.

* Remove no longer needed sl82c105_{ide_dma_on,off_quietly}().

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-26 20:12:58 +01:00
Bartlomiej Zolnierkiewicz 4eed504d14 sc1200: move DMA timings to timing tables
Based on pata_sc1200.c.

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-01-25 22:17:18 +01:00
Bartlomiej Zolnierkiewicz 4db90a1452 ide: add IDE_HFLAG_ABUSE_SET_DMA_MODE host flag
* Add IDE_HFLAG_ABUSE_SET_DMA_MODE host flag and use it to decide
  what to do with transfer modes < XFER_PIO_0 in ide_set_xfer_rate().

* Set IDE_HFLAG_ABUSE_SET_DMA_MODE in host drivers that need it
  (aec62xx, amd74xx, cs5520, cs5535, hpt34x, hpt366, pdc202xx_old,
  serverworks, tc86c001 and via82cxxx) and cleanup ->set_dma_mode
  methods in host drivers that don't (IDE core code guarantees that
  ->set_dma_mode will be called only for modes which are present
  in SWDMA/MWDMA/UDMA masks).

While at it:

* Add IDE_HFLAGS_HPT34X/HPT3XX/PDC202XX/SVWKS define in
  hpt34x/hpt366/pdc202xx_old/serverworks host driver.

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-01-25 22:17:18 +01:00
Bartlomiej Zolnierkiewicz 428c6440ef sis5513: factor out UDMA programming code
* Factor out UDMA programming code from sis_set_dma_mode() to per
  chipset family helpers: sis_{ata33,ata133}_program_udma_timings().

* Add sis_program_udma_timings() helper.

* Remove unneeded casts to 'unsigned long'.

* Minor cleanups.

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-01-25 22:17:18 +01:00
Bartlomiej Zolnierkiewicz ad4ba7dcef pdc202xx_new: move PIO programming code to pdcnew_set_pio_mode()
* Move PIO programming code from pdcnew_set_mode() to pdcnew_set_pio_mode().

* Rename pdcnew_set_mode() to pdcnew_set_dma_mode().

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-01-25 22:17:18 +01:00
Bartlomiej Zolnierkiewicz 7c0e26661d sc1200: remove pointless hwif lookup loop
Save PCI regs values for both IDE ports in one buffer, in order to eliminate
a needless and ugly loop across all hwifs, searching for our PCI device.

Partially based on the previous patch by Jeff Garzik.

Cc: Jeff Garzik <jeff@garzik.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-25 22:17:14 +01:00
Bartlomiej Zolnierkiewicz 7299a39184 ide: remove hwif->intrproc
Given that:

* hpt366.c::hpt3xx_intrproc() is the only user of hwif->intrproc

* hpt366.c::hpt3xx_quirkproc() sets drive->quirk_list to 1 for quirky drives
  which is a value unique to hpt366 host driver

we can remove hwif->intproc and just check for drive->quirk_list == 1
in ide_do_request().

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-25 22:17:14 +01:00
Bartlomiej Zolnierkiewicz 1c029fd658 ide: remove ->dma_master field from ide_hwif_t (take 5)
* Convert cmd64x, hpt366 and pdc202xx_old host drivers to use
  pci_resource_start(hwif->pci_dev, 4) instead of hwif->dma_master.

* Remove no longer needed ->dma_master field from ide_hwif_t.

v2:
* Use the more readable 'hwif->dma_base - (hwif->channel * 8)' instead of
  pci_resource_start(hwif->pci_dev, 4).

v3:
* Use hwif->extra_base in hpt366/pdc20xx_old + some cosmetic fixups over v2
  (suggested by Sergei).

v4:
* Correct offsets in hpt3xxn_set_clock().

v5:
* Use hwif->extra_base in hpt366 for _real_ this time. (Noticed by Sergei)

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-25 22:17:05 +01:00
Sergei Shtylyov 866664d79f hpt366: merge set_dma_mode() methods
Group the array of pointers to the timing tables with the timing register masks
which allows us to merge HPT36x/HPT37x set_dma_mode() methods into one.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-25 22:17:05 +01:00
Sergei Shtylyov a488f34e0d hpt366: kill set_dma_mode() method wrapper
There's no reason to keep the set_dma_mode() method wrapper for two different
chip families, so get rid of it...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-25 22:17:05 +01:00
Sergei Shtylyov ceb1b2c583 hpt366: change timing register masks
Since PIO autotuning is now done always, there's no need anymore to program
the taskfile timings also on DMA modes, so change the IDE timing register
masks accordingly, "inverting the polarity" of the masks while at it...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-25 22:17:04 +01:00
Sergei Shtylyov 93c0b56080 trm290: do hook dma_host_{on,off} methods (take 2)
Using default methods caused the chip's DMA PRD count registers, inadvertently
starting DMA!  While fixing it, also do:

- get rid of the 'ide_' prefixes in several functions for which the prefix in
  the method's name has been 'ide_' ectomized already;

- align the code hooking the IDE DMA methods in init_hwif_trm290()...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-01-10 23:03:42 +01:00
Bartlomiej Zolnierkiewicz deffca117b cmd64x: fix hwif->chipset setup
commit 528a572dae ("ide: add ->chipset field
to ide_pci_device_t") broke hwif->chipset setup (it is now set to ide_cmd646
for CMD648 instead of CMD646).  It seems that the breakage happend while
I was moving patches around (cmd64x_chipsets[] entries for CMD646 and CMD648
are identical except for 'name' field).  Fix it and bump driver version.

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-12-24 15:23:44 +01:00
Joe Perches a1c6d28c2b drivers/ide/: Spelling fixes
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-12-24 15:23:42 +01:00
Sergei Shtylyov 809b53c4ef hpt366: fix HPT37x PIO mode timings (take 2)
After looking into the HPT370 manual (now that I have it) and re-checking all
the timing tables, here's what I have discovered:

- at 33 MHz clock, PIO mode 0 timings turned to be overclocked, and all other
  PIO modes underclocked;

- at 50 MHz clock, PIO modes 0 to 2 turned to be overclocked;

- at 66 MHz clock, PIO mode 0 was overclocked too.

Finally, the taskfile timing (matching PIO mode 0) turned to be overclocked at
all clock frequencies (and in all manuals)...

The new timings have been tested on HPT370 chip (at 33 MHz PCI clock) and on
HPT371N chip (at both 50 and 66 MHz DPLL clock).

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-12-12 23:31:58 +01:00
Bartlomiej Zolnierkiewicz eadb6ecf76 pdc202xx_new: fix Promise TX4 support
In case of Promise TX4 the first PCI device is located at slot 1
and the second one is at slot 2 so the offset used by pci_get_slot()
should be "+1" and not "+2".

Thanks goes out to Markus Dietz for bugreport and testing this patch.

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-12-12 23:31:58 +01:00
Bartlomiej Zolnierkiewicz 8a82387cd2 trm290: remove bogus init_hwif_trm290() comment
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-11-27 21:35:56 +01:00
Bartlomiej Zolnierkiewicz dd0fd40d54 piix: add HP compaq laptop to short cable list
Port of Jeff's libata commit 54174db300
("[libata] ata_piix: add HP compaq laptop to short cable list").

Cc: Jeff Garzik <jeff@garzik.org>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-11-27 21:35:56 +01:00
Bartlomiej Zolnierkiewicz d151456a71 alim15x3: add Mitac 8317 and derivatives to ali_cable_override()
Port of Alan's patch for pata_ali.c.

Cc: Alan Cox <alan@redhat.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-11-27 21:35:56 +01:00
Aleksandar Radovanovic b48d08177f aec62xx: Fix kernel oops in driver's probe function
Add pci_enable_device() to aec62xx probe function
before doing any I/O.

Original probe function tries to read from device's
PCI region 4 before calling ide_setup_pci_device().
Since the device is not enabled at this point,
on machines that have no firmware PCI initialization
(e.g. ASUS WL-700gE router), corresponding PCI BAR 
is 0 and the following inb() causes a kernel oops.

Signed-off-by: Aleksandar Radovanovic <biblbroks@sezampro.yu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-11-27 21:35:53 +01:00
Sergei Shtylyov 8ac98ce17c siimage: remove resetproc() method
The intent behind siimage_reset() was probably to hard reset the interface and
the SATA PHY but as the code writes to two reserved bits instead, it obviously
has been ineffective from the start. So, just remove it.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-11-27 21:35:53 +01:00
Gabriel Craciunescu a1d85864d3 sis5513.c: Add Packard Bell EasyNote K5305 to laptops
With newer kernels HDD in my old laptop is limited to UDMA 33.
With this patch I get UDMA 100 again.

Signed-off-by: Gabriel Craciunescu <nix.or.die@googlemail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-11-27 21:35:52 +01:00
Bartlomiej Zolnierkiewicz 24ffbd6258 it821x/jmicron: fix return value of {it821x,jmicron}_init_one()
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-11-13 22:09:16 +01:00
Bartlomiej Zolnierkiewicz 34c69b601b ide: don't BUG() on unsupported transfer modes
Fix ide-cris, cs5530, sc1200 and sis5513 host drivers to just return instead
of OOPS-ing for unsupported modes in ->set_dma_mode methods.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-11-13 22:09:15 +01:00
Sergei Shtylyov 6183289cd4 cmd64x: don't clear the other channel's interrupt
Make sure to not clear the other IDE channel's interrupt when clearing an IDE
interrupt via the MRDMODE register.

Thanks to Bart for finding a coding mistake.

Bart:

This fixes regression from commit 66602c83dc
("cmd64x: use interrupt status from MRDMODE register (take 2)").

Extra thanks to Martin for reporting and bisecting the issue.

From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Tested-by: Martin Rogge <marogge@onlinehome.de>
Tested-by: Milan Kocian <milon@wq.cz>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-11-13 22:09:14 +01:00
sebdeg@ngi.it afda5e4da5 piix: add support for ICH7 on Acer 5602aWLMi
In piix.c (and in ata_piix.c) are already included some patches to skip the
cable check on some laptops and to enable UDMA > 33 modes, but I've noticed
than theese doesn't work on my Acer Aspire 5602WLMi (maybe exist more
versions of this laptop).  With this simple patch I can set transfer mode
to UDMA100.

From: "sebdeg@ngi.it" <sebdeg@ngi.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-11-05 21:42:25 +01:00
Jeff Garzik 9d43481364 drivers/ide/pci/sc1200.c: fix suspend/resume buglets and warnings
* We shouldn't bother with dev->current_state, the PCI API functions we
  call manage this for us (and do a far better job at it too).

* Remove pci_set_power_state(dev, PCI_D0) call in resume, as
  pci_enable_device() does the same thing.

* Check pci_enable_device() return value.  If it failed, fail
  the entire resume and avoid programming timings into the [potentially
  dead/asleep] chip.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-26 20:31:15 +02:00
Bartlomiej Zolnierkiewicz d5271be6b5 drivers/ide/pci/generic: fix build for CONFIG_HOTPLUG=n
It turns out that const and __{dev}initdata cannot be mixed currently
and that generic IDE PCI host driver is also affected by the same issue:

On Thursday 25 October 2007, Ralf Baechle wrote:
>   CC      drivers/ide/pci/generic.o
> drivers/ide/pci/generic.c:52: error: __setup_str_ide_generic_all_on causes a
> +section type conflict

[ Also reported by Martijn Uffing <mp3project@sarijopen.student.utwente.nl>. ]

This patch workarounds the problem in a bit hackish way but without
removing const from generic_chipsets[] (it adds const to __setup() so
__setup_str_ide_generic_all becomes const).

Now all __{dev}initdata data in generic IDE PCI host driver are read-only
so it builds again (driver's .init.data section gets marked as READONLY).

Cc: Martijn Uffing <mp3project@sarijopen.student.utwente.nl>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-26 20:31:15 +02:00
Bartlomiej Zolnierkiewicz 282037f17f hpt366: fix build for CONFIG_HOTPLUG=n
On Saturday 20 October 2007, Avuton Olrich wrote:

> My randconfig script the attached config caught an error on:
> drivers/ide/pci/cy82c693.c:439: error: primary causes a section type conflict
>
> My git tree: c00046c279
>
> Bisected to:
> 8562043606 is first bad commit
> commit 8562043606
> Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Date:   Sat Oct 20 00:32:34 2007 +0200
>
>     ide: constify struct ide_port_info
>
>     Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

It turns out that const and __{dev}initdata cannot be mixed currently
and that hpt366 host driver is also affected by the same issue:

> drivers/ide/pci/hpt366.c:1428: error: hpt366_chipsets causes a section type
> conflict

This patch workarounds the problem by making static struct hpt_info instances
const.  Now all __devinitdata data in hpt366 host driver are read-only so it
builds again (driver's .init.data section gets marked as READONLY).

While at it:

* Bump driver version.

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: "Avuton Olrich" <avuton@gmail.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-26 20:31:15 +02:00
Bartlomiej Zolnierkiewicz f32d26ae26 cy82c693: fix build for CONFIG_HOTPLUG=n
On Saturday 20 October 2007, Avuton Olrich wrote:

> My randconfig script the attached config caught an error on:
> drivers/ide/pci/cy82c693.c:439: error: primary causes a section type conflict
>
> My git tree: c00046c279
>
> Bisected to:
> 8562043606 is first bad commit
> commit 8562043606
> Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Date:   Sat Oct 20 00:32:34 2007 +0200
>
>     ide: constify struct ide_port_info
>
>     Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

It turns out that const and __{dev}initdata cannot be mixed currently.

This patch workarounds the problem by removing __devinitdata tag from 'primary'
variable (which makes 'primary' to be moved from .init.data to .bss section).
Now all __devinitdata data in cy82c693 host driver are read-only so it builds
again (driver's .init.data section gets marked as READONLY).

While at it:

* Move 'primary' variable to its only user, init_iops_cy82c693().

* Bump driver version.

Cc: "Avuton Olrich" <avuton@gmail.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-26 20:31:15 +02:00
Linus Torvalds c00046c279 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial
* git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: (74 commits)
  fix do_sys_open() prototype
  sysfs: trivial: fix sysfs_create_file kerneldoc spelling mistake
  Documentation: Fix typo in SubmitChecklist.
  Typo: depricated -> deprecated
  Add missing profile=kvm option to Documentation/kernel-parameters.txt
  fix typo about TBI in e1000 comment
  proc.txt: Add /proc/stat field
  small documentation fixes
  Fix compiler warning in smount example program from sharedsubtree.txt
  docs/sysfs: add missing word to sysfs attribute explanation
  documentation/ext3: grammar fixes
  Documentation/java.txt: typo and grammar fixes
  Documentation/filesystems/vfs.txt: typo fix
  include/asm-*/system.h: remove unused set_rmb(), set_wmb() macros
  trivial copy_data_pages() tidy up
  Fix typo in arch/x86/kernel/tsc_32.c
  file link fix for Pegasus USB net driver help
  remove unused return within void return function
  Typo fixes retrun -> return
  x86 hpet.h: remove broken links
  ...
2007-10-19 20:36:17 -07:00
Bartlomiej Zolnierkiewicz ae6855c0d5 cs5530: remove needless ide_lock taking
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:36 +02:00
Bartlomiej Zolnierkiewicz d393aa0326 ide: take ide_lock for prefetch disable/enable in do_special()
Take ide_lock for prefetch disable/enable in do_special(),
then cleanup cmd640 and ht6560b host drivers.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:36 +02:00
Bartlomiej Zolnierkiewicz 5bbcf9242d cmd640: fix deadlock on error handling
Stop abusing ide_lock lock (switch to a private locking).

Fixes same issue as fixed by Alan Cox in atiixp host driver with
commit 6c5f8cc33e.

cmd640 is a bit special cause we still need to leave ide_lock for
->set_pio_mode with 'pio' argument == 8/9 (prefetch disable/enable).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:35 +02:00
Bartlomiej Zolnierkiewicz a482958bf6 slc90e66: fix deadlock on error handling
* Stop abusing ide_lock lock (switch to a private locking).

  Fixes same issue as fixed by Alan Cox in atiixp host driver with
  commit 6c5f8cc33e.

* Bump driver version.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:35 +02:00
Bartlomiej Zolnierkiewicz e65dde715c opti621: fix deadlock on error handling
* Stop abusing ide_lock lock (switch to a private locking).

  Fixes same issue as fixed by Alan Cox in atiixp host driver with
  commit 6c5f8cc33e.

* Bump driver version.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:35 +02:00
Bartlomiej Zolnierkiewicz 8562043606 ide: constify struct ide_port_info
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:34 +02:00
Bartlomiej Zolnierkiewicz 039788e153 ide: replace ide_pci_device_t by struct ide_port_info
* Rename struct ide_pci_device_s to struct ide_port_info.

* Remove ide_pci_device_t typedef.

While at it:

* Fix __ide_pci_register_driver() comment.

* Fix aec62xx_init_one() comment.

* Remove unused 'cds' field from ide_hwgroup_t.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:34 +02:00
Bartlomiej Zolnierkiewicz 6157332eda via82cxxx: keep local ide_pci_device_t copy
* Keep local ide_pci_device_t copy in via_init_one().

* Adjust ide_pci_device_t copy according to id->driver_data in via_init_one()
  and remove no longer needed second via82cxxx_chipsets[] entry.

* via82cxxx_chipsets[] -> via82cxxx_chipset.

* Remove IDE_HFLAGS_VIA define.

* Bump driver version.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:33 +02:00
Bartlomiej Zolnierkiewicz 9239b33393 ide: remove write-only hwif->hw
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:33 +02:00
Bartlomiej Zolnierkiewicz 8447d9d52a ide: add ide_device_add()
* Add ide_device_add() helper and convert host drivers to use it
  instead of open-coded variants.

* Make ide_pci_setup_ports() and do_ide_setup_pci_device()
  take 'u8 *idx' argument instead of 'ata_index_t *index'.

* Remove no longer needed ata_index_t.

* Unexport probe_hwif_init() and make it static.

* Unexport ide_proc_register_port().

There should be no functionality changes caused by this patch
(sgiioc4.c: ide_proc_register_port() requires hwif->present
 to be set and it won't be set if probe_hwif_init() fails).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:31 +02:00
Bartlomiej Zolnierkiewicz fd9bb53942 ide: add ->fixup method to ide_hwif_t
* Add ->fixup method to ide_hwif_t.

* Set hwif->fixup in ide_pci_setup_ports() to d->fixup.

* Use hwif->fixup in probe_hwif().

* Use probe_hwif_init() instead of probe_hwif_init_with_fixup() in
  ide_setup_pci_device().

* Add 'fixup' argument to ide_register_hw() and use it to set hwif->fixup,
  update all ide_register_hw() users accordingly.

* Convert ide-cs/delkin_cb host drivers to use ide_register_hw().

* Restore hwif->fixup in ide_hwif_restore().

* Remove ide_register_hw_with_fixup(), probe_hwif_init_with_fixup()
  and 'fixup' argument from probe_hwif().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:31 +02:00
Bartlomiej Zolnierkiewicz 438c470261 siimage: separate PATA and SATA methods
* Split off sil_sata_udma_filter() from sil_udma_filter()
  and rename sil_udma_filter() to sil_pata_udma_filter().

* Rename siimage_busproc() to sil_sata_busproc().

* Rename siimage_reset_poll() to sil_sata_reset_poll()
  and in init_hwif_siimage() set ->reset_poll method only
  for SATA controllers.

* Rename siimage_pre_reset() to sil_sata_pre_reset(),
  in init_hwif_siimage() set ->pre_reset method only for
  SATA controllers and remove redundant is_sata() call.

* Add CONFIG_BLK_DEV_IDE_SATA #ifdef/#endif to pdev_is_sata()
  so compiler will know to throw out unused SATA code for
  CONFIG_BLK_DEV_IDE_SATA=n case (830 bytes saved on x86-32).

* Bump driver version.

Some minor cleanups while at it:

* Convert sil_{pata,sata}_udma_filter() to use ATA_UDMA* defines.

* In siimage_mmio_ide_dma_test_irq() move 'base' variable
  under 'if (SATA_ERROR_REG)' block.

* Simplify sil_sata_reset_poll() a bit.

* Cache is_sata() result in init_hwif_siimage() 

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:31 +02:00
Bartlomiej Zolnierkiewicz b1e0386543 aec62xx: remove aec62xx_dma_lost_irq()
* Remove aec62xx_dma_lost_irq() (generic ide_dma_lost_irq() will be used now).

* Bump driver version.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:31 +02:00
Bartlomiej Zolnierkiewicz 283283070f alim15x3: use ->host_flags and ->udma_mask fields from ide_pci_device_t
* Make a local copy of ali15x3_chipset in alim15x3_init_one() and set
  ->host_flags / ->udma_mask according to the controller capabilities.

* Cleanup init_hwif_common_ali15x3().

* Bump driver version.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:30 +02:00
Bartlomiej Zolnierkiewicz cad221aa82 alim15x3: fix CD_ROM DMA and PIO FIFO settings setup
* Setup CD_ROM DMA and PIO FIFO settings in init_chipset_ali15x3() instead
  of ata66_ali15x3().  The latter is called from init_hwif_common_ali15x3()
  only if DMA base exists (which insists m5529_revision > 0x20).

  This changes makes CD_ROM DMA / PIO FIFO bits being set only once
  and also when "idex=ata66" kernel parameter is used.

* While at it move also chip_is_1543c_e setup from ata66_ali15x3() to
  init_chipset_ali15x3() and check if isa_dev exists before accessing it.

* Bump driver version.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:30 +02:00
Bartlomiej Zolnierkiewicz caea7602f3 ide: add IDE_HFLAG_{IO_32BIT,UNMASK_IRQS} host flags
Add IDE_HFLAG_{IO_32BIT,UNMASK_IRQS} host flag to tell ide_pci_setup_ports()
to set drive->{io_32bit,unmask} for both drives on the interface.  Convert
amd74xx, sl82c105 and via82cxxx host drivers to use these new host flags.

While at it:

* Add IDE_HFLAGS_AMD define (amd74xx host driver).

* Add IDE_HFLAGS_VIA define (via82cxxx host driver).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:30 +02:00
Bartlomiej Zolnierkiewicz 272a370900 ide: add IDE_HFLAG_RQSIZE_256 host flag
Add IDE_HFLAG_RQSIZE_256 host flag to tell ide_pci_setup_ports() to set
hwif->rqsize to 256 sectors.  Convert pdc202xx_old host driver to use it.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:30 +02:00
Bartlomiej Zolnierkiewicz 8acf28c090 ide: add IDE_HFLAG_FORCE_LEGACY_IRQS host flag
Add IDE_HFLAG_FORCE_LEGACY_IRQS host flag to tell ide_pci_setup_ports()
to always set hwif->irq to legacy IRQ 14/15 and convert generic IDE PCI
and via82cxxx host drivers to use it.

While at it:

* Add IDE_HFLAGS_UMC define (generic IDE PCI host driver).

* Remove no longer needed init_hwif_generic() (generic IDE PCI host driver).

* Set d->udma_mask instead of hwif->ultra_mask (via82cxxx host driver).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:30 +02:00
Bartlomiej Zolnierkiewicz 528a572dae ide: add ->chipset field to ide_pci_device_t
Add ->chipset field to ide_pci_device_t and use it in ide_hwif_configure()
to set hwif->chipset.  Convert cmd64x, cy82c693, rz1000 and trm290 host
drivers to use this new ability.

While at it define hwif_chipset_t as u8 to save some space in hw_regs_t,
ide_hwif_t and ide_pci_device_t instances.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:30 +02:00
Bartlomiej Zolnierkiewicz b515da89c6 serverworks: remove dead code from svwks_set_dma_mode()
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:29 +02:00
Bartlomiej Zolnierkiewicz 746f312a56 rz1000: set serialized flag only if mate interface exists
Setting hwif->serialized makes sense only if the mate interface exists.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:29 +02:00
Bartlomiej Zolnierkiewicz e9a0765eac cmd64x: always set hwif->chipset for CMD646
hwif->chipset should be set to ide_cmd646 also when DMA base is invalid.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:29 +02:00
Adrian Bunk 3dfd6433ff ide/pci/sis5513.c: add missing "else"
This patch adds a missing "else" that was missing in
commit c77a89cd98.

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>,
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-20 00:32:29 +02:00
Robert P. J. Day 3a4fa0a25d Fix misspellings of "system", "controller", "interrupt" and "necessary".
Fix the various misspellings of "system", controller", "interrupt" and
"[un]necessary".

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
2007-10-19 23:10:43 +02:00
Bartlomiej Zolnierkiewicz 85ad93ad56 ide: set drive->autotune in ide_pci_setup_ports()
Majority of host drivers using IDE PCI layer set drive->autotune, the only
exceptions are:

generic.c
ns87415.c
rz1000.c
trm290.c
* no ->set_pio_mode method

it821x.c:
* if memory allocation fails drive->autotune won't be set
  (but there also won't be ->set_pio_mode method in such case)

piix.c:
* MPIIX controller (no ->init_hwif method so also no ->set_pio_mode method)

However if there is no ->set_pio_mode method there are no changes in behavior
w.r.t. PIO tuning so always set drive->autotune in ide_pci_setup_ports().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:12 +02:00
Bartlomiej Zolnierkiewicz d7c526f7db triflex: always tune PIO
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:11 +02:00
Bartlomiej Zolnierkiewicz 912fb29a36 opti621: always tune PIO
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:11 +02:00
Bartlomiej Zolnierkiewicz af1b3d5c51 cy82c693: always tune PIO
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:11 +02:00
Bartlomiej Zolnierkiewicz f0bb945c9d cs5520: always tune PIO
Since cs5520 uses VDMA best PIO mode was tuned anyway by ide_dma_check()
but only if DMA was successfully initialized.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:11 +02:00
Bartlomiej Zolnierkiewicz 93c6807985 alim15x3: always tune PIO
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:11 +02:00
Bartlomiej Zolnierkiewicz 3985ee3b4c ide: add IDE_HFLAG_LEGACY_IRQS host flag
Add IDE_HFLAG_LEGACY_IRQS host flag to tell ide_pci_setup_ports() to set
hwif->irq to legacy IRQ 14/15 (iff hwif->irq is not already set) and convert
atiixp, piix, serverworks, sis5513 and slc90e66 host drivers to use it.

While at it:

* In piix.c add IDE_HFLAGS_PIIX define and don't use ->init_hwif for MPIIX.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:11 +02:00
Bartlomiej Zolnierkiewicz 1c51361a98 ide: add IDE_HFLAG_SERIALIZE host flag
Add IDE_HFLAG_SERIALIZE host flag to tell ide_pci_setup_ports() to set
hwif/mate->serialized and convert aec62xx, cs5530 and sc1200 host drivers
to use it.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:10 +02:00
Bartlomiej Zolnierkiewicz ed67b92385 ide: add IDE_HFLAG_ERROR_STOPS_FIFO host flag
Add IDE_HFLAG_ERROR_STOPS_FIFO host flag and use it instead
of hwif->err_stops_fifo.  As a side-effect this change fixes
hwif->err_stops_fifo not being restored by ide_hwif_restore().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:10 +02:00
Bartlomiej Zolnierkiewicz 40d2dd7ef3 piix: add DECLARE_ICH_DEV() macro
Add DECLARE_ICH_DEV() macro.

While at it:

* Add init_hwif_ich() (->init_hwif method) for ICH controllers.

* Rename init_chipset_piix() to init_chipset_ich() and use it only for
  ICH controllers.

* Remove no longer needed piix_is_ichx() helper.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:10 +02:00
Bartlomiej Zolnierkiewicz 5ef8cb5d92 pdc202xx_old: add DECLARE_PDC2026X_DEV() macro
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:10 +02:00
Bartlomiej Zolnierkiewicz 05d7e6cbcd pdc202xx_new: add DECLARE_PDCNEW_DEV() macro
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:10 +02:00
Bartlomiej Zolnierkiewicz 6a7f62af60 aec62xx: no need to disable UDMA in ->init_hwif method for ATP850UF
* No need to disable UDMA in ->init_hwif method for ATP850UF (and since we
  now always tune PIO it will be disabled by ->set_pio_mode calls anyway).

* Bump driver version.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:10 +02:00
Bartlomiej Zolnierkiewicz 7ed5829758 serverworks: remove ->init_setup
Merge init_setup_{svwks,csb6}() into svwks_init_one().

While at it:

* Remove redundant dev->device checks.

* Operate on a local copy of serverworks_chipsets[] entry.

* Use pci_resource_start().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:09 +02:00
Bartlomiej Zolnierkiewicz aaf707f061 scc_pata: remove ->init_setup
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:09 +02:00
Bartlomiej Zolnierkiewicz 97f84baa03 pdc202xx_old: remove ->init_setup
* Split off pdc202ata4_fixup_irq() helper from init_setup_pdc202ata4().

* Merge init_setup_{pdc202ata4,pdc20265,pdc202xx}() into pdc202xx_init_one().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:09 +02:00
Bartlomiej Zolnierkiewicz 099b1f42ab pdc202xx_new: remove ->init_setup
* Split off pdc20270_get_dev2() helper from init_setup_pdc20270().

* Merge init_setup_{pdcnew,pdc20270,pdc20276}() into pdc202new_init_one().

While at it:

* Change KERN_ level of interrupt fixup message from KERN_WARNING to KERN_INFO.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:09 +02:00
Bartlomiej Zolnierkiewicz fbf47840fe hpt366: remove ->init_setup
* Split off hpt{374,371,366}_init() helper from init_setup_hpt{374,371,366}().

* Merge init_setup_{374,372n,371,372a,302,366}() into hpt366_init_one().

While at it:

* Use "HPT36x" name for HPT366/HPT368 chipsets.

* Add .chip_name to struct hpt_info and use it to set set d->name.

* Convert .max_ultra in struct hpt_info to .udma_mask and use it to set
  d->udma_mask.

* Fix hpt302 to use HPT302_ALLOW_ATA133_6 define.

* Change HPT366/HPT374 interrupt fixup message from KERN_WARNING to KERN_INFO.

* Use the second hpt366_chipsets[] entry for HPT37x chipsets using HPT36x PCI
  device ID and fix .enablebits/.host_flags for HPT36x hpt366_chipsets[] entry.

* Bump driver version.

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:09 +02:00
Bartlomiej Zolnierkiewicz bfd314a304 cmd64x: remove ->init_setup
Merge init_setup_{cmd64x,cmd646}() into cmd64x_init_one().

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:09 +02:00
Bartlomiej Zolnierkiewicz df95f5ab58 aec62xx: remove ->init_setup
Merge init_setup_{aec62xx,aec6x80}() into aec62xx_init_one().

While at it:

* Use id->driver_data instead of dev->device.

* Use ATA_UDMA6 define.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:08 +02:00
Bartlomiej Zolnierkiewicz 31e8a465a2 ide: use I/O ops directly part #2 (take 2)
v2:
- bump host driver versions (as suggested by Sergei)
- use I/O ops directly in drivers/ide/setup-pci.c

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:08 +02:00
Bartlomiej Zolnierkiewicz fc212bb1fb ide: use pci_dev->revision
Some places were using PCI_CLASS_REVISION instead of PCI_REVISION_ID so
they were not converted by commit 44c10138fd.

Cc: Auke Kok <auke-jan.h.kok@intel.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:08 +02:00
Auke Kok 1afa655492 cmd64x: Use dev->revision
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:08 +02:00
Auke Kok a84f3eeddf amd74xx: Omit PCI_REVISION_ID read
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:07 +02:00
Bartlomiej Zolnierkiewicz 5f8b6c3485 ide: add ->mwdma_mask and ->swdma_mask to ide_pci_device_t (take 2)
* Add ->mwdma_mask and ->swdma_mask to ide_pci_device_t.

* Set ide_hwif_t DMA masks using DMA masks from ide_pci_device_t in
  setup-pci.c::ide_pci_setup_ports() (iff DMA base is valid and ->init_hwif
  method may still override them).

* Convert IDE PCI host drivers to use ide_pci_device_t DMA masks.

While at it:

* Use ATA_{UDMA,MWDMA,SWDMA}* defines.

* hpt34x.c: add separate ide_pci_device_t instances for HPT343 and HPT345.

* serverworks.c: fix DMA masks being set before checking DMA base.

v2:
* Add missing masks to DECLARE_GENERIC_PCI_DEV() macro.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:07 +02:00
Bartlomiej Zolnierkiewicz 9adf768a39 pdc202xx_old: remove broken SWDMA support
Documentation doesn't mention SWDMA and moreover all timings used
for SWDMA modes were over-clocked when compared to ATA spec.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:07 +02:00
Bartlomiej Zolnierkiewicz 238e4f142c ide: add IDE_HFLAG_NO_LBA48 and IDE_HFLAG_NO_LBA48_DMA host flags
Add IDE_HFLAG_NO_LBA48[_DMA] host flags, use it instead of hwif->no_lba48[_dma]
and then remove no longer needed hwif->no_lba48[_dma].  As a side-effect
this change fixes hwif->no_lba48_dma not being restored by ide_hwif_restore().

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:07 +02:00
Bartlomiej Zolnierkiewicz 9ffcf364f9 ide: remove ->init_setup_dma from ide_pci_device_t (take 2)
* Make ide_pci_device_t.host_flags u32 and add IDE_HFLAG_CS5520 host flag.

* Pass ide_pci_device_t *d to setup-pci.c::ide_get_or_set_dma_base()
  and use d->name instead of hwif->cds->name.

* Set IDE_HFLAG_CS5520 host flag in cs5520 host driver and use it in
  ide_get_or_set_dma_base() to find out which PCI BAR to use, remove no longer
  needed cs5520.c::cs5520_init_setup_dma() and ide_pci_device_t.init_setup_dma.

  This fixes PCI bus-mastering not being checked for CS5510/CS5520 hosts.

v2:
* It is wrong to check simplex bits on CS5510/CS5520 as v1 did.
  (Noticed by Alan).

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:07 +02:00
Bartlomiej Zolnierkiewicz 47b687882c ide: add IDE_HFLAG_NO_{DMA,AUTODMA} host flags
Add IDE_HFLAG_NO_{DMA,AUTODMA} host flags.  Convert all host drivers using
ide_pci_device_t to use these flags instead of d->autodma and then remove no
longer needed d->autodma.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:06 +02:00
Bartlomiej Zolnierkiewicz 7cab14a799 ide: add IDE_HFLAG_BOOTABLE host flag
Add IDE_HFLAG_BOOTABLE host flag and IDE_HFLAG_OFF_BOARD define.  Convert
all host drivers using ide_pci_device_t to use IDE_HFLAG_{BOOTABLE,OFF_BOARD}
instead of d->bootable and then remove no longer needed d->bootable.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:06 +02:00
Bartlomiej Zolnierkiewicz 33c1002ed9 ide: add IDE_HFLAG_NO_ATAPI_DMA host flag
Add IDE_HFLAG_NO_ATAPI_DMA host flag and set it in host drivers which
don't support ATAPI DMA.  Then remove no longer needed hwif->atapi_dma.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:06 +02:00
Bartlomiej Zolnierkiewicz 1c3dd326ad ide: add DECLARE_GENERIC_PCI_DEV() macro to generic IDE PCI host driver
* Add DECLARE_GENERIC_PCI_DEV() macro to generic IDE PCI host driver
  and use it to cleanup generic_chipsets[].

* Remove dead/obsolete code while at it.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:06 +02:00
Bartlomiej Zolnierkiewicz af4c90f4c2 siimage: bump driver version
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:05 +02:00
Benjamin Herrenschmidt 15d8061bf0 ide: Fix cs5535 driver accessing beyond array boundary
The cs5535 uses an incorrect construct to access the other drive of a pair,
causing it to access beyond an array boundary on the secondary interface.

This fixes it by using the new ide_get_paired_drive() helper instead.

Bart: patch description fixes

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Andrew Morton <akpm@osdl.org>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:05 +02:00
Benjamin Herrenschmidt a87a87ccdc ide: Fix siimage driver accessing beyond array boundary
The siimage uses an incorrect construct to access the other drive of a pair,
causing it to access beyond an array boundary on the secondary interface.

This fixes it by using the new ide_get_paired_drive() helper instead.

Bart: patch description fixes

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Andrew Morton <akpm@osdl.org>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-19 00:30:05 +02:00
Bartlomiej Zolnierkiewicz b02fcae007 amd74xx: remove /proc/ide/amd74xx
This belongs to user-space (and only if really needed).

   text    data     bss     dec     hex filename
   6723    2000      28    8751    222f drivers/ide/pci/amd74xx.o.before
   3833    2000      16    5849    16d9 drivers/ide/pci/amd74xx.o.after

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:58 +02:00
Bartlomiej Zolnierkiewicz 8fcb2ea822 amd74xx/via82cxxx: don't initialize drive->dn
drive->dn is initialized by ide-probe.c::probe_hwif() so no need to do it
in ->init_hwif method.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:58 +02:00
Bartlomiej Zolnierkiewicz a718122ce8 sis5513: remove /proc/ide/sis
This belongs to user-space (and only if really needed).

   text    data     bss     dec     hex filename
   7129     404       8    7541    1d75 drivers/ide/pci/sis5513.o.before
   3916     404       1    4321    10e1 drivers/ide/pci/sis5513.o.after

Additionaly to being bloat the code contained two bugs:
- wrong cable bit was checked (0x0001 instead of 0x8000) on ATA_133 chipsets
- incorrect UDMA cycle time was reported on ATA_100a/ATA_133 chipsets

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:58 +02:00
Bartlomiej Zolnierkiewicz 9ff6f72f43 ide: remove hwif->autodma and drive->autodma
* hpt34x.c: disable DMA masks for HPT345
  (hwif->autodma is zero so DMA won't be enabled anyway).

* trm290.c: disable IDE_HFLAG_TRUST_BIOS_FOR_DMA flag
  (hwif->autodma is zero so DMA won't be enabled anyway).

* Check noautodma global variable instead of drive->autodma in ide_tune_dma().

  This fixes handling of "ide=nodma" kernel parameter for icside, ide-cris,
  au1xxx-ide, pmac, it821x, jmicron, sgiioc4 and siimage host drivers.

* Remove hwif->autodma (it was not checked by IDE core code anyway) and
  drive->autodma (was set by all host drivers - except HPT345/TRM290 special
  cases - unless "ide=nodma" was used).

While at it:
- remove needless printk() from icside.c
- remove stale FIXME/comment from ide-probe.c
- don't force DMA off if PCI bus-mastering had to be enabled in setup-pci.c
  (this setting was always later over-ridden by host drivers anyway)

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:58 +02:00
Bartlomiej Zolnierkiewicz 9cbcc5e3c5 ide: use PCI_VDEVICE() macro
While at it:
- make struct pci_device_id tables const
- use PCI_DEVICE_ID_ITE_8213 define in it8213.c
- fix comment in generic.c

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:56 +02:00
Bartlomiej Zolnierkiewicz d83fca58d3 sis5513: clear prefetch and postwrite for ATAPI devices
Clear prefetch and postwrite for ATAPI devices instead of depending on BIOS.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:56 +02:00
Bartlomiej Zolnierkiewicz 1c54a93d4d it8213/piix/slc90e66: "de-couple" PIO and UDMA modes
Don't force PIO4 when programming UDMA mode (suggested by Sergei).

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:56 +02:00
Bartlomiej Zolnierkiewicz 0ae2e17865 ide: remove ->ide_dma_check (take 2)
* Add IDE_HFLAG_TRUST_BIOS_FOR_DMA host flag for host drivers that depend
  on BIOS for programming device/controller for DMA.  Set it in cy82c693,
  generic, ns87415, opti621 and trm290 host drivers.

* Add IDE_HFLAG_VDMA host flag for host drivers using VDMA.  Set it in cs5520
  host driver.

* Teach ide_tune_dma() about IDE_HFLAG_TRUST_BIOS_FOR_DMA flag.

* Add generic ide_dma_check() helper and remove all open coded ->ide_dma_check
  implementations.  Fix all places checking for presence of ->ide_dma_check
  hook to check for ->ide_dma_on instead.

* Remove no longer needed code from config_drive_for_dma().

* Make ide_tune_dma() static.

v2:
* Fix config_drive_for_dma() return values.

* Fix ide-dma.c build for CONFIG_BLK_DEV_IDEDMA_PCI=n by adding
  dummy config_drive_for_dma() inline.

* Fix IDE_HFLAG_TRUST_BIOS_FOR_DMA handling in ide_dma_check().

* Fix init_hwif_it8213() comment.

There should be no functionality changes caused by this patch.

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:55 +02:00
Bartlomiej Zolnierkiewicz d6ae3adb2e sl82c105: add PIO autotune fallback to ->ide_dma_check
Since sl82c105 re-programs DMA/PIO timings for DMA enable/disable, and sets
->autotune this change shouldn't have any other effect than bringing sl82c105
driver in-line with other host drivers wrt ->ide_dma_check implementation.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:54 +02:00
Bartlomiej Zolnierkiewicz 3f019eea9c cs5530/sc1200: add PIO autotune fallback to ->ide_dma_check
* Add PIO autotune fallback to ->ide_dma_check.

  Since cs5530/sc1200 allow separate PIO and DMA timings, and cs5530/sc1200
  always set ->autotune this change shouldn't have any other effect than
  bringing these drivers in-line with other host drivers wrt ->ide_dma_check
  implementations.

* Fix ->ide_dma_check to return "-1" if DMA cannot be set.

* Bump driver version.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:54 +02:00
Bartlomiej Zolnierkiewicz 65c9cd23ca ide: remove ide_use_fast_pio()
Remove ide_use_fast_pio() and just re-tune PIO unconditionally if DMA tuning
has failed in ->ide_dma_check.  All host drivers using ide_use_fast_pio() set
drive->autotune so PIO is always tuned anyway and in some cases we _really_
need to re-tune PIO because PIO and DMA timings are shared.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:54 +02:00
Bartlomiej Zolnierkiewicz d3b90baf09 ide: remove drive->init_speed zeroing
Several host drivers used to reset drive->init_speed in their ->ide_dma_check
implementations which resulted in incorrect init speed being reported to the
user, fix it.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:54 +02:00
Bartlomiej Zolnierkiewicz 8c91abf862 it8213/piix/slc90e66: remove {it8213,piix,slc90e66}_dma_2_pio()
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:54 +02:00
Bartlomiej Zolnierkiewicz 94c7fa0fcc atiixp: DMA setup fixes
* Fix handling of unsupported/invalid modes in atiixp_set_dma_mode().

* ATI controllers allow separate PIO and DMA timings so remove programming
  of PIO modes from atiixp_set_dma_mode().  Also remove no longer needed
  atiixp_dma_2_pio() helper.

* SWDMA timings are not programmed by atiixp_set_dma_mode() and if SWDMA
  mode is chosen atiixp_dma_host_on() erroneously enables UDMA, just disable
  support for SWDMA modes for now.

* Enable support for MWDMA0 mode.

* Bump driver version.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:53 +02:00
Bartlomiej Zolnierkiewicz cb824c32f1 sc1200: always tune PIO
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:53 +02:00
Bartlomiej Zolnierkiewicz 93104654c4 cs5530: always tune PIO
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:53 +02:00
Bartlomiej Zolnierkiewicz a7b888b2f1 slc90e66: always tune PIO
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:53 +02:00
Bartlomiej Zolnierkiewicz bc46b17d23 aec62xx: always tune PIO
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:53 +02:00
Bartlomiej Zolnierkiewicz 4960ab7c81 sis5513: always tune PIO
* Always set ->autotune in init_hwif_sis5513(), this means practically
  no change in behavior since PIO was always tuned in ->ide_dma_check
  and >autotune was always set for ->dma_base == 0 case.

* Bump driver version.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:53 +02:00
Bartlomiej Zolnierkiewicz c77a89cd98 sis5513: DMA setup fixes
* Add sis_ata133_get_base() helper function for obtaining the address of
  the drive control registers on chipset_family == ATA_133 chipsets.

* Add three helper functions for programming PIO/MWDMA timings:
  - sis_ata16_program_timings()  (for ATA_16/33/66/100a chipset families)
  - sis_ata100_program_timings() (for ATA_100/133a chipset families)
  - sis_ata133_program_timings() (for ATA_133 chipset family)

  MWDMA timings are taken from datasheets and they match ATA spec.

* Add generic helper function sis_program_timings() and use it in
  ->set_pio_mode and ->set_dma_mode methods (previously the driver
  depended on BIOS to program the correct MWDMA timings).

* Remove redundant !chipset_family check from init_hwif_sis5513()
  (init_chipset_sis5513() guarantees that we will never get here if
   chipset_family cannot be determined).

* SWDMA seems to be unsupported by SiS chipsets (no info about SWDMA in
  datasheets and for SWDMA0 mode timing requirements are impossible to
  fulfill) so remove ->swdma_mask from init_hwif_sis5513() and handling
  of SWDMA modes from sis_set_dma_mode().

* Enable DMA support for chipset_family == ATA_16.

* Bump driver version.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:52 +02:00
Bartlomiej Zolnierkiewicz a29ec3b219 hpt366: always tune PIO
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:52 +02:00
Tony Battersby 0c824b51b3 ide: fix serverworks.c UDMA regression
The patch described by the following excerpt from ChangeLog-2.6.22 makes
it impossible to use UDMA on a Tyan S2707 motherboard (SvrWks CSB5):

commit 2d5eaa6dd7
Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Date:   Thu May 10 00:01:08 2007 +0200

    ide: rework the code for selecting the best DMA transfer mode (v3)

    ...

This one-line patch against 2.6.23 fixes the problem.

Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-16 22:29:52 +02:00
Jens Axboe 55c16a7004 IDE: sg chaining support
Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-10-16 11:21:00 +02:00
Bartlomiej Zolnierkiewicz 99149a4859 alim15x3: remove redundant m5229_revision check
init_dma_ali15x3() guarantees that hwif->dma_base will never be set for
m5229_revision < 0x20 so remove redundant m5229_revision >= 0x20 check from
init_hwif_common_ali15x3().

While at it remove incorrect comment.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13 17:47:53 +02:00
Bartlomiej Zolnierkiewicz 88ae4d8c38 sc1200: fix ->dma_base equal zero handling
Set hwif->atapi_dma/{ultra,mwdma}_mask and drive->autodma after checking that
->dma_base exists.  If ->dma_base is not set (== PCI BAR4 cannot be reserved)
then DMA hooks shouldn't be initialized or bad things will happen.

OTOH hwif->set_{pio,dma}_mode hooks should be set even if hwif->dma_base == 0.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13 17:47:53 +02:00
Bartlomiej Zolnierkiewicz dfb2311226 cs5520: fix ->dma_base equal zero handling
Set hwif->ide_dma_{check,on} and hwif->autodma to 1 after checking that
->dma_base exists.  If ->dma_base is not set (== PCI BAR4 cannot be reserved)
then DMA hooks shouldn't be initialized or bad things will happen.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13 17:47:52 +02:00
Bartlomiej Zolnierkiewicz b9d9e61abb sgiioc4: add missing ->dma_base check
If ->dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks
shouldn't be initialized or bad things will happen.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13 17:47:52 +02:00
Bartlomiej Zolnierkiewicz 7bda292d12 cs5535: add missing ->dma_base check
If ->dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks
shouldn't be initialized or bad things will happen.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13 17:47:52 +02:00
Bartlomiej Zolnierkiewicz 88b2b32bab ide: move ide_config_drive_speed() calls to upper layers (take 2)
* Convert {ide_hwif_t,ide_pci_device_t}->host_flag to be u16.

* Add IDE_HFLAG_POST_SET_MODE host flag to indicate the need to program 
  the host for the transfer mode after programming the device.  Set it
  in au1xxx-ide, amd74xx, cs5530, cs5535, pdc202xx_new, sc1200, pmac
  and via82cxxx host drivers.

* Add IDE_HFLAG_NO_SET_MODE host flag to indicate the need to completely
  skip programming of host/device for the transfer mode ("smart" hosts).
  Set it in it821x host driver and check it in ide_tune_dma().

* Add ide_set_pio_mode()/ide_set_dma_mode() helpers and convert all
  direct ->set_pio_mode/->speedproc users to use these helpers.

* Move ide_config_drive_speed() calls from ->set_pio_mode/->speedproc
  methods to callers.

* Rename ->speedproc method to ->set_dma_mode, make it void and update
  all implementations accordingly.

* Update ide_set_xfer_rate() comments.

* Unexport ide_config_drive_speed().

v2:
* Fix issues noticed by Sergei:
  - export ide_set_dma_mode() instead of moving ->set_pio_mode abuse wrt
    to setting DMA modes from sc1200_set_pio_mode() to do_special()
  - check IDE_HFLAG_NO_SET_MODE in ide_tune_dma()
  - check for (hwif->set_pio_mode) == NULL in ide_set_pio_mode()
  - check for (hwif->set_dma_mode) == NULL in ide_set_dma_mode()
  - return -1 from ide_set_{pio,dma}_mode() if ->set_{pio,dma}_mode == NULL
  - don't set ->set_{pio,dma}_mode on it821x in "smart" mode
  - fix build problem in pmac.c
  - minor fixes in au1xxx-ide.c/cs5530.c/siimage.c
  - improve patch description

Changes in behavior caused by this patch:
- HDIO_SET_PIO_MODE ioctl would now return -ENOSYS for attempts to change
  PIO mode if it821x controller is in "smart" mode
- removal of two debugging printk-s (from cs5530.c and sc1200.c)
- transfer modes 0x00-0x07 passed from user space may be programmed twice on
  the device (not really an issue since 0x00 is not supported correctly by
  any host driver ATM, 0x01 is not supported at all and 0x02-0x07 are invalid)

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13 17:47:51 +02:00
Bartlomiej Zolnierkiewicz 6e249395ea pdc202xx_new: check ide_config_drive_speed() return value
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13 17:47:51 +02:00
Bartlomiej Zolnierkiewicz 249aa4ff17 cs5535: check ide_config_drive_speed() return value
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13 17:47:51 +02:00
Bartlomiej Zolnierkiewicz 3b4024d429 amd74xx/via82cxxx: check ide_config_drive_speed() return value
* Check ide_config_drive_speed() return value.

* While at also call ide_config_drive_speed() if the transfer mode is
  XFER_PIO_SLOW (this case happens iff the transfer mode has already been
  set on the device by ide-proc.c::set_xfer_rate()) and remove redundant
  setting of ->{init,current}_speed.

* Bump driver version.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13 17:47:51 +02:00
Linus Torvalds 19f71153b9 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (24 commits)
  ide: use only ->set_pio_mode method for programming PIO modes (take 2)
  sis5513: don't change UDMA settings when programming PIO
  it8213/piix/slc90e66: don't change DMA settings when programming PIO
  alim15x3: PIO mode setup fixes
  siimage: fix ->set_pio_mode method to select PIO data transfer
  cs5520: don't enable VDMA in ->speedproc
  sc1200: remove redundant warning message from sc1200_tune_chipset()
  ide-pmac: PIO mode setup fixes (take 3)
  icside: fix ->speedproc to return on unsupported modes (take 5)
  sgiioc4: use ide_tune_dma()
  amd74xx/via82cxxx: use ide_tune_dma()
  ide: add ide_set{_max}_pio() (take 4)
  ide: Kconfig face-lift
  ide: move ide_rate_filter() calls to the upper layer (take 2)
  sis5513: add ->udma_filter method for chipset_family >= ATA_133
  ide: mode limiting fixes for user requested speed changes
  ide: add missing ide_rate_filter() calls to ->speedproc()-s
  ide: call udma_filter() before resorting to the UltraDMA mask
  ide: make jmicron match vendor and device class
  pdc202xx_new: switch to using pci_get_slot() (take 2)
  ...
2007-10-11 19:20:44 -07:00
Bartlomiej Zolnierkiewicz 8f4dd2e426 ide: use only ->set_pio_mode method for programming PIO modes (take 2)
Use ->set_pio_mode method to program PIO modes in ide_set_xfer_rate()
(the only place which used ->speedproc to program PIO modes) and remove
handling of PIO modes from all ->speedproc implementations.

v2:
* Fix pmac_ide_tune_chipset() comment.

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11 23:54:02 +02:00
Bartlomiej Zolnierkiewicz 0d3be723cb sis5513: don't change UDMA settings when programming PIO
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11 23:54:01 +02:00
Bartlomiej Zolnierkiewicz 90986028c9 it8213/piix/slc90e66: don't change DMA settings when programming PIO
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11 23:54:01 +02:00
Bartlomiej Zolnierkiewicz a6fe837ed6 alim15x3: PIO mode setup fixes
* Return failure in ->speedproc method for unsupported/invalid transfer
  modes passed from user-space (fixes theoretical OOPS in ali_tune_pio()
  and/or setting random PIO timings on host controller + disabling UDMA
  bit + setting unsupported/invalid transfer mode on the device).

* Don't disable UDMA bit when programming PIO modes.

* Add FIXME about DMA timings never being set.

* Bump driver version.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11 23:54:01 +02:00
Bartlomiej Zolnierkiewicz ffe5415c3d siimage: fix ->set_pio_mode method to select PIO data transfer
* Remember to select PIO data transfer (with IORDY monitored) in sil_tune_pio()
  (->set_pio_mode method) so the controller is always programmed correctly for
  PIO transfers (this is important if DMA is not going to be used).

* Don't set DMA/UDMA timings for PIO modes in siimage_tune_chipset().

* Bump driver version.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11 23:54:01 +02:00
Bartlomiej Zolnierkiewicz 326d72f437 cs5520: don't enable VDMA in ->speedproc
There is no need to do it in cs5520_tune_chipset() (->speedproc method)
since it is correctly handled by cs5520_dma_on() (->ide_dma_on method).

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11 23:54:01 +02:00
Bartlomiej Zolnierkiewicz fabe151056 sc1200: remove redundant warning message from sc1200_tune_chipset()
ide_config_drive_speed() called by sc1200_set_xfer_mode() already gives
a meaningful warning message in case of failure.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11 23:54:01 +02:00
Bartlomiej Zolnierkiewicz ca1997c1f3 sgiioc4: use ide_tune_dma()
* Add DRV_NAME define and use it instead of sgiioc4_chipset.name.

* Remove no longer needed sgiioc4_chipset.

* Remove needless clearing of ->atapi_dma from ide_dma_sgiioc4().

* Fix ide_dma_sgiioc4() to return success/failure.  Check return value in
  sgiioc4_ide_setup_pci_device() and set hwif->autodma accordingly.  Also add
  missing setting of drive->autodma.

* Add sgiioc4_speedproc() (implementation of ->speedproc method).

* Fix ->mwdma_mask (MWDMA2 mask is 0x04 not 0x02) and remove incorrect
  ->swdma_mask.  Also remove needless initialization of ->ultra_mask.

* Use ide_tune_dma() in sgiioc4_ide_dma_check(), this fixes following bugs:
  - DMA capability bit not being checked on the device
  - DMA blacklist not being checked
  - MWDMA2 mode support by device not being checked

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeremy Higdon <jeremy@sgi.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11 23:54:00 +02:00
Bartlomiej Zolnierkiewicz 55f17e8da1 amd74xx/via82cxxx: use ide_tune_dma()
* Use ide_tune_dma() in amd74xx/via82cxxx driver, this fixes following bugs:
  - DMA capability bit not being checked on the device
  - DMA blacklist not being checked
  - DMA mode being programmed even if drive->autodma == 0
    (thus possibly destroying PIO timings)

* Bump driver version.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11 23:54:00 +02:00
Bartlomiej Zolnierkiewicz 26bcb879c0 ide: add ide_set{_max}_pio() (take 4)
* Add IDE_HFLAG_ABUSE_{PREFETCH,FAST_DEVSEL,DMA_MODES} flags
  and set them in ht6560, cmd640, cmd64x and sc1200 host drivers.

* Add set_pio_mode_abuse() for checking if host driver has a non-standard
  ->tuneproc() implementation and use it in do_special().

* Add ide_set_pio() for setting PIO mode (it uses hwif->pio_mask to find
  the maximum PIO mode supported by the host), also add ide_set_max_pio()
  wrapper for ide_set_pio() to use for auto-tuning.  Convert users of
  ->tuneproc to use ide_set{_max}_pio() where possible.  This leaves only
  do_special(), set_using_pio(), ide_hwif_restore() and ide_set_pio() as
  a direct users of ->tuneproc.

* Remove no longer needed ide_get_best_pio_mode() calls and printk-s
  reporting PIO mode selected from ->tuneproc implementations.

* Rename ->tuneproc hook to ->set_pio_mode and make 'pio' argument const.

* Remove stale comment from ide_config_drive_speed().

v2:
* Fix "ata_" prefix (Noticed by Jeff).

v3:
* Minor cleanups/fixups per Sergei's suggestions.

v4:
* Fix compile problem in drivers/ide/pci/cmd640.c
  (Noticed by Andrew Morton).

* Improve some ->set_pio_mode comments.

Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11 23:54:00 +02:00
Bartlomiej Zolnierkiewicz f212ff28f0 ide: move ide_rate_filter() calls to the upper layer (take 2)
* Move ide_rate_filter() calls from host drivers to IDE core.

* Make ide_rate_filter() static.

* Make 'speed' argument of ->speedproc const.

v2:
* Fix it8213_tune_chipset() comment.

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>
2007-10-11 23:53:59 +02:00
Bartlomiej Zolnierkiewicz 3160d5416f sis5513: add ->udma_filter method for chipset_family >= ATA_133
* Add sis5513_ata133_udma_filter() for chipset_family >= ATA_133,
  use it to filter UDMA6 mode if ATA133 bit is disabled.

* Remove no longer needed UDMA6 limiting logic from sis5513_tune_chipset().

* Bump driver version.

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>
2007-10-11 23:53:59 +02:00
Bartlomiej Zolnierkiewicz 7670df73fb ide: mode limiting fixes for user requested speed changes
* Add an extra argument to ide_max_dma_mode() for passing requested transfer
  mode.  Use it as an upper limit when finding the best DMA for device/host.

* Rename ide_max_dma_mode() to ide_find_dma_mode() and at the same time add
  ide_max_dma_mode() wrapper which passes XFER_UDMA_6 as a requested mode to
  ide_find_dma_mode().  Also add inline ide_find_dma_mode() version for
  CONFIG_BLK_DEV_IDEDMA=n case.

* Pass requested transfer mode from ide_find_dma_mode() to ide_get_mode_mask()
  to avoid false warning from eighty_ninty_three().

* Use ide_find_dma_mode() to limit the user requested transfer mode in
  ide_rate_filter().  Also limit the requested mode by host max PIO mode.


Above changes make ide_rate_filter() to:

* Clip desired transfer mode down if it is invalid (values 0x0F, 0x13-0x19
  and 0x25-0x39, values > 0x46 were already clipped down, same for values
  0x25-0x39 but iff UDMA was not supported by the host).

* Clip desired transfer mode down if it is currently unsupported by IDE core
  (PIO6 and MWDMA3-4, the latter were already clipped down but iff UDMA was
  not supported by the host).

* Clip desired transfer mode down according to the host capabilities
  (UDMA modes were already clipped down but MWDMA/SWDMA/PIO weren't,
  also ->atapi_dma flag was not respected).

* Clip desired transfer mode down according to the device capabilities
  (except PIO modes for now which require mode work) - shouldn't be a
  problem since ide_set_xfer_rate() is called _after_ device has accepted
  given transfer mode.

and also result in a number of host driver specific bugfixes:

* icside
  - clip unsupported PIO5 mode down
  - fix unsupported/invalid modes being set in drive->current_speed

* ide-cris
  - clip unsupported PIO5 and SWDMA0-2 modes down
  - clip DMA modes down for ATAPI devices
  - fix BUG() on unsupported/invalid modes

* au1xxx-ide
  - clip unsupported PIO5, SWDMA0-2 and MWDMA0-2
    (if BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=n) modes down

* aec62xx
  - clip unsupported PIO5 and SWDMA0-2 modes down
  - clip DMA modes down for ATAPI devices
  - fix 0x00 being programmed as PIO timing for unsupported/invalid modes
  - fix unsupported/invalid modes being set on the device

* alim15x3
  - clip DMA modes down for ATAPI devices (chipset revision == 0x20 only)
  - fix theoretical OOPS for 0x0F mode
  - fix unsupported/invalid modes being set on the device

* amd74xx
  - clip unsupported SWDMA0-2 (on COBRA_7401 revs <= 7) modes down
  - fix random PIO timings being set for unsupported/invalid modes
  - fix unsupported/invalid modes being set on the device

* atiixp
  - clip unsupported PIO5 and SWDMA0-2 modes down
  - fix cached MWDMA mode being cleared for unsupported/invalid modes
  - fix PIO{0,2} timings being programmed for unsupported/invalid modes
  - fix theoretical OOPS for PIO5-6 and 0x0F modes
  - fix unsupported/invalid modes being set on the device

* cmd64x
  - clip unsupported SWDMA0-2 modes down

* cs5530
  - clip unsupported PIO5 and SWDMA0-2 modes down
  - fix unsupported/invalid modes being set on the device
  - fix BUG() on unsupported/invalid modes
    (which happened if the device accepted the setting)

* cs5535
  - clip unsupported PIO5 and SWDMA0-2 modes down
  - fix unsupported/invalid modes being set on the device
  - fix theoretical OOPS for PIO5-6 and 0x0F modes

* hpt34x
  - clip DMA modes down for ATAPI devices
  - fix invalid timings being programmed for unsupported/invalid modes
  - fix unsupported/invalid modes being set on the device

* hpt366
  - clip unsupported PIO5 and SWDMA0-2 modes down
  - fix PIO0 timings being programmed for unsupported/invalid modes
  - fix DMA timings being cleared for MWDMA3-4 and 0x25-0x39 modes
  - fix unsupported/invalid modes being set on the device

* it8213
  - clip unsupported PIO5, SWDMA0-1 and MWDMA0 modes down

* it821x
  - clip unsupported PIO5 and SWDMA0-2 modes down
  - clip DMA modes down for ATAPI devices
    (chipset in smart mode and revision 0x10 in pass-through mode)

* jmicron
  - clip unsupported SWDMA0-2 modes down
  - fix unsupported/invalid modes being set on the device

* pdc202xx_new
  - clip unsupported PIO5 and SWDMA0-2 modes down
  - fix unsupported/invalid modes being set on the device

* pdc202xx_old
  - clip unsupported PIO5 mode down
  - fix incorrect timings being set for unsupported/invalid modes
  - fix unsupported/invalid modes being set on the device

* piix
  - clip unsupported PIO5, SWDMA0-1 and MWDMA0 modes down

* sc1200
  - clip unsupported PIO5 and SWDMA0-2 modes down
  - fix unsupported/invalid modes being set on the device
  - fix BUG() on unsupported/invalid modes
    (which happened if the device accepted the setting)

* scc_pata
  - clip unsupported PIO5, SWDMA0-2 and MWDMA0-2 modes down

* serverworks
  - clip unsupported PIO5 and SWDMA0-2 modes down
  - fix DMA/UDMA timings/settings being cleared for unsupported/invalid modes
  - fix unsupported/invalid modes being set on the device

* siimage
  - clip unsupported PIO5 and SWDMA0-2 modes down
  - clip DMA modes down for ATAPI devices (SATA chipsets)

* sis5513
  - clip unsupported PIO5 mode down
  - fix BUG() on unsupported/invalid modes

* sl82c105
  - clip unsupported SWDMA0-2 modes down

* slc90e66
  - clip unsupported PIO5, SWDMA0-1 and MWDMA0 modes down

* tc86c001
  - clip unsupported PIO5 and SWDMA0-2 modes down
  - fix PIO0 timings being programmed for PIO5/0x0F/SWDMA0-2/0x13-0x19 modes
  - fix invalid 0x00 DMA timing being programmed for MWDMA3-4/0x25-0x39 modes
  - fix unsupported/invalid modes being set on the device

* triflex
  - clip unsupported PIO5 mode down

* via82cxxx
  - fix random PIO timings being set for unsupported/invalid modes
  - fix unsupported/invalid modes being set on the device

* pmac
  - clip unsupported PIO5 and SWDMA0-2 modes down

* cmd640/ht6560b
  - clip DMA modes down (if CONFIG_BLK_DEV_IDEDMA=y)
  - fix PIO5 being clipped to PIO4 (if CONFIG_BLK_DEV_IDEDMA=n)

* opti621
  - clip DMA modes down (if CONFIG_BLK_DEV_IDEDMA=y)
  - clip unsupported PIO4 to PIO3 (if CONFIG_BLK_DEV_IDEDMA=n)


While at it:

* Use ide_rate_filter() in cs5520.c::cs5520_tune_chipset().

* Remove no longer needed checks from hpt366.c::hpt3{6,7}x_tune_chipset().

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11 23:53:59 +02:00
Bartlomiej Zolnierkiewicz a8028fcb48 ide: add missing ide_rate_filter() calls to ->speedproc()-s
* Fix icside, cris-ide, au1xxx-ide, amd74xx, via82cxxx and pmac host drivers
  to use ide_rate_filter().

  This results in the following modes (from user requests) being clipped down:
  - invalid modes (values 0x46-0xFF)  [ for all hosts ]
  - unsupported by a host UDMA modes  [ for hosts which support UDMA]
  - all UDMA modes and MWDMA3-4 modes [ for hosts which don't support UDMA ]
  - invalid modes (values 0x25-0x39)  [ for hosts which don't support UDMA ]

* Host driver specific changes in behavior:

  icside:
    - no change

  cris-ide
    - clip unsupported UDMA3-6 modes down
    - fix BUG() on trying to set unsupported UDMA3-6 modes

  au1xxx-ide/pmac
    - clip unsupported UDMA modes down

  amd74xx/via82cxxx
    - clip unsupported UDMA modes down
    - fix random PIO timings being set for unsupported/invalid modes
    - fix unsupported/invalid modes being set on the device

* While at it remove no longer needed checks from pmac.c driver.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11 23:53:59 +02:00
Tejun Heo bda7970c27 ide: make jmicron match vendor and device class
PATA part of all current JMB controllers behave the same way and
JMicron confirms that all future ones will stay compatible.  Matching
vendor and device class is enough.

For backward compatibility, jmicron still needs to match 361,3,5,6,8
DIDs regardless of device class if libata is not configured but won't
need further DID update from this point.

Bart: cosmetic fixes to jmicron_chipset

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Ethan Hsiao <ethanhsiao@jmicron.com>
Cc: Justin Tsai <justin@jmicron.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11 23:53:59 +02:00
Sergei Shtylyov 0704793579 pdc202xx_new: switch to using pci_get_slot() (take 2)
Switch to using pci_get_slot() in init_setup_pdc20270() to get to the mate chip
behind DC21150 bridge as there's no need for the driver itself to walk the list
of the PCI devices (and the driver didn't check the bus # of the found device).
While at it, make it emit warning about IRQ # being fixed up (just like hpt366.c
does) and "beautify" this whole function as well as init_setup_pdc20276()...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11 23:53:58 +02:00
Sergei Shtylyov b4e44369a3 hpt366: MWDMA filter for SATA cards (take 2)
The Marvell bridge chips used on HighPoint SATA cards do not seem to support
the MWDMA modes (at least that could be seen in their so-called drivers :-),
so the driver needs to account for this -- to achieve this:

- add mdma_filter() method from the original patch by Bartlomiej Zolnierkiewicz
  with his consent;

- install the method for all chips to only return empty mask if a SATA drive
  is detected on HPT372{AN]/374 chips...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11 23:53:58 +02:00
Shane Huang 7cfa7168f7 atiixp: SB700 contains more than one IDE channel
SB700 supports one physical IDE channel, but SB700 SATA controller
supports combined mode.  When the SATA combined mode is enabled,
two SATA ports (port4 and port5) share one IDE channel from IDE
controller, and PATA will share the other IDE channel.

Our previous patch adding SB700 IDE device ID only supports one
IDE channel, which contains bug.  The attached patch fixes the bug.

Signed-off-by: "Shane Huang" <Shane.Huang@amd.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-11 23:53:58 +02:00
Jeff Garzik 1855256c49 drivers/firmware: const-ify DMI API and internals
Three main sets of changes:

1) dmi_get_system_info() return value should have been marked const,
   since callers should not be changing that data.

2) const-ify DMI internals, since DMI firmware tables should,
   whenever possible, be marked const to ensure we never ever write to
   that data area.

3) const-ify DMI API, to enable marking tables const where possible
   in low-level drivers.

And if we're really lucky, this might enable some additional
optimizations on the part of the compiler.

The bulk of the changes are #2 and #3, which are interrelated.  #1 could
have been a separate patch, but it was so small compared to the others,
it was easier to roll it into this changeset.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2007-10-09 20:22:20 -04:00
Mikael Pettersson 56fe23d5a7 pdc202xx_new: PLL detection fix
Fix a bitmask typo in the pdc202xx_new PLL frequency detection code
which causes it to truncate an intermediate difference to 26 bits
instead of the correct 30 bits (the PLL's bitwidth).

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-09-11 22:28:37 +02:00
Bartlomiej Zolnierkiewicz 58e47bb176 via82cxxx: add Arima W730-K8 and other rebadgings to short cables list
Port of Alan's patch for pata_via.c.

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-09-11 22:28:37 +02:00
Daniel Exner 03e6f489b3 pata_ali/alim15x3: override 80-wire cable detection for Toshiba S1800-814
Add Toshiba S1800-814 to whitelist for both pata_ali and alim15x3,
as it is correctly detected as 40-wire connected but this cable is
short enough to still use transfer modes higher than UDMA33.

Signed-off-by: Daniel Exner <dex@dragonslave.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-09-11 22:28:36 +02:00
Sergei Shtylyov 2808b0a96a hpt366: UltraDMA filter for SATA cards (take 2)
The Marvell bridge chips used on HighPoint SATA cards do not seem to support
the UltraDMA modes 1, 2, and 3 as well as any MWDMA modes, so the driver needs
to account for this in the udma_filter() method.  In order to achieve that, do
the following changes:

- install the method for all chips, not only HPT36x/370 and improve the code
  formatting by killing the extra tabs while at it;

- add to the end of the 'switch' statement in the method cases for HPT372[AN]
  and HPT374 chips upon which the known SATA cards are based;

- use hwif->ultra_mask as a default mask for the ide_dma_filter() method to
  behave correctly;

- move the HPT370[A] cases below the HPT36x case for consistency.

While at it, replace the explicit UltraDMA mode masks with ATA_UDMA* constants
all over the driver...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Bob Ham <rah@bash.sh>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-09-11 22:28:36 +02:00
Sergei Shtylyov 7293136810 hpt366: fix PCI clock detection for HPT374 (take 4)
HPT374 BIOS seems to only save f_CNT register value for the function #0 before
re-tuning DPLL (that causes the driver to report obviously distorted f_CNT for
the function #1) -- fix this by always reading the saved f_CNT register value
from the function #0 in the driver's init_chipset() method.
While at it, introduce 'chip_type' for holding the 'struct hpt_info' field
of the same name and replace the structure assignment with memcpy()...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-09-11 22:28:35 +02:00
Sergei Shtylyov 35198234a2 pdc202xx_new: fix PCI refcounting
The driver erroneously "lets go" the mate IDE chip in init_setup_pdc20270()
when ide_setup_pci_devices() call succeeds -- fix this, and drop a couple of
useless assignments in this function while at it...

Bart: keep "findev" variable initialization to silence gcc

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-09-11 22:28:34 +02:00
Joseph Chan b311ec4ae8 [libata, IDE] add new VIA bridge to VIA PATA drivers
Signed-off-by: Joseph Chan <josephchan@via.com.tw>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-09-10 22:06:01 -04:00
Bartlomiej Zolnierkiewicz 76e1faa7cf hpt34x: fix CONFIG_HPT34X_AUTODMA=n handling
Programming DMA mode may destroy current PIO mode setting so if
CONFIG_HPT34X_AUTODMA=n (the default case) make ide_tune_dma() fail
early by disabling all host DMA masks and re-tune PIO mode.

This fix doesn't help with the driver being broken but is needed
for some other changes.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-20 22:42:57 +02:00
Bartlomiej Zolnierkiewicz 88b47040f8 triflex: add missing ->dma_base check
If ->dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks
shouldn't be initialized or bad things will happen.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-20 22:42:56 +02:00
Bartlomiej Zolnierkiewicz e98d6e50be pdc202xx_old: add missing ->dma_base check
If ->dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks
shouldn't be initialized or bad things will happen.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-20 22:42:56 +02:00
Bartlomiej Zolnierkiewicz 01cc643ae3 pdc202xx_new: add missing ->dma_base check
If ->dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks
shouldn't be initialized or bad things will happen.

Also this host driver requires valid PCI BAR4 for normal operation so
check it in ->init_chipset and fail initialization if not set.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-20 22:42:56 +02:00
Bartlomiej Zolnierkiewicz f7b0d2df2f cs5530: add missing ->dma_base check
If ->dma_base is not set (== PCI BAR4 cannot be reserved) then DMA hooks
shouldn't be initialized or bad things will happen.

Also this host driver requires valid PCI BAR4 for normal operation so
check it in ->init_chipset and fail initialization if not set.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-20 22:42:56 +02:00
Bartlomiej Zolnierkiewicz 1116fae5fd ide: config_drive_for_dma() fixes
* Add DMA blacklist checking (->ide_dma_on check probably can go now).

* Add ->atapi_dma flag checking and remove no longer needed
  ns87415_ide_dma_check() from ns87415 host driver.

* Remove now needless __ide_dma_check() wrapper and symbol export.

* Check drive->autodma instead of hwif->autodma (there should be no changes in
  behavior as all users of config_drive_for_dma() set both ->autodma flags).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-20 22:42:55 +02:00
Bartlomiej Zolnierkiewicz 3fcece6691 scc_pata: PIO fixes
* Use pio == 255 == "auto-tune" in scc_config_drive_for_dma() instead of
  forcing PIO4 on PIO fallback.  Fix comment while at it.

* Rename scc_tuneproc() to scc_tune_pio() and add scc_tuneproc() wrapper.
  Move finding of the best PIO mode and setting of transfer mode on the device
  to the new wrapper.

* Fix scc_tune_chipset() to tune PIO modes.  Do a small cleanup while at it.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-01 23:46:46 +02:00
Bartlomiej Zolnierkiewicz 0c8de52d76 piix/slc90e66: fix PIO1 handling in ->speedproc method (take 2)
* Don't call {piix,slc90e66}_dma_2_pio() for PIO modes in
  {piix,slc90e66}_tune_chipset().

* Add PIO1 handling to {piix,slc90e66}_tune_chipset().

* Bump driver version.  

v2:
* Remove PIO modes from {piix,slc90e66}_dma_2_pio(), they are no longer needed
  there (Noticed by Sergei)

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-01 23:46:46 +02:00
Bartlomiej Zolnierkiewicz 8b6b33be32 jmicron: PIO fixes
* Set transfer mode on the device in jmicron_tuneproc(),
  also add pio == 255 == "auto-tune" handling.

* Use jmicron_tuneproc() in jmicron_config_drive_for_dma().

* Remove no longer needed config_jmicron_chipset_for_pio().

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-01 23:46:46 +02:00
Bartlomiej Zolnierkiewicz 68aaf81503 it8213: PIO fixes (take 2)
* Rename it8213_tuneproc() to it8213_tune_pio() and add it8213_tuneproc()
  wrapper.  Move finding of the best PIO mode to the new wrapper.

* Add setting of transfer mode on the device to it8213_tuneproc().

* Don't call it8213_dma_2_pio() for PIO modes in it8213_tune_chipset().

* Use it8213_tuneproc() in it8213_config_drive_for_dma().

v2:
* Remove PIO modes from it8213_dma_2_pio(), they are no longer needed there
  (Noticed by Sergei)

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-01 23:46:46 +02:00
Bartlomiej Zolnierkiewicz bc0b0b5c4b cs5535: PIO fixes
* Fix cs5535_tuneproc() to pass PIO transfer mode value instead of PIO mode
  number to cs5535_set_speed() (fixes random PIO timings being programmed
  and a possible OOPS).  Do a little cleanup while at it.

* Fix cs5535_set_speed() to check if the mate device is present (fixes PIO0
  taskfile timings being used if there is no other device on the cable).

* Use cs5535_tuneproc() in cs5535_dma_check().  The old code had the same
  issue as cs5535_tuneproc() and add additionally caused 0x00-0x04 transfer
  mode values (== default PIO, default PIO w/ IORDY + two invalid values)
  being set on the device instead of values 0x08-0x0c (XFER_PIO_[0,4]).

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-01 23:46:45 +02:00
Bartlomiej Zolnierkiewicz 070224339b cs5520: fix PIO auto-tuning in ->ide_dma_check method
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-01 23:46:45 +02:00
Meelis Roos b37c6b842b ide: fix runtogether printk's in cmd64x IDE driver
Fix a couple of runtogether printks in cmd64x.c IDE driver by adding 
proper newlines.

Signed-off-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-01 23:46:44 +02:00
David Lamparter 1955f6814f sis5513: Add FSC Amilo A1630 PCI subvendor/dev to laptops
Recognise the FSC Amilo A1630's incarnation of a SiS5513 chip as laptop to
get UDMA100 support.

Signed-off-by: David Lamparter <equinox@diac24.net>
Cc: Lionel Bouton <Lionel.Bouton@inet6.fr>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-01 23:46:44 +02:00
Bartlomiej Zolnierkiewicz 8663fd6d0d alim15x3: Correct HP detect
Direct port of Alan's fix for pata_ali.

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-01 23:46:43 +02:00
Jordan Crouse 32a70a817a ide: Fix an overrun found in the CS5535 IDE driver
As found by the Coverity checker, and reported by Adrian Bunk, this
fixes a overrun error in the CS5535 IDE driver.  Somebody got a little
excited with the if() statement - the CS5535 only supports UDMA 0-4.

Bart:
Not a bug per se since the upper layer will never feed this function
with speed > XFER_UDMA_4 (thanks to ->ultra_mask being set to 0x1f).

Worth fixing anyway.

Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
Cc: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-08-01 23:46:42 +02:00
Al Viro 0bd8496b59 drivers/ misc __iomem annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-26 11:11:57 -07:00
Bartlomiej Zolnierkiewicz 4099d14322 ide: add PIO masks
* Add ATA_PIO[0-6] defines to <linux/ata.h>.

* Add ->pio_mask field to ide_pci_device_t and ide_hwif_t.

* Add PIO masks to host drivers.

<linux/ata.h> change ACK-ed by Jeff Garzik <jeff@garzik.org>.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-20 01:11:59 +02:00
Bartlomiej Zolnierkiewicz 6a824c92db ide: remove ide_find_best_pio_mode()
* Add ->host_flags to ide_hwif_t to store ide_pci_device_t.host_flags,
  assign it in setup-pci.c:ide_pci_setup_ports().

* Add IDE_HFLAG_PIO_NO_{BLACKLIST,DOWNGRADE} to ide_pci_device_t.host_flags
  and teach ide_get_best_pio_mode() about them.  Also remove needless
  !drive->id check while at it (drive->id is always present).

* Convert amd74xx, via82cxxx and ide-timing.h to use ide_get_best_pio_mode()
  and then remove no longer needed ide_find_best_pio_mode().

There should be no functionality changes caused by this patch.

Acked-by: Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-20 01:11:58 +02:00
Bartlomiej Zolnierkiewicz 2134758d2a ide: drop "PIO data" argument from ide_get_best_pio_mode()
* Drop no longer needed "PIO data" argument from ide_get_best_pio_mode()
  and convert all users accordingly.

* Remove no longer needed ide_pio_data_t.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-20 01:11:58 +02:00
Bartlomiej Zolnierkiewicz 7dd00083b1 ide: add ide_pio_cycle_time() helper (take 2)
* Add ide_pio_cycle_time() helper.

* Use it in ali14xx/ht6560b/qd65xx/cmd64{0,x}/sl82c105 and pmac host drivers
  (previously cycle time given by the device was only used for "pio" == 255).

* Remove no longer needed ide_pio_data_t.cycle_time field.

v2:
* Fix "ata_" prefix (Noticed by Jeff).

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-20 01:11:56 +02:00
Bartlomiej Zolnierkiewicz 31c4df441c sc1200: remove stale Power Management code
* Nowadays core IDE code handles restoring of PIO and DMA modes
  (ide-io.c:ide_start_power_step() etc) so remove open-coded version
  from sc1200_resume().

  There should be no change in behavior because settings done by
  sc1200_resume() were always overridden by generic_ide_resume()
  and ide_{start,stop}_power_step().

* Bump driver version.

Cc: Mark Lord <mlord@pobox.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-20 01:11:56 +02:00
Bartlomiej Zolnierkiewicz 1c164acf50 serverworks: fix DMA
The driver used to depend on BIOS settings for deciding whether it is OK
to use DMA.  However it seems that BIOS doesn't always handle all cases
correctly so just let IDE core to decide about this.  It should be a safe
thing to do now, after the driver went through heavy bugfixing.

Thanks for bugreport and testing the patch goes out to Sven Niedner.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-20 01:11:56 +02:00
Bartlomiej Zolnierkiewicz 1880a8d7f2 serverworks: always tune PIO
* Always set ->autotune so PIO gets correctly auto-tuned (previously
  ->autotune was only set when ->dma_base wasn't available, however
  ->ide_dma_check()/->speedproc() was always trying to tune PIO when
  tuning DMA).

* Move code responsible for programming chipset for PIO mode from
  svwks_tune_chipset() to svwks_tune_pio().  Don't tune PIO when tuning
  DMA (this is no longer needed since ->autotune is always set now).

* Handle PIO modes early in svwks_tune_chipset() so DMA configuration
  registers don't get cleared when programming PIO mode.

* Bump driver version.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-20 01:11:56 +02:00
Bartlomiej Zolnierkiewicz a5d8c5c834 ide: add ide_pci_device_t.host_flags (take 2)
* Rename ide_pci_device_t.flags to ide_pci_device_t.host_flags
  and IDEPCI_FLAG_ISA_PORTS flag to IDE_HFLAG_ISA_PORTS.

* Add IDE_HFLAG_SINGLE flag for single channel devices.

* Convert core code and all IDE PCI drivers to use IDE_HFLAG_SINGLE
  and remove no longer needed ide_pci_device_t.channels field.

v2:
* Fix issues noticed by Sergei:
  - correct code alignment in scc_pata.c
  - s/IDE_HFLAG_SINGLE/~IDE_HFLAG_SINGLE/ in serverworks.c

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-20 01:11:55 +02:00
Bartlomiej Zolnierkiewicz 2229833c13 ide: add ide_dev_has_iordy() helper (take 4)
* Add ide_dev_has_iordy() helper and use it sl82c105 host driver.

* Remove no longer needed ide_pio_data_t.use_iordy field.

v2/v3:
* Fix issues noticed by Sergei:
  - correct patch description
  - fix comment in ide_get_best_pio_mode()

v4:
* Fix "ata_" prefix (Noticed by Jeff).

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-20 01:11:55 +02:00
Bartlomiej Zolnierkiewicz 342cdb6d47 ide: make ide_get_best_pio_mode() print info if overriding PIO mode
* Print info about overriding PIO mode in ide_get_best_pio_mode().

* Remove info about overriding PIO mode from cmd64{0,x} host drivers.

* Remove no longer needed ide_pio_data_t.overridden field.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-20 01:11:55 +02:00
Bartlomiej Zolnierkiewicz 328dcbb636 siimage: PIO mode setup fixes (take 2)
* Add sil_tuneproc() wrapper for siimage_tuneproc() which also sets
  PIO mode on the device.

* Add missing ide_get_best_pio_mode() call to sil_tuneproc() so
  "pio" == 255 (autotune) is handled correctly (previously PIO0 was used)
  and "pio" values > 4 && < 255 are filtered to PIO4 (instead of PIO0).

* Add code limiting maximum PIO mode according to the pair device capabilities
  to sil_tuneproc().

* Convert users of config_siimage_chipset_for_pio() to use sil_tune_pio() and
  sil_tuneproc().  This fixes PIO fallback in siimage_config_drive_for_dma() to
  use max PIO mode available instead of PIO4 (config_siimage_chipset_for_pio()
  used wrong arguments for ide_get_best_pio_mode() and as a results always
  tried to set PIO4).

* Remove no longer needed siimage_taskfile_timing()
  and config_siimage_chipset_for_pio().

* Enable ->autotune unconditionally and remove PIO tuning for UDMA/MDMA modes
  from siimage_speedproc()

* Bump driver version.

v2:
* Fix issues noticed by Sergei:
  - correct pair device check
  - trim only taskfile PIO to the slowest of the master/slave
  - enable ->autotune unconditionally and remove PIO tuning for UDMA/MDMA modes
    from siimage_speedproc()
  - add TODO item for IORDY bugs
  - minor cleanups

Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-20 01:11:54 +02:00
Bartlomiej Zolnierkiewicz 485efc6cf5 atiixp: PIO mode setup fixes
* Split off exisiting atiixp_tuneproc() into atiixp_tune_pio()
  and then add setting device PIO mode to atiixp_tuneproc().

* Add missing ide_get_best_pio_mode() call to atiixp_tuneproc() so
  "pio" == 255 (autotune) is handled correctly and "pio" values > 4 && < 255
  are filtered to PIO4 (previously "pio" == 5 could result in wrong timings
  being used and "pio" values > 4 && < 255 in an OOPS).

* Handle PIO modes early in atiixp_speedproc() so save_mdma_mode[]
  doesn't get cleared.

* In atiixp_dma_check():
  - fix max_mode argument for ide_get_best_pio_mode()
  - don't call atiixp_dma_2_pio() so PIO1 doesn't get remapped to PIO0
  - use atiixp_tuneproc() instead of atiixp_speedproc()

* Bump driver version.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-20 01:11:54 +02:00
Alan Cox 9702b5d5c2 ide: Stop mapping ROMs
Various old IDE drivers go mapping ROM devices for no apparent reason and
without using the ROM mapping API we now have. They don't actually use
the ROM they map and the new libata drivers are happy without it being
mapped so rather than port them lets just junk it for the next -rc1.

Signed-off-by: Alan Cox <alan@redhat.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-20 01:11:54 +02:00
Kou Ishizaki 4ae41ff887 scc_pata.c: Workaround for errata A308 (take 2)
Workaround for errata A308: turn down the UDMA mode and retry
the DMA command when the data lost condition is detected.

take2:
udma_filter() hook is used to limit ATAPI UDMA mode.

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>
2007-07-20 01:11:53 +02:00
Kumar Gala f644d47af3 scc_pata: Use inline function for eieio
Move to using inline function variant of eieio instead of inline assmebly.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Cc: kou.ishizaki@toshiba.co.jp
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-20 01:11:53 +02:00
Randy Dunlap 694625c0b3 PCI: add pci_try_set_mwi
As suggested by Andrew, add pci_try_set_mwi(), which does not require
return-value checking.

- add pci_try_set_mwi() without __must_check
- make it return 0 on success, errno if the "try" failed or error
- review callers

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-07-11 16:02:11 -07:00
Auke Kok 44c10138fd PCI: Change all drivers to use pci_device->revision
Instead of all drivers reading pci config space to get the revision
ID, they can now use the pci_device->revision member.

This exposes some issues where drivers where reading a word or a dword
for the revision number, and adding useless error-handling around the
read. Some drivers even just read it for no purpose of all.

In devices where the revision ID is being copied over and used in what
appears to be the equivalent of hotpath, I have left the copy code
and the cached copy as not to influence the driver's performance.

Compile tested with make all{yes,mod}config on x86_64 and i386.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Acked-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-07-11 16:02:10 -07:00
Bartlomiej Zolnierkiewicz bdab00b73d via82cxxx: backport short cables support from pata_via.c
Backport short cables support from pata_via.c.

This patch should allow UDMA > 2 modes on Acer Ferrari 3400.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
2007-07-09 23:17:58 +02:00
Bartlomiej Zolnierkiewicz f2befd9e80 sis5513: backport short cables support from pata_sis.c
Backport short cables support from pata_sis.c.

This patch allows UDMA > 2 modes on ASUS A6K.

Thanks to testing this patch goes out to Jiri Stavinoha.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
2007-07-09 23:17:58 +02:00
Bartlomiej Zolnierkiewicz 95ba8c17bc alim15x3: backport short cables support from pata_ali.c
Backport short cables support from pata_ali.c and while at it cleanup
existing cable detection code.

This patch should allow UDMA > 2 modes on HP Pavilion N5430 and Fujitsu P2000.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
2007-07-09 23:17:58 +02:00
Bartlomiej Zolnierkiewicz 7207626f47 piix: backport short cables support from ata_piix.c
Backport short cables support from ata_piix.c.

This patch should allow UDMA > 2 modes on:
- Acer 5602WLMi
- Acer 3682WLMi
- Asus W5F
- Acer Aspire 2023WLMi

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
2007-07-09 23:17:58 +02:00
Bartlomiej Zolnierkiewicz 49521f97cc ide: add short cables support
This patch allows users to override both host and device side cable detection
with "ideX=ata66" kernel parameter.  Thanks to this it should be now possible
to use UDMA > 2 modes on systems (laptops mainly) which use short 40-pin cable
instead of 80-pin one.

Next patches add automatic detection of some systems using short cables.

Changes:

* Rename hwif->udma_four to hwif->cbl and make it u8.

* Convert all existing users accordingly (use ATA_CBL_* defines while at it).  

* Add ATA_CBL_PATA40_SHORT support to ide-iops.c:eighty_ninty_three().

* Use ATA_CBL_PATA40_SHORT for "ideX=ata66" kernel parameter.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
2007-07-09 23:17:58 +02:00
Bartlomiej Zolnierkiewicz 75b1d97535 ide: convert ide_find_best_mode() users to use ide_max_dma_mode()
ide-timing.h:

* remove handling of DMA modes from ide_find_best_mode() and rename it to
  ide_find_best_pio_mode()

* drop no longer needed "map" argument from ide_find_best_pio_mode()
  and delete needless ->id check

* remove no longer needed XFER_SWDMA and XFER_UDMA* defines

au1xxx-ide.c:

* use ide_max_dma_mode() instead of ide_find_best_mode()

* remove needless CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA #ifdef

amd74xx.c:

* store UDMA masks in amd_ide_chip[] and while at it make "base" field
  to be u8 instead of unsigned long

* convert the driver to use UDMA masks from amd_ide_chip[]

* use ide_max_dma_mode() and ide_find_best_pio_mode() instead
  of ide_find_best_mode()

* delete stale comment from amd74xx_ide_dma_check()

* remove no longer needed AMD_UDMA* defines

via82cxxx.c:

* remove unused DISPLAY_VIA_TIMINGS define

* store UDMA masks in via_isa_bridges[] and while at it make "flags" field
  to be u8 instead of u16

* convert the driver to use UDMA masks from via_isa_bridges[]

* use ide_max_dma_mode() and ide_find_best_pio_mode() instead
  of ide_find_best_mode()

* remove no longer needed VIA_UDMA* defines

pmac.c:

* use ide_max_dma_mode() instead of ide_find_best_mode()

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
2007-07-09 23:17:57 +02:00
Sergei Shtylyov 6d78013bfc aec62xx: kill speedproc() method wrapper (take 2)
There's no reason to have the speedproc() method wrapper for the two quite
different chip families, so just get rid of it.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-09 23:17:56 +02:00
Sergei Shtylyov 1b9da32a28 aec62xx: remove init_dma() method (take 2)
Get rid of the init_dma() method (which had no particular reason to exist) by
folding it into the init_hwif() method. While at it, also perform some cleanup
in the latter method:

- get rid of the useless clearing of hwif->autodma;

- fold the serialization code into one 'if' statement;

- fold setting the drives' 'autotune' and 'autodma' fields into the single
  statements...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-09 23:17:56 +02:00
Sergei Shtylyov b1d19db4e7 aec62xx: rework init_setup_aec6x80()
Rework init_setup_aec6x80() so that it won't rewrite the constant name strings
anymore -- in order to do this:

- in aec62xx_init_one(), pass a local copy of 'struct pci_device_id' down the
  call chain;

- change the names for in aec62xx_chipsets[] to default to AEC-6280[R];

- override the 'name' field in init_setup_aec6x80() only if bit 4 of the DMA
  status register is set.

While at it, also change the 'udma_mask' field for AEC-6x80R chips in this
function and remove the code doing the same from the init_hwif() method...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-09 23:17:56 +02:00
Sergei Shtylyov 83a6d4ab3b cmd64x: init. code cleanup
Fix two minor issues with PCI0646 chip reporting in the init_chipset() method:
"IRQ workaround enabled" message printed out not only for revision 0x01 and
"CMD646: chipset revision" printed twice (by IDE core and the driver itself).
Also, remove empty/pointless switch cases for the chips other than PCI0646,
duplicate write to the MRDMODE register when enabling interrupts and MEMORY
READ LINE cycles, and needless/misplaced initialization of the timing registers
in this method.
Switch to reading only the PCI revision ID register itself, not the whole 32
bits at its address in init_chipset() and init_hwif() methods; in addition,
get rid of the useless clearing of hwif->autodma and perform some cosmetic
style changes in the latter method.
Refactor ata66_cmd64x() by moving all the code into the 'switch' statement,
renaming/adding variables, and fixing the coding style.
While at it, finally get rid of the meaningless aliasing register #define's...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-09 23:17:55 +02:00
Sergei Shtylyov 2648e5d9a8 hpt366: simplify UltraDMA filtering (take 4)
Simplify UltraDMA mode filtering in the driver:

- make use of the newly introduced 'udma_mask' field of 'ide_pci_device_t' to
  set the correct hwif->ultra_mask, modifying init_setup_hpt366() to select
  the correct mask based on the chip revision;

- replace 'max_mode' field of the 'struct hpt_info' with 'max_ultra' specifying
  the maximum UltraDMA mode allowed;

- rewrite hpt3xx_udma_filter() to differ the filters based on the 'chip_type'
  field, and only use it for HPT366 and HPT370[A] where it's really necessary.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-09 23:17:55 +02:00
Sergei Shtylyov c283f5dbe3 ide: make void and rename ide_dma_timeout() method
Since ide_dma_timeout() method's result is discarded, make it return 'void'.
While at it, drop 'ide_' from the method's name, drop the '__' prefix from
the default method's name, and do some cleanups in this method driver-wise:

- in ide-dma.c, au1xxx-ide.c, and pdc202xx_old.c, define/use 'hwif' variable;

- in au1xxx-ide.c, get rid of commented out printk();

- in sl82c105.c, get rid of unnecessary variables.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-09 23:17:54 +02:00
Sergei Shtylyov 841d2a9bf1 ide: make void and rename ide_dma_lostirq() method
Since ide_dma_lostirq() method's result is discarded, make it return 'void'.
While at it, rename the method to dma_lost_irq(), drop the '__' prefix from the
default method's name, and do some cleanups in this method driver-wise:

- in aec62xx.c, rename the method in accordance with other drivers, and get rid
  of unnecessary variables there;

- in pdc202xx_old.c, define/use 'hwif' variable;

- in sgiioc4.c, rearrange the code to call the resetproc() method directly.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-09 23:17:54 +02:00
Bartlomiej Zolnierkiewicz b740d8846e serverworks: always tune CSB6
Switch the driver to always program DMA/PIO timings and set device transfer
mode instead of trusting BIOS on CSB6 controllers (libata pata_serverworks.c
driver is also doing things this way and there were no problems reported so
far).  While doing conversion I noticed that the old code had many issues:

* the code was assuming that hwif->dma_status is always valid
  (which obviously isn't true if hwif->dma_base == NULL)

* value of "(ultra_timing >> (4*unit)) & ~(0xF0)" expression wasn't checked
  to fit into udma_modes[5]

* code validating DMA timings didn't validate corresponding PIO timings

* extra CSB5 PIO register wasn't validated et all

* hwif->ide_dma_off_quietly() is always called before ide_set_dma() (which in
  turn calls hwif->speedproc() method - svwks_tune_chipset() in this case)
  so the code depending on DMA capable bit of DMA status to be set was never
  executed (=> the code was never validating DMA timings despite actually
  enabling DMA if the PIO timings were OK!)

* on resume driver dependend entirely on BIOS to restore timings and set
  transfer mode on the device

While at it:

There is no need to read PIO/MWDMA timings now so don't do it.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
2007-07-09 23:17:53 +02:00
Uwe Koziolek 4c6c914e4c sis5513: adding PCI-ID
The SiS966 has one additional PCI-ID 1180.

If the chipset is using this PCI-ID, the primary channel is connected to the
first PATA-port. The secondary channel is connected to SATA-ports in IDE
emulation mode.  The legacy IO-ports are used.

The including of the PCI-ID into pata_sis is not sufficient, because the legacy
driver in drivers/ide is initialized before pata_sis.

Signed-off-by: Uwe Koziolek <uwe.koziolek@gmx.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-08 15:21:58 +02:00
Albert Lee 8006bf56e3 ide: pdc202xx_new PLL input clock fix
Recently the PLL input clock of Promise 2027x is sometimes detected
higher than expected (e.g. 20.027 MHz compared to 16.714 MHz).
It seems sometimes the mdelay() function is not as precise as it
used to be. Per Alan's advice, HT or power management might affect
the precision of mdelay().

This patch calls gettimeofday() to measure the time elapsed and
calculate the PLL input clock accordingly.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Bahadir Balban <bahadir.balban@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-03 22:28:36 +02:00
Bartlomiej Zolnierkiewicz 52374f890c it821x: fix incorrect SWDMA mask
SWDMA modes are unsupported by it821x.  Attempts to tune SWDMA modes always
fail (due to sanity check in ->speedproc) and result in PIO being tuned.

* Fix incorrect SWDMA mask so core code won't try these modes and will just
  tune PIO if no other DMA modes are available.

* Bump driver version.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
2007-07-03 22:28:35 +02:00
Bartlomiej Zolnierkiewicz 603a0e2c0a amd74xx: resume fix
* Driver can't skip programming transfer mode on the device in amd_set_drive()
  (similar fix has been applied to via82cxxx driver ages ago).

* While at it remove redundant warning (ide_config_drive_speed() already
  produces more valuable one).

* Bump driver version.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-03 22:28:35 +02:00
Sergei Shtylyov 96dcc08b0c hpt366: use correct enablebits for HPT36x
The HPT36x chips finally turned out to have the channel enable bits -- however,
badly implemented.  Make use of them despite it's probably only going to burden
the driver's code -- assuming both channels are always enabled by the HighPoint
BIOS anyway...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Acked-by: Linas Vepstas <linas@austin.ibm.com>
Cc: michal.kepien@poczta.onet.pl
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-03 22:28:35 +02:00
Sergei Shtylyov 783353b1d3 hpt366: blacklist MAXTOR STM3320620A for UltraDMA/66
Add the MAXTOR STM3320620A drive into the UltraDMA/66 mode blacklist
for the HPT36x chips.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Acked-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-07-03 22:28:35 +02:00
Peer Chen c1183a3345 ide: Add the MCP73/77 support to PATA driver
Add the MCP73/MCP77 support to PATA driver.

bart: Added amd74xx_chipsets[] and amd_pci_tbl[] entries.
bart: Bumped driver version.

Signed-off-by: Peer Chen <peerchen@gmail.com>
Cc: Alan Cox <alan@redhat.com>,
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-06-08 15:14:32 +02:00
Sergei Shtylyov 278978e953 hpt366: disallow Ultra133 for HPT374
Eliminate UltraATA/133 support for HPT374 -- the chip isn't capable of this mode
according to the manual, and doesn't even seem to tolerate 66 MHz DPLL clock...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Geller Sandor <wildy@petra.hos.u-szeged.hu>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-06-08 15:14:32 +02:00
Jiri Slaby ea30759643 ide: generic IDE PCI driver, add another device exception
generic IDE PCI driver, add another device exception

This device is char device and is grabbed by generic ide driver:
00:0b.0 Class ffff: National Semiconductor Corporation 87410 IDE (rev ff) (prog-if ff)
	Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-

Disallow generic IDE PCI driver to grab it by adding next condition. Also
consolidate exceptions to one bigger 'switch (dev->vendor)'.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Ingo Korb <ml@akana.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-06-08 15:14:31 +02:00
Bartlomiej Zolnierkiewicz 0380dad45e it821x: RAID mode fixes
The DMA support for RAID mode broke after:

	commit 71ef51cc17
	Author: Jens Axboe <axboe@suse.de>
	Date:   Fri Jul 28 09:02:17 2006 +0200

	    [PATCH] it821x: fix ide dma setup bug

	    Only enable dma for a valid speed setting.

	    Signed-off-by: Jens Axboe <axboe@suse.de>

	commit 0a8348d086
	Author: Jens Axboe <axboe@suse.de>
	Date:   Fri Jul 28 08:58:26 2006 +0200

	    [PATCH] ide: if the id fields looks screwy, disable DMA

	    It's the safer choice. Originally due to a bug in itx821x, but a
	    generally sound thing to do.

	    Signed-off-by: Jens Axboe <axboe@suse.de>

However it worked by pure luck before Jens' fixes: bogus ide_dma_enable()
usage in it821x driver combined with loosy check in ide_dma_verbose() allowed
the hardware to operate in DMA mode.  When these problems were fixed the DMA
support broke...

The source root for the regression turned out to be that the it821x.c code
was clearing too much of id->field_valid.  The IDE core code was using the
original value of id->field_valid to do the tuning but later DMA got disabled
in ide_dma_verbose() because of the incorrect id->field_valid fixup.  Fix it.

While at it:

* Do fixup() after probing the drives but before tuning them (which is also
  OK w.r.t. ide_undecoded_slave() fixup).  This change fixes device IDENTIFY
  data to be consistent before/after the tuning and allows us to remove extra
  re-tuning of drives from it821x_fixups().

* Fake MWDMA0 enabled/supported bits in IDENTIFY data if the device has
  DMA capable bit set (this is just to tell the IDE core that DMA is
  supported since it821x firmware takes care of DMA mode programming).

* Don't touch timing registers and don't program transfer modes on devices
  et all when in RAID mode - depend solely on firmware to do the tuning
  (as suggested by Alan Cox and done in libata pata_it821x driver).

Thanks for testing the patch goes out to Thomas Kuther.

Cc: Thomas Kuther <gimpel@sonnenkinder.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Jens Axboe <axboe@suse.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-06-08 15:14:29 +02:00
Bartlomiej Zolnierkiewicz 1abb8a8b84 serverworks: fix CSB6 tuning logic
Problem noticed by Joe Zbiciak, see

	http://kerneltrap.org/node/8252

for details.

On CSB6 the driver is using BIOS settings and not programming DMA/PIO timings
itself.  However the logic was completely broken and resulted in wrong timings
being silently allowed (instead of being corrected by the driver).

This bug would explain some data corruption/timeout issues with Serverworks
MegaIDE in RAID mode that Alan Cox has fixed recently with:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=2074a106f52b6371885afbd714e929d60d0e3f64

For 2.6.23 we may be better off with completely switching the driver to always
programming timings (libata pata_serverworks.c driver is doing things this way
and there were no problems reported so far) but for 2.6.22 lets fix the bug
in the simplest and the least intrusive way.

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-06-08 15:14:28 +02:00
Bartlomiej Zolnierkiewicz ed84fad500 serverworks: remove crappy code
Remove crappy code noticed by Linus, see

	http://lkml.org/lkml/2007/5/23/476

for details.

While at it simplify logic a bit.

There should be no functionality changes caused by this patch.

Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-06-08 15:14:27 +02:00
Andrew Morton 585a2858b9 ide serverworks warning fixes
gcc-4.3:

drivers/ide/pci/serverworks.c: In function 'svwks_tune_chipset':
drivers/ide/pci/serverworks.c:176: warning: overflow in implicit constant conversion
drivers/ide/pci/serverworks.c:190: warning: overflow in implicit constant conversion
drivers/ide/pci/serverworks.c:211: warning: overflow in implicit constant conversion
drivers/ide/pci/serverworks.c:212: warning: overflow in implicit constant conversion

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-05-24 02:42:39 +02:00
Alan Cox 2074a106f5 ide/pci/serverworks.c: Fix corruption/timeouts with MegaIDE
It turns out from customer reports to Red Hat and some PCI dumps that the
MegaIDE in RAID mode doesn't provide the drive tuning data that the
serverworks driver expects but sometimes does provide something that
fools the code.

For the RAID class case skip the oem setup and don't trust the BIOS data.
We then tune from scratch and this sorts it out. (This has been confirmed
on an afflicted IBM blade)

[libata serverworks.c never trusts the BIOS in the first place so is
accidentally immune]

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-05-24 02:42:38 +02:00
Henry Su 6c6a2a8d20 add the IDE device ID for ATI SB700
Add the IDE device ID to atiixp_pci_tbl struct in atiixp.c for ATI SB700.

From: Henry Su <henry.su@amd.com>
Signed-off-by: Luugi Marsan <luugi.marsan@amd.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-05-24 02:42:37 +02:00