14 Dec, 2006

7 commits

  • * 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm:
    [ARM] 4017/1: [Jornada7xx] - Updating Jornada720.c
    [ARM] 3992/1: i.MX/MX1 CPU Frequency scaling support
    [ARM] Provide a method to alter the control register
    [ARM] 4016/1: prefetch macro is wrong wrt gcc's "delete-null-pointer-checks"
    [ARM] Remove empty fixup function
    [ARM] 4014/1: include drivers/hid/Kconfig
    [ARM] 4013/1: clocksource driver for netx
    [ARM] 4012/1: Clocksource for pxa
    [ARM] Clean up ioremap code
    [ARM] Unuse another Linux PTE bit
    [ARM] Clean up KERNEL_RAM_ADDR
    [ARM] Add sys_*at syscalls
    [ARM] 4004/1: S3C24XX: UDC remove implict addition of VA to regs
    [ARM] Formalise the ARMv6 processor name string
    [ARM] Handle HWCAP_VFP in VFP support code
    [ARM] 4011/1: AT91SAM9260: Fix compilation with NAND driver
    [ARM] 4010/1: AT91SAM9260-EK board: Prepare for MACB Ethernet support

    Linus Torvalds
     
  • Signed-off-by: Russell King

    Russell King
     
  • Support to change MX1 CPU frequency at runtime.
    Tested on PiKRON's PiMX1 board and seems to be fully
    stable up to 200 MHz end even as low as 8 MHz.

    Signed-off-by: Pavel Pisa
    Signed-off-by: Russell King

    Pavel Pisa
     
  • i.MX needs to tweak the control register to support CPU frequency
    scaling. Rather than have folk blindly try and change the control
    register by writing to it and then wondering why it doesn't work,
    provide a method (which is safe for UP only, and therefore only
    available for UP) to achieve this.

    Signed-off-by: Russell King

    Russell King
     
  • optimization

    The gcc manual says:

    |`-fdelete-null-pointer-checks'
    | Use global dataflow analysis to identify and eliminate useless
    | checks for null pointers. The compiler assumes that dereferencing
    | a null pointer would have halted the program. If a pointer is
    | checked after it has already been dereferenced, it cannot be null.
    | Enabled at levels `-O2', `-O3', `-Os'.

    Now the problem can be seen with this test case:

    #include
    extern void bar(char *x);
    void foo(char *x)
    {
    prefetch(x);
    if (x)
    bar(x);
    }

    Because the constraint to the inline asm used in the prefetch() macro is
    a memory operand, gcc assumes that the asm code does dereference the
    pointer and the delete-null-pointer-checks optimization kicks in.
    Inspection of generated assembly for the above example shows that bar()
    is indeed called unconditionally without any test on the value of x.

    Of course in the prefetch case there is no real dereference and it
    cannot be assumed that a null pointer would have been caught at that
    point. This causes kernel oopses with constructs like
    hlist_for_each_entry() where the list's 'next' content is prefetched
    before the pointer is tested against NULL, and only when gcc feels like
    applying this optimization which doesn't happen all the time with more
    complex code.

    It appears that the way to prevent delete-null-pointer-checks
    optimization to occur in this case is to make prefetch() into a static
    inline function instead of a macro. At least this is what is done on
    x86_64 where a similar inline asm memory operand is used (I presume they
    would have seen the same problem if it didn't work) and resulting code
    for the above example confirms that.

    An alternative would consist of replacing the memory operand by a
    register operand containing the pointer, and use the addressing mode
    explicitly in the asm template. But that would be less optimal than an
    offsettable memory reference.

    Signed-off-by: Nicolas Pitre
    Signed-off-by: Russell King

    Nicolas Pitre
     
  • Virtually index, physically tagged cache architectures can get away
    without cache flushing when forking. This patch adds a new cache
    flushing function flush_cache_dup_mm(struct mm_struct *) which for the
    moment I've implemented to do the same thing on all architectures
    except on MIPS where it's a no-op.

    Signed-off-by: Ralf Baechle
    Signed-off-by: Linus Torvalds

    Ralf Baechle
     
  • Currently, to tell a task that it should go to the refrigerator, we set the
    PF_FREEZE flag for it and send a fake signal to it. Unfortunately there
    are two SMP-related problems with this approach. First, a task running on
    another CPU may be updating its flags while the freezer attempts to set
    PF_FREEZE for it and this may leave the task's flags in an inconsistent
    state. Second, there is a potential race between freeze_process() and
    refrigerator() in which freeze_process() running on one CPU is reading a
    task's PF_FREEZE flag while refrigerator() running on another CPU has just
    set PF_FROZEN for the same task and attempts to reset PF_FREEZE for it. If
    the refrigerator wins the race, freeze_process() will state that PF_FREEZE
    hasn't been set for the task and will set it unnecessarily, so the task
    will go to the refrigerator once again after it's been thawed.

    To solve first of these problems we need to stop using PF_FREEZE to tell
    tasks that they should go to the refrigerator. Instead, we can introduce a
    special TIF_*** flag and use it for this purpose, since it is allowed to
    change the other tasks' TIF_*** flags and there are special calls for it.

    To avoid the freeze_process()-refrigerator() race we can make
    freeze_process() to always check the task's PF_FROZEN flag after it's read
    its "freeze" flag. We should also make sure that refrigerator() will
    always reset the task's "freeze" flag after it's set PF_FROZEN for it.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Cc: Russell King
    Cc: David Howells
    Cc: Andi Kleen
    Cc: "Luck, Tony"
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Paul Mundt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

13 Dec, 2006

2 commits

  • L_PTE_ASID is not really required to be stored in every PTE, since we
    can identify it via the address passed to set_pte_at(). So, create
    set_pte_ext() which takes the address of the PTE to set, the Linux
    PTE value, and the additional CPU PTE bits which aren't encoded in
    the Linux PTE value.

    Signed-off-by: Russell King

    Russell King
     
  • * 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
    i2c: Fix OMAP clock prescaler to match the comment
    i2c: Refactor a kfree in i2c-dev
    i2c: Fix return value check in i2c-dev
    i2c: Enable PEC on more i2c-i801 devices
    i2c: Discard the i2c algo del_bus wrappers
    i2c: New ARM Versatile/Realview bus driver
    i2c: fix broken ds1337 initialization
    i2c: i2c-i801 documentation update
    i2c: Use the __ATTR macro where possible
    i2c: Whitespace cleanups
    i2c: Use put_user instead of copy_to_user where possible
    i2c: New Atmel AT91 bus driver
    i2c: Add support for nested i2c bus locking
    i2c: Cleanups to the i2c-nforce2 bus driver
    i2c: Add request/release_mem_region to i2c-ibm_iic bus driver
    i2c: New Philips PNX bus driver
    i2c: Delete the broken i2c-ite bus driver
    i2c: Update the list of driver IDs
    i2c: Fix documentation typos

    Linus Torvalds
     

11 Dec, 2006

2 commits

  • New I2C bus driver for Philips ARM boards (Philips IP3204 I2C IP
    block). This I2C controller can be found on (at least) PNX010x,
    PNX52xx and PNX4008 Philips boards.

    Signed-off-by: Vitaly Wool
    Signed-off-by: Jean Delvare

    Vitaly Wool
     
  • Stabilize PIO mode transfers against a range of word sizes and FIFO
    thresholds and fixes word size setup/override issues.

    1) 16 and 32 bit DMA/PIO transfers broken due to timing differences.
    2) Potential for bad transfer counts due to transfer size assumptions.
    3) Setup function broken is multiple ways.
    4) Per transfer bit_per_word changes break DMA setup in pump_tranfers.
    5) False positive timeout are not errors.
    6) Changes in pxa2xx_spi_chip not effective in calls to setup.
    7) Timeout scaling wrong for PXA255 NSSP.
    8) Driver leaks memory while busy during unloading.

    Known issues:

    SPI_CS_HIGH and SPI_LSB_FIRST settings in struct spi_device are not handled.

    Testing:

    This patch has been test against the "random length, random bits/word,
    random data (verified on loopback) and stepped baud rate by octaves
    (3.6MHz to 115kHz)" test. It is robust in PIO mode, using any
    combination of tx and rx thresholds, and also in DMA mode (which
    internally computes the thresholds).

    Much thanks to Ned Forrester for exhaustive reviews, fixes and testing.
    The driver is substantially better for his efforts.

    Signed-off-by: Stephen Street
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Street
     

10 Dec, 2006

1 commit


09 Dec, 2006

4 commits

  • This patch adds support for stn displays on the s3c2410 arm SoC.

    The LCD type is choosen by a new field in the s3c2410fb_mach_info structure
    and its value is the value of the PNRMODE bits. This worth to be noted as
    a value of 0 means that you configure a 4 bit dual scan stn display.

    Signed-off-by: Arnaud Patard
    Cc: "Antonino A. Daplas"
    Cc: Russell King
    Cc: Ben Dooks
    Acked-by: James Simmons
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arnaud Patard (Rtp
     
  • In order to sort out our struct termios and add proper speed control we need
    to separate the kernel and user termios structures. Glibc is fine but the
    other libraries rely on the kernel exported struct termios and we need to
    extend this without breaking the ABI/API

    To do so we add a struct ktermios which is the kernel view of a termios
    structure and overlaps the struct termios with extra fields on the end for
    now. (That limitation will go away in later patches). Some platforms (eg
    alpha) planned ahead and thus use the same struct for both, others did not.

    This just adds the structures but does not use them, it seems a sensible
    splitting point for bisect if there are compile failures (not that I expect
    them)

    Signed-off-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • Remove the implicit addition of a virtual address
    to the UDC registers. This should have been done
    by ioremap() in the driver, not by a static map.

    Signed-off-by: Ben Dooks
    Signed-off-by: Russell King

    Ben Dooks
     
  • Don't set HWCAP_VFP in the processor support file; not only does it
    depend on the processor features, but it also depends on the support
    code being present. Therefore, only set it if the support code
    detects that we have a VFP coprocessor attached.

    Also, move the VFP handling of the coprocessor access register into
    the VFP support code.

    Signed-off-by: Russell King

    Russell King
     

08 Dec, 2006

13 commits

  • * 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (76 commits)
    [ARM] 4002/1: S3C24XX: leave parent IRQs unmasked
    [ARM] 4001/1: S3C24XX: shorten reboot time
    [ARM] 3983/2: remove unused argument to __bug()
    [ARM] 4000/1: Osiris: add third serial port in
    [ARM] 3999/1: RX3715: suspend to RAM support
    [ARM] 3998/1: VR1000: LED platform devices
    [ARM] 3995/1: iop13xx: add iop13xx support
    [ARM] 3968/1: iop13xx: add iop13xx_defconfig
    [ARM] Update mach-types
    [ARM] Allow gcc to optimise arm_add_memory a little more
    [ARM] 3991/1: i.MX/MX1 high resolution time source
    [ARM] 3990/1: i.MX/MX1 more precise PLL decode
    [ARM] 3986/1: H1940: suspend to RAM support
    [ARM] 3985/1: ixp4xx clocksource cleanup
    [ARM] 3984/1: ixp4xx/nslu2: Fix disk LED numbering (take 2)
    [ARM] 3994/1: ixp23xx: fix handling of pci master aborts
    [ARM] 3981/1: sched_clock for PXA2xx
    [ARM] 3980/1: extend the ARM Versatile sched_clock implementation from 32 to 63 bit
    [ARM] 3979/1: extend the SA11x0 sched_clock implementation from 32 to 63 bit period
    [ARM] 3978/1: macro to provide a 63-bit value from a 32-bit hardware counter
    ...

    Linus Torvalds
     
  • Merge:
    Atmel AT91RM9200 and AT91SAM9260 changes
    General ARM developments
    Disconfiguous memory cleanups
    64-bit/32-bit division and sched_clock extension patches
    EP93xx support changes
    IOP support changes

    Signed-off-by: Russell King

    Russell King
     
  • Cut down the time between requesting a reboot
    and actually getting the reboot to happen by
    a quarter.

    Signed-off-by: Ben Dooks
    Signed-off-by: Russell King

    Ben Dooks
     
  • It appears that include/asm-arm/bug.h requires include/linux/stddef.h
    for the definition of NULL. It seems that stddef.h was always included
    indirectly in most cases, and that issue was properly fixed a while ago.

    Then commit 5047f09b56d0bc3c21aec9cb16de60283da645c6 incorrectly reverted
    change from commit ff10952a547dad934d9ed9afc5cf579ed1ccb53a (bad dwmw2)
    and the problem recently resurfaced.

    Because the third argument to __bug() is never used anyway, RMK suggested
    getting rid of it entirely instead of readding #include
    which this patch does.

    Signed-off-by: Nicolas Pitre
    Signed-off-by: Russell King

    Nicolas Pitre
     
  • The iop348 processor integrates an Xscale (XSC3 512KB L2 Cache) core with a
    Serial Attached SCSI (SAS) controller, multi-ported DDR2 memory
    controller, 3 Application Direct Memory Access (DMA) controllers, a 133Mhz
    PCI-X interface, a x8 PCI-Express interface, and other peripherals to form
    a system-on-a-chip RAID subsystem engine.

    The iop342 processor replaces the SAS controller with a second Xscale core
    for dual core embedded applications.

    The iop341 processor is the single core version of iop342.

    This patch supports the two Intel customer reference platforms iq81340mc
    for external storage and iq81340sc for direct attach (HBA) development.

    The developer's manual is available here:
    ftp://download.intel.com/design/iio/docs/31503701.pdf

    Changelog:
    * removed virtual addresses from resource definitions
    * cleaned up some unnecessary #include's

    Signed-off-by: Dan Williams
    Signed-off-by: Russell King

    Dan Williams
     
  • Make the contents of the userspace asm/setup.h header consistent on all
    architectures:

    - export setup.h to userspace on all architectures
    - export only COMMAND_LINE_SIZE to userspace
    - frv: move COMMAND_LINE_SIZE from param.h
    - i386: remove duplicate COMMAND_LINE_SIZE from param.h
    - arm:
    - export ATAGs to userspace
    - change u8/u16/u32 to __u8/__u16/__u32

    Signed-off-by: Adrian Bunk
    Acked-by: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • dma_is_consistent() is ill-designed in that it does not have a struct
    device pointer argument which makes proper support for systems that consist
    of a mix of coherent and non-coherent DMA devices hard. Change
    dma_is_consistent to take a struct device pointer as first argument and fix
    the sole caller to pass it.

    Signed-off-by: Ralf Baechle
    Cc: James Bottomley
    Cc: "David S. Miller"
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ralf Baechle
     
  • The last thing we agreed on was to remove the macros entirely for 2.6.19,
    on all architectures. Unfortunately, I think nobody actually _did_ that,
    so they are still there.

    [akpm@osdl.org: x86_64 fix]
    Cc: David Woodhouse
    Cc: Greg Schafer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     
  • Enhanced resolution for time measurement functions.

    Signed-off-by: Pavel Pisa
    Signed-off-by: Sascha Hauer
    Signed-off-by: Russell King

    Pavel Pisa
     
  • Add support to suspend and resume, using the
    H1940's bootloader

    Signed-off-by: Ben Dooks
    Signed-off-by: Arnaud Patard
    Signed-off-by: Russell King

    Ben Dooks
     
  • This patch fixes an error in the numbering of the disk LEDs on the
    Linksys NSLU2. The error crept in because the physical location
    of the LEDs has the Disk 2 LED *above* the Disk 1 LED.

    Thanks to Gordon Farquharson for reporting this.

    Signed-off-by: Rod Whitby
    Signed-off-by: Russell King

    Rod Whitby
     
  • This is done in a completely lockless fashion. Bits 0 to 31 of the count
    are provided by the hardware while bits 32 to 62 are stored in memory.
    The top bit in memory is used to synchronize with the hardware count
    half-period. When the top bit of both counters (hardware and in memory)
    differ then the memory is updated with a new value, incrementing it when
    the hardware counter wraps around. Because a word store in memory is
    atomic then the incremented value will always be in synch with the top
    bit indicating to any potential concurrent reader if the value in memory
    is up to date or not wrt the needed increment. And any race in updating
    the value in memory is harmless as the same value would be stored more
    than once.

    Signed-off-by: Nicolas Pitre
    Signed-off-by: Russell King

    Nicolas Pitre
     
  • On ARM all divisions have to be performed "manually". For 64-bit
    divisions that may take more than a hundred cycles in many cases.

    With 32-bit divisions gcc already use the recyprocal of constant
    divisors to perform a multiplication, but not with 64-bit divisions.

    Since the kernel is increasingly relying upon 64-bit divisions it is
    worth optimizing at least those cases where the divisor is a constant.
    This is what this patch does using plain C code that gets optimized away
    at compile time.

    For example, despite the amount of added C code, do_div(x, 10000) now
    produces the following assembly code (where x is assigned to r0-r1):

    adr r4, .L0
    ldmia r4, {r4-r5}
    umull r2, r3, r4, r0
    mov r2, #0
    umlal r3, r2, r5, r0
    umlal r3, r2, r4, r1
    mov r3, #0
    umlal r2, r3, r5, r1
    mov r0, r2, lsr #11
    orr r0, r0, r3, lsl #21
    mov r1, r3, lsr #11
    ...
    .L0:
    .word 948328779
    .word 879609302

    which is the fastest that can be done for any value of x in that case,
    many times faster than the __do_div64 code (except for the small x value
    space for which the result ends up being zero or a single bit).

    The fact that this code is generated inline produces a tiny increase in
    .text size, but not significant compared to the needed code around each
    __do_div64 call site this code is replacing.

    The algorithm used has been validated on a 16-bit scale for all possible
    values, and then recodified for 64-bit values. Furthermore I've been
    running it with the final BUG_ON() uncommented for over two months now
    with no problem.

    Note that this new code is compiled with gcc versions 4.0 or later.
    Earlier gcc versions proved themselves too problematic and only the
    original code is used with them.

    Signed-off-by: Nicolas Pitre
    Signed-off-by: Russell King

    Nicolas Pitre
     

06 Dec, 2006

1 commit


05 Dec, 2006

1 commit

  • * 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: (82 commits)
    [PATCH] pata_ali: small fixes
    [PATCH] pata_via: VIA 8251 bridged systems are now out and about
    [PATCH] trivial piix: swap bogus dot for comma space
    [PATCH] sata_promise: PHYMODE4 fixup
    [PATCH] libata: always use polling IDENTIFY
    [libata] pata_cs5535: fix build
    [PATCH] ahci: do not powerdown during initialization
    [PATCH] libata: prepare ata_sg_clean() for invocation from EH
    [PATCH] libata: separate out rw ATA taskfile building into ata_build_rw_tf()
    [PATCH] libata: implement ata_exec_internal_sg()
    [PATCH] libata: make sure IRQ is cleared after ata_bmdma_freeze()
    [PATCH] libata: move BMDMA host status recording from EH to interrupt handler
    [PATCH] libata: make sure sdev doesn't go away while rescanning
    [PATCH] libata: don't request sense if the port is frozen
    [PATCH] libata: fix READ CAPACITY simulation
    [PATCH] libata: implement ATA_FLAG_SETXFER_POLLING and use it in pata_via, take #2
    [PATCH] libata: set IRQF_SHARED for legacy PCI IDE IRQs
    [PATCH] libata: remove unused HSM_ST_UNKNOWN
    [PATCH] libata: kill unnecessary sht->max_sectors initializations
    [PATCH] libata: add missing sht->slave_destroy
    ...

    Linus Torvalds
     

04 Dec, 2006

4 commits

  • Removed the infinite loop in our arch_reset().

    After calling arch_reset(), the kernel waits for 1 second before
    printing a "reboot failed" message and then waits for ever itself.

    Signed-off-by: Andrew Victor
    Signed-off-by: Russell King

    Andrew Victor
     
  • The USB Device port registers are already defined in
    drivers/usb/gadget/at91_udc.h. This file can therefore just be removed.

    Signed-off-by: Andrew Victor
    Signed-off-by: Russell King

    Andrew Victor
     
  • Replace the 'is_b' variable with 'slot_b' in at91_mmc_data.
    Also add the new 'chipselect' variable for CF/PCMCIA and 'bus_width_16'
    variable for NAND.

    This (and previous patches) will unfortunately break the current MMC,
    USB Gadget and PCMCIA drivers. Updates and fixes for those drivers will
    be submitted to the various subsystem maintainers.

    Signed-off-by: Andrew Victor
    Signed-off-by: Russell King

    Andrew Victor
     
  • XScale cores either have a DSP coprocessor (which contains a single
    40 bit accumulator register), or an iWMMXt coprocessor (which contains
    eight 64 bit registers.)

    Because of the small amount of state in the DSP coprocessor, access to
    the DSP coprocessor (CP0) is always enabled, and DSP context switching
    is done unconditionally on every task switch. Access to the iWMMXt
    coprocessor (CP0/CP1) is enabled only when an iWMMXt instruction is
    first issued, and iWMMXt context switching is done lazily.

    CONFIG_IWMMXT is supposed to mean 'the cpu we will be running on will
    have iWMMXt support', but boards are supposed to select this config
    symbol by hand, and at least one pxa27x board doesn't get this right,
    so on that board, proc-xscale.S will incorrectly assume that we have a
    DSP coprocessor, enable CP0 on boot, and we will then only save the
    first iWMMXt register (wR0) on context switches, which is Bad.

    This patch redefines CONFIG_IWMMXT as 'the cpu we will be running on
    might have iWMMXt support, and we will enable iWMMXt context switching
    if it does.' This means that with this patch, running a CONFIG_IWMMXT=n
    kernel on an iWMMXt-capable CPU will no longer potentially corrupt iWMMXt
    state over context switches, and running a CONFIG_IWMMXT=y kernel on a
    non-iWMMXt capable CPU will still do DSP context save/restore.

    These changes should make iWMMXt work on PXA3xx, and as a side effect,
    enable proper acc0 save/restore on non-iWMMXt capable xsc3 cores such
    as IOP13xx and IXP23xx (which will not have CONFIG_CPU_XSCALE defined),
    as well as setting and using HWCAP_IWMMXT properly.

    Signed-off-by: Lennert Buytenhek
    Acked-by: Dan Williams
    Signed-off-by: Russell King

    Lennert Buytenhek
     

03 Dec, 2006

1 commit


02 Dec, 2006

4 commits