1. 13 5月, 2008 3 次提交
  2. 12 5月, 2008 2 次提交
    • L
      Add new 'cond_resched_bkl()' helper function · c3921ab7
      Linus Torvalds 提交于
      It acts exactly like a regular 'cond_resched()', but will not get
      optimized away when CONFIG_PREEMPT is set.
      
      Normal kernel code is already preemptable in the presense of
      CONFIG_PREEMPT, so cond_resched() is optimized away (see commit
      02b67cc3 "sched: do not do
      cond_resched() when CONFIG_PREEMPT").
      
      But when wanting to conditionally reschedule while holding a lock, you
      need to use "cond_sched_lock(lock)", and the new function is the BKL
      equivalent of that.
      
      Also make fs/locks.c use it.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c3921ab7
    • J
      i2c: Match dummy devices by type · 60b129d7
      Jean Delvare 提交于
      As the old driver_name/type matching scheme is going away soon, change
      the dummy device mechanism to use the new matching scheme.
      
      This has the downside that dummy i2c clients can no longer choose
      their name, they'll all appear as "dummy" in sysfs and in log
      messages. I don't think it is a problem in practice though, as there
      is little reason to use these i2c clients to log messages.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      60b129d7
  3. 11 5月, 2008 2 次提交
    • L
      BKL: revert back to the old spinlock implementation · 8e3e076c
      Linus Torvalds 提交于
      The generic semaphore rewrite had a huge performance regression on AIM7
      (and potentially other BKL-heavy benchmarks) because the generic
      semaphores had been rewritten to be simple to understand and fair.  The
      latter, in particular, turns a semaphore-based BKL implementation into a
      mess of scheduling.
      
      The attempt to fix the performance regression failed miserably (see the
      previous commit 00b41ec2 'Revert
      "semaphore: fix"'), and so for now the simple and sane approach is to
      instead just go back to the old spinlock-based BKL implementation that
      never had any issues like this.
      
      This patch also has the advantage of being reported to fix the
      regression completely according to Yanmin Zhang, unlike the semaphore
      hack which still left a couple percentage point regression.
      
      As a spinlock, the BKL obviously has the potential to be a latency
      issue, but it's not really any different from any other spinlock in that
      respect.  We do want to get rid of the BKL asap, but that has been the
      plan for several years.
      
      These days, the biggest users are in the tty layer (open/release in
      particular) and Alan holds out some hope:
      
        "tty release is probably a few months away from getting cured - I'm
         afraid it will almost certainly be the very last user of the BKL in
         tty to get fixed as it depends on everything else being sanely locked."
      
      so while we're not there yet, we do have a plan of action.
      Tested-by: NYanmin Zhang <yanmin_zhang@linux.intel.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Cc: Alexander Viro <viro@ftp.linux.org.uk>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8e3e076c
    • L
      Move ACCESS_ONCE() to <linux/compiler.h> · 9c3cdc1f
      Linus Torvalds 提交于
      It actually makes much more sense there, and we do tend to need it for
      non-RCU usage too.  Moving it to <linux/compiler.h> will allow some
      other cases that have open-coded the same logic to use the same helper
      function that RCU has used.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9c3cdc1f
  4. 10 5月, 2008 1 次提交
  5. 09 5月, 2008 2 次提交
  6. 08 5月, 2008 1 次提交
  7. 07 5月, 2008 6 次提交
  8. 06 5月, 2008 5 次提交
    • M
      libata: export ata_eh_analyze_ncq_error · 10acf3b0
      Mark Lord 提交于
      Export ata_eh_analyze_ncq_error() for subsequent use by sata_mv,
      as suggested by Tejun.
      Signed-off-by: NMark Lord <mlord@pobox.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      10acf3b0
    • T
      libata: improve post-reset device ready test · 78ab88f0
      Tejun Heo 提交于
      Some controllers (jmb and inic162x) use 0x77 and 0x7f to indicate that
      the device isn't ready yet.  It looks like they use 0xff if device
      presence is detected but connection isn't established.  0x77 or 0x7f
      after connection is established and use the value from signature FIS
      after receiving it.
      
      This patch implements ata_check_ready(), which takes TF status value
      and determines whether the port is ready or not considering the above
      and other conditions, and use it in @check_ready() functions.  This is
      safe as both 0x77 and 0x7f aren't valid ready status value even though
      they have BSY bit cleared.
      
      This fixes hot plug detection failures which can be triggered with
      certain drives if they aren't already spun up when the data connector
      is hot plugged.
      
      Tested on sil, sil24, ahci (jmb/ich), piix and inic162x combined with
      eight drives from all major vendors.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      78ab88f0
    • P
      sched: add optional support for CONFIG_HAVE_UNSTABLE_SCHED_CLOCK · 3e51f33f
      Peter Zijlstra 提交于
      this replaces the rq->clock stuff (and possibly cpu_clock()).
      
       - architectures that have an 'imperfect' hardware clock can set
         CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
      
       - the 'jiffie' window might be superfulous when we update tick_gtod
         before the __update_sched_clock() call in sched_clock_tick()
      
       - cpu_clock() might be implemented as:
      
           sched_clock_cpu(smp_processor_id())
      
         if the accuracy proves good enough - how far can TSC drift in a
         single jiffie when considering the filtering and idle hooks?
      
      [ mingo@elte.hu: various fixes and cleanups ]
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3e51f33f
    • I
      sched: make clock sync tunable by architecture code · 690229a0
      Ingo Molnar 提交于
      make time_sync_thresh tunable to architecture code.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      690229a0
    • G
      sched: fix RT task-wakeup logic · 8ae121ac
      Gregory Haskins 提交于
      Dmitry Adamushko pointed out a logic error in task_wake_up_rt() where we
      will always evaluate to "true".  You can find the thread here:
      
      http://lkml.org/lkml/2008/4/22/296
      
      In reality, we only want to try to push tasks away when a wake up request is
      not going to preempt the current task.  So lets fix it.
      
      Note: We introduce test_tsk_need_resched() instead of open-coding the flag
      check so that the merge-conflict with -rt should help remind us that we
      may need to support NEEDS_RESCHED_DELAYED in the future, too.
      Signed-off-by: NGregory Haskins <ghaskins@novell.com>
      CC: Dmitry Adamushko <dmitry.adamushko@gmail.com>
      CC: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8ae121ac
  9. 05 5月, 2008 3 次提交
    • H
      kgdb: fix signedness mixmatches, add statics, add declaration to header · 688b744d
      Harvey Harrison 提交于
      Noticed by sparse:
      arch/x86/kernel/kgdb.c:556:15: warning: symbol 'kgdb_arch_pc' was not declared. Should it be static?
      kernel/kgdb.c:149:8: warning: symbol 'kgdb_do_roundup' was not declared. Should it be static?
      kernel/kgdb.c:193:22: warning: symbol 'kgdb_arch_pc' was not declared. Should it be static?
      kernel/kgdb.c:712:5: warning: symbol 'remove_all_break' was not declared. Should it be static?
      
      Related to kgdb_hex2long:
      arch/x86/kernel/kgdb.c:371:28: warning: incorrect type in argument 2 (different signedness)
      arch/x86/kernel/kgdb.c:371:28:    expected long *long_val
      arch/x86/kernel/kgdb.c:371:28:    got unsigned long *<noident>
      kernel/kgdb.c:469:27: warning: incorrect type in argument 2 (different signedness)
      kernel/kgdb.c:469:27:    expected long *long_val
      kernel/kgdb.c:469:27:    got unsigned long *<noident>
      kernel/kgdb.c:470:27: warning: incorrect type in argument 2 (different signedness)
      kernel/kgdb.c:470:27:    expected long *long_val
      kernel/kgdb.c:470:27:    got unsigned long *<noident>
      kernel/kgdb.c:894:27: warning: incorrect type in argument 2 (different signedness)
      kernel/kgdb.c:894:27:    expected long *long_val
      kernel/kgdb.c:894:27:    got unsigned long *<noident>
      kernel/kgdb.c:895:27: warning: incorrect type in argument 2 (different signedness)
      kernel/kgdb.c:895:27:    expected long *long_val
      kernel/kgdb.c:895:27:    got unsigned long *<noident>
      kernel/kgdb.c:1127:28: warning: incorrect type in argument 2 (different signedness)
      kernel/kgdb.c:1127:28:    expected long *long_val
      kernel/kgdb.c:1127:28:    got unsigned long *<noident>
      kernel/kgdb.c:1132:25: warning: incorrect type in argument 2 (different signedness)
      kernel/kgdb.c:1132:25:    expected long *long_val
      kernel/kgdb.c:1132:25:    got unsigned long *<noident>
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      688b744d
    • E
      [POWERPC] devres: Add devm_ioremap_prot() · b41e5fff
      Emil Medve 提交于
      We provide an ioremap_flags, so this provides a corresponding
      devm_ioremap_prot.  The slight name difference is at Ben
      Herrenschmidt's request as he plans on changing ioremap_flags to
      ioremap_prot in the future.
      Signed-off-by: NEmil Medve <Emilian.Medve@Freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      Acked-by: NTejun Heo <htejun@gmail.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      b41e5fff
    • I
      sysfs: build fix · e73b65f1
      Ingo Molnar 提交于
      x86.git testing found the following build failure on v2.6.26-rc1:
      
        In file included from include/linux/kobject.h:22,
                         from include/linux/module.h:17,
                         from include/linux/crypto.h:22,
                         from arch/x86/kernel/asm-offsets_32.c:8,
                         from arch/x86/kernel/asm-offsets.c:3:
        include/linux/sysfs.h:201: error: redefinition of 'sysfs_update_group'
        include/linux/sysfs.h:195: error: previous definition of 'sysfs_update_group' was here
        make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 1
        make: *** [prepare0] Error 2
      
      with the following config:
      
          http://redhat.com/~mingo/misc/config-Sun_May__4_07_09_30_CEST_2008.bad
      
      the reason for the build failure is the duplicate definition of the
      sysfs_update_group() inline function in include/linux/sysfs.h.
      
      The duplication was a merge error: it was added via -mm by commit
      v2.6.25-7262-g2850699c, "sysfs: sysfs_update_group stub for
      CONFIG_SYSFS=n" a day before v2.6.26-rc1, but a day before that the same
      commit was already merged upstream via the sysfs tree, with commit
      v2.6.25-7211-g1cbfb7a5.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e73b65f1
  10. 04 5月, 2008 1 次提交
  11. 03 5月, 2008 6 次提交
  12. 02 5月, 2008 8 次提交
    • R
      virtio: add virtio disk geometry feature · 48e4043d
      Ryan Harper 提交于
      Rather than faking up some geometry, allow the backend to push the disk
      geometry via virtio pci config option.  Keep the old geo code around for
      compatibility.
      Signed-off-by: NRyan Harper <ryanh@us.ibm.com>
      Reviewed-by: NAnthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (modified to single struct)
      48e4043d
    • R
      virtio: explicit advertisement of driver features · c45a6816
      Rusty Russell 提交于
      A recent proposed feature addition to the virtio block driver revealed
      some flaws in the API: in particular, we assume that feature
      negotiation is complete once a driver's probe function returns.
      
      There is nothing in the API to require this, however, and even I
      didn't notice when it was violated.
      
      So instead, we require the driver to specify what features it supports
      in a table, we can then move the feature negotiation into the virtio
      core.  The intersection of device and driver features are presented in
      a new 'features' bitmap in the struct virtio_device.
      
      Note that this highlights the difference between Linux unsigned-long
      bitmaps where each unsigned long is in native endian, and a
      straight-forward little-endian array of bytes.
      
      Drivers can still remove feature bits in their probe routine if they
      really have to.
      
      API changes:
      - dev->config->feature() no longer gets and acks a feature.
      - drivers should advertise their features in the 'feature_table' field
      - use virtio_has_feature() for extra sanity when checking feature bits
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      c45a6816
    • R
      virtio: change config to guest endian. · 72e61eb4
      Rusty Russell 提交于
      A recent proposed feature addition to the virtio block driver revealed
      some flaws in the API, in particular how easy it is to break big
      endian machines.
      
      The virtio config space was originally chosen to be little-endian,
      because we thought the config might be part of the PCI config space
      for virtio_pci.  It's actually a separate mmio region, so that
      argument holds little water; as only x86 is currently using the virtio
      mechanism, we can change this (but must do so now, before the
      impending s390 merge).
      
      API changes:
      - __virtio_config_val() just becomes a striaght vdev->config_get() call.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      72e61eb4
    • R
      virtio: finer-grained features for virtio_net · 5539ae96
      Rusty Russell 提交于
      So, we previously had a 'VIRTIO_NET_F_GSO' bit which meant that 'the
      host can handle csum offload, and any TSO (v4&v6 incl ECN) or UFO
      packets you might want to send.  I thought this was good enough for
      Linux, but it actually isn't, since we don't do UFO in software.
      
      So, add separate feature bits for what the host can handle.  Add
      equivalent ones for the guest to say what it can handle, because LRO
      is coming too (thanks Herbert!).
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      5539ae96
    • R
      virtio: de-structify virtio_block status byte · cb38fa23
      Rusty Russell 提交于
      Ron Minnich points out that a struct containing a char is not always
      sizeof(char); simplest to remove the structure to avoid confusion.
      
      Cc: "ron minnich" <rminnich@gmail.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      cb38fa23
    • C
      virtio: export more headers to userspace · 81473132
      Christian Borntraeger 提交于
      Rusty,
      
      is there a reason why we dont export the virtio headers for
      9p, balloon, console, pci, and virtio_ring? kvm uses make sync,
      but I think it is still useful to heave these headers exported
      as they might be useful for other userspace tools.
      
      I dont export virtio.h, because it does not seem to have useful
      information for userspace and it requires scatterlist.h which is
      also not exported. See also my other mail about your "virtio:
      change config to guest endian." patch.
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      81473132
    • T
      genirq: reenable a nobody cared disabled irq when a new driver arrives · 1adb0850
      Thomas Gleixner 提交于
      Uwe Kleine-Koenig has some strange hardware where one of the shared
      interrupts can be asserted during boot before the appropriate driver
      loads. Requesting the shared irq line from another driver result in a
      spurious interrupt storm which finally disables the interrupt line.
      
      I have seen similar behaviour on resume before (the hardware does not
      work anymore so I can not verify).
      
      Change the spurious disable logic to increment the disable depth and
      mark the interrupt with an extra flag which allows us to reenable the
      interrupt when a new driver arrives which requests the same irq
      line. In the worst case this will disable the irq again via the
      spurious trap, but there is a decent chance that the new driver is the
      one which can handle the already asserted interrupt and makes the box
      usable again.
      
      Eric Biederman said further: This case also happens on a regular basis
      in kdump kernels where we deliberately don't shutdown the hardware
      before starting the new kernel.  This patch should reduce the need for
      using irqpoll in that situation by a small amount.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Tested-and-Acked-by: NUwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
      1adb0850
    • R
      [RAPIDIO] fix current kernel-doc notation · 9941d945
      Randy Dunlap 提交于
      Fix current (-git16) missing docbook/kernel-doc notation in RapidIO files.
      
      Warning(linux-2.6.25-git16//include/linux/rio.h:187): No description found for parameter 'sys_size'
      Warning(linux-2.6.25-git16//include/linux/rio.h:187): No description found for parameter 'phy_type'
      
      Warning(linux-2.6.25-git16//arch/powerpc/sysdev/fsl_rio.c:188): No description found for parameter 'mport'
      Warning(linux-2.6.25-git16//arch/powerpc/sysdev/fsl_rio.c:224): No description found for parameter 'mport'
      Warning(linux-2.6.25-git16//arch/powerpc/sysdev/fsl_rio.c:245): No description found for parameter 'mport'
      Warning(linux-2.6.25-git16//arch/powerpc/sysdev/fsl_rio.c:270): No description found for parameter 'mport'
      Warning(linux-2.6.25-git16//arch/powerpc/sysdev/fsl_rio.c:311): No description found for parameter 'mport'
      Warning(linux-2.6.25-git16//arch/powerpc/sysdev/fsl_rio.c:996): No description found for parameter 'dev'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      9941d945