24 Dec, 2009

3 commits

  • When printing legacy sysctls print the warning message
    for each of them only once. This way there is a guarantee
    the syslog won't be flooded for any sane program.

    The original attempt at this made the tables non const and stored
    the flag inline.

    Linus suggested using a separate hash table for this, this is based on a
    code snippet from him.

    The hash implies this is not exact and can sometimes not print a
    new sysctl due to a hash collision, but in practice this should not
    be a problem

    I used a FNV32 hash over the binary string with a 32byte bitmap. This
    gives relatively little collisions when all the predefined binary sysctls
    are hashed:

    size 256
    bucket
    length number
    0: [25]
    1: [67]
    2: [88]
    3: [47]
    4: [22]
    5: [6]
    6: [1]

    The worst case is a single collision of 6 hash values.

    Signed-off-by: Andi Kleen

    Andi Kleen
     
  • * 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (35 commits)
    drm/radeon/kms: add definitions for v4 power tables
    drm/radeon/kms: never combine LVDS with another encoder
    drm/radeon/kms: Check module arguments to be valid V2
    drm/radeon/kms: Avoid crash when trying to cleanup uninitialized structure
    drm/radeon/kms: add cvt mode if we only have lvds w/h and no edid (v4)
    drm/radeon/kms: add 3DC compression support
    drm/radeon/kms: allow rendering while no colorbuffer is set on r300
    drm/radeon/kms: enable memory clock reading on legacy (V2)
    drm/radeon/kms: prevent parallel AtomBIOS calls
    drm/radeon/kms: set proper default tv standard
    drm/radeon/kms: fix legacy rmx
    drm/radeon/kms/atom: fill in proper defines for digital setup
    drm/kms: silencing a false positive warning.
    drm/mm: fix logic for selection of best fit block
    drm/vmwgfx: Use TTM handles instead of SIDs as user-space surface handles.
    drm/vmwgfx: Return -ERESTARTSYS when interrupted by a signal.
    drm/vmwgfx: Fix unlocked ioctl and add proper access control
    drm/radeon: fix build on 64-bit with some compilers.
    drivers/gpu: Use kzalloc for allocating only one thing
    DRM: Rename clamp variable
    ...

    Linus Torvalds
     
  • The USB serial code was a new user of the kfifo API, and it was missed
    when porting things to the new kfifo API.

    Please make the write_fifo in place. Here is my patch to fix the
    regression and full ported version.

    Signed-off-by: Stefani Seibold
    Reported-and-tested-by: Rafael J. Wysocki
    Cc: Greg KH
    Cc: Andrew Morton
    Cc: Alan Stern
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     

23 Dec, 2009

37 commits

  • * korg/drm-radeon-next:
    drm/radeon/kms: add definitions for v4 power tables
    drm/radeon/kms: never combine LVDS with another encoder
    drm/radeon/kms: Check module arguments to be valid V2
    drm/radeon/kms: Avoid crash when trying to cleanup uninitialized structure
    drm/radeon/kms: add cvt mode if we only have lvds w/h and no edid (v4)
    drm/radeon/kms: add 3DC compression support
    drm/radeon/kms: allow rendering while no colorbuffer is set on r300
    drm/radeon/kms: enable memory clock reading on legacy (V2)
    drm/radeon/kms: prevent parallel AtomBIOS calls
    drm/radeon/kms: set proper default tv standard
    drm/radeon/kms: fix legacy rmx
    drm/radeon/kms/atom: fill in proper defines for digital setup

    Dave Airlie
     
  • [airlied: just adding this for completeness to avoid drift between
    public atombios.h files]
    Signed-off-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Alex Deucher
     
  • When linking multiple encoders to a connector, make sure
    to not link LVDS with another connector. Some bioses
    have the same i2c line for LVDS and VGA.

    Signed-off-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Alex Deucher
     
  • This patch add a function which check module argument to be
    valid. On invalid argument it prints a warning and setback
    the default value.

    V2: Allow 0 for vram limit & agp mode which are the default
    value

    Signed-off-by: Jerome Glisse
    Signed-off-by: Dave Airlie

    Jerome Glisse
     
  • Add boolean to record if some part of the driver are initialized or
    not this allow to avoid a crash when trying to cleanup uninitialized
    structure members.

    Signed-off-by: Jerome Glisse
    Signed-off-by: Dave Airlie

    Jerome Glisse
     
  • This fixes LVDS on some mac laptops without a panel edid.

    v2 - Set proper mode type flags
    v3 - Note that this is not neceesarily the exact panel mode,
    but an approximation based on the cvt formula. For these
    systems we should ideally read the mode info out of the
    registers or add a mode table, but this works and is much
    simpler.
    v4 - Update comments and debug message.

    Signed-off-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Alex Deucher
     
  • There are 2 formats:
    ATI1N: 64 bits per 4x4 block, one-channel format
    ATI2N: 128 bits per 4x4 block, two-channel format

    Signed-off-by: Dave Airlie

    Marek Olšák
     
  • Because hardware cannot disable all colorbuffers directly to do depth-only
    rendering, a user should:
    - disable reading from a colorbuffer in blending
    - disable fastfill
    - set the color channel mask to 0 to prevent writing to a colorbuffer

    Signed-off-by: Dave Airlie

    Marek Olšák
     
  • V2: detect IGP cards (which don't have own memory)

    Signed-off-by: Rafał Miłecki
    Acked-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Rafał Miłecki
     
  • This just adds a mutex around the atombios table execution
    so we don't call it from two contexts at once.

    Signed-off-by: Rafał Miłecki
    Signed-off-by: Dave Airlie

    Rafał Miłecki
     
  • we were just using 1 before.

    reported on irc by soreau

    Signed-off-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Alex Deucher
     
  • This makes 640x480 on my R100 work again, both
    in aspect and centered mode.

    Signed-off-by: Alex Deucher
    Tested-by: Dave Airlie
    Signed-off-by: Dave Airlie

    Alex Deucher
     
  • Signed-off-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Alex Deucher
     
  • * nouveau/for-airlied:
    drm/nouveau: fix bug causing pinned buffers to lose their NO_EVICT flag
    drm/nv50: fix suspend/resume delays without firmware present
    drm/nouveau: prevent all channel creation if accel not available
    drm/nv50: fix two potential suspend/resume oopses
    drm/nv40: implement ctxprog/state generation
    drm/nv10: Add the initial graph context and soft methods needed for LMA.
    drm/nouveau: Fix up buffer eviction, and evict them to GART, if possible.
    drm/nouveau: Add proper error handling to nouveau_card_init
    drm/nv04: Fix NV04 set_operation software method.
    drm/nouveau: Kill global state in BIOS script interpreter
    drm/nouveau: Kill global state in NvShadowBIOS
    drm/nouveau: use drm debug levels
    drm/i2c/ch7006: Fix load detection false positives right after system init.
    drm/nv04-nv40: Fix "conflicting memory types" when saving/restoring VGA fonts.

    Dave Airlie
     
  • warning: 'width' may be used uninitialized in this function
    drivers/gpu/drm/drm_edid.c

    Signed-off-by: Marin Mitov
    Signed-off-by: Dave Airlie

    Marin Mitov
     
  • This is from bug 25728.

    [airlied: I'm just forwarding the patch for review, Thomas, ickle?]

    Acked-by: Jerome Glisse
    Acked-by: Thomas Hellstrom
    Signed-off-by: Dave Airlie

    Bob Gleitsmann
     
  • Improve the command verifier to catch all occurences of surface handles,
    and translate to SIDs.

    This way DMA buffers and 3D surfaces share a common handle space,
    which makes it possible for the kms code to differentiate.

    Signed-off-by: Thomas Hellstrom
    Signed-off-by: Dave Airlie

    Thomas Hellstrom
     
  • Fixes for TTM API change.

    Signed-off-by: Thomas Hellstrom
    Signed-off-by: Jakob Bornecrantz
    Signed-off-by: Dave Airlie

    Thomas Hellstrom
     
  • This fixes up vmwgfx for the unlocked ioctl code to avoid
    doing it in the driver. Also adds ioctl flags.

    Signed-off-by: Thomas Hellstrom
    Signed-off-by: Jakob Bornecrantz
    Signed-off-by: Dave Airlie

    Thomas Hellstrom
     
  • drivers/gpu/drm/radeon/radeon_test.c:45: undefined reference to `__udivdi3'

    Reported-by: Mr. James W. Laferriere
    Cc: stable@kernel.org
    Signed-off-by: Dave Airlie

    Dave Airlie
     
  • Use kzalloc rather than kcalloc(1,...)

    The use of the allocated memory that looks like an array is &p->relocs[0],
    but this should be the same as p->relocs.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    @@

    - kcalloc(1,
    + kzalloc(
    ...)
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Dave Airlie

    Julia Lawall
     
  • linux/kernel.h has a "clamp" macro, but r300_cmdbuf also uses a variable
    with the same name. Right now it doesn't seem to include the header,
    but sooner or later someone will. So better rename the variable
    now.

    Signed-off-by: Andi Kleen
    Signed-off-by: Dave Airlie

    Andi Kleen
     
  • * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
    pata_bf54x: handle portmuxing of pins through GPIO PORTs

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
    PM: Runtime PM documentation update
    PM / Runtime: Use device type and device class callbacks
    PM: Use pm_runtime_put_sync in system resume
    PM: Measure device suspend and resume times
    PM: Make the initcall_debug style timing for suspend/resume complete

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
    jfs: Fix 32bit build warning
    Remove obsolete comment in fs.h
    Sanitize f_flags helpers
    Fix f_flags/f_mode in case of lookup_instantiate_filp() from open(pathname, 3)
    anonfd: Allow making anon files read-only
    fs/compat_ioctl.c: fix build error when !BLOCK
    pohmelfs needs I_LOCK
    alloc_file(): simplify handling of mnt_clone_write() errors

    Linus Torvalds
     
  • * 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/dvrabel/uwb:
    MAINTAINERS: update entries for WUSB, UWB and WLP subsystems

    Linus Torvalds
     
  • * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (36 commits)
    powerpc/gc/wii: Remove get_irq_desc()
    powerpc/gc/wii: hlwd-pic: convert irq_desc.lock to raw_spinlock
    powerpc/gamecube/wii: Fix off-by-one error in ugecon/usbgecko_udbg
    powerpc/mpic: Fix problem that affinity is not updated
    powerpc/mm: Fix stupid bug in subpge protection handling
    powerpc/iseries: use DECLARE_COMPLETION_ONSTACK for non-constant completion
    powerpc: Fix MSI support on U4 bridge PCIe slot
    powerpc: Handle VSX alignment faults correctly in little-endian mode
    powerpc/mm: Fix typo of cpumask_clear_cpu()
    powerpc/mm: Fix hash_utils_64.c compile errors with DEBUG enabled.
    powerpc: Convert BUG() to use unreachable()
    powerpc/pseries: Make declarations of cpu_hotplug_driver_lock() ANSI compatible.
    powerpc/pseries: Don't panic when H_PROD fails during cpu-online.
    powerpc/mm: Fix a WARN_ON() with CONFIG_DEBUG_PAGEALLOC and CONFIG_DEBUG_VM
    powerpc/defconfigs: Set HZ=100 on pseries and ppc64 defconfigs
    powerpc/defconfigs: Disable token ring in powerpc defconfigs
    powerpc/defconfigs: Reduce 64bit vmlinux by making acenic and cramfs modules
    powerpc/pseries: Select XICS and PCI_MSI PSERIES
    powerpc/85xx: Wrong variable returned on error
    powerpc/iseries: Convert to proc_fops
    ...

    Linus Torvalds
     
  • Fix the cx23888 driver to use the new kfifo API. Using kfifo_reset()
    may result in a possible race conditions. This patch fixes it by using
    a spinlock around the kfifo_reset() function.

    Signed-off-by: Stefani Seibold
    Cc: Mauro Carvalho Chehab
    Reviewed-by: Andy Walls
    Acked-by: Andy Walls
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • Add kfifo_in_rec() - puts some record data into the FIFO
    Add kfifo_out_rec() - gets some record data from the FIFO
    Add kfifo_from_user_rec() - puts some data from user space into the FIFO
    Add kfifo_to_user_rec() - gets data from the FIFO and write it to user space
    Add kfifo_peek_rec() - gets the size of the next FIFO record field
    Add kfifo_skip_rec() - skip the next fifo out record
    Add kfifo_avail_rec() - determinate the number of bytes available in a record FIFO

    Signed-off-by: Stefani Seibold
    Acked-by: Greg Kroah-Hartman
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • Add kfifo_reset_out() for save lockless discard the fifo output
    Add kfifo_skip() to skip a number of output bytes
    Add kfifo_from_user() to copy user space data into the fifo
    Add kfifo_to_user() to copy fifo data to user space

    Signed-off-by: Stefani Seibold
    Acked-by: Greg Kroah-Hartman
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Andi Kleen
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • Add DECLARE_KFIFO - macro to declare a kfifo and the associated buffer inside a struct
    Add INIT_KFIFO - Initialize a kfifo declared by DECLARED_KFIFO
    Add DEFINE_KFIFO - macro to define and initialize a kfifo as a global or local object
    Add kfifo_size() - returns the size of the fifo in bytes
    Add kfifo_is_empty() - returns true if the fifo is empty
    Add kfifo_is_full() - returns true if the fifo is full
    Add kfifo_avail() - returns the number of bytes available in the FIFO
    Do some code cleanup

    Signed-off-by: Stefani Seibold
    Acked-by: Greg Kroah-Hartman
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Andi Kleen
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • Fix the "ignoring return value of '...', declared with attribute
    warn_unused_result" compiler warning in several users of the new kfifo
    API.

    It removes the __must_check attribute from kfifo_in() and
    kfifo_in_locked() which must not necessary performed.

    Fix the allocation bug in the nozomi driver file, by moving out the
    kfifo_alloc from the interrupt handler into the probe function.

    Fix the kfifo_out() and kfifo_out_locked() users to handle a unexpected
    end of fifo.

    Signed-off-by: Stefani Seibold
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • rename kfifo_put... into kfifo_in... to prevent miss use of old non in
    kernel-tree drivers

    ditto for kfifo_get... -> kfifo_out...

    Improve the prototypes of kfifo_in and kfifo_out to make the kerneldoc
    annotations more readable.

    Add mini "howto porting to the new API" in kfifo.h

    Signed-off-by: Stefani Seibold
    Acked-by: Greg Kroah-Hartman
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Andi Kleen
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • change name of __kfifo_* functions to kfifo_*, because the prefix __kfifo
    should be reserved for internal functions only.

    Signed-off-by: Stefani Seibold
    Acked-by: Greg Kroah-Hartman
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Andi Kleen
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • Move the pointer to the spinlock out of struct kfifo. Most users in
    tree do not actually use a spinlock, so the few exceptions now have to
    call kfifo_{get,put}_locked, which takes an extra argument to a
    spinlock.

    Signed-off-by: Stefani Seibold
    Acked-by: Greg Kroah-Hartman
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Andi Kleen
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • This is a new generic kernel FIFO implementation.

    The current kernel fifo API is not very widely used, because it has to
    many constrains. Only 17 files in the current 2.6.31-rc5 used it.
    FIFO's are like list's a very basic thing and a kfifo API which handles
    the most use case would save a lot of development time and memory
    resources.

    I think this are the reasons why kfifo is not in use:

    - The API is to simple, important functions are missing
    - A fifo can be only allocated dynamically
    - There is a requirement of a spinlock whether you need it or not
    - There is no support for data records inside a fifo

    So I decided to extend the kfifo in a more generic way without blowing up
    the API to much. The new API has the following benefits:

    - Generic usage: For kernel internal use and/or device driver.
    - Provide an API for the most use case.
    - Slim API: The whole API provides 25 functions.
    - Linux style habit.
    - DECLARE_KFIFO, DEFINE_KFIFO and INIT_KFIFO Macros
    - Direct copy_to_user from the fifo and copy_from_user into the fifo.
    - The kfifo itself is an in place member of the using data structure, this save an
    indirection access and does not waste the kernel allocator.
    - Lockless access: if only one reader and one writer is active on the fifo,
    which is the common use case, no additional locking is necessary.
    - Remove spinlock - give the user the freedom of choice what kind of locking to use if
    one is required.
    - Ability to handle records. Three type of records are supported:
    - Variable length records between 0-255 bytes, with a record size
    field of 1 bytes.
    - Variable length records between 0-65535 bytes, with a record size
    field of 2 bytes.
    - Fixed size records, which no record size field.
    - Preserve memory resource.
    - Performance!
    - Easy to use!

    This patch:

    Since most users want to have the kfifo as part of another object,
    reorganize the code to allow including struct kfifo in another data
    structure. This requires changing the kfifo_alloc and kfifo_init
    prototypes so that we pass an existing kfifo pointer into them. This
    patch changes the implementation and all existing users.

    [akpm@linux-foundation.org: fix warning]
    Signed-off-by: Stefani Seibold
    Acked-by: Greg Kroah-Hartman
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Andi Kleen
    Acked-by: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stefani Seibold
     
  • Clean up typos/grammos/spellos in events-kmem.txt.

    Signed-off-by: Randy Dunlap
    Cc: Mel Gorman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap