25 May, 2010

9 commits

  • Remove own implementation of hex_to_bin().

    Signed-off-by: Andy Shevchenko
    Cc: Eric W. Biederman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Minor cleanup on duplicate __{start/stop}__ksymtab_gpl_future.

    Signed-off-by: Wenji Huang
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wenji Huang
     
  • Add global mutex zonelists_mutex to fix the possible race:

    CPU0 CPU1 CPU2
    (1) zone->present_pages += online_pages;
    (2) build_all_zonelists();
    (3) alloc_page();
    (4) free_page();
    (5) build_all_zonelists();
    (6) __build_all_zonelists();
    (7) zone->pageset = alloc_percpu();

    In step (3,4), zone->pageset still points to boot_pageset, so bad
    things may happen if 2+ nodes are in this state. Even if only 1 node
    is accessing the boot_pageset, (3) may still consume too much memory
    to fail the memory allocations in step (7).

    Besides, atomic operation ensures alloc_percpu() in step (7) will never fail
    since there is a new fresh memory block added in step(6).

    [haicheng.li@linux.intel.com: hold zonelists_mutex when build_all_zonelists]
    Signed-off-by: Haicheng Li
    Signed-off-by: Wu Fengguang
    Reviewed-by: Andi Kleen
    Cc: Christoph Lameter
    Cc: Mel Gorman
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Haicheng Li
     
  • For each new populated zone of hotadded node, need to update its pagesets
    with dynamically allocated per_cpu_pageset struct for all possible CPUs:

    1) Detach zone->pageset from the shared boot_pageset
    at end of __build_all_zonelists().

    2) Use mutex to protect zone->pageset when it's still
    shared in onlined_pages()

    Otherwises, multiple zones of different nodes would share same boot strapping
    boot_pageset for same CPU, which will finally cause below kernel panic:

    ------------[ cut here ]------------
    kernel BUG at mm/page_alloc.c:1239!
    invalid opcode: 0000 [#1] SMP
    ...
    Call Trace:
    [] __alloc_pages_nodemask+0x131/0x7b0
    [] alloc_pages_current+0x87/0xd0
    [] __page_cache_alloc+0x67/0x70
    [] __do_page_cache_readahead+0x120/0x260
    [] ra_submit+0x21/0x30
    [] ondemand_readahead+0x166/0x2c0
    [] page_cache_async_readahead+0x80/0xa0
    [] generic_file_aio_read+0x364/0x670
    [] nfs_file_read+0xca/0x130
    [] do_sync_read+0xfa/0x140
    [] vfs_read+0xb5/0x1a0
    [] sys_read+0x51/0x80
    [] system_call_fastpath+0x16/0x1b
    RIP [] get_page_from_freelist+0x883/0x900
    RSP
    ---[ end trace 4bda28328b9990db ]

    [akpm@linux-foundation.org: merge fix]
    Signed-off-by: Haicheng Li
    Signed-off-by: Wu Fengguang
    Reviewed-by: Andi Kleen
    Reviewed-by: Christoph Lameter
    Cc: Mel Gorman
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Haicheng Li
     
  • Enable users to online CPUs even if the CPUs belongs to a numa node which
    doesn't have onlined local memory.

    The zonlists(pg_data_t.node_zonelists[]) of a numa node are created either
    in system boot/init period, or at the time of local memory online. For a
    numa node without onlined local memory, its zonelists are not initialized
    at present. As a result, any memory allocation operations executed by
    CPUs within this node will fail. In fact, an out-of-memory error is
    triggered when attempt to online CPUs before memory comes to online.

    This patch tries to create zonelists for such numa nodes, so that the
    memory allocation for this node can be fallback'ed to other nodes.

    [akpm@linux-foundation.org: remove unneeded export]
    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: minskey guo
    Cc: Minchan Kim
    Cc: Yasunori Goto
    Cc: Andi Kleen
    Cc: Christoph Lameter
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    minskey guo
     
  • …hen it should be reclaimed

    The kernel applies some heuristics when deciding if memory should be
    compacted or reclaimed to satisfy a high-order allocation. One of these
    is based on the fragmentation. If the index is below 500, memory will not
    be compacted. This choice is arbitrary and not based on data. To help
    optimise the system and set a sensible default for this value, this patch
    adds a sysctl extfrag_threshold. The kernel will only compact memory if
    the fragmentation index is above the extfrag_threshold.

    [randy.dunlap@oracle.com: Fix build errors when proc fs is not configured]
    Signed-off-by: Mel Gorman <mel@csn.ul.ie>
    Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
    Cc: Rik van Riel <riel@redhat.com>
    Cc: Minchan Kim <minchan.kim@gmail.com>
    Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
    Cc: Christoph Lameter <cl@linux-foundation.org>
    Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

    Mel Gorman
     
  • Add a proc file /proc/sys/vm/compact_memory. When an arbitrary value is
    written to the file, all zones are compacted. The expected user of such a
    trigger is a job scheduler that prepares the system before the target
    application runs.

    Signed-off-by: Mel Gorman
    Acked-by: Rik van Riel
    Reviewed-by: KAMEZAWA Hiroyuki
    Reviewed-by: Minchan Kim
    Reviewed-by: KOSAKI Motohiro
    Reviewed-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mel Gorman
     
  • Before applying this patch, cpuset updates task->mems_allowed and
    mempolicy by setting all new bits in the nodemask first, and clearing all
    old unallowed bits later. But in the way, the allocator may find that
    there is no node to alloc memory.

    The reason is that cpuset rebinds the task's mempolicy, it cleans the
    nodes which the allocater can alloc pages on, for example:

    (mpol: mempolicy)
    task1 task1's mpol task2
    alloc page 1
    alloc on node0? NO 1
    1 change mems from 1 to 0
    1 rebind task1's mpol
    0-1 set new bits
    0 clear disallowed bits
    alloc on node1? NO 0
    ...
    can't alloc page
    goto oom

    This patch fixes this problem by expanding the nodes range first(set newly
    allowed bits) and shrink it lazily(clear newly disallowed bits). So we
    use a variable to tell the write-side task that read-side task is reading
    nodemask, and the write-side task clears newly disallowed nodes after
    read-side task ends the current memory allocation.

    [akpm@linux-foundation.org: fix spello]
    Signed-off-by: Miao Xie
    Cc: David Rientjes
    Cc: Nick Piggin
    Cc: Paul Menage
    Cc: Lee Schermerhorn
    Cc: Hugh Dickins
    Cc: Ravikiran Thirumalai
    Cc: KOSAKI Motohiro
    Cc: Christoph Lameter
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miao Xie
     
  • Nick Piggin reported that the allocator may see an empty nodemask when
    changing cpuset's mems[1]. It happens only on the kernel that do not do
    atomic nodemask_t stores. (MAX_NUMNODES > BITS_PER_LONG)

    But I found that there is also a problem on the kernel that can do atomic
    nodemask_t stores. The problem is that the allocator can't find a node to
    alloc page when changing cpuset's mems though there is a lot of free
    memory. The reason is like this:

    (mpol: mempolicy)
    task1 task1's mpol task2
    alloc page 1
    alloc on node0? NO 1
    1 change mems from 1 to 0
    1 rebind task1's mpol
    0-1 set new bits
    0 clear disallowed bits
    alloc on node1? NO 0
    ...
    can't alloc page
    goto oom

    I can use the attached program reproduce it by the following step:

    # mkdir /dev/cpuset
    # mount -t cpuset cpuset /dev/cpuset
    # mkdir /dev/cpuset/1
    # echo `cat /dev/cpuset/cpus` > /dev/cpuset/1/cpus
    # echo `cat /dev/cpuset/mems` > /dev/cpuset/1/mems
    # echo $$ > /dev/cpuset/1/tasks
    # numactl --membind=`cat /dev/cpuset/mems` ./cpuset_mem_hog &
    = max(nr_cpus - 1, 1)
    # killall -s SIGUSR1 cpuset_mem_hog
    # ./change_mems.sh

    several hours later, oom will happen though there is a lot of free memory.

    This patchset fixes this problem by expanding the nodes range first(set
    newly allowed bits) and shrink it lazily(clear newly disallowed bits). So
    we use a variable to tell the write-side task that read-side task is
    reading nodemask, and the write-side task clears newly disallowed nodes
    after read-side task ends the current memory allocation.

    This patch:

    In order to fix no node to alloc memory, when we want to update mempolicy
    and mems_allowed, we expand the set of nodes first (set all the newly
    nodes) and shrink the set of nodes lazily(clean disallowed nodes), But the
    mempolicy's rebind functions may breaks the expanding.

    So we restructure the mempolicy's rebind functions and split the rebind
    work to two steps, just like the update of cpuset's mems: The 1st step:
    expand the set of the mempolicy's nodes. The 2nd step: shrink the set of
    the mempolicy's nodes. It is used when there is no real lock to protect
    the mempolicy in the read-side. Otherwise we can do rebind work at once.

    In order to implement it, we define

    enum mpol_rebind_step {
    MPOL_REBIND_ONCE,
    MPOL_REBIND_STEP1,
    MPOL_REBIND_STEP2,
    MPOL_REBIND_NSTEP,
    };

    If the mempolicy needn't be updated by two steps, we can pass
    MPOL_REBIND_ONCE to the rebind functions. Or we can pass
    MPOL_REBIND_STEP1 to do the first step of the rebind work and pass
    MPOL_REBIND_STEP2 to do the second step work.

    Besides that, it maybe long time between these two step and we have to
    release the lock that protects mempolicy and mems_allowed. If we hold the
    lock once again, we must check whether the current mempolicy is under the
    rebinding (the first step has been done) or not, because the task may
    alloc a new mempolicy when we don't hold the lock. So we defined the
    following flag to identify it:

    #define MPOL_F_REBINDING (1 << 2)

    The new functions will be used in the next patch.

    Signed-off-by: Miao Xie
    Cc: David Rientjes
    Cc: Nick Piggin
    Cc: Paul Menage
    Cc: Lee Schermerhorn
    Cc: Hugh Dickins
    Cc: Ravikiran Thirumalai
    Cc: KOSAKI Motohiro
    Cc: Christoph Lameter
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miao Xie
     

24 May, 2010

2 commits

  • commit 3bbb9ec946 (timers: Introduce the concept of timer slack for
    legacy timers) does not take the case into account when the timer is
    already expired. This broke wireless drivers.

    The solution is not to apply slack to already expired timers.

    Signed-off-by: Thomas Gleixner
    Cc: Arjan van de Ven

    Jeff Chua
     
  • commit 64ce4c2f (time: Clean up warp_clock()) breaks the timezone
    update in a very subtle way. To avoid the direct access to timekeeping
    internals it adds the timezone delta to the current time with
    timespec_add_safe(). This works nicely when the timezone delta is > 0.
    If timezone delta is < 0 then the wrap check in timespec_add_safe()
    triggers and timespec_add_safe() returns TIME_MAX and screws up
    timekeeping completely.

    The comment above timespec_add_safe() says:
    It's assumed that both values are valid (>= 0)

    Add the timezone seconds adjustment directly.

    Reported-by: Rafael J. Wysocki
    Tested-by: Rafael J. Wysocki
    Acked-by: John Stultz
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

22 May, 2010

14 commits

  • * 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (36 commits)
    PCI: hotplug: pciehp: Removed check for hotplug of display devices
    PCI: read memory ranges out of Broadcom CNB20LE host bridge
    PCI: Allow manual resource allocation for PCI hotplug bridges
    x86/PCI: make ACPI MCFG reserved error messages ACPI specific
    PCI hotplug: Use kmemdup
    PM/PCI: Update PCI power management documentation
    PCI: output FW warning in pci_read/write_vpd
    PCI: fix typos pci_device_dis/enable to pci_dis/enable_device in comments
    PCI quirks: disable msi on AMD rs4xx internal gfx bridges
    PCI: Disable MSI for MCP55 on P5N32-E SLI
    x86/PCI: irq and pci_ids patch for additional Intel Cougar Point DeviceIDs
    PCI: aerdrv: trivial cleanup for aerdrv_core.c
    PCI: aerdrv: trivial cleanup for aerdrv.c
    PCI: aerdrv: introduce default_downstream_reset_link
    PCI: aerdrv: rework find_aer_service
    PCI: aerdrv: remove is_downstream
    PCI: aerdrv: remove magical ROOT_ERR_STATUS_MASKS
    PCI: aerdrv: redefine PCI_ERR_ROOT_*_SRC
    PCI: aerdrv: rework do_recovery
    PCI: aerdrv: rework get_e_source()
    ...

    Linus Torvalds
     
  • * git://git.infradead.org/iommu-2.6:
    intel-iommu: Set a more specific taint flag for invalid BIOS DMAR tables
    intel-iommu: Combine the BIOS DMAR table warning messages
    panic: Add taint flag TAINT_FIRMWARE_WORKAROUND ('I')
    panic: Allow warnings to set different taint flags
    intel-iommu: intel_iommu_map_range failed at very end of address space
    intel-iommu: errors with smaller iommu widths
    intel-iommu: Fix boot inside 64bit virtualbox with io-apic disabled
    intel-iommu: use physfn to search drhd for VF
    intel-iommu: Print out iommu seq_id
    intel-iommu: Don't complain that ACPI_DMAR_SCOPE_TYPE_IOAPIC is not supported
    intel-iommu: Avoid global flushes with caching mode.
    intel-iommu: Use correct domain ID when caching mode is enabled
    intel-iommu mistakenly uses offset_pfn when caching mode is enabled
    intel-iommu: use for_each_set_bit()
    intel-iommu: Fix section mismatch dmar_ir_support() uses dmar_tbl.

    Linus Torvalds
     
  • * 'modules' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
    module: drop the lock while waiting for module to complete initialization.
    MODULE_DEVICE_TABLE(isapnp, ...) does nothing
    hisax_fcpcipnp: fix broken isapnp device table.
    isapnp: move definitions to mod_devicetable.h so file2alias can reach them.

    Linus Torvalds
     
  • * 'for-2.6.35' of git://git.kernel.dk/linux-2.6-block: (86 commits)
    pipe: set lower and upper limit on max pages in the pipe page array
    pipe: add support for shrinking and growing pipes
    drbd: This is now equivalent to drbd release 8.3.8rc1
    drbd: Do not free p_uuid early, this is done in the exit code of the receiver
    drbd: Null pointer deref fix to the large "multi bio rewrite"
    drbd: Fix: Do not detach, if a bio with a barrier fails
    drbd: Ensure to not trigger late-new-UUID creation multiple times
    drbd: Do not Oops when C_STANDALONE when uuid gets generated
    writeback: fix mixed up arguments to bdi_start_writeback()
    writeback: fix problem with !CONFIG_BLOCK compilation
    block: improve automatic native capacity unlocking
    block: use struct parsed_partitions *state universally in partition check code
    block,ide: simplify bdops->set_capacity() to ->unlock_native_capacity()
    block: restart partition scan after resizing a device
    buffer: make invalidate_bdev() drain all percpu LRU add caches
    block: remove all rcu head initializations
    writeback: fixups for !dirty_writeback_centisecs
    writeback: bdi_writeback_task() must set task state before calling schedule()
    writeback: ensure that WB_SYNC_NONE writeback with sb pinned is sync
    drivers/block/drbd: Use kzalloc
    ...

    Linus Torvalds
     
  • Fix kernel-doc warnings, kernel-doc special characters, and
    typos in recent kernel/sysctl.c additions.

    Signed-off-by: Randy Dunlap
    Cc: Amerigo Wang
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (46 commits)
    random: simplify fips mode
    crypto: authenc - Fix cryptlen calculation
    crypto: talitos - add support for sha224
    crypto: talitos - add hash algorithms
    crypto: talitos - second prepare step for adding ahash algorithms
    crypto: talitos - prepare for adding ahash algorithms
    crypto: n2 - Add Niagara2 crypto driver
    crypto: skcipher - Add ablkcipher_walk interfaces
    crypto: testmgr - Add testing for async hashing and update/final
    crypto: tcrypt - Add speed tests for async hashing
    crypto: scatterwalk - Fix scatterwalk_done() test
    crypto: hifn_795x - Rename ablkcipher_walk to hifn_cipher_walk
    padata: Use get_online_cpus/put_online_cpus in padata_free
    padata: Add some code comments
    padata: Flush the padata queues actively
    padata: Use a timer to handle remaining objects in the reorder queues
    crypto: shash - Remove usage of CRYPTO_MINALIGN
    crypto: mv_cesa - Use resource_size
    crypto: omap - OMAP macros corrected
    padata: Use get_online_cpus/put_online_cpus
    ...

    Fix up conflicts in arch/arm/mach-omap2/devices.c

    Linus Torvalds
     
  • Conflicts:
    fs/ext3/fsync.c

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • We need at least two to guarantee proper POSIX behaviour, so
    never allow a smaller limit than that.

    Also expose a /proc/sys/fs/pipe-max-pages sysctl file that allows
    root to define a sane upper limit. Make it default to 16 times the
    default size, which is 16 pages.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • This patch adds F_GETPIPE_SZ and F_SETPIPE_SZ fcntl() actions for
    growing and shrinking the size of a pipe and adjusts pipe.c and splice.c
    (and relay and network splice) usage to work with these larger (or smaller)
    pipes.

    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • …jwessel/linux-2.6-kgdb

    * 'dbg-early-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb:
    echi-dbgp: Add kernel debugger support for the usb debug port
    earlyprintk,vga,kdb: Fix \b and \r for earlyprintk=vga with kdb
    kgdboc: Add ekgdboc for early use of the kernel debugger
    x86,early dr regs,kgdb: Allow kernel debugger early dr register access
    x86,kgdb: Implement early hardware breakpoint debugging
    x86, kgdb, init: Add early and late debug states
    x86, kgdb: early trap init for early debug

    Linus Torvalds
     
  • * 'kdb-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb: (25 commits)
    kdb,debug_core: Allow the debug core to receive a panic notification
    MAINTAINERS: update kgdb, kdb, and debug_core info
    debug_core,kdb: Allow the debug core to process a recursive debug entry
    printk,kdb: capture printk() when in kdb shell
    kgdboc,kdb: Allow kdb to work on a non open console port
    kgdb: Add the ability to schedule a breakpoint via a tasklet
    mips,kgdb: kdb low level trap catch and stack trace
    powerpc,kgdb: Introduce low level trap catching
    x86,kgdb: Add low level debug hook
    kgdb: remove post_primary_code references
    kgdb,docs: Update the kgdb docs to include kdb
    kgdboc,keyboard: Keyboard driver for kdb with kgdb
    kgdb: gdb "monitor" -> kdb passthrough
    sparc,sunzilog: Add console polling support for sunzilog serial driver
    sh,sh-sci: Use NO_POLL_CHAR in the SCIF polled console code
    kgdb,8250,pl011: Return immediately from console poll
    kgdb: core changes to support kdb
    kdb: core for kgdb back end (2 of 2)
    kdb: core for kgdb back end (1 of 2)
    kgdb,blackfin: Add in kgdb_arch_set_pc for blackfin
    ...

    Linus Torvalds
     
  • This allows bin_attr->read,write,mmap callbacks to check file specific data
    (such as inode owner) as part of any privilege validation.

    Signed-off-by: Chris Wright
    Signed-off-by: Greg Kroah-Hartman

    Chris Wright
     
  • The conversion of device->sem to device->mutex resulted in lockdep
    warnings. Create a novalidate class for now until the driver folks
    come up with separate classes. That way we have at least the basic
    mutex debugging coverage.

    Add a checkpatch error so the usage is reserved for device->mutex.

    [ tglx: checkpatch and compile fix for LOCKDEP=n ]

    Signed-off-by: Peter Zijlstra
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Peter Zijlstra
     
  • Of the three uses of kref_set in the kernel:

    One really should be kref_put as the code is letting go of a
    reference,
    Two really should be kref_init because the kref is being
    initialised.

    This suggests that making kref_set available encourages bad code.
    So fix the three uses and remove kref_set completely.

    Signed-off-by: NeilBrown
    Acked-by: Mimi Zohar
    Acked-by: Serge Hallyn
    Signed-off-by: Greg Kroah-Hartman

    NeilBrown
     

21 May, 2010

15 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (182 commits)
    [SCSI] aacraid: add an ifdef'd device delete case instead of taking the device offline
    [SCSI] aacraid: prohibit access to array container space
    [SCSI] aacraid: add support for handling ATA pass-through commands.
    [SCSI] aacraid: expose physical devices for models with newer firmware
    [SCSI] aacraid: respond automatically to volumes added by config tool
    [SCSI] fcoe: fix fcoe module ref counting
    [SCSI] libfcoe: FIP Keep-Alive messages for VPorts are sent with incorrect port_id and wwn
    [SCSI] libfcoe: Fix incorrect MAC address clearing
    [SCSI] fcoe: fix a circular locking issue with rtnl and sysfs mutex
    [SCSI] libfc: Move the port_id into lport
    [SCSI] fcoe: move link speed checking into its own routine
    [SCSI] libfc: Remove extra pointer check
    [SCSI] libfc: Remove unused fc_get_host_port_type
    [SCSI] fcoe: fixes wrong error exit in fcoe_create
    [SCSI] libfc: set seq_id for incoming sequence
    [SCSI] qla2xxx: Updates to ISP82xx support.
    [SCSI] qla2xxx: Optionally disable target reset.
    [SCSI] qla2xxx: ensure flash operation and host reset via sg_reset are mutually exclusive
    [SCSI] qla2xxx: Silence bogus warning by gcc for wrap and did.
    [SCSI] qla2xxx: T10 DIF support added.
    ...

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (229 commits)
    USB: remove unused usb_buffer_alloc and usb_buffer_free macros
    usb: musb: update gfp/slab.h includes
    USB: ftdi_sio: fix legacy SIO-device header
    USB: kl5usb105: reimplement using generic framework
    USB: kl5usb105: minor clean ups
    USB: kl5usb105: fix memory leak
    USB: io_ti: use kfifo to implement write buffering
    USB: io_ti: remove unsused private counter
    USB: ti_usb: use kfifo to implement write buffering
    USB: ir-usb: fix incorrect write-buffer length
    USB: aircable: fix incorrect write-buffer length
    USB: safe_serial: straighten out read processing
    USB: safe_serial: reimplement read using generic framework
    USB: safe_serial: reimplement write using generic framework
    usb-storage: always print quirks
    USB: usb-storage: trivial debug improvements
    USB: oti6858: use port write fifo
    USB: oti6858: use kfifo to implement write buffering
    USB: cypress_m8: use kfifo to implement write buffering
    USB: cypress_m8: remove unused drain define
    ...

    Fix up conflicts (due to usb_buffer_alloc/free renaming) in
    drivers/input/tablet/acecad.c
    drivers/input/tablet/kbtab.c
    drivers/input/tablet/wacom_sys.c
    drivers/media/video/gspca/gspca.c
    sound/usb/usbaudio.c

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1674 commits)
    qlcnic: adding co maintainer
    ixgbe: add support for active DA cables
    ixgbe: dcb, do not tag tc_prio_control frames
    ixgbe: fix ixgbe_tx_is_paused logic
    ixgbe: always enable vlan strip/insert when DCB is enabled
    ixgbe: remove some redundant code in setting FCoE FIP filter
    ixgbe: fix wrong offset to fc_frame_header in ixgbe_fcoe_ddp
    ixgbe: fix header len when unsplit packet overflows to data buffer
    ipv6: Never schedule DAD timer on dead address
    ipv6: Use POSTDAD state
    ipv6: Use state_lock to protect ifa state
    ipv6: Replace inet6_ifaddr->dead with state
    cxgb4: notify upper drivers if the device is already up when they load
    cxgb4: keep interrupts available when the ports are brought down
    cxgb4: fix initial addition of MAC address
    cnic: Return SPQ credit to bnx2x after ring setup and shutdown.
    cnic: Convert cnic_local_flags to atomic ops.
    can: Fix SJA1000 command register writes on SMP systems
    bridge: fix build for CONFIG_SYSFS disabled
    ARCNET: Limit com20020 PCI ID matches for SOHARD cards
    ...

    Fix up various conflicts with pcmcia tree drivers/net/
    {pcmcia/3c589_cs.c, wireless/orinoco/orinoco_cs.c and
    wireless/orinoco/spectrum_cs.c} and feature removal
    (Documentation/feature-removal-schedule.txt).

    Also fix a non-content conflict due to pm_qos_requirement getting
    renamed in the PM tree (now pm_qos_request) in net/mac80211/scan.c

    Linus Torvalds
     
  • The kernel debugger can operate well before mm_init(), but the x86
    hardware breakpoint code which uses the perf api requires that the
    kernel allocators are initialized.

    This means the kernel debug core needs to provide an optional arch
    specific call back to allow the initialization functions to run after
    the kernel has been further initialized.

    The kdb shell already had a similar restriction with an early
    initialization and late initialization. The kdb_init() was moved into
    the debug core's version of the late init which is called
    dbg_late_init();

    CC: kgdb-bugreport@lists.sourceforge.net
    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • It is highly desirable to trap into kdb on panic. The debug core will
    attempt to register as the first in line for the panic notifier.

    CC: Ingo Molnar
    CC: Andrew Morton
    CC: Eric W. Biederman
    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • This allows kdb to debug a crash with in the kms code with a
    single level recursive re-entry.

    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • Certain calls from the kdb shell will call out to printk(), and any of
    these calls should get vectored back to the kdb_printf() so that the
    kdb pager and processing can be used, as well as to properly channel
    I/O to the polled I/O devices.

    CC: Randy Dunlap
    Signed-off-by: Jason Wessel
    Acked-by: Andrew Morton

    Jason Wessel
     
  • If kdb is open on a serial port that is not actually a console make
    sure to call the poll routines to emit and receive characters.

    Signed-off-by: Jason Wessel
    Acked-by: Martin Hicks

    Jason Wessel
     
  • Some kgdb I/O modules require the ability to create a breakpoint
    tasklet, such as kgdboc and external modules such as kgdboe. The
    breakpoint tasklet is used as an asynchronous entry point into the
    debugger which will have a different function scope than the current
    execution path where it might not be safe to have an inline
    breakpoint. This is true of some of the kgdb I/O drivers which share
    code with kgdb and rest of the kernel users.

    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • The only way the debugger can handle a trap in inside rcu_lock,
    notify_die, or atomic_notifier_call_chain without a triple fault is
    to have a low level "first opportunity handler" in the int3 exception
    handler.

    Generally this will be something the vast majority of folks will not
    need, but for those who need it, it is added as a kernel .config
    option called KGDB_LOW_LEVEL_TRAP.

    CC: Ingo Molnar
    CC: Thomas Gleixner
    CC: H. Peter Anvin
    CC: x86@kernel.org
    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • Remove all the references to the kgdb_post_primary_code. This
    function serves no useful purpose because you can obtain the same
    information from the "struct kgdb_state *ks" from with in the
    debugger, if for some reason you want the data.

    Also remove the unintentional duplicate assignment for ks->ex_vector.

    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • This patch adds in the kdb PS/2 keyboard driver. This was mostly a
    direct port from the original kdb where I cleaned up the code against
    checkpatch.pl and added the glue to stitch it into kgdb.

    This patch also enables early kdb debug via kgdbwait and the keyboard.

    All the access to configure kdb using either a serial console or the
    keyboard is done via kgdboc.

    If you want to use only the keyboard and want to break in early you
    would add to your kernel command arguments:

    kgdboc=kbd kgdbwait

    If you wanted serial and or the keyboard access you could use:

    kgdboc=kbd,ttyS0

    You can also configure kgdboc as a kernel module or at run time with
    the sysfs where you can activate and deactivate kgdb.

    Turn it on:
    echo kbd,ttyS0 > /sys/module/kgdboc/parameters/kgdboc

    Turn it off:
    echo "" > /sys/module/kgdboc/parameters/kgdboc

    Signed-off-by: Jason Wessel
    Reviewed-by: Dmitry Torokhov

    Jason Wessel
     
  • One of the driving forces behind integrating another front end (kdb)
    to the debug core is to allow front end commands to be accessible via
    gdb's monitor command. It is true that you could write gdb macros to
    get certain data, but you may want to just use gdb to access the
    commands that are available in the kdb front end.

    This patch implements the Rcmd gdb stub packet. In gdb you access
    this with the "monitor" command. For instance you could type "monitor
    help", "monitor lsmod" or "monitor ps A" etc...

    There is no error checking or command restrictions on what you can and
    cannot access at this point. Doing something like trying to set
    breakpoints with the monitor command is going to cause nothing but
    problems. Perhaps in the future only the commands that are actually
    known to work with the gdb monitor command will be available.

    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • The design of the kdb shell requires that every device that can
    provide input to kdb have a polling routine that exits immediately if
    there is no character available. This is required in order to get the
    page scrolling mechanism working.

    Changing the kernel debugger I/O API to require all polling character
    routines to exit immediately if there is no data allows the kernel
    debugger to process multiple input channels.

    NO_POLL_CHAR will be the return code to the polling routine when ever
    there is no character available.

    CC: linux-serial@vger.kernel.org
    Signed-off-by: Jason Wessel

    Jason Wessel
     
  • These are the minimum changes to the kgdb core in order to enable an
    API to connect a new front end (kdb) to the debug core.

    This patch introduces the dbg_kdb_mode variable controls where the
    user level I/O is routed. It will be routed to the gdbstub (kgdb) or
    to the kdb front end which is a simple shell available over the kgdboc
    connection.

    You can switch back and forth between kdb or the gdb stub mode of
    operation dynamically. From gdb stub mode you can blindly type
    "$3#33", or from the kdb mode you can enter "kgdb" to switch to the
    gdb stub.

    The logic in the debug core depends on kdb to look for the typical gdb
    connection sequences and return immediately with KGDB_PASS_EVENT if a
    gdb serial command sequence is detected. That should allow a
    reasonably seamless transition between kdb -> gdb without leaving the
    kernel exception state. The two gdb serial queries that kdb is
    responsible for detecting are the "?" and "qSupported" packets.

    CC: Ingo Molnar
    Signed-off-by: Jason Wessel
    Acked-by: Martin Hicks

    Jason Wessel