20 May, 2008

29 commits

  • This timeout was set low because previously PMP register access was
    done via polling and register access timeouts could stack up. This is
    no longer the case. One timeout will make all following accesses fail
    immediately.

    In rare cases both marvell and SIMG PMPs need almost a second. Bump
    it to 3s.

    While at it, rename it to SATA_PMP_RW_TIMEOUT. It's not specific to
    SCR access.

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

    Tejun Heo
     
  • No reason to get overzealous about recovered comm and data errors.
    Some PHYs habitually sets them w/o no good reason and being draconian
    about these soft error conditions doesn't seem to help anybody.

    If need ever rises, we might need to add soft PHY error condition, say
    AC_ERR_MAYBE_ATA_BUS and use it only to determine whether speed down
    is necessary but I don't think that's very likely to happen. It's far
    more likely we'll get timeouts or fatal transmission errors if
    recovered errors are so prominent that they hamper operation.

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

    Tejun Heo
     
  • Originally, whole reset processing was done while the port is frozen
    and SError was cleared during @postreset(). This had two race
    conditions. 1: hotplug could occur after reset but before SError is
    cleared and libata won't know about it. 2: hotplug could occur after
    all the reset is complete but before the port is thawed. As all
    events are cleared on thaw, the hotplug event would be lost.

    Commit ac371987a81c61c2efbd6931245cdcaf43baad89 kills the first race
    by clearing SError during link resume but before link onlineness test.
    However, this doesn't fix race #2 and in some cases clearing SError
    after SRST is a good idea.

    This patch solves this problem by cross checking link onlineness with
    classification result after SError is cleared and port is thawed.
    Reset is retried if link is online but all devices attached to the
    link are unknown. As all devices will be revalidated, this one-way
    check is enough to ensure that all devices are detected and
    revalidated reliably.

    This, luckily, also fixes the cases where host controller returns
    bogus status while harddrive is spinning up after hotplug making
    classification run before the device sends the first FIS and thus
    causes misdetection.

    Low level drivers can bypass the logic by setting class explicitly to
    ATA_DEV_NONE if ever necessary (currently none requires this).

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

    Tejun Heo
     
  • Previously reset freeze/thaw handling lived outside of ata_eh_reset()
    mainly because the original PMP reset code needed the port frozen
    while resetting all the fan-out ports, which is no longer the case.

    This patch moves freeze/thaw handling into ata_eh_reset().
    @prereset() and @postreset() are now called w/o freezing the port
    although @prereset() an be called frozen if the port is frozen prior
    to entering ata_eh_reset().

    This makes code simpler and will help removing hotplug event related
    races.

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

    Tejun Heo
     
  • Reorganize ata_eh_reset() such that @prereset() is called even when no
    reset method is available and if block is used instead of goto to skip
    actual reset. This makes no reset case behave better (readiness wait)
    and future changes easier.

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

    Tejun Heo
     
  • The @online out parameter is supposed to set to true iff link is
    online and reset succeeded as advertised in the function description
    and callers are coded expecting that. However, sata_link_reset()
    didn't behave this way on device readiness test failure. Fix it.

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

    Tejun Heo
     
  • Minor coding-style fixes for sata_promise:
    - remove stray blank lines
    - fix checkpatch.pl errors; warnings about long lines
    remain, but I don't intend to address those at this time
    - remove two inline directives: neither is essential and
    both functions are trivially inlinable anyway by virtue
    of being static and having a single unique call site
    - fix comment in pdc_interrupt(): the bits in PDC_INT_SEQMASK
    denote SEQIDs not tags, the distinction becomes important
    when NCQ gets implemented

    Signed-off-by: Mikael Pettersson
    Signed-off-by: Jeff Garzik

    Mikael Pettersson
     
  • This patch cleans up sata_promise's mmio accesses.

    In sata_promise there are three distinct mmio address spaces:
    1. global registers, offsets from host->iomap[PDC_MMIO_BAR]
    2. per-port ATA registers, offsets from ap->ioaddr.cmd_addr
    3. per-port SATA registers, offsets from ap->ioaddr.scr_addr

    The driver currently often fails to indicate which address space
    a given mmio base pointer refers to, which is a source of bugs
    and confusion (see recent pdc_thaw() irq clearing bug; it's also
    been an obstacle for the pending NCQ extensions).

    To reduce these problems, adopt a coding style where the name of
    a base pointer always indicates which address space it refers to:
    1. global registers: host_mmio
    2. per-port ATA registers: ata_mmio
    3. per-port SATA registers: sata_mmio

    Also rearrange register offset definitions to clearly indicate
    which address space they belong to, and add a symbolic definition
    for the previously hard-coded PHYMODE4 register.

    Signed-off-by: Mikael Pettersson
    Signed-off-by: Jeff Garzik

    Mikael Pettersson
     
  • This patch fixes two bugs in sata_promise's irq status clearing paths:
    1. When clearing the irq status for a specific port, the driver
    read the global SEQMASK register. This is wrong because that
    clears the irq status for _all_ ports.
    2. pdc_thaw() incorrectly added the PDC_INT_SEQMASK host register
    offset to a per-port ata engine base address. This resulted in
    it reading the unrelated PDC_PKT_SUBMIT register, which did not
    have the desired irq status clearing effect.

    In both cases the fix is to read from the port's Command/Status
    register. This also matches what Promise's own driver does.

    Signed-off-by: Mikael Pettersson
    Signed-off-by: Jeff Garzik

    Mikael Pettersson
     
  • Use the kernel-provided clamp_val() macro.

    FIT was always applied to a member of struct ata_timing (unsigned short)
    and two constants. clamp_val will not cast to short anymore.

    Signed-off-by: Harvey Harrison
    Cc: Jeff Garzik
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Jeff Garzik

    Harvey Harrison
     
  • Check for an empty request queue before stopping EDMA after a FBS-NCQ error,
    as per recommendation from the Marvell datasheet.

    This ensures that the EDMA won't suddenly become active again
    just after our subsequent check of the empty/idle bits.

    Also bump DRV_VERSION.

    Signed-off-by: Mark Lord
    Signed-off-by: Jeff Garzik

    Mark Lord
     
  • Part five of simplifying/fixing handling of the main_irq_mask register
    to resolve unexpected interrupt issues observed in 2.6.26-rc*.

    Keep a cached copy of the main_irq_mask so that we don't have
    to stall the CPU to read it on every pass through mv_interrupt.

    This significantly speeds up interrupt handling, both for sata_mv,
    and for any other driver/device sharing the same PCI IRQ line.

    Signed-off-by: Mark Lord
    Signed-off-by: Jeff Garzik

    Mark Lord
     
  • Part four of simplifying/fixing handling of the main_irq_mask register
    to resolve unexpected interrupt issues observed in 2.6.26-rc*.

    Ignore masked IRQs in mv_interrupt().
    This prevents "unexpected device interrupt while idle" messages.

    Signed-off-by: Mark Lord
    Signed-off-by: Jeff Garzik

    Mark Lord
     
  • Part three of simplifying/fixing handling of the main_irq_mask register
    to resolve unexpected interrupt issues observed in 2.6.26-rc*.

    Partially fix a reported bug whereby we sometimes miss seeing drives on
    a port-multiplier, as reported by Gwendal Grignou .

    The problem was that we were receiving unexpected interrupts
    during EH from POLLed commands while accessing port-multiplier registers.
    These unexpected interrupts can be prevented by masking the DONE_IRQ bit
    for the port whenever not operating in EDMA mode.

    Also fix port_stop() to mask all port interrupts.

    Signed-off-by: Mark Lord
    Signed-off-by: Jeff Garzik

    Mark Lord
     
  • Part two of simplifying/fixing handling of the main_irq_mask register
    to resolve unexpected interrupt issues observed in 2.6.26-rc*.

    Consolidate all updates of the host main_irq_mask register
    into a single function. This simplifies maintenance,
    and also prepares the way for caching it (later).

    No functionality changes in this update.

    Signed-off-by: Mark Lord
    Signed-off-by: Jeff Garzik

    Mark Lord
     
  • Part one of simplifying/fixing handling of the main_irq_mask register
    to resolve unexpected interrupt issues observed in 2.6.26-rc*.

    Don't blindly enable port IRQs at host init time.
    Instead, enable only the bits that we want,
    which in this case is simply the PCI_ERR bit.

    The per-port bits can wait until the ports are reset/probed for devices.

    Signed-off-by: Mark Lord
    Signed-off-by: Jeff Garzik

    Mark Lord
     
  • Now that we handle the FIS_IRQ_CAUSE register correctly,
    we can also now handle SATA asynchronous notification events.

    So enable them, but only for the more modern GenIIe chips.
    (older chips have unaddressed errata issues related to this).

    This fixes hot plug/unplug for port-muliplier ports.

    Signed-off-by: Mark Lord
    Signed-off-by: Jeff Garzik

    Mark Lord
     
  • Group all of the flags for GenIIe devices into a common definition,
    to ensure that any updates to them are shared by all GenIIe devices.

    This will help make future maintenance somewhat simpler.

    Signed-off-by: Mark Lord
    Signed-off-by: Jeff Garzik

    Mark Lord
     
  • Fix handling of the FIS_IRQ_CAUSE register in sata_mv.

    This register exists *only* on GenIIe devices, so don't bother
    writing to it on older chips. Also, it has to be read/cleared
    in mv_err_intr() before clearing the main ERR_IRQ_CAUSE register.

    This keeps sata_mv from getting stuck forever on certain error types.

    Signed-off-by: Mark Lord
    Signed-off-by: Jeff Garzik

    Mark Lord
     
  • Always request a softreset after hardreset succeeds.

    This fixes a regression reported by Martin Michlmayr .

    Signed-off-by: Mark Lord
    Signed-off-by: Jeff Garzik

    Mark Lord
     
  • Remove an explicit memset(.., 0, ...) to a variable allocated with
    kzalloc (i.e. 'info').

    Signed-off-by: Christophe Jaillet
    Acked-by: Haavard Skinnemoen
    Signed-off-by: Jeff Garzik

    Christophe Jaillet
     
  • Set ATAPI host state machine to control IDE device terminate sequence.
    Some IDE harddisk may assert terminate sequence in the middle of a
    formal DMA transaction and resume later. Bit DETECT_TERM in ATAPI_CTRL
    register determines whether the ATAPI host state machine or the kernel
    driver should take care of this case.

    Signed-off-by: Sonic Zhang
    Signed-off-by: Bryan Wu
    Signed-off-by: Jeff Garzik

    Sonic Zhang
     
  • * 'drm-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
    drm/i915: save and restore dsparb and d_state registers.
    drm/i915: fix off by one in VGA save/restore of AR & CR regs.
    drm: disable tasklets not IRQs when taking the drm lock spinlock
    Revert "drm/vbl rework: rework how the drm deals with vblank."

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes:
    Don't clean bounds.h and asm-offsets.h
    kconfig: incorrect 'len' field initialisation ?
    kernel-doc: allow unnamed bit-fields
    kbuild: filter away debug symbols from kernel symbols
    Remove *.rej pattern from .gitignore
    MAINTAINERS: document names of new kbuild trees
    kbuild: disable modpost warnings for linkonce sections
    kbuild: escape meta characters in regular expression in make TAGS

    Linus Torvalds
     
  • Since 97965478a66fbdf0f4ad5e4ecc4828f0cb548a45 ("mm: Get rid of __ZONE_COUNT")
    mmzone.h includes bounds.h.
    Calling make clean after make prepare removes bounds.h
    again so when building external modules this fails.

    Signed-off-by: Jan Blunck
    Signed-off-by: Sam Ravnborg
    --

    Jan Blunck
     
  • 1) The field 'len' of the 'gstr' structure seems to track the size of the memory
    already allocated for the "growable string". So the value of this field should be
    the same as the 'malloc()' just above, shouldn't it ?

    Signed-off-by: Christophe Jaillet
    Signed-off-by: Sam Ravnborg

    Christophe Jaillet
     
  • Allow for unnamed bit-fields and skip them instead of printing an
    erroneous warning message for them, such as:

    Warning(include/asm-s390/cio.h:103): No description found for parameter 'u32'

    which contains:

    struct tm_scsw {
    u32 :1;

    Signed-off-by: Randy Dunlap
    Signed-off-by: Sam Ravnborg

    Randy Dunlap
     
  • Andi Kleen
    reported that he saw a lot of symbols like this:

    0000000000000b24 N DW.aio.h.903a6d92.2
    0000000000000bce N DW.task_io_accounting.h.8d8de327.0
    0000000000000bec N DW.hrtimer.h.c23659c6.0

    in his System.map / kallsyms output.

    Simple solution is to skip all debugging
    symbols (they are marked 'N').

    Signed-off-by: Sam Ravnborg
    Cc: Paulo Marques

    Sam Ravnborg
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
    snd-pcsp: silent misleading warning
    snd-pcsp: depend on CONFIG_EXPERIMENTAL
    snd-pcsp: put back the compatibility code for the older alsa-libs
    snd-pcsp: adjust help texts to frighten users

    Linus Torvalds
     

19 May, 2008

11 commits