31 Aug, 2019

1 commit

  • In coretemp_init(), 'zone_devices' is allocated through kcalloc().
    However, it is not deallocated in the following execution if
    platform_driver_register() fails, leading to a memory leak. To fix this
    issue, introduce the 'outzone' label to free 'zone_devices' before
    returning the error.

    Signed-off-by: Wenwen Wang
    Link: https://lore.kernel.org/r/1566248402-6538-1-git-send-email-wenwen@cs.uga.edu
    Signed-off-by: Guenter Roeck

    Wenwen Wang
     

09 Jul, 2019

1 commit

  • Pull x86 topology updates from Ingo Molnar:
    "Implement multi-die topology support on Intel CPUs and expose the die
    topology to user-space tooling, by Len Brown, Kan Liang and Zhang Rui.

    These changes should have no effect on the kernel's existing
    understanding of topologies, i.e. there should be no behavioral impact
    on cache, NUMA, scheduler, perf and other topologies and overall
    system performance"

    * 'x86-topology-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf/x86/intel/rapl: Cosmetic rename internal variables in response to multi-die/pkg support
    perf/x86/intel/uncore: Cosmetic renames in response to multi-die/pkg support
    hwmon/coretemp: Cosmetic: Rename internal variables to zones from packages
    thermal/x86_pkg_temp_thermal: Cosmetic: Rename internal variables to zones from packages
    perf/x86/intel/cstate: Support multi-die/package
    perf/x86/intel/rapl: Support multi-die/package
    perf/x86/intel/uncore: Support multi-die/package
    topology: Create core_cpus and die_cpus sysfs attributes
    topology: Create package_cpus sysfs attribute
    hwmon/coretemp: Support multi-die/package
    powercap/intel_rapl: Update RAPL domain name and debug messages
    thermal/x86_pkg_temp_thermal: Support multi-die/package
    powercap/intel_rapl: Support multi-die/package
    powercap/intel_rapl: Simplify rapl_find_package()
    x86/topology: Define topology_logical_die_id()
    x86/topology: Define topology_die_id()
    cpu/topology: Export die_id
    x86/topology: Create topology_max_die_per_package()
    x86/topology: Add CPUID.1F multi-die/package support

    Linus Torvalds
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation version 2 of the license this program
    is distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not write to the free
    software foundation inc 51 franklin street fifth floor boston ma
    02110 1301 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 12 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Richard Fontana
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070033.745497013@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

23 May, 2019

2 commits

  • Syntax update only -- no logical or functional change.

    In response to the new multi-die/package changes, update variable names to
    use the more generic thermal "zone" terminology, instead of "package", as
    the zones can refer to either packages or die.

    Signed-off-by: Len Brown
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Ingo Molnar
    Acked-by: Peter Zijlstra (Intel)
    Cc: Zhang Rui
    Link: https://lkml.kernel.org/r/facecfd3525d55c2051f63a7ec709aeb03cc1dc1.1557769318.git.len.brown@intel.com

    Len Brown
     
  • Package temperature sensors are actually implemented in hardware per-die.

    Update coretemp to be "die-aware", so it can expose mulitple sensors per
    package, instead of just one. No change to single-die/package systems.

    Signed-off-by: Zhang Rui
    Signed-off-by: Len Brown
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Ingo Molnar
    Acked-by: Guenter Roeck
    Acked-by: Peter Zijlstra (Intel)
    Cc: linux-pm@vger.kernel.org
    Cc: linux-hwmon@vger.kernel.org
    Link: https://lkml.kernel.org/r/ec2868f35113a01ff72d9041e0b97fc6a1c7df84.1557769318.git.len.brown@intel.com

    Zhang Rui
     

17 Dec, 2018

1 commit

  • Replace S_ with octal values.

    The conversion was done automatically with coccinelle. The semantic patches
    and the scripts used to generate this commit log are available at
    https://github.com/groeck/coccinelle-patches/hwmon/.

    This patch does not introduce functional changes. It was verified by
    compiling the old and new files and comparing text and data sizes.

    Cc: Fenghua Yu
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     

13 Jun, 2018

1 commit

  • The kzalloc() function has a 2-factor argument form, kcalloc(). This
    patch replaces cases of:

    kzalloc(a * b, gfp)

    with:
    kcalloc(a * b, gfp)

    as well as handling cases of:

    kzalloc(a * b * c, gfp)

    with:

    kzalloc(array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    kzalloc_array(array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    kzalloc(4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    type TYPE;
    expression THING, E;
    @@

    (
    kzalloc(
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    kzalloc(
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    kzalloc(
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    identifier SIZE, COUNT;
    @@

    - kzalloc
    + kcalloc
    (
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    kzalloc(
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    kzalloc(
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    kzalloc(
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    kzalloc(sizeof(THING) * C2, ...)
    |
    kzalloc(sizeof(TYPE) * C2, ...)
    |
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(C1 * C2, ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

15 Feb, 2018

2 commits

  • Pull x86 PTI and Spectre related fixes and updates from Ingo Molnar:
    "Here's the latest set of Spectre and PTI related fixes and updates:

    Spectre:
    - Add entry code register clearing to reduce the Spectre attack
    surface
    - Update the Spectre microcode blacklist
    - Inline the KVM Spectre helpers to get close to v4.14 performance
    again.
    - Fix indirect_branch_prediction_barrier()
    - Fix/improve Spectre related kernel messages
    - Fix array_index_nospec_mask() asm constraint
    - KVM: fix two MSR handling bugs

    PTI:
    - Fix a paranoid entry PTI CR3 handling bug
    - Fix comments

    objtool:
    - Fix paranoid_entry() frame pointer warning
    - Annotate WARN()-related UD2 as reachable
    - Various fixes
    - Add Add Peter Zijlstra as objtool co-maintainer

    Misc:
    - Various x86 entry code self-test fixes
    - Improve/simplify entry code stack frame generation and handling
    after recent heavy-handed PTI and Spectre changes. (There's two
    more WIP improvements expected here.)
    - Type fix for cache entries

    There's also some low risk non-fix changes I've included in this
    branch to reduce backporting conflicts:

    - rename a confusing x86_cpu field name
    - de-obfuscate the naming of single-TLB flushing primitives"

    * 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (41 commits)
    x86/entry/64: Fix CR3 restore in paranoid_exit()
    x86/cpu: Change type of x86_cache_size variable to unsigned int
    x86/spectre: Fix an error message
    x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping
    selftests/x86/mpx: Fix incorrect bounds with old _sigfault
    x86/mm: Rename flush_tlb_single() and flush_tlb_one() to __flush_tlb_one_[user|kernel]()
    x86/speculation: Add dependency
    nospec: Move array_index_nospec() parameter checking into separate macro
    x86/speculation: Fix up array_index_nospec_mask() asm constraint
    x86/debug: Use UD2 for WARN()
    x86/debug, objtool: Annotate WARN()-related UD2 as reachable
    objtool: Fix segfault in ignore_unreachable_insn()
    selftests/x86: Disable tests requiring 32-bit support on pure 64-bit systems
    selftests/x86: Do not rely on "int $0x80" in single_step_syscall.c
    selftests/x86: Do not rely on "int $0x80" in test_mremap_vdso.c
    selftests/x86: Fix build bug caused by the 5lvl test which has been moved to the VM directory
    selftests/x86/pkeys: Remove unused functions
    selftests/x86: Clean up and document sscanf() usage
    selftests/x86: Fix vDSO selftest segfault for vsyscall=none
    x86/entry/64: Remove the unused 'icebp' macro
    ...

    Linus Torvalds
     
  • x86_mask is a confusing name which is hard to associate with the
    processor's stepping.

    Additionally, correct an indent issue in lib/cpu.c.

    Signed-off-by: Jia Zhang
    [ Updated it to more recent kernels. ]
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: bp@alien8.de
    Cc: tony.luck@intel.com
    Link: http://lkml.kernel.org/r/1514771530-70829-1-git-send-email-qianyue.zj@alibaba-inc.com
    Signed-off-by: Ingo Molnar

    Jia Zhang
     

03 Jan, 2018

1 commit

  • pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
    where a PCI device is present. This restricts the device drivers to be
    reused for other domain numbers.

    Use pci_get_domain_bus_and_slot() with a domain number of 0 where we can't
    extract the domain number. Other places, use the actual domain number from
    the device.

    Signed-off-by: Sinan Kaya
    Signed-off-by: Guenter Roeck

    Sinan Kaya
     

14 May, 2017

1 commit

  • The recent conversion to the hotplug state machine missed that the original
    hotplug notifiers did not execute in the frozen state, which is used on
    suspend on resume.

    This does not matter on single socket machines, but on multi socket systems
    this breaks when the device for a non-boot socket is removed when the last
    CPU of that socket is brought offline. The device removal locks up the
    machine hard w/o any debug output.

    Prevent executing the hotplug callbacks when cpuhp_tasks_frozen is true.

    Thanks to Tommi for providing debug information patiently while I failed to
    spot the obvious.

    Fixes: e00ca5df37ad ("hwmon: (coretemp) Convert to hotplug state machine")
    Reported-by: Tommi Rantala
    Tested-by: Tommi Rantala
    Signed-off-by: Thomas Gleixner
    Signed-off-by: Guenter Roeck

    Thomas Gleixner
     

10 Dec, 2016

6 commits

  • Keeping track of the per package platform devices requires an extra object,
    which is held in a linked list.

    The maximum number of packages is known at init() time. So the extra object
    and linked list management can be replaced by an array of platform device
    pointers in which the per package devices pointers can be stored. Lookup
    becomes a simple array lookup instead of a list walk.

    The mutex protecting the list can be removed as well because the array is
    only accessed from cpu hotplug callbacks which are already serialized.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Guenter Roeck

    Thomas Gleixner
     
  • The cpu online callback returns success unconditionally even when the
    device has no support, micro code mismatches or device allocation fails.
    Only if CPU_HOTPLUG is disabled, the init function checks whether the
    device list is empty and removes the driver.

    This does not make sense. If CPU HOTPLUG is enabled then there is no point
    to keep the driver around when it failed to initialize on the already
    online cpus. The chance that not yet online CPUs will provide a functional
    interface later is very close to zero.

    Add proper error return codes, so the setup of the cpu hotplug states fails
    when the device cannot be initialized and remove all the magic cruft.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Guenter Roeck

    Thomas Gleixner
     
  • Install the callbacks via the state machine. Setup and teardown are handled
    by the hotplug core.

    Signed-off-by: Sebastian Andrzej Siewior
    Cc: linux-hwmon@vger.kernel.org
    Cc: Fenghua Yu
    Cc: Jean Delvare
    Cc: rt@linuxtronix.de
    Cc: Guenter Roeck
    Link: http://lkml.kernel.org/r/20161117183541.8588-5-bigeasy@linutronix.de
    Signed-off-by: Guenter Roeck

    Thomas Gleixner
     
  • No point in looking up the same thing over and over.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Guenter Roeck

    Thomas Gleixner
     
  • The coretemp driver provides a sysfs interface per physical core. If
    hyperthreading is enabled and one of the siblings goes offline the sysfs
    interface is removed and then immeditately created again for the
    sibling. The only difference of them is the target cpu for the
    rdmsr_on_cpu() in the sysfs show functions.

    It's way simpler to keep a cpumask of cpus which are active in a package
    and only remove the interface when the last sibling goes offline. Otherwise
    just move the target cpu for the sysfs show functions to the still online
    sibling.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Guenter Roeck

    Thomas Gleixner
     
  • When a CPU is offlined nothing checks whether it is the target CPU for the
    package temperature sysfs interface.

    As a consequence all future readouts of the package temperature return
    crap:

    90000

    which is Tjmax of that package.

    Check whether the outgoing CPU is the target for the package and assign it
    to some other still online CPU in the package. Protect the change against
    the rdmsr_on_cpu() in show_crit_alarm().

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Guenter Roeck

    Thomas Gleixner
     

14 Oct, 2015

1 commit

  • A new limit selected arbitrarily as power of two greater than
    required minimum for Xeon Phi processor (72 for Knights Landing).

    Currently driver is not able to handle cores with core ID greater than 32.
    Such attempt ends up with the following error in dmesg:
    coretemp coretemp.0: Adding Core XXX failed

    Signed-off-by: Lukasz Odzioba
    Signed-off-by: Guenter Roeck

    Lukasz Odzioba
     

27 May, 2015

1 commit

  • The former duplicates the functionality of the latter but is
    neither documented nor arch-independent.

    Signed-off-by: Bartosz Golaszewski
    Acked-by: Guenter Roeck
    Cc: Benoit Cousson
    Cc: Catalin Marinas
    Cc: Fenghua Yu
    Cc: Jean Delvare
    Cc: Jonathan Corbet
    Cc: Linus Torvalds
    Cc: Oleg Drokin
    Cc: Peter Zijlstra
    Cc: Rafael J. Wysocki
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Viresh Kumar
    Link: http://lkml.kernel.org/r/1432645896-12588-4-git-send-email-bgolaszewski@baylibre.com
    Signed-off-by: Ingo Molnar

    Bartosz Golaszewski
     

10 Mar, 2015

1 commit


20 Oct, 2014

1 commit


01 May, 2014

1 commit

  • This reverts commit 9fb6c9c73b11bef65ba80a362547fd116c1e1c9d.

    Tjmax on some Intel CPUs is below 85 degrees C. One known example is
    L5630 with Tjmax of 71 degrees C. There are other Xeon processors with
    Tjmax of 70 or 80 degrees C. Also, the Intel IA32 System Programming
    document states that the temperature target is in bits 23:16 of MSR 0x1a2
    (MSR_TEMPERATURE_TARGET), which is 8 bits, not 7.

    So even if turbostat uses similar checks to validate Tjmax, there is no
    evidence that the checks are actually required. On the contrary, the
    checks are known to cause problems and therefore need to be removed.

    This fixes https://bugzilla.kernel.org/show_bug.cgi?id=75071.

    Fixes: 9fb6c9c hwmon: (coretemp) Refine TjMax detection
    Reviewed-by: Jean Delvare
    Cc: stable@vger.kernel.org # 3.14+
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     

08 Apr, 2014

1 commit

  • Pull CPU hotplug notifiers registration fixes from Rafael Wysocki:
    "The purpose of this single series of commits from Srivatsa S Bhat
    (with a small piece from Gautham R Shenoy) touching multiple
    subsystems that use CPU hotplug notifiers is to provide a way to
    register them that will not lead to deadlocks with CPU online/offline
    operations as described in the changelog of commit 93ae4f978ca7f ("CPU
    hotplug: Provide lockless versions of callback registration
    functions").

    The first three commits in the series introduce the API and document
    it and the rest simply goes through the users of CPU hotplug notifiers
    and converts them to using the new method"

    * tag 'cpu-hotplug-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (52 commits)
    net/iucv/iucv.c: Fix CPU hotplug callback registration
    net/core/flow.c: Fix CPU hotplug callback registration
    mm, zswap: Fix CPU hotplug callback registration
    mm, vmstat: Fix CPU hotplug callback registration
    profile: Fix CPU hotplug callback registration
    trace, ring-buffer: Fix CPU hotplug callback registration
    xen, balloon: Fix CPU hotplug callback registration
    hwmon, via-cputemp: Fix CPU hotplug callback registration
    hwmon, coretemp: Fix CPU hotplug callback registration
    thermal, x86-pkg-temp: Fix CPU hotplug callback registration
    octeon, watchdog: Fix CPU hotplug callback registration
    oprofile, nmi-timer: Fix CPU hotplug callback registration
    intel-idle: Fix CPU hotplug callback registration
    clocksource, dummy-timer: Fix CPU hotplug callback registration
    drivers/base/topology.c: Fix CPU hotplug callback registration
    acpi-cpufreq: Fix CPU hotplug callback registration
    zsmalloc: Fix CPU hotplug callback registration
    scsi, fcoe: Fix CPU hotplug callback registration
    scsi, bnx2fc: Fix CPU hotplug callback registration
    scsi, bnx2i: Fix CPU hotplug callback registration
    ...

    Linus Torvalds
     

20 Mar, 2014

1 commit

  • Subsystems that want to register CPU hotplug callbacks, as well as perform
    initialization for the CPUs that are already online, often do it as shown
    below:

    get_online_cpus();

    for_each_online_cpu(cpu)
    init_cpu(cpu);

    register_cpu_notifier(&foobar_cpu_notifier);

    put_online_cpus();

    This is wrong, since it is prone to ABBA deadlocks involving the
    cpu_add_remove_lock and the cpu_hotplug.lock (when running concurrently
    with CPU hotplug operations).

    Instead, the correct and race-free way of performing the callback
    registration is:

    cpu_notifier_register_begin();

    for_each_online_cpu(cpu)
    init_cpu(cpu);

    /* Note the use of the double underscored version of the API */
    __register_cpu_notifier(&foobar_cpu_notifier);

    cpu_notifier_register_done();

    Fix the hwmon coretemp code by using this latter form of callback
    registration.

    Cc: Fenghua Yu
    Cc: Jean Delvare
    Cc: Ingo Molnar
    Acked-by: Guenter Roeck
    Signed-off-by: Srivatsa S. Bhat
    Signed-off-by: Rafael J. Wysocki

    Srivatsa S. Bhat
     

04 Mar, 2014

3 commits


15 Jan, 2014

5 commits

  • Some Intel CPUs do not set the 'valid' bit in IA32_THERM_STATUS if the
    temperature is too low to be measured. This condition will not change until
    the CPU is hot enough for its temperature to be measured. Returning an error
    in such conditions is not very useful. Drop checking the valid bit and just
    return the reported temperature instead.

    Reviewed-by: Jean Delvare
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • Intel's turbostat code uses only 7 bits from MSR_IA32_TEMPERATURE_TARGET to
    read TjMax, and also only accepts it if the reported temperature is at least
    85 degrees C. Play safe and do the same.

    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • Since we now have to use PCI IDs to detect CPU types anyway, use this mechanism
    to detect CE41x0 CPUs. Advantage is that it only requires a single entry and
    covers all variants of CE41x0, including those unknown to us.

    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • Atom S12x0 CPUs are identified by the CPU host bridge ID. Add an override
    table based on PCI IDs as well as code to detect it.

    PCI access functions can now be called with PCI disabled, so unlike previous
    attempts to use PCI IDs, the code no longer depends on it. If PCI is disabled,
    the CPU will not be identified correctly. Since it is unlikely that anything
    will work in this case, this is an acceptable limitation.

    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • When the core number exceeds 9, the size of the buffer storing the
    alarm attribute name is insufficient and the attribute name is
    truncated. This causes libsensors to skip these attributes as the
    truncated name is not recognized.

    Reported-by: Andreas Hollmann
    Signed-off-by: Jean Delvare
    Cc: stable@vger.kernel.org
    Signed-off-by: Guenter Roeck

    Jean Delvare
     

12 Aug, 2013

1 commit


15 Jul, 2013

1 commit

  • The __cpuinit type of throwaway sections might have made sense
    some time ago when RAM was more constrained, but now the savings
    do not offset the cost and complications. For example, the fix in
    commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
    is a good example of the nasty type of bugs that can be created
    with improper use of the various __init prefixes.

    After a discussion on LKML[1] it was decided that cpuinit should go
    the way of devinit and be phased out. Once all the users are gone,
    we can then finally remove the macros themselves from linux/init.h.

    This removes all the drivers/hwmon uses of the __cpuinit macros
    from all C files.

    [1] https://lkml.org/lkml/2013/5/20/589

    Cc: Fenghua Yu
    Cc: lm-sensors@lm-sensors.org
    Acked-by: Guenter Roeck
    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

22 Jun, 2013

1 commit


08 Apr, 2013

1 commit


26 Jan, 2013

1 commit


12 Dec, 2012

1 commit

  • Pull driver core updates from Greg Kroah-Hartman:
    "Here's the large driver core updates for 3.8-rc1.

    The biggest thing here is the various __dev* marking removals. This
    is going to be a pain for the merge with different subsystem trees, I
    know, but all of the patches included here have been ACKed by their
    various subsystem maintainers, as they wanted them to go through here.

    If this is too much of a pain, I can pull all of them out of this tree
    and just send you one with the other fixes/updates and then, after
    3.8-rc1 is out, do the rest of the removals to ensure we catch them
    all, it's up to you. The merges should all be trivial, and Stephen
    has been doing them all in linux-next for a few weeks now quite
    easily.

    Other than the __dev* marking removals, there's nothing major here,
    some firmware loading updates and other minor things in the driver
    core.

    All of these have (much to Stephen's annoyance), been in linux-next
    for a while.

    Signed-off-by: Greg Kroah-Hartman "

    Fixed up trivial conflicts in drivers/gpio/gpio-{em,stmpe}.c due to gpio
    update.

    * tag 'driver-core-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (93 commits)
    modpost.c: Stop checking __dev* section mismatches
    init.h: Remove __dev* sections from the kernel
    acpi: remove use of __devinit
    PCI: Remove __dev* markings
    PCI: Always build setup-bus when PCI is enabled
    PCI: Move pci_uevent into pci-driver.c
    PCI: Remove CONFIG_HOTPLUG ifdefs
    unicore32/PCI: Remove CONFIG_HOTPLUG ifdefs
    sh/PCI: Remove CONFIG_HOTPLUG ifdefs
    powerpc/PCI: Remove CONFIG_HOTPLUG ifdefs
    mips/PCI: Remove CONFIG_HOTPLUG ifdefs
    microblaze/PCI: Remove CONFIG_HOTPLUG ifdefs
    dma: remove use of __devinit
    dma: remove use of __devexit_p
    firewire: remove use of __devinitdata
    firewire: remove use of __devinit
    leds: remove use of __devexit
    leds: remove use of __devinit
    leds: remove use of __devexit_p
    mmc: remove use of __devexit
    ...

    Linus Torvalds
     

06 Dec, 2012

2 commits