04 Sep, 2019

1 commit

  • Removes:
    - hwmon_dev from k8temp_data struct, as that is now passed
    to callbacks, anyway.
    - other k8temp_data struct fields, too.
    - k8temp_update_device()

    Also reduces binary size:
    text data bss dec hex filename
    4139 1448 0 5587 15d3 drivers/hwmon/k8temp.ko.bak
    3103 1220 0 4323 10e3 drivers/hwmon/k8temp.ko

    Signed-off-by: Robert Karszniewicz
    Signed-off-by: Robert Karszniewicz
    Link: https://lore.kernel.org/r/20190721120051.28064-1-avoidr@riseup.net
    Signed-off-by: Guenter Roeck

    Robert Karszniewicz
     

21 May, 2019

1 commit

  • Based on 2 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 either version 2 of the license or at
    your option any later version 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

    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 either version 2 of the license or at
    your option [no]_[pad]_[ctrl] any later version 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-or-later

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

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Jilayne Lovejoy
    Reviewed-by: Steve Winslow
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190519154040.652910950@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

19 Feb, 2019

1 commit

  • Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code,
    to improve readability, and to reduce the chance of inconsistencies.

    Also replace any remaining S_ in the driver 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: Rudolf Marek
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     

15 Feb, 2018

1 commit

  • 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, 2017

1 commit

  • Use DEVICE_ATTR_RO for read-only attributes. This simplifies the source
    code, improves readbility, and reduces the chance of inconsistencies.

    The conversion was done automatically using coccinelle. It was validated
    by compiling both the old and the new source code and comparing its text,
    data, and bss size.

    Signed-off-by: Julia Lawall
    [groeck: Updated description]
    Signed-off-by: Guenter Roeck

    Julia Lawall
     

15 Jan, 2014

1 commit


08 Apr, 2013

1 commit


29 Nov, 2012

3 commits

  • CONFIG_HOTPLUG is going away as an option so __devexit is no
    longer needed.

    Signed-off-by: Bill Pemberton
    Cc: Hans de Goede
    Cc: Jean Delvare
    Cc: Alistair John Strachan
    Cc: Fenghua Yu
    Cc: Juerg Haefliger
    Cc: Andreas Herrmann
    Cc: Clemens Ladisch
    Cc: Rudolf Marek
    Cc: Jim Cromie
    Cc: "Mark M. Hoffman"
    Cc: Roger Lucas
    Acked-by: Guenter Roeck
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devinit is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: Hans de Goede
    Cc: Jean Delvare
    Cc: Alistair John Strachan
    Cc: Fenghua Yu
    Cc: Juerg Haefliger
    Cc: Andreas Herrmann
    Cc: Clemens Ladisch
    Cc: Rudolf Marek
    Cc: Jim Cromie
    Cc: "Mark M. Hoffman"
    Cc: Roger Lucas
    Acked-by: Guenter Roeck
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: Hans de Goede
    Cc: Jean Delvare
    Cc: Alistair John Strachan
    Cc: Fenghua Yu
    Cc: Juerg Haefliger
    Cc: Andreas Herrmann
    Cc: Clemens Ladisch
    Cc: Rudolf Marek
    Cc: Jim Cromie
    Cc: "Mark M. Hoffman"
    Cc: Roger Lucas
    Acked-by: Guenter Roeck
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     

10 Oct, 2012

1 commit


22 Jul, 2012

1 commit


21 May, 2012

1 commit

  • This patch converts the drivers in drivers/hwmon/* to use module_pci_driver()
    macro which makes the code smaller and a bit simpler.

    Signed-off-by: Axel Lin
    Cc: Andreas Herrmann
    Cc: Clemens Ladisch
    Cc: Rudolf Marek
    Signed-off-by: Guenter Roeck

    Axel Lin
     

19 Mar, 2012

2 commits


26 May, 2011

1 commit


29 Oct, 2010

1 commit


25 Aug, 2010

1 commit

  • Commit 8bf0223ed515be24de0c671eedaff49e78bebc9c (hwmon, k8temp: Fix
    temperature reporting for ASB1 processor revisions) fixed temperature
    reporting for ASB1 CPUs. But those CPU models (model 0x6b, 0x6f, 0x7f)
    were packaged both as AM2 (desktop) and ASB1 (mobile). Thus the commit
    leads to wrong temperature reporting for AM2 CPU parts.

    The solution is to determine the package type for models 0x6b, 0x6f,
    0x7f.

    This is done using BrandId from CPUID Fn8000_0001_EBX[15:0]. See
    "Constructing the processor Name String" in "Revision Guide for AMD
    NPT Family 0Fh Processors" (Rev. 3.46).

    Cc: Rudolf Marek
    Cc: stable@kernel.org [.32.x, .33.x, .34.x, .35.x]
    Reported-by: Vladislav Guberinic
    Signed-off-by: Andreas Herrmann
    Signed-off-by: Jean Delvare

    Andreas Herrmann
     

15 Aug, 2010

1 commit

  • Move the if(err) statement after the if into the if branch indicated by its
    indentation. The preceding if(err) test implies that err cannot be nonzero
    unless the if branch is taken.

    The semantic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r disable braces5@
    position p1,p2;
    statement S1,S2;
    @@

    (
    if (...) { ... }
    |
    if (...) S1@p1 S2@p2
    )

    @script:python@
    p1 << r.p1;
    p2 << r.p2;
    @@

    if (p1[0].column == p2[0].column):
    cocci.print_main("branch",p4)
    cocci.print_secs("after",p5)
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Jean Delvare

    Julia Lawall
     

09 Jul, 2010

1 commit

  • Reported temperature for ASB1 CPUs is too high.
    Add ASB1 CPU revisions (these are also non-desktop variants) to the
    list of CPUs for which the temperature fixup is not required.

    Example: (from LENOVO ThinkPad Edge 13, 01972NG, system was idle)

    Current kernel reports

    $ sensors
    k8temp-pci-00c3
    Adapter: PCI adapter
    Core0 Temp: +74.0 C
    Core0 Temp: +70.0 C
    Core1 Temp: +69.0 C
    Core1 Temp: +70.0 C

    With this patch I have

    $ sensors
    k8temp-pci-00c3
    Adapter: PCI adapter
    Core0 Temp: +54.0 C
    Core0 Temp: +51.0 C
    Core1 Temp: +48.0 C
    Core1 Temp: +49.0 C

    Cc: stable@kernel.org [.32.x .33.x, .34.x]
    Cc: Rudolf Marek
    Signed-off-by: Andreas Herrmann
    Signed-off-by: Jean Delvare

    Andreas Herrmann
     

20 Jun, 2010

1 commit

  • Commit a2e066bba2aad6583e3ff648bf28339d6c9f0898 introduced core
    swapping for CPU models 64 and later. I recently had a report about
    a Sempron 3200+, model 95, for which this patch broke temperature
    reading. It happens that this is a single-core processor, so the
    effect of the swapping was to read a temperature value for a core
    that didn't exist, leading to an incorrect value (-49 degrees C.)

    Disabling core swapping on singe-core processors should fix this.

    Additional comment from Andreas:

    The BKDG says

    Thermal Sensor Core Select (ThermSenseCoreSel)-Bit 2. This bit
    selects the CPU whose temperature is reported in the CurTemp
    field. This bit only applies to dual core processors. For
    single core processors CPU0 Thermal Sensor is always selected.

    k8temp_probe() correctly detected that SEL_CORE can't be used on single
    core CPU. Thus k8temp did never update the temperature values stored
    in temp[1][x] and -49 degrees was reported. For single core CPUs we
    must use the values read into temp[0][x].

    Signed-off-by: Jean Delvare
    Tested-by: Rick Moritz
    Acked-by: Andreas Herrmann
    Cc: stable@kernel.org

    Jean Delvare
     

11 Jan, 2010

1 commit

  • The id_table field of the struct pci_driver is constant in
    so it is worth to make pci_device_id also constant.

    The semantic match that finds this kind of pattern is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r@
    identifier I1, I2, x;
    @@
    struct I1 {
    ...
    const struct I2 *x;
    ...
    };
    @s@
    identifier r.I1, y;
    identifier r.x, E;
    @@
    struct I1 y = {
    .x = E,
    };
    @c@
    identifier r.I2;
    identifier s.E;
    @@
    const struct I2 E[] = ... ;
    @depends on !c@
    identifier r.I2;
    identifier s.E;
    @@
    + const
    struct I2 E[] = ...;
    //

    Signed-off-by: Márton Németh
    Cc: Julia Lawall
    Signed-off-by: Jean Delvare

    Márton Németh
     

16 Jan, 2009

3 commits

  • Current Temperature for K8 RevG desktop CPUs is a "normalized value"
    which can be below ambient temperature.

    As a consequence lots of RevG systems report temperatures like:

    $ sensors
    k8temp-pci-00c3
    Adapter: PCI adapter
    Core0 Temp: +17 C
    Core0 Temp: +3 C
    Core1 Temp: +21 C
    Core1 Temp: +5 C

    being quite below ambient temperature.
    There are even reports of negative temperature values.

    This patch corrects the temperature reporting of k8temp for
    RevG desktop CPUs.

    Cc: Rudolf Marek
    Signed-off-by: Andreas Herrmann
    Signed-off-by: Jean Delvare

    Andreas Herrmann
     
  • Meaning of ThermSenseCoreSel bit was inverted beginning with K8 RevF.
    That means with current driver temp1/temp2 belong to core 1 and
    temp3/temp4 belong to core 0 on a K8 RevF/RevG CPU.

    This patch ensures that temp1/temp2 always belong to core 0 and
    temp3/temp4 to core 1 for all K8 revisions.

    Cc: Rudolf Marek
    Signed-off-by: Andreas Herrmann
    Signed-off-by: Jean Delvare

    Andreas Herrmann
     
  • Add warning about wrong CPU temperature readouts on all fam F rev F.

    The allowed combinations of processors ensure that all processors
    in a multisocket system have similar characteristics, e.g.

    (1) provide temperature sensor interface (>=RevC && =RevF)

    Thus it is sufficient to check the revision of the boot CPU.

    For "mixed silicon support" refer to
    "Revision Guide for AMD Athlon 64 and AMD Opteron Processors" (RevA-E) and
    "Revision Guide for AMD NPT Family 0Fh Processors" (RefF-G).

    Cc: Rudolf Marek
    Signed-off-by: Andreas Herrmann
    Signed-off-by: Jean Delvare

    Andreas Herrmann
     

10 Oct, 2007

1 commit


13 Dec, 2006

1 commit


29 Sep, 2006

2 commits