20 May, 2008

40 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
    [PATCH] return to old errno choice in mkdir() et.al.
    [Patch] fs/binfmt_elf.c: fix wrong return values
    [PATCH] get rid of leak in compat_execve()
    [Patch] fs/binfmt_elf.c: fix a wrong free
    [PATCH] avoid multiplication overflows and signedness issues for max_fds
    [PATCH] dup_fd() part 4 - race fix
    [PATCH] dup_fd() - part 3
    [PATCH] dup_fd() part 2
    [PATCH] dup_fd() fixes, part 1
    [PATCH] take init_files to fs/file.c

    Linus Torvalds
     
  • * 'for-2.6.26' of git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx:
    [POWERPC] 4xx: Workaround for CHIP_11 Errata

    Linus Torvalds
     
  • Signed-off-by: Linus Torvalds

    Alan Cox
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/blackfin-2.6:
    Blackfin SPORTS UART Driver: converting BFIN->BLACKFIN
    Blackfin serial driver: add extra IRQ flag for 8250 serial driver
    8250 Serial Driver: Added support for 8250-class UARTs in HV Sistemas H8606 board
    Blackfin arch: Fix bug - USB fails to build for BF524/BF526
    Blackfin arch: update boards defconfig files
    Blackfin arch: IO Port functions to read/write unalligned memory
    Blackfin arch: enable a choice to provide 4M DMA memory
    Blackfin arch: cleanup the icplb/dcplb multiple hit checks
    Blackfin arch: Add workaround to read edge triggered GPIOs
    Blackfin arch: Sync channel defines with struct dma_register dma_io_base_addr.
    Blackfin arch: Check for Anomaly 05000182
    [Blackfin] arch: rename bf5xx-flash to bfin-async-flash
    [Blackfin] arch: Blackfin checksum annotations

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
    sh: Fix up restorer in debug_trap exception return path.
    sh: Make is_valid_bugaddr() more intelligent on nommu.
    sh: use the common ascii hex helpers
    sh: fix sh7785 master clock value
    sh: Fix up thread info pointer in syscall_badsys resume path.
    sh: Fix up optimized SH-4 memcpy on big endian.
    sh: disable initrd defaults in .empty_zero_page.
    sh: display boot params by default on entry.

    Linus Torvalds
     
  • * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: (28 commits)
    drivers/ata: trim trailing whitespace
    Fixups to ATA ACPI hotplug
    libata: ignore SIMG4726 config pseudo device
    sata_sil24: don't use NCQ if marvell 4140 PMP is attached
    libata: don't schedule LPM action seperately during probing
    libata: make sure PMP notification is turned off during recovery
    libata: increase PMP register access timeout to 3s
    libata: ignore recovered PHY errors
    libata: kill hotplug related race condition
    libata: move reset freeze/thaw handling into ata_eh_reset()
    libata: reorganize ata_eh_reset() no reset method path
    libata: fix sata_link_hardreset() @online out parameter handling
    sata_promise: other cleanups
    sata_promise: mmio access cleanups
    sata_promise: fix irq clearing buglets
    ata: remove FIT() macro
    sata_mv: ensure empty request queue for FBS-NCQ EH
    sata_mv: cache main_irq_mask register in hpriv
    sata_mv: disregard masked irqs
    sata_mv: fix pmp drives not found
    ...

    Linus Torvalds
     
  • Signed-off-by: Jeff Garzik

    Jeff Garzik
     
  • The libata-acpi.c code currently accepts hotplug messages from both the
    port and the device. This does not match the behaviour of the bay
    driver, and may result in confusion when two hotplug requests are
    received for the same device. This patch limits the hotplug notification
    to removable ACPI devices, which in turn allows it to use the _STA
    method to determine whether the device has been removed or inserted.
    On removal, devices are marked as detached. On insertion, a hotplug scan
    is started. This should avoid lockups caused by the ata layer attempting
    to scan devices which have been removed. The uevent sending is moved
    outside the spinlock in order to avoid a warning generated by it firing
    when interrupts are disabled.

    Signed-off-by: Matthew Garrett
    Signed-off-by: Jeff Garzik

    Matthew Garrett
     
  • I was hoping ATA_HORKAGE_NODMA | ATA_HORKAGE_SKIP_PM could keep it
    happy but no even this doesn't work under certain configurations and
    it's not like we can do anything useful with the cofig device anyway.
    Replace ATA_HORKAGE_SKIP_PM with ATA_HORKAGE_DISABLE and use it for
    the config device. This makes the device completely ignored by
    libata.

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

    Tejun Heo
     
  • When 4140 PMP is attached to sil24, NCQ commands to fan out port 1 and
    2 (0 based) often stall if commands are in progress to other ports.
    I've tried a number of things but can't tell what's going on. It
    never happens w/ ahci and reportedly sata_mv which can issue NCQ
    commands to multiple devices simultaneously like sil24 does.

    Disable NCQ for devices behind 4140 PMP for the time being.

    Signed-off-by: Tejun Heo
    Cc: Mark Lord
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • There's no reason to schedule LPM action after probing is complete
    causing another EH iteration. Just schedule it together with probing
    itself.

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

    Tejun Heo
     
  • PMP notification during reset can make some controllers fail reset
    processing and needs to be turned off during resets. PMP attach and
    full-revalidation path did this via sata_pmp_configure() but the quick
    revalidation wasn't. Move the notification disable code right above
    fan-out port recovery so that it's always turned off.

    This fixes obscure reset failures.

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

    Tejun Heo
     
  • 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
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm:
    dlm: should be "unifdef"ed.
    dlm: fix plock dev_write return value
    dlm: tcp_connect_to_sock should check for -EINVAL, not EINVAL
    dlm: section mismatch warning fix
    dlm: convert connections_lock in a mutex

    Linus Torvalds
     
  • * 'kvm-updates-2.6.26' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm:
    KVM: LAPIC: ignore pending timers if LVTT is disabled
    KVM: Update MAINTAINERS for new mailing lists
    KVM: Fix kvm_vcpu_block() task state race
    KVM: ia64: Set KVM_IOAPIC_NUM_PINS to 48
    KVM: ia64: fix GVMM module including position-dependent objects
    KVM: ia64: Define new kvm_fpreg struture to replace ia64_fpreg
    KVM: PIT: take inject_pending into account when emulating hlt
    s390: KVM guest: fix compile error
    KVM: x86 emulator: fix writes to registers with modrm encodings

    Linus Torvalds
     
  • Given that contains a conditional __KERNEL__ test,
    it should be moved from header-y to unifdef-y.

    Signed-off-by: Robert P. J. Day
    Signed-off-by: David Teigland

    Robert P. J. Day
     
  • The return value on writes to the plock device should be
    the number of bytes written. It was returning 0 instead
    when an nfs lock callback was involved.

    Reported-by: Nathan Straz
    Signed-off-by: David Teigland

    David Teigland
     
  • Signed-off-by: Marcin Slusarz
    Cc: Christine Caulfield
    Cc: David Teigland
    Cc: cluster-devel@redhat.com
    Signed-off-by: David Teigland

    Marcin Slusarz
     
  • Removed the section mismatch message:
    WARNING: fs/dlm/dlm.o(.init.text+0x132): Section mismatch in reference from the function init_module() to the function .exit.text:dlm_netlink_exit()

    Since dlm_netlink_exit() is called in the init_dlm() error handling,
    the __exit annotation has been removed.

    Signed-off-by: Leonardo Potenza
    Signed-off-by: David Teigland

    Leonardo Potenza