11 Feb, 2007

12 commits


10 Feb, 2007

28 commits

  • The ATA_ENABLE_PATA define was never meant to be permanent, and in
    recent kernels, it's already been unconditionally enabled. Remove.

    Signed-off-by: Jeff Garzik

    Jeff Garzik
     
  • Signed-off-by: Jeff Garzik

    Jeff Garzik
     
  • If we are doing a PIO setup for a CFA card and it blows up with a device
    error then assume it is an older CFA card which doesn't support this
    rather than failing the device out of existance.

    Stands seperate to the quieting patch but that is obviously useful with
    this change.

    Signed-off-by: Alan Cox
    Signed-off-by: Jeff Garzik

    Alan
     
  • ata_pci_device_do_resume can fail if the PCI device couldn't be re-enabled.
    Update sata_nv to propagate the return value from this call and to not try
    to do any other resume activities if it fails. Fixes a compile warning.

    Signed-off-by: Robert Hancock
    Signed-off-by: Andrew Morton
    Signed-off-by: Jeff Garzik

    Robert Hancock
     
  • Update sata_nv to wait for the controller to indicate via the status
    register that it has entered the requested state when switching between
    ADMA mode and register mode. This issue came up recently when debugging
    some problems with cache flush command timeouts and while it didn't appear
    to fix that problem, this is something we should likely be doing in any
    case.

    Signed-off-by: Robert Hancock
    Cc: Tejun Heo
    Cc: Jeff Garzik
    Signed-off-by: Andrew Morton
    Signed-off-by: Jeff Garzik

    Robert Hancock
     
  • Some problems showed up recently with cache flush commands timing out on
    sata_nv. Previously these commands were always handled by transitioning to
    legacy mode from ADMA mode first. The timeout problem was worked around
    already by a change to the interrupt handling code for legacy mode, but for
    non-data commands like these it appears we can handle them in ADMA mode, so
    the switch to legacy mode is not needed.

    This patch changes the behavior so that we use ADMA mode to submit
    interrupt-driven commands with ATA_PROT_NODATA protocol. In addition to
    avoiding the problem mentioned above entirely, this avoids the overhead of
    switching to legacy mode and back to ADMA mode for handling cache flushes.
    When handling non-DMA-mapped commands, we leave the APRD blank and clear
    the NV_CPB_CTL_APRD_VALID field in the CPB so the controller does not
    attempt to read it.

    Signed-off-by: Robert Hancock
    Cc: Jeff Garzik
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Jeff Garzik

    Robert Hancock
     
  • This cleans up a few issues with the error handling in sata_nv in ADMA mode
    to make it more consistent with other NCQ-capable drivers like ahci and
    sata_sil24:

    - When a command failed, we would effectively set AC_ERR_DEV on the
    queued command always. In the case of NCQ commands this prevents libata
    from doing a log page query to determine the details of the failed
    command, since it thinks we've already analyzed. Just set flags in the
    port ehi->err_mask, then freeze or abort and let libata figure out what
    went wrong.

    - The code handled NV_ADMA_STAT_CPBERR as a "really bad error" which
    caused it to set error flags on every queued command. I don't know
    exactly what this flag means (no docs, grr!) but from what I can guess
    from the standard ADMA spec, it just means that one or more of the CPBs
    had an error, so we just need to go through and do our normal checks in
    this case.

    - In the error_handler function the code would always dump the state of
    all the CPBs. This output seems redundant at this point since libata
    already dumps the state of all active commands on errors (and it also
    triggers at times when it shouldn't, like when suspending). Take this
    out.

    [akpm@osdl.org: many coding-style fixes]
    Signed-off-by: Robert Hancock
    Cc: Jeff Garzik
    Cc: Tejun Heo
    Cc: Allen Martin
    Signed-off-by: Andrew Morton
    Signed-off-by: Jeff Garzik

    Robert Hancock
     
  • MPIIX has only single channel IDE which can be configured for either primary or
    secondary legacy I/O ports and IRQ. So, get rid of the unneeded second probe
    entry in mpiix_init_one() and of the invalid (but unused anyway) enable bits in
    mpiix_pre_reset().

    Warning: this cleanup has only been compile-tested...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Jeff Garzik

    Sergei Shtylyov
     
  • Fix clearing/setting the wrong TIME/IE/PPE bits for a slave drive caused by a
    wrong shift count.
    Fix the PIO mode 1 being overclocked by wrongly selecting the fast timing bank.
    Also, fix/rephrase some comments while at it.

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Jeff Garzik

    Sergei Shtylyov
     
  • Fix the PIO mode 2 using mode 0 timings -- this driver should enable the
    fast timing bank starting with PIO2, just like the ata_piix driver does.
    Also, fix/rephrase some comments while at it.

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Jeff Garzik

    Sergei Shtylyov
     
  • IORDY and IORDY enable/disable flags.

    Signed-off-by: Alan Cox
    Signed-off-by: Jeff Garzik

    Alan
     
  • People are getting confused about which drivers to enable for PATA PIIX
    type devices. Change the ATA_PIIX line and help to make it clearer.

    Signed-off-by: Alan Cox
    Signed-off-by: Jeff Garzik

    Alan
     
  • * Hardreset must not exit without actually performing reset regardless
    of link status. We're resetting the link after all.

    * Minor message update.

    * 150ms delay is meaningful iff link is online after reset is
    complete.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Follow the old SRST rule and delay 150ms between completion of
    hardreset and status checking. Debouncing delay should usually cover
    this but debounce duration could be shorter than 150ms under certain
    circumstances.

    Usefulness depends on host controller implementation but it can't hurt
    and serves as a reminder that 2s delay for GoVault should also be
    added here.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Per Jeff's suggestion, this patch rearranges the info printed for ATA
    drives into dmesg to add the full ATA firmware revision and model
    information, while keeping the output to 2 lines.

    Signed-off-by: Eric D. Mudama
    Signed-off-by: Jeff Garzik

    Eric D. Mudama
     
  • Fix the wrong "compatible" PIO mode choices: MWDMA0 has 480 ns cycle while PIO1
    only has 383 ns cycle, and MWDMA2 timings matchs those of PIO4 exactly.

    Signed-off-by: Jeff Garzik

    Sergei Shtylyov
     
  • This patch is against each libata driver.

    Two IRQ calls are added in ata_port_operations.
    - irq_on() is used to enable interrupts.
    - irq_ack() is used to acknowledge a device interrupt.

    In most drivers, ata_irq_on() and ata_irq_ack() are used for
    irq_on and irq_ack respectively.

    In some drivers (ex: ahci, sata_sil24) which cannot use them
    as is, ata_dummy_irq_on() and ata_dummy_irq_ack() are used.

    Signed-off-by: Kou Ishizaki
    Signed-off-by: Akira Iguchi
    Signed-off-by: Jeff Garzik

    Akira Iguchi
     
  • This patch is against the libata core and headers.

    Two IRQ calls are added in ata_port_operations.
    - irq_on() is used to enable interrupts.
    - irq_ack() is used to acknowledge a device interrupt.

    In most drivers, ata_irq_on() and ata_irq_ack() are used for
    irq_on and irq_ack respectively.

    In some drivers (ex: ahci, sata_sil24) which cannot use them
    as is, ata_dummy_irq_on() and ata_dummy_irq_ack() are used.

    Signed-off-by: Kou Ishizaki
    Signed-off-by: Akira Iguchi
    Signed-off-by: Jeff Garzik

    Akira Iguchi
     
  • In file included from drivers/infiniband/hw/ipath/ipath_diag.c:44:
    include/linux/io.h:35: warning: 'struct device' declared inside parameter list
    include/linux/io.h:35: warning: its scope is only this definition or declaration

    Cc: Jeff Garzik
    Signed-off-by: Andrew Morton
    Signed-off-by: Jeff Garzik

    Andrew Morton
     
  • Convert libata core layer and LLDs to use iomap.

    * managed iomap is used. Pointer to pcim_iomap_table() is cached at
    host->iomap and used through out LLDs. This basically replaces
    host->mmio_base.

    * if possible, pcim_iomap_regions() is used

    Most iomap operation conversions are taken from Jeff Garzik
    's iomap branch.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • devres updates for pata_platform were dropped while merging devres
    patches due to merge conflict. This is the updated version.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • devres change moved iomap.o from obj-$(CONFIG_GENERIC_IOMAP) to lib-y
    making it not linked if no in-kernel driver uses it. Fix it.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Signed-off-by: Jeff Garzik

    Jeff Garzik
     
  • Implement pcim_iomap_regions(). This function takes mask of BARs to
    request and iomap. No BAR should have length of zero. BARs are
    iomapped using pcim_iomap_table().

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Now that all LLDs are converted to use devres, default stop callbacks
    are unused. Remove them.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Update libata LLDs to use devres. Core layer is already converted to
    support managed LLDs. This patch simplifies initialization and fixes
    many resource related bugs in init failure and detach path. For
    example, all converted drivers now handle ata_device_add() failure
    gracefully without excessive resource rollback code.

    As most resources are released automatically on driver detach, many
    drivers don't need or can do with much simpler ->{port|host}_stop().
    In general, stop callbacks are need iff port or host needs to be given
    commands to shut it down. Note that freezing is enough in many cases
    and ports are automatically frozen before being detached.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Update libata core layer to use devres.

    * ata_device_add() acquires all resources in managed mode.

    * ata_host is allocated as devres associated with ata_host_release.

    * Port attached status is handled as devres associated with
    ata_host_attach_release().

    * Initialization failure and host removal is handedl by releasing
    devres group.

    * Except for ata_scsi_release() removal, LLD interface remains the
    same. Some functions use hacky is_managed test to support both
    managed and unmanaged devices. These will go away once all LLDs are
    updated to use devres.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Implement ata_host_detach() which calls ata_port_detach() for each
    port in the host and export it. ata_port_detach() is now internal and
    thus un-exported. ata_host_detach() will be used as the 'deregister
    from libata layer' function after devres conversion.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo