1. 30 3月, 2010 3 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
    • L
      ext3: fix broken handling of EXT3_STATE_NEW · de329820
      Linus Torvalds 提交于
      In commit 9df93939 ("ext3: Use bitops to read/modify
      EXT3_I(inode)->i_state") ext3 changed its internal 'i_state' variable to
      use bitops for its state handling.  However, unline the same ext4
      change, it didn't actually change the name of the field when it changed
      the semantics of it.
      
      As a result, an old use of 'i_state' remained in fs/ext3/ialloc.c that
      initialized the field to EXT3_STATE_NEW.  And that does not work
      _at_all_ when we're now working with individually named bits rather than
      values that get masked.  So the code tried to mark the state to be new,
      but in actual fact set the field to EXT3_STATE_JDATA.  Which makes no
      sense at all, and screws up all the code that checks whether the inode
      was newly allocated.
      
      In particular, it made the xattr code unhappy, and caused various random
      behavior, like apparently
      
      	https://bugzilla.redhat.com/show_bug.cgi?id=577911
      
      So fix the initialization, and rename the field to match ext4 so that we
      don't have this happen again.
      
      Cc: James Morris <jmorris@namei.org>
      Cc: Stephen Smalley <sds@tycho.nsa.gov>
      Cc: Daniel J Walsh <dwalsh@redhat.com>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: Jan Kara <jack@suse.cz>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      de329820
    • D
      SLOW_WORK: CONFIG_SLOW_WORK_PROC should be CONFIG_SLOW_WORK_DEBUG · a53f4f9e
      David Howells 提交于
      CONFIG_SLOW_WORK_PROC was changed to CONFIG_SLOW_WORK_DEBUG, but not in all
      instances.  Change the remaining instances.  This makes the debugfs file
      display the time mark and the owner's description again.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a53f4f9e
  2. 27 3月, 2010 1 次提交
  3. 25 3月, 2010 6 次提交
  4. 24 3月, 2010 3 次提交
  5. 23 3月, 2010 1 次提交
  6. 22 3月, 2010 2 次提交
  7. 21 3月, 2010 3 次提交
  8. 20 3月, 2010 1 次提交
  9. 19 3月, 2010 6 次提交
    • M
      USB: Fix usb_fill_int_urb for SuperSpeed devices · f09a15e6
      Matthew Wilcox 提交于
      USB 3 and Wireless USB specify a logarithmic encoding of the endpoint
      interval that matches the USB 2 specification.  usb_fill_int_urb() didn't
      know that and was filling in the interval as if it was USB 1.1.  Fix
      usb_fill_int_urb() for SuperSpeed devices, but leave the wireless case
      alone, because David Vrabel wants to keep the old encoding.
      
      Update the struct urb kernel doc to note that SuperSpeed URBs must have
      urb->interval specified in microframes.
      
      Add a missing break statement in the usb_submit_urb() interrupt URB
      checking, since wireless USB and SuperSpeed USB encode urb->interval
      differently.  This allows xHCI roothubs to actually register with khubd.
      Signed-off-by: NMatthew Wilcox <willy@linux.intel.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f09a15e6
    • J
      tty_port,usb-console: Fix usb serial console open/close regression · 336cee42
      Jason Wessel 提交于
      Commit e1108a63 ("usb_serial: Use the
      shutdown() operation") breaks the ability to use a usb console
      starting in 2.6.33.  This was observed when using
      console=ttyUSB0,115200 as a boot argument with an FTDI device.  The
      error is:
      
      ftdi_sio ttyUSB0: ftdi_submit_read_urb - failed submitting read urb, error -22
      
      The handling of the ASYNCB_INITIALIZED changed in 2.6.32 such that in
      tty_port_shutdown() it always clears the flag if it is set.  The fix
      is to add a variable to the tty_port struct to indicate when the tty
      port is a console.
      
      CC: Alan Cox <alan@linux.intel.com>
      CC: Alan Stern <stern@rowland.harvard.edu>
      CC: Oliver Neukum <oliver@neukum.org>
      CC: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      336cee42
    • M
      tty: Take a 256 byte padding into account when buffering below sub-page units · 352fa6ad
      Mel Gorman 提交于
      The TTY layer takes some care to ensure that only sub-page allocations
      are made with interrupts disabled. It does this by setting a goal of
      "TTY_BUFFER_PAGE" to allocate. Unfortunately, while TTY_BUFFER_PAGE takes the
      size of tty_buffer into account, it fails to account that tty_buffer_find()
      rounds the buffer size out to the next 256 byte boundary before adding on
      the size of the tty_buffer.
      
      This patch adjusts the TTY_BUFFER_PAGE calculation to take into account the
      size of the tty_buffer and the padding. Once applied, tty_buffer_alloc()
      should not require high-order allocations.
      Signed-off-by: NMel Gorman <mel@csn.ul.ie>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      352fa6ad
    • G
      Revert "tty: Add a new VT mode which is like VT_PROCESS but doesn't require a... · 87a6aca5
      Greg Kroah-Hartman 提交于
      Revert "tty: Add a new VT mode which is like VT_PROCESS but doesn't require a VT_RELDISP ioctl call"
      
      This reverts commit eec9fe7d.
      
      Ari writes as the reason this should be reverted:
      	The problems with this patch include:
      	1. There's at least one subtlety I overlooked - switching
      	between X servers (i.e. from one X VT to another) still requires
      	the cooperation of both X servers. I was assuming that KMS
      	eliminated this.
      	2. It hasn't been tested at all (no X server patch exists which
      	uses the new mode).
      
      As he was the original author of the patch, I'll revert it.
      
      Cc: Ari Entlich <atrigent@ccs.neu.edu>
      Cc: Alan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      87a6aca5
    • E
      net: Potential null skb->dev dereference · 0641e4fb
      Eric Dumazet 提交于
      When doing "ifenslave -d bond0 eth0", there is chance to get NULL
      dereference in netif_receive_skb(), because dev->master suddenly becomes
      NULL after we tested it.
      
      We should use ACCESS_ONCE() to avoid this (or rcu_dereference())
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0641e4fb
    • L
      rcu: Fix local_irq_disable() CONFIG_PROVE_RCU=y false positives · 0cff810f
      Lai Jiangshan 提交于
      It is documented that local_irq_disable() also delimits RCU_SCHED
      read-site critical sections.
      
      See the document of synchronize_sched() or
      Documentation/RCU/whatisRCU.txt.
      
      So we have to test irqs_disabled() in rcu_read_lock_sched_held().
      Otherwise rcu-lockdep brings incorrect complaint.
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: dipankar@in.ibm.com
      Cc: mathieu.desnoyers@polymtl.ca
      Cc: josh@joshtriplett.org
      Cc: dvhltc@us.ibm.com
      Cc: niv@us.ibm.com
      Cc: peterz@infradead.org
      Cc: rostedt@goodmis.org
      Cc: Valdis.Kletnieks@vt.edu
      Cc: dhowells@redhat.com
      Cc: eric.dumazet@gmail.com
      LKML-Reference: <1268940334-10892-1-git-send-email-paulmck@linux.vnet.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0cff810f
  10. 18 3月, 2010 2 次提交
    • G
      of: Fix comparison of "compatible" properties · 1976152f
      Grant Likely 提交于
      Commit 7c7b60cb
      "of: put default string compare and #a/s-cell values into common header"
      
      Breaks various things on powerpc due to using strncasecmp instead of
      strcasecmp for comparing against "compatible" strings.
      
      This causes things like the 4xx PCI code to fail miserably due to the
      partial matches in code like this:
      
             for_each_compatible_node(np, NULL, "ibm,plb-pcix")
                     ppc4xx_probe_pcix_bridge(np);
             for_each_compatible_node(np, NULL, "ibm,plb-pci")
                     ppc4xx_probe_pci_bridge(np);
      
      It's not quite right to do partial name match. Entries in a compatible
      list are meant to be matched whole. If a device is compatible with both
      "foo" and "foo1", then the device should have both strings in its
      "compatible" property.
      
      This patch reverts powerpc and microblaze us to use strcasecmp.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
            (for patch description)
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Acked-by: NMichal Simek <michal.simek@petalogix.com>
      1976152f
    • H
      memory hotplug: allow setting of phys_device · bc32df00
      Heiko Carstens 提交于
      /sys/devices/system/memory/memoryX/phys_device is supposed to contain the
      number of the physical device that the corresponding piece of memory
      belongs to.
      
      In case a physical device should be replaced or taken offline for whatever
      reason it is necessary to set all corresponding memory pieces offline.
      The current implementation always sets phys_device to '0' and there is no
      way or hook to change that.  Seems like there was a plan to implement that
      but it wasn't finished for whatever reason.
      
      So add a weak function which architectures can override to actually set
      the phys_device from within add_memory_block().
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Dave Hansen <haveblue@us.ibm.com>
      Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bc32df00
  11. 17 3月, 2010 4 次提交
  12. 16 3月, 2010 2 次提交
    • L
      rcu: Fix tracepoints & lockdep false positive · 7f5b7742
      Lai Jiangshan 提交于
      tracepoint.h uses rcu_dereference(), which triggers this warning:
      
      [    0.701161] ===================================================
      [    0.702211] [ INFO: suspicious rcu_dereference_check() usage. ]
      [    0.702716] ---------------------------------------------------
      [    0.703203] include/trace/events/workqueue.h:68 invoked rcu_dereference_check() without protection!
      [    0.703971] [ 0.703990] other info that might help us debug this:
      [    0.703993]
      [    0.705590]
      [    0.705604] rcu_scheduler_active = 1, debug_locks = 0
      [    0.706712] 1 lock held by swapper/1:
      [    0.707229]  #0:  (cpu_add_remove_lock){+.+.+.}, at: [<c0142f54>] cpu_maps_update_begin+0x14/0x20
      [    0.710097]
      [    0.710106] stack backtrace:
      [    0.712602] Pid: 1, comm: swapper Not tainted 2.6.34-rc1-tip-01613-g72662bb #168
      [    0.713231] Call Trace:
      [    0.713997]  [<c017174d>] lockdep_rcu_dereference+0x9d/0xb0
      [    0.714746]  [<c015a117>] create_workqueue_thread+0x107/0x110
      [    0.715353]  [<c015aee0>] ? worker_thread+0x0/0x340
      [    0.715845]  [<c015a8e8>] __create_workqueue_key+0x138/0x240
      [    0.716427]  [<c0142f92>] ? cpu_maps_update_done+0x12/0x20
      [    0.717012]  [<c086b12f>] init_workqueues+0x6f/0x80
      [    0.717530]  [<c08576d2>] kernel_init+0x102/0x1f0
      [    0.717570]  [<c08575d0>] ? kernel_init+0x0/0x1f0
      [    0.718944]  [<c01030fa>] kernel_thread_helper+0x6/0x10
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <4B9F48AD.4000404@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7f5b7742
    • P
      rcu: Make rcu_read_lock_bh_held() allow for disabled BH · e3818b8d
      Paul E. McKenney 提交于
      Disabling BH can stand in for rcu_read_lock_bh(), and this patch
      updates rcu_read_lock_bh_held() to allow for this.  In order to
      avoid include-file hell, this function is moved out of line to
      kernel/rcupdate.c.
      
      This fixes a false positive RCU warning.
      Reported-by: NArnd Bergmann <arnd@arndb.de>
      Reported-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Acked-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Cc: dipankar@in.ibm.com
      Cc: mathieu.desnoyers@polymtl.ca
      Cc: josh@joshtriplett.org
      Cc: dvhltc@us.ibm.com
      Cc: niv@us.ibm.com
      Cc: peterz@infradead.org
      Cc: rostedt@goodmis.org
      Cc: Valdis.Kletnieks@vt.edu
      Cc: dhowells@redhat.com
      LKML-Reference: <20100316000343.GA25857@linux.vnet.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e3818b8d
  13. 15 3月, 2010 6 次提交