1. 15 11月, 2012 1 次提交
  2. 23 10月, 2012 1 次提交
  3. 22 12月, 2011 1 次提交
    • K
      cpu: convert 'cpu' and 'machinecheck' sysdev_class to a regular subsystem · 8a25a2fd
      Kay Sievers 提交于
      This moves the 'cpu sysdev_class' over to a regular 'cpu' subsystem
      and converts the devices to regular devices. The sysdev drivers are
      implemented as subsystem interfaces now.
      
      After all sysdev classes are ported to regular driver core entities, the
      sysdev implementation will be entirely removed from the kernel.
      
      Userspace relies on events and generic sysfs subsystem infrastructure
      from sysdev devices, which are made available with this conversion.
      
      Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
      Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Borislav Petkov <bp@amd64.org>
      Cc: Tigran Aivazian <tigran@aivazian.fsnet.co.uk>
      Cc: Len Brown <lenb@kernel.org>
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: Dave Jones <davej@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8a25a2fd
  4. 15 12月, 2011 1 次提交
  5. 01 11月, 2011 1 次提交
  6. 17 6月, 2011 1 次提交
    • K
      [CPUFREQ] Don't set stat->last_index to -1 if the pol->cur has incorrect value. · 46a310b8
      Konrad Rzeszutek Wilk 提交于
      If the driver submitted an non-existing pol>cur value (say it
      used the default initialized value of zero), when the cpufreq
      stats tries to setup its initial values it incorrectly sets
      stat->last_index to -1 (or 0xfffff...). And cpufreq_stats_update
      tries to update at that index location and fails.
      
      This can be caused by:
      
      stat->last_index = freq_table_get_index(stat, policy->cur);
      
      not finding the appropiate frequency in the table (b/c the policy->cur
      is wrong) and we end up crashing. The fix however is
      concentrated in the 'cpufreq_stats_update' as the last_index
      (and old_index) are updated there. Which means it can reset
      the last_index to -1 again and on the next iteration cause a crash.
      
      Without this patch, the following crash is observed:
      
      powernow-k8: Found 1 AMD Athlon(tm) 64 Processor 3700+ (1 cpu cores) (version 2.20.00)
      powernow-k8: fid 0x2 (1000 MHz), vid 0x12
      powernow-k8: fid 0xa (1800 MHz), vid 0xa
      powernow-k8: fid 0xc (2000 MHz), vid 0x8
      powernow-k8: fid 0xe (2200 MHz), vid 0x8
      Marking TSC unstable due to cpufreq changes
      powernow-k8: fid trans failed, fid 0x2, curr 0x0
      BUG: unable to handle kernel paging request at ffff880807e07b78
      IP: [<ffffffff81479163>] cpufreq_stats_update+0x46/0x5b
      .. snip..
      Pid: 1, comm: swapper Not tainted 3.0.0-rc2 #45 MICRO-STAR INTERNATIONAL CO., LTD MS-7094/MS-7094
      ..snip..
      Call Trace:
       [<ffffffff81479248>] cpufreq_stat_notifier_trans+0x48/0x7c
       [<ffffffff81095d68>] notifier_call_chain+0x32/0x5e
       [<ffffffff81095e6b>] __srcu_notifier_call_chain+0x47/0x63
       [<ffffffff81095e96>] srcu_notifier_call_chain+0xf/0x11
       [<ffffffff81477e7a>] cpufreq_notify_transition+0x111/0x134
       [<ffffffff8147b0d4>] powernowk8_target+0x53b/0x617
       [<ffffffff8147723a>] __cpufreq_driver_target+0x2e/0x30
       [<ffffffff8147a127>] cpufreq_governor_dbs+0x339/0x356
       [<ffffffff81477394>] __cpufreq_governor+0xa8/0xe9
       [<ffffffff81477525>] __cpufreq_set_policy+0x132/0x13e
       [<ffffffff8147848d>] cpufreq_add_dev_interface+0x272/0x28c
      Reported-by: NTobias Diedrich <ranma+xen@tdiedrich.de>
      Tested-by: NTobias Diedrich <ranma+xen@tdiedrich.de>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NDave Jones <davej@redhat.com>
      46a310b8
  7. 13 6月, 2011 1 次提交
  8. 04 5月, 2011 2 次提交
  9. 30 3月, 2010 1 次提交
    • 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
  10. 25 2月, 2009 1 次提交
  11. 20 5月, 2008 1 次提交
  12. 29 4月, 2008 2 次提交
  13. 06 3月, 2008 1 次提交
    • S
      [CPUFREQ] fix section mismatch warnings · f6ebef30
      Sam Ravnborg 提交于
      Fix the following warnings:
      WARNING: vmlinux.o(.text+0xfe6711): Section mismatch in reference from the function cpufreq_unregister_driver() to the variable .cpuinit.data:cpufreq_cpu_notifier
      WARNING: vmlinux.o(.text+0xfe68af): Section mismatch in reference from the function cpufreq_register_driver() to the variable .cpuinit.data:cpufreq_cpu_notifier
      WARNING: vmlinux.o(.exit.text+0xc4fa): Section mismatch in reference from the function cpufreq_stats_exit() to the variable .cpuinit.data:cpufreq_stat_cpu_notifier
      
      The warnings were casued by references to unregister_hotcpu_notifier()
      from normal functions or exit functions.
      This is flagged by modpost as a potential error because
      it does not know that for the non HOTPLUG_CPU
      scenario the unregister_hotcpu_notifier() is a nop.
      Silence the warning by replacing the __initdata
      annotation with a __refdata annotation.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NDave Jones <davej@codemonkey.org.uk>
      f6ebef30
  14. 18 12月, 2007 1 次提交
  15. 05 10月, 2007 1 次提交
  16. 12 7月, 2007 1 次提交
    • T
      sysfs: kill unnecessary attribute->owner · 7b595756
      Tejun Heo 提交于
      sysfs is now completely out of driver/module lifetime game.  After
      deletion, a sysfs node doesn't access anything outside sysfs proper,
      so there's no reason to hold onto the attribute owners.  Note that
      often the wrong modules were accounted for as owners leading to
      accessing removed modules.
      
      This patch kills now unnecessary attribute->owner.  Note that with
      this change, userland holding a sysfs node does not prevent the
      backing module from being unloaded.
      
      For more info regarding lifetime rule cleanup, please read the
      following message.
      
        http://article.gmane.org/gmane.linux.kernel/510293
      
      (tweaked by Greg to not delete the field just yet, to make it easier to
      merge things properly.)
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7b595756
  17. 10 5月, 2007 1 次提交
    • R
      Add suspend-related notifications for CPU hotplug · 8bb78442
      Rafael J. Wysocki 提交于
      Since nonboot CPUs are now disabled after tasks and devices have been
      frozen and the CPU hotplug infrastructure is used for this purpose, we need
      special CPU hotplug notifications that will help the CPU-hotplug-aware
      subsystems distinguish normal CPU hotplug events from CPU hotplug events
      related to a system-wide suspend or resume operation in progress.  This
      patch introduces such notifications and causes them to be used during
      suspend and resume transitions.  It also changes all of the
      CPU-hotplug-aware subsystems to take these notifications into consideration
      (for now they are handled in the same way as the corresponding "normal"
      ones).
      
      [oleg@tv-sign.ru: cleanups]
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: Gautham R Shenoy <ego@in.ibm.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8bb78442
  18. 11 2月, 2007 1 次提交
  19. 23 12月, 2006 1 次提交
  20. 07 11月, 2006 1 次提交
  21. 23 9月, 2006 1 次提交
    • D
      [CPUFREQ] Fix some more CPU hotplug locking. · ddad65df
      Dave Jones 提交于
      Lukewarm IQ detected in hotplug locking
      BUG: warning at kernel/cpu.c:38/lock_cpu_hotplug()
      [<b0134a42>] lock_cpu_hotplug+0x42/0x65
      [<b02f8af1>] cpufreq_update_policy+0x25/0xad
      [<b0358756>] kprobe_flush_task+0x18/0x40
      [<b0355aab>] schedule+0x63f/0x68b
      [<b01377c2>] __link_module+0x0/0x1f
      [<b0119e7d>] __cond_resched+0x16/0x34
      [<b03560bf>] cond_resched+0x26/0x31
      [<b0355b0e>] wait_for_completion+0x17/0xb1
      [<f965c547>] cpufreq_stat_cpu_callback+0x13/0x20 [cpufreq_stats]
      [<f9670074>] cpufreq_stats_init+0x74/0x8b [cpufreq_stats]
      [<b0137872>] sys_init_module+0x91/0x174
      [<b0102c81>] sysenter_past_esp+0x56/0x79
      
      As there are other places that call cpufreq_update_policy without
      the hotplug lock, it seems better to keep the hotplug locking
      at the lower level for the time being until this is revamped.
      Signed-off-by: NDave Jones <davej@redhat.com>
      ddad65df
  22. 01 7月, 2006 1 次提交
  23. 28 6月, 2006 1 次提交
  24. 31 5月, 2006 1 次提交
  25. 12 3月, 2006 1 次提交
    • S
      [PATCH] cpufreq: fix section mismatch warnings · bb1a813d
      Sam Ravnborg 提交于
      cpufreq are the only remaining bit to be solved for me to have a modpost
      clean build for sparc64 - so I took one more look at it.
      changelog entry:
      
      Fix section mismatch warnings in cpufreq:
      WARNING: drivers/cpufreq/cpufreq_stats.o - Section mismatch: reference to .init.text: from .data between 'cpufreq_stat_cpu_notifier' (at offset 0xa8) and 'notifier_policy_block'
      WARNING: drivers/cpufreq/cpufreq_stats.o - Section mismatch: reference to .init.text: from .exit.text after 'cleanup_module' (at offset 0x30)
      
      The culprint is the function: cpufreq_stat_cpu_callback
      It is marked __cpuinit which get's redefined to __init in case
      HOTPLUG_CPU is not enabled as per. init.h:
      
      #ifdef CONFIG_HOTPLUG_CPU
      #define __cpuinit
      #else
      #define __cpuinit       __init
      #endif
      
      $> grep HOTPLUG .config
      CONFIG_HOTPLUG=y
      
      But cpufreq_stat_cpu_callback() is used in:
      __exit cpufreq_stats_exit()
      static struct notifier_block cpufreq_stat_cpu_notifier
      
      cpufreq_stat_cpu_notifier is again used in:
      __init cpufreq_stats_init()
      __exit cpufreq_stats_exit()
      
      So in both cases used from both __init and __exit context.
      Only solution seems to drop __cpuinit tag.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NDave Jones <davej@redhat.com>
      bb1a813d
  26. 28 2月, 2006 1 次提交
  27. 02 11月, 2005 1 次提交
  28. 31 10月, 2005 1 次提交
    • A
      [PATCH] create and destroy cpufreq sysfs entries based on cpu notifiers · c32b6b8e
      Ashok Raj 提交于
      cpufreq entries in sysfs should only be populated when CPU is online state.
       When we either boot with maxcpus=x and then boot the other cpus by echoing
      to sysfs online file, these entries should be created and destroyed when
      CPU_DEAD is notified.  Same treatement as cache entries under sysfs.
      
      We place the processor in the lowest frequency, so hw managed P-State
      transitions can still work on the other threads to save power.
      
      Primary goal was to just make these directories appear/disapper dynamically.
      
      There is one in this patch i had to do, which i really dont like myself but
      probably best if someone handling the cpufreq infrastructure could give
      this code right treatment if this is not acceptable.  I guess its probably
      good for the first cut.
      
      - Converting lock_cpu_hotplug()/unlock_cpu_hotplug() to disable/enable preempt.
        The locking was smack in the middle of the notification path, when the
        hotplug is already holding the lock. I tried another solution to avoid this
        so avoid taking locks if we know we are from notification path. The solution
        was getting very ugly and i decided this was probably good for this iteration
        until someone who understands cpufreq could do a better job than me.
      
      (akpm: export cpucontrol to GPL modules: drivers/cpufreq/cpufreq_stats.c now
      does lock_cpu_hotplug())
      Signed-off-by: NAshok Raj <ashok.raj@intel.com>
      Signed-off-by: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Cc: Dave Jones <davej@codemonkey.org.uk>
      Cc: Zwane Mwaikambo <zwane@holomorphy.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      c32b6b8e
  29. 28 10月, 2005 1 次提交
    • D
      [CPUFREQ] Check return value of cpufreq_cpu_get in cpufreq_stats · bc7b26fd
      Dave Jones 提交于
      This fixes an issue found in drivers/cpufreq/cpufreq_stats.c by Coverity.
      
      Error reported:
      CID: 2642
      Checker: NULL_RETURNS (help)
      File: /export2/p4-coverity/mc2/linux26/drivers/cpufreq/cpufreq_stats.c
      Function: cpufreq_stats_create_table
      Description: Dereferencing NULL value "data"
      
      Patch description:
       The return of cpufreq_cpu_get can be NULL, check return code and return
       -EINVAL if it is NULL.
      
      Signed-off-by: Jayachandran C. <c.jayachandran at gmail.com>
      Signed-off-by: NDave Jones <davej@redhat.com>
      bc7b26fd
  30. 21 10月, 2005 1 次提交
  31. 01 6月, 2005 1 次提交
  32. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4