08 Jan, 2012

1 commit

  • * 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (73 commits)
    arm: fix up some samsung merge sysdev conversion problems
    firmware: Fix an oops on reading fw_priv->fw in sysfs loading file
    Drivers:hv: Fix a bug in vmbus_driver_unregister()
    driver core: remove __must_check from device_create_file
    debugfs: add missing #ifdef HAS_IOMEM
    arm: time.h: remove device.h #include
    driver-core: remove sysdev.h usage.
    clockevents: remove sysdev.h
    arm: convert sysdev_class to a regular subsystem
    arm: leds: convert sysdev_class to a regular subsystem
    kobject: remove kset_find_obj_hinted()
    m86k: gpio - convert sysdev_class to a regular subsystem
    mips: txx9_sram - convert sysdev_class to a regular subsystem
    mips: 7segled - convert sysdev_class to a regular subsystem
    sh: dma - convert sysdev_class to a regular subsystem
    sh: intc - convert sysdev_class to a regular subsystem
    power: suspend - convert sysdev_class to a regular subsystem
    power: qe_ic - convert sysdev_class to a regular subsystem
    power: cmm - convert sysdev_class to a regular subsystem
    s390: time - convert sysdev_class to a regular subsystem
    ...

    Fix up conflicts with 'struct sysdev' removal from various platform
    drivers that got changed:
    - arch/arm/mach-exynos/cpu.c
    - arch/arm/mach-exynos/irq-eint.c
    - arch/arm/mach-s3c64xx/common.c
    - arch/arm/mach-s3c64xx/cpu.c
    - arch/arm/mach-s5p64x0/cpu.c
    - arch/arm/mach-s5pv210/common.c
    - arch/arm/plat-samsung/include/plat/cpu.h
    - arch/powerpc/kernel/sysfs.c
    and fix up cpu_is_hotpluggable() as per Greg in include/linux/cpu.h

    Linus Torvalds
     

22 Dec, 2011

1 commit

  • 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
    Cc: Hans-Christian Egtvedt
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: Arnd Bergmann
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Paul Mundt
    Cc: "David S. Miller"
    Cc: Chris Metcalf
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Borislav Petkov
    Cc: Tigran Aivazian
    Cc: Len Brown
    Cc: Zhang Rui
    Cc: Dave Jones
    Cc: Peter Zijlstra
    Cc: Russell King
    Cc: Andrew Morton
    Cc: Arjan van de Ven
    Cc: "Rafael J. Wysocki"
    Cc: "Srivatsa S. Bhat"
    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     

15 Dec, 2011

1 commit


01 Nov, 2011

1 commit


17 Jun, 2011

1 commit

  • 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: [] 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:
    [] cpufreq_stat_notifier_trans+0x48/0x7c
    [] notifier_call_chain+0x32/0x5e
    [] __srcu_notifier_call_chain+0x47/0x63
    [] srcu_notifier_call_chain+0xf/0x11
    [] cpufreq_notify_transition+0x111/0x134
    [] powernowk8_target+0x53b/0x617
    [] __cpufreq_driver_target+0x2e/0x30
    [] cpufreq_governor_dbs+0x339/0x356
    [] __cpufreq_governor+0xa8/0xe9
    [] __cpufreq_set_policy+0x132/0x13e
    [] cpufreq_add_dev_interface+0x272/0x28c

    Reported-by: Tobias Diedrich
    Tested-by: Tobias Diedrich
    Signed-off-by: Konrad Rzeszutek Wilk
    Signed-off-by: Dave Jones

    Konrad Rzeszutek Wilk
     

13 Jun, 2011

1 commit


04 May, 2011

2 commits


30 Mar, 2010

1 commit

  • …it 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: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

25 Feb, 2009

1 commit


20 May, 2008

1 commit

  • Change cpufreq_policy and cpufreq_governor pointer tables
    from arrays to per_cpu variables in the cpufreq subsystem.

    Also some minor complaints from checkpatch.pl fixed.

    Based on:
    git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
    git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git

    Signed-off-by: Mike Travis
    Signed-off-by: Dave Jones

    Mike Travis
     

29 Apr, 2008

2 commits

  • Sometimes old_index != stat->last_index, see cpufreq_update_policy, bios can
    change cpu setting in resume. In my test, after resume cpu is in lowest
    speed, but the stat info shows cpu is in full speed. This patch makes the
    stat info correct after a resume.

    Signed-off-by: Shaohua Li
    Signed-off-by: Andrew Morton
    Signed-off-by: Dave Jones

    Shaohua Li
     
  • Fix show_trans_table when it overflows PAGE_SIZE.

    * Not all snprintf calls were protected against being passed a negative
    length.
    * When show_trans_table overflows, len might be > PAGE_SIZE. In that case,
    returns PAGE_SIZE.

    Signed-off-by: Cesar Eduardo Barros
    Signed-off-by: Dave Jones

    Cesar Eduardo Barros
     

06 Mar, 2008

1 commit

  • 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: Sam Ravnborg
    Signed-off-by: Dave Jones

    Sam Ravnborg
     

18 Dec, 2007

1 commit

  • cpufreq_stats_free_table() mustn't be __cpuexit since it's called by the
    __cpuinit cpufreq_stat_cpu_callback().

    This patch fixes the following section mismatch reported by
    Chris Clayton:

    WARNING: vmlinux.o(.init.text+0x143dd): Section mismatch: reference to .exit.text:cpufreq_stats_free_table (between 'cpufreq_stat_cpu_callback' and 'cpufreq_stats_init')

    Signed-off-by: Adrian Bunk
    Cc: Chris Clayton
    Acked-by: Dave Jones
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     

05 Oct, 2007

1 commit

  • * Stop referencing the callback directly from the __init and __exit
    functions of this driver, and instead explicitly call
    cpufreq_update_policy() et al. This enables the callback function
    to be marked as __cpuinit (and the notifier_block __cpuinitdata),
    thereby saving space when HOTPLUG_CPU=n. This also enables us to
    use other tricks to replace __cpuinit{data} in future.

    * cpufreq_stats_free_table() is only called from __cpuinit or __exit
    marked functions, making it an ideal candidate for __cpuexit.

    * Fix missing space in the module description

    Signed-off-by: Satyam Sharma
    Signed-off-by: Andrew Morton
    Signed-off-by: Dave Jones

    Satyam Sharma
     

12 Jul, 2007

1 commit

  • 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: Tejun Heo
    Cc: Cornelia Huck
    Cc: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

10 May, 2007

1 commit

  • 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: Rafael J. Wysocki
    Cc: Gautham R Shenoy
    Cc: Pavel Machek
    Signed-off-by: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

11 Feb, 2007

1 commit

  • The hotplug CPU locking in cpufreq is horrendous. No-one seems to care
    enough to fix it, so just remove it so that the 99.9% of the real world
    users of this code can use cpufreq without being bothered by warnings.

    Signed-off-by: Andrew Morton
    Signed-off-by: Dave Jones

    Dave Jones
     

23 Dec, 2006

1 commit

  • Fixes the oops in cpufreq_stats with acpi_cpufreq driver. The issue was
    that the frequency was reported as 0 in acpi-cpufreq.c. The bug is due to
    different indicies for freq_table and ACPI perf table.

    Also adds a check in cpufreq_stats to check for error return from
    freq_table_get_index() and avoid using the error return value.

    Patch fixes the issue reported at
    http://www.ussg.iu.edu/hypermail/linux/kernel/0611.2/0629.html
    and also other similar issue here
    http://bugme.osdl.org/show_bug.cgi?id=7383 comment 53

    Signed-off-by: Dhaval Giani
    Signed-off-by: Venkatesh Pallipadi
    Signed-off-by: Andrew Morton
    Signed-off-by: Dave Jones

    Venkatesh Pallipadi
     

07 Nov, 2006

1 commit


23 Sep, 2006

1 commit

  • Lukewarm IQ detected in hotplug locking
    BUG: warning at kernel/cpu.c:38/lock_cpu_hotplug()
    [] lock_cpu_hotplug+0x42/0x65
    [] cpufreq_update_policy+0x25/0xad
    [] kprobe_flush_task+0x18/0x40
    [] schedule+0x63f/0x68b
    [] __link_module+0x0/0x1f
    [] __cond_resched+0x16/0x34
    [] cond_resched+0x26/0x31
    [] wait_for_completion+0x17/0xb1
    [] cpufreq_stat_cpu_callback+0x13/0x20 [cpufreq_stats]
    [] cpufreq_stats_init+0x74/0x8b [cpufreq_stats]
    [] sys_init_module+0x91/0x174
    [] 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: Dave Jones

    Dave Jones
     

01 Jul, 2006

1 commit


28 Jun, 2006

1 commit

  • CPUs come online only at init time (unless CONFIG_HOTPLUG_CPU is defined).
    So, cpu_notifier functionality need to be available only at init time.

    This patch makes register_cpu_notifier() available only at init time, unless
    CONFIG_HOTPLUG_CPU is defined.

    This patch exports register_cpu_notifier() and unregister_cpu_notifier() only
    if CONFIG_HOTPLUG_CPU is defined.

    Signed-off-by: Chandra Seetharaman
    Cc: Ashok Raj
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chandra Seetharaman
     

31 May, 2006

1 commit


12 Mar, 2006

1 commit

  • 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: Sam Ravnborg
    Signed-off-by: Dave Jones

    Sam Ravnborg
     

28 Feb, 2006

1 commit


08 Nov, 2005

1 commit


02 Nov, 2005

1 commit


31 Oct, 2005

1 commit

  • 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: Ashok Raj
    Signed-off-by: Venkatesh Pallipadi
    Cc: Dave Jones
    Cc: Zwane Mwaikambo
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ashok Raj
     

28 Oct, 2005

1 commit

  • 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.
    Signed-off-by: Dave Jones

    Dave Jones
     

21 Oct, 2005

1 commit


01 Jun, 2005

1 commit


17 Apr, 2005

1 commit

  • 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!

    Linus Torvalds