07 Apr, 2009

40 commits

  • Replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64)

    Signed-off-by: Yang Hongyang
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yang Hongyang
     
  • Make romfs return f_fsid info for statfs(2).

    Signed-off-by: Coly Li
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Coly Li
     
  • Largely inspired from ipc/ipc_sysctl.c. This patch isolates the mqueue
    sysctl stuff in its own file.

    [akpm@linux-foundation.org: build fix]
    Signed-off-by: Cedric Le Goater
    Signed-off-by: Nadia Derbey
    Signed-off-by: Serge E. Hallyn
    Cc: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Serge E. Hallyn
     
  • Implement multiple mounts of the mqueue file system, and link it to usage
    of CLONE_NEWIPC.

    Each ipc ns has a corresponding mqueuefs superblock. When a user does
    clone(CLONE_NEWIPC) or unshare(CLONE_NEWIPC), the unshare will cause an
    internal mount of a new mqueuefs sb linked to the new ipc ns.

    When a user does 'mount -t mqueue mqueue /dev/mqueue', he mounts the
    mqueuefs superblock.

    Posix message queues can be worked with both through the mq_* system calls
    (see mq_overview(7)), and through the VFS through the mqueue mount. Any
    usage of mq_open() and friends will work with the acting task's ipc
    namespace. Any actions through the VFS will work with the mqueuefs in
    which the file was created. So if a user doesn't remount mqueuefs after
    unshare(CLONE_NEWIPC), mq_open("/ab") will not be reflected in "ls
    /dev/mqueue".

    If task a mounts mqueue for ipc_ns:1, then clones task b with a new ipcns,
    ipcns:2, and then task a is the last task in ipc_ns:1 to exit, then (1)
    ipc_ns:1 will be freed, (2) it's superblock will live on until task b
    umounts the corresponding mqueuefs, and vfs actions will continue to
    succeed, but (3) sb->s_fs_info will be NULL for the sb corresponding to
    the deceased ipc_ns:1.

    To make this happen, we must protect the ipc reference count when

    a) a task exits and drops its ipcns->count, since it might be dropping
    it to 0 and freeing the ipcns

    b) a task accesses the ipcns through its mqueuefs interface, since it
    bumps the ipcns refcount and might race with the last task in the ipcns
    exiting.

    So the kref is changed to an atomic_t so we can use
    atomic_dec_and_lock(&ns->count,mq_lock), and every access to the ipcns
    through ns = mqueuefs_sb->s_fs_info is protected by the same lock.

    Signed-off-by: Cedric Le Goater
    Signed-off-by: Serge E. Hallyn
    Cc: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Serge E. Hallyn
     
  • Move mqueue vfsmount plus a few tunables into the ipc_namespace struct.
    The CONFIG_IPC_NS boolean and the ipc_namespace struct will serve both the
    posix message queue namespaces and the SYSV ipc namespaces.

    The sysctl code will be fixed separately in patch 3. After just this
    patch, making a change to posix mqueue tunables always changes the values
    in the initial ipc namespace.

    Signed-off-by: Cedric Le Goater
    Signed-off-by: Serge E. Hallyn
    Cc: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Serge E. Hallyn
     
  • The mqueuefs filesystem will use this helper as well. Proc's main get_sb
    could also be made to use it, but that will require a bit more rework.

    Signed-off-by: Serge E. Hallyn
    Cc: Cedric Le Goater
    Cc: Alexey Dobriyan
    Cc: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Serge E. Hallyn
     
  • Update the uvesafb documentation to accurately reflect the default options
    used by the driver.

    Signed-off-by: Michal Januszewski
    Cc: Krzysztof Helt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Januszewski
     
  • 1. check for errors returned from clk_get()
    2. fix "Unbalanced enable for IRQ 160"
    3. fix transmit descriptor handling in panning
    4. clean frame buffer on blank - useful for OLED displays
    5. formatting clean up

    Signed-off-by: Guennadi Liakhovetski
    Cc: Dan Williams
    Cc: Sascha Hauer
    Cc: Krzysztof Helt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Guennadi Liakhovetski
     
  • Read DDC information from a connected monitor and use it to select initial
    mode (if the mode is not specified).

    Also, use the information to protect against modes outside the monitor
    specs.

    Signed-off-by: Krzysztof Helt
    Tested-by: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Helt
     
  • The I2C functionality provided by the i2c-voodoo3 driver is moved into the
    tdfxfb (frame buffer driver for Voodoo3 cards). This way there is no
    conflict between the i2c driver and the fb driver.

    The tdfxfb does not make use from the DDC functionality yet but provides
    all the functionality of the i2c-voodoo3 driver.

    Signed-off-by: Krzysztof Helt
    Acked-by: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Helt
     
  • Add disable/enable_kretprobe() and disable/enable_jprobe().

    Signed-off-by: Masami Hiramatsu
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     
  • Add disable_kprobe() and enable_kprobe() to disable/enable kprobes
    temporarily.

    disable_kprobe() asynchronously disables probe handlers of specified
    kprobe. So, after calling it, some handlers can be called at a while.
    enable_kprobe() enables specified kprobe.

    aggr_pre_handler and aggr_post_handler check disabled probes. On the
    other hand aggr_break_handler and aggr_fault_handler don't check it
    because these handlers will be called while executing pre or post handlers
    and usually those help error handling.

    Signed-off-by: Masami Hiramatsu
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     
  • Rename kprobe_enabled to kprobes_all_disarmed and invert logic due to
    avoiding naming confusion from per-probe disabling.

    Signed-off-by: Masami Hiramatsu
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     
  • Fix comment style in kprobes.h.

    Signed-off-by: Masami Hiramatsu
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     
  • Clean up positions of EXPORT_SYMBOL_GPL in kernel/kprobes.c according to
    checkpatch.pl.

    Signed-off-by: Masami Hiramatsu
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     
  • Currently, kprobes can disable all probes at once, but can't disable it
    individually (not unregister, just disable an kprobe, because
    unregistering needs to wait for scheduler synchronization). These patches
    introduce APIs for on-the-fly per-probe disabling and re-enabling by
    dis-arming/re-arming its breakpoint instruction.

    This patch:

    Change old_p to ap in add_new_kprobe() for readability, copy flags member
    in add_aggr_kprobe(), and simplify the code flow of
    register_aggr_kprobe().

    Signed-off-by: Masami Hiramatsu
    Acked-by: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masami Hiramatsu
     
  • Signed-off-by: Mike Rapoport
    Cc: Bryan Wu
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Signed-off-by: Mike Rapoport
    Cc: Bryan Wu
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Some SPI controllers have restrictions on DMAable buffers alignemt.
    Currently if the buffer supplied by protocol driver is not properly
    aligned, the controller silently performs transfer in PIO mode. Addition
    of dma_alignment field to spi_master allows protocol drivers to perform
    proper alignment.

    Signed-off-by: Mike Rapoport
    Cc: Bryan Wu
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Signed-off-by: Mike Rapoport
    Cc: Bryan Wu
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Most SPI peripherals use GPIOs as their chip selects, introduce .gpio_cs
    for this.

    Signed-off-by: Eric Miao
    Cc: David Brownell
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Miao
     
  • With a postfix decrement limit will reach -1 rather than 0, so the warning
    will not be issued.

    Also, add a cpu_relax() into the busy-wait loop.

    Signed-off-by: Roel Kluin
    Cc: Mariusz Ceier
    Acked-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roel Kluin
     
  • 1. Rewrite of the non-dma data transfer functions to use only ONE mode
    of TIMOD (TIMOD=0x1). With TIMOD=0, it was not possible to set the TX
    bit pattern. So the TDBR = 0xFFFF inside the read calls won't work.

    2. Clear SPI_RDBR before reading and before duplex transfer.
    Otherwise the garbage data in RDBR will get read. Since mmc_spi uses a
    lot of duplex transfers, this is the main cause of mmc_spi failure.

    3. Poll RXS for transfer completion. Polling SPIF or TXS cannot
    guarantee transfer completion. This may interrupt a transfer before it
    is finished. Also this may leave garbage data in buffer and affect
    next transfer.

    [Yi Li : add a field "u16 idle_tx_val" in "struct
    bfin5xx_spi_chip" to specify the value to transmit if no TX value
    is supplied.]
    Signed-off-by: Wolfgang Muees
    Signed-off-by: Yi Li
    Signed-off-by: Bryan Wu
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfgang Muees
     
  • Add support for GPIO controlled SPI Chip Selects. To make use of this
    feature, set chip_select = 0 and add a proper cs_gpio to your
    controller_data.

    struct spi_board_info
    .chip_select = 0

    struct bfin5xx_spi_chip
    .cs_gpio = GPIO_P###

    There are various SPI devices that require SPI MODE_0, and need to have
    the Chip Selects asserted during the entire transfer. Consider using
    SPI_MODE_3 (SPI_CPHA | SPI_CPOL) if your device allows it.

    Signed-off-by: Michael Hennerich
    Signed-off-by: Bryan Wu
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Hennerich
     
  • Fix NULL pointer crash when cleaning up from invalid platform resources

    Signed-off-by: Mike Frysinger
    Signed-off-by: Bryan Wu
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • Do this because when things crash, we get simple names like "setup" and
    "start_queue" which is pretty difficult to trace back to the real thing:
    the spi driver

    Signed-off-by: Mike Frysinger
    Signed-off-by: Bryan Wu
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • According to comments in linux/spi/spi.h:

    * All SPI transfers start with the relevant chipselect active. Normally
    * it stays selected until after the last transfer in a message. Drivers
    * can affect the chipselect signal using cs_change.
    *
    * (i) If the transfer isn't the last one in the message, this flag is
    * used to make the chipselect briefly go inactive in the middle of the
    * message. Toggling chipselect in this way may be needed to terminate
    * a chip command, letting a single spi_message perform all of group of
    * chip transactions together.
    *
    * (ii) When the transfer is the last one in the message, the chip may
    * stay selected until the next transfer. On multi-device SPI busses
    * with nothing blocking messages going to other devices, this is just
    * a performance hint; starting a message to another device deselects
    * this one. But in other cases, this can be used to ensure correctness.
    * Some devices need protocol transactions to be built from a series of
    * spi_message submissions, where the content of one message is determined
    * by the results of previous messages and where the whole transaction
    * ends when the chipselect goes intactive.

    Signed-off-by: Yi Li
    Signed-off-by: Bryan Wu
    Acked-by: David Brownell
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yi Li
     
  • This bug can be observed when two SPI devices are sharing the spi bus: One
    device is set as SPI CS 7, another one is using SPI CS 4.

    In spi_bfin5xx.c: cs_active(), cs_deactive() are used to control SPI_FLG
    register. From the debug bellow:

    cs_active: flag: 0x7f91, chip->flag: 0x7f80, cs: 7
    cs_active: flag: 0xef91, chip->flag: 0xef10, cs: 4

    When device A (cs_7) activate CS 7, SPI_FLG is set as 0x7f91 (however,
    SPI_FLG should be set as 0x7f80, or 0x6f91 if in broadcast mode).

    Due to some HW bug (very possibly), if SPI_FLG is set as 0x7f91, SPISSEL7
    is asserted, however SPISSEL4 will be asserted too (I can see this using
    the scope). This is unreasonable according to HRM.

    Signed-off-by: Yi Li
    Signed-off-by: Bryan Wu
    Acked-by: David Brownell
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yi Li
     
  • Without this change, SPI DMA is not reliably under stress tests.
    Obiviously it's a hardware issue which is not addressed by any document.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Bryan Wu
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • The "while" endless loop will cause the system hang if hardware error, so
    we add timeout control to make the system alive.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Bryan Wu
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • When using a BF533-STAMP here with a W25X10 SPI flash. It works fine when
    enable_dma is disabled, but doesn't work at all when turning DMA on. We
    get just 0xff bytes back when trying to read the device.

    Change the code around so that it programs the SPI first and then enables
    DMA, it seems to work a lot better ...

    Signed-off-by: Mike Frysinger
    Signed-off-by: Bryan Wu
    Acked-by: David Brownell
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • - remove duplicated definition MAX_SPI_SSEL

    - remove unnecessary array size

    Signed-off-by: Mike Frysinger
    Signed-off-by: Bryan Wu
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • use the properl BIT_CTL_... defines rather than the internal driv er
    CFG_SPI_... defines

    Signed-off-by: Mike Frysinger
    Signed-off-by: Bryan Wu
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • We only need to check SPI error when DMA failes, cause that is the DMA IRQ
    handling routine.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Bryan Wu
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • Because of DMA hardware issue, we were trying to use software workaround.
    This patch add some useful debug messages to help us debugging the DMA
    code.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Bryan Wu
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • Blackfin's related DMA callback API doesn't need void * cast, so drop it.
    And this driver is for all Blackfin processors not only for BF53x, we
    update the DMA request label for more meaningful information.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Bryan Wu
    Acked-by: David Brownell
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • For DMA TX/RX operation in pump_transfers, DMA contriguration code in TX
    and RX paths are almost the same. This patch unify the duplicated DMA
    code to make it more readable.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Bryan Wu
    Acked-by: David Brownell
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • If the SPI bus registers a receive overflow error, pass the result back up
    to the higher levels.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Bryan Wu
    Acked-by: David Brownell
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • Use len_in_bytes when we care about the number of bytes transferred rather
    than the number of spi transactions. (this value will be the same for
    8bit transfers, but not any other sizes)

    Signed-off-by: Mike Frysinger
    Signed-off-by: Bryan Wu
    Acked-by: David Brownell
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • We already moved bfin_addr_dcachable() and friends into the cacheflush
    header where it belongs, so don't need to include here.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Bryan Wu
    Acked-by: David Brownell
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger