17 Jan, 2012

1 commit


21 Dec, 2011

1 commit

  • Several fields in struct cpuinfo_x86 were not defined for the
    !SMP case, likely to save space. However, those fields still
    have some meaning for UP, and keeping them allows some #ifdef
    removal from other files. The additional size of the UP kernel
    from this change is not significant enough to worry about
    keeping up the distinction:

    text data bss dec hex filename
    4737168 506459 972040 6215667 5ed7f3 vmlinux.o.before
    4737444 506459 972040 6215943 5ed907 vmlinux.o.after

    for a difference of 276 bytes for an example UP config.

    If someone wants those 276 bytes back badly then it should
    be implemented in a cleaner way.

    Signed-off-by: Kevin Winchester
    Cc: Steffen Persvold
    Link: http://lkml.kernel.org/r/1324428742-12498-1-git-send-email-kjwinchester@gmail.com
    Signed-off-by: Ingo Molnar

    Kevin Winchester
     

07 Nov, 2011

1 commit

  • The definition of TO_ATTR_NO in the non-SMP case is wrong. As the SMP
    definition resolves to the correct value, just use this for both
    cases.

    Without this fix the temperature attributes are named temp0_* instead
    of temp2_*, so libsensors won't pick them. Broken since kernel 3.0.

    Signed-off-by: Jean Delvare
    Tested-by: Phil Sutter
    Cc: stable@kernel.org
    Acked-by: Durgadoss R
    Acked-by: Guenter Roeck

    Jean Delvare
     

14 Oct, 2011

1 commit

  • Now that the ucode revision is available in cpu_data remove
    the existing code in coretemp.c to query it manually. Read the
    ucode revision from cpu_data instead

    Signed-off-by: Andi Kleen
    Acked-by: H. Peter Anvin
    Cc: jbeulich@novell.com
    Cc: fenghua.yu@intel.com
    Cc: khali@linux-fr.org
    Link: http://lkml.kernel.org/r/1318466795-7393-3-git-send-email-andi@firstfloor.org
    Signed-off-by: Ingo Molnar

    Andi Kleen
     

28 Sep, 2011

2 commits

  • Storing the struct temp_data pointer allocated from create_core_data()
    when returning an error has the potential of leaving around a pointer
    to freed memory. Reset it to NULL for error returns.

    Reported-by: Jan Beulich
    Signed-off-by: Guenter Roeck
    Acked-by: Jean Delvare

    Guenter Roeck
     
  • With recent change "hwmon: (coretemp) don't use kernel assigned CPU
    number as platform device ID", the microcode check is now running on
    random CPU. Fix that by checking the microcode before creating the
    platform device rather than at probe time.

    Also avoid calling TO_PHYS_ID(cpu) twice in the same function, it's
    expensive.

    Signed-off-by: Jean Delvare
    Cc: Jan Beulich
    Cc: Guenter Roeck
    Signed-off-by: Guenter Roeck

    Jean Delvare
     

24 Sep, 2011

3 commits


22 Sep, 2011

3 commits

  • With commit c814a4c7c4aad795835583344353963a0a673eb0, the meaning of tempX_max
    was changed. It no longer returns the value of bits 8:15 of
    MSR_IA32_TEMPERATURE_TARGET, but instead returns the value of CPU threshold
    register T1. tempX_max_hyst was added to reflect the value of temperature
    threshold register T0.

    As it turns out, T0 and T1 are used on some systems, presumably by the BIOS.
    Also, T0 and T1 don't have a well defined meaning. The thresholds may be used
    as upper or lower limits, and it is not guaranteed that T0
    Cc: Fenghua Yu
    Cc: Durgadoss R
    Acked-by: Jean Delvare

    Guenter Roeck
     
  • On old CPUs (and even some recent Atom CPUs) TjMax can't be read from
    the CPU registers, so it is guessed by the driver using a complex
    heuristic which isn't reliable. So let users who know their CPU's
    TjMax pass it as a module parameter.

    Signed-off-by: Jean Delvare
    Cc: Fenghua Yu
    Cc: "R, Durgadoss"
    Cc: Guenter Roeck
    Cc: Alexander Stein
    Acked-by: Fenghua Yu
    Signed-off-by: Guenter Roeck

    Jean Delvare
     
  • Function get_pkg_tjmax is a simplified copy of get_tjmax. Drop it and
    always use get_tjmax, result is the same and this avoids code
    duplication.

    Also make get_tjmax less verbose: don't warn about MSR read failure
    when failure was expected, and don't report TjMax in the logs unless
    debugging is enabled.

    Signed-off-by: Jean Delvare
    Cc: Fenghua Yu
    Cc: Guenter Roeck
    Cc: Durgadoss R
    Acked-by: Fenghua Yu
    Signed-off-by: Guenter Roeck

    Jean Delvare
     

14 Sep, 2011

1 commit

  • ttarget is initialized when the driver is loaded, but tmin is not.
    As a result, tempX_max_hyst attributes read 0. Fix this.

    Also use THERM_*_THRESHOLD* constants in these initializations instead
    of hard-coding the constants.

    Signed-off-by: Jean Delvare
    Cc: "R, Durgadoss"
    Cc: Guenter Roeck
    Cc: Fenghua Yu
    Signed-off-by: Guenter Roeck

    Jean Delvare
     

28 Jul, 2011

1 commit

  • This patch adds the core and pkg support to coretemp.
    These thresholds can be configured via the sysfs interfaces tempX_max
    and tempX_max_hyst. An interrupt is generated when CPU temperature reaches
    or crosses above tempX_max OR drops below tempX_max_hyst.

    This patch is based on the documentation in IA Manual vol 3A, that can be
    downloaded from here:
    http://download.intel.com/design/processor/manuals/253668.pdf

    Signed-off-by: Durgadoss R
    Signed-off-by: Guenter Roeck

    Durgadoss R
     

18 Jun, 2011

1 commit


02 Jun, 2011

3 commits

  • Further relax temperature range checks after reading the IA32_TEMPERATURE_TARGET
    register. If the register returns a value other than 0 in bits 16..32, assume
    that the returned value is correct.

    This change applies to both packet and core temperature limits.

    Cc: Carsten Emde
    Cc: Fenghua Yu
    Cc: Jean Delvare
    Signed-off-by: Guenter Roeck
    Acked-by: Fenghua Yu

    Guenter Roeck
     
  • Commit a321cedb12904114e2ba5041a3673ca24deb09c9 excludes CPU models 0xe, 0xf,
    0x16, and 0x1a from TjMax temperature adjustment, even though several of those
    CPUs are known to have TiMax other than 100 degrees C, and even though the code
    in adjust_tjmax() explicitly handles those CPUs and points to a Web document
    listing several of the affected CPU IDs.

    Reinstate original TjMax adjustment if TjMax can not be determined using the
    IA32_TEMPERATURE_TARGET register.

    https://bugzilla.kernel.org/show_bug.cgi?id=32582

    Signed-off-by: Guenter Roeck
    Cc: Huaxu Wan
    Cc: Carsten Emde
    Cc: Valdis Kletnieks
    Cc: Henrique de Moraes Holschuh
    Cc: Yong Wang
    Cc: Rudolf Marek
    Cc: Fenghua Yu
    Tested-by: Jean Delvare
    Acked-by: Jean Delvare
    Acked-by: Fenghua Yu
    Cc: # .35.x .36.x .37.x .38.x .39.x

    Guenter Roeck
     
  • The current temperature range check of MSR_IA32_TEMPERATURE_TARGET
    seems too strict to me, some TjMax values documented in
    Documentation/hwmon/coretemp wouldn't pass. Relax the check so that
    all the documented values pass.

    Signed-off-by: Jean Delvare
    Cc: Carsten Emde
    Cc: Fenghua Yu
    Signed-off-by: Guenter Roeck

    Jean Delvare
     

27 May, 2011

3 commits

  • chk_ucode_version() is only called from coretemp_probe() which is
    __devinit, so it can be marked __devinit too.

    Signed-off-by: Jean Delvare
    Cc: Durgadoss R
    Cc: Fenghua Yu
    Cc: Guenter Roeck
    Signed-off-by: Guenter Roeck

    Jean Delvare
     
  • Update comments describing the handling of HT CPUs based on review feedback.

    Signed-off-by: Guenter Roeck
    Cc: Fenghua Yu
    Cc: Durgadoss R
    Acked-by: Jean Delvare

    Guenter Roeck
     
  • Initialize sysfs attrs before device_create_file() call to suppress lockdep_init_map()
    warning:

    [ 3.653628] WARNING: at kernel/lockdep.c:2885 lockdep_init_map+0xea/0x43c()
    [ 3.653698] Modules linked in:
    [ 3.654835] Pid: 1, comm: swapper Not tainted 2.6.39-dbg-git8-05624-g46187f8 #576
    [ 3.656014] Call Trace:
    [ 3.657139] [] warn_slowpath_common+0x7e/0x96
    [ 3.658298] [] warn_slowpath_null+0x15/0x17
    [ 3.659460] [] lockdep_init_map+0xea/0x43c
    [ 3.660616] [] sysfs_add_file_mode+0x5d/0xa8
    [ 3.661785] [] sysfs_add_file+0xc/0xe
    [ 3.662929] [] sysfs_create_file+0x23/0x25
    [ 3.664045] [] device_create_file+0x14/0x16
    [ 3.665172] [] coretemp_probe+0xf9/0x185
    [ 3.666306] [] platform_drv_probe+0x12/0x14
    [ 3.667420] [] driver_probe_device+0xb0/0x14b
    [ 3.668542] [] __device_attach+0x35/0x3a
    [ 3.669710] [] ? __driver_attach+0x7c/0x7c
    [ 3.670816] [] bus_for_each_drv+0x54/0x88
    [ 3.671921] [] device_attach+0x77/0x9b
    [ 3.673027] [] bus_probe_device+0x22/0x39
    [ 3.674137] [] device_add+0x3c1/0x550
    [ 3.675249] [] ? dev_set_name+0x3c/0x3e
    [ 3.676371] [] platform_device_add+0x10c/0x156
    [ 3.677491] [] get_core_online+0xab/0x16e
    [ 3.678608] [] coretemp_init+0x4b/0x80
    [ 3.679724] [] ? hwmon_init+0xee/0xee
    [ 3.680853] [] do_one_initcall+0x7a/0x13c
    [ 3.681975] [] kernel_init+0xe1/0x15b
    [ 3.683081] [] kernel_thread_helper+0x4/0x10
    [ 3.684174] [] ? finish_task_switch+0x76/0xf0
    [ 3.685266] [] ? retint_restore_args+0x13/0x13
    [ 3.686356] [] ? start_kernel+0x3ee/0x3ee
    [ 3.687425] [] ? gs_change+0x13/0x13
    [ 3.688489] ---[ end trace 7392ad3e6a92ae39 ]---

    Signed-off-by: Sergey Senozhatsky
    Signed-off-by: Guenter Roeck

    Sergey Senozhatsky
     

24 May, 2011

2 commits

  • The coretemp driver provides a single set of device attributes for each
    physical core of a HT CPU to avoid duplicate sensors. This
    functionality was introduced with commit d883b9f09772 ("hwmon:
    (coretemp) Skip duplicate CPU entries").

    Commit e40cc4bdfd4b ("x86/hwmon: register alternate sibling upon CPU
    removal") extends this functionality to register the HT sibling of a CPU
    which is taken offline, to ensure that sensor attributes are provided if
    at least one HT sibling of a core is online.

    Add comments into the code describing the functionality in some more
    detail.

    Signed-off-by: Guenter Roeck
    Cc: Fenghua Yu
    Cc: Durgadoss R
    Signed-off-by: Linus Torvalds

    Guenter Roeck
     
  • cpu_sibling_mask() is not defined unless CONFIG_SMP is defined, so it
    must not be used directly in the code without ifdef protection.

    To solve the problem and avoid ifdefs in the code, define
    for_each_sibling() and use it instead.

    Signed-off-by: Guenter Roeck
    Cc: Fenghua Yu
    Cc: Durgadoss R
    Signed-off-by: Linus Torvalds

    Guenter Roeck
     

21 May, 2011

1 commit


20 May, 2011

1 commit

  • This patch merges the pkgtemp with coretemp driver.
    The sysfs interfaces for all cores in the same pkg
    are shown under one directory, in hwmon. It also
    supports CONFIG_HOTPLUG_CPU. So, the sysfs interfaces
    are created when each core comes online and are
    removed when it goes offline.

    Signed-off-by: Durgadoss R
    Cc: Fenghua Yu
    [guenter.roeck@ericsson.com: Fixed section reference errors]
    Signed-off-by: Guenter Roeck

    Durgadoss R
     

09 Jan, 2011

1 commit


26 Oct, 2010

5 commits


28 Sep, 2010

1 commit

  • Commit e40cc4bdfd4b89813f072f72bd9c7055814d3f0f introduced
    a build breakage if CONFIG_SMP is undefined. This commit
    fixes the problem.

    This fix is only a workaround. For a real fix, cpu_sibling_mask() should
    be defined in UP include code, eg in linux/smp.h, and asm/smp.h should not be
    included directly. This fix is currently not possible because asm/smp.h defines
    cpu_sibling_mask() unconditionally and is included directly from many source
    files.

    Reported-by: Ingo Molnar
    Tested-by: Ingo Molnar
    Signed-off-by: Guenter Roeck
    Cc: Fenghua Yu

    Guenter Roeck
     

25 Sep, 2010

3 commits

  • Just like pkgtemp registers another core of the same package when one
    gets removed, coretemp should register another hyperthread (if
    available) in that situation.

    As pointed out in the patch fixing the respective code in pkgtemp, the
    list protectng mutex must be dropped before calling
    coretemp_device_add(), and due to the restructured loop (including an
    explicit return) the "safe" variant of the list iterator isn't needed
    anymore.

    Signed-off-by: Jan Beulich
    Cc: Rudolf Marek
    Signed-off-by: Guenter Roeck

    Jan Beulich
     
  • Using cpuid_eax() to determine feature availability on other than
    the current CPU is invalid. And feature availability should also be
    checked in the hotplug code path.

    Signed-off-by: Jan Beulich
    Cc: Rudolf Marek
    Cc: Fenghua Yu
    Signed-off-by: Guenter Roeck

    Jan Beulich
     
  • In commit 0dca94baeab4a1a514841b0a4c8e3a51dfb4d5ae the call to
    platform_driver_unregister() was made conditional upon !HOTPLUG_CPU,
    but the return value from coretemp_init() was left to indicate an
    error. This isn't correct, as the negative return value indicates to
    the module loader that initialization failed, which isn't intended
    here and results in dangling pointers.

    Signed-off-by: Jan Beulich
    Cc: Chen Gong
    Signed-off-by: Guenter Roeck

    Jan Beulich
     

25 Aug, 2010

1 commit

  • Fix the following build warning:

    CC [M] drivers/hwmon/coretemp.o
    drivers/hwmon/coretemp.c: In function "coretemp_init":
    drivers/hwmon/coretemp.c:521: warning: unused variable "n"
    drivers/hwmon/coretemp.c:521: warning: unused variable "p"

    Introduced by commit 851b29cb3b196cb66452ec964ab5f66c9c9cd1ed. When
    you drop code, you also have to drop the variables this code was
    using.

    Signed-off-by: Jean Delvare
    Cc: Chen Gong
    Cc: Rudolf Marek
    Cc: Huaxu Wan

    Jean Delvare
     

11 Aug, 2010

1 commit

  • In commit 0dca94baeab4 ("hwmon: coretemp: update hotplug condition
    check") we merged v2 of this patch. Update that to v3.

    The difference is to remove the new and unnecesary references to
    CPU_*_FROZEN.

    Cc: "Rafael J. Wysocki"
    Cc: Chen Gong
    Cc: Rudolf Marek
    Cc: Huaxu Wan
    Cc: Jean Delvare
    Cc: Guenter Roeck
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

10 Aug, 2010

3 commits

  • register_hotcpu_notifier() is designed to make these ifdefs unnecessary.

    Cc: Chen Gong
    Cc: Rudolf Marek
    Cc: Huaxu Wan
    Cc: Jean Delvare
    Cc: Guenter Roeck
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • If one coretemp device can't be added, it should allow subsequent adding
    operation because every new-added device will create a new sysfs group,
    not an additional sensor sys entry.

    Signed-off-by: Chen Gong
    Cc: Rudolf Marek
    Cc: Huaxu Wan
    Cc: Jean Delvare
    Cc: Guenter Roeck
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chen Gong
     
  • Fix two errors in hotplug. One is for hotplug notifier. The other is
    unnecessary driver unregister. Because even none of online cpus supports
    coretemp, we can't assume new onlined cpu doesn't support it either. If
    related driver is unregistered there we have no chance to use coretemp
    from then on.

    Signed-off-by: Chen Gong
    Cc: Rudolf Marek
    Cc: Huaxu Wan
    Cc: Jean Delvare
    Cc: Guenter Roeck
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chen Gong