24 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this driver is free software you can redistribute it and or modify
    it under the terms of the gnu general public license either version
    2 of the license or at your option any later version this driver 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 driver if not see http www gnu org
    licenses

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 2 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/20190520071858.296418152@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

03 Jan, 2017

1 commit

  • Use DEVICE_ATTR_RO for read only attributes and DEVICE_ATTR_RW for
    read/write 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
     

08 Jun, 2016

1 commit

  • We need to read a bunch of registers on each compute unit and possibly
    on the current CPU too. Disable preemption around it. Otherwise, you
    get:

    BUG: using smp_processor_id() in preemptible [00000000] code: systemd-udevd/327
    caller is read_registers+0x6a/0x110 [fam15h_power]
    CPU: 3 PID: 327 Comm: systemd-udevd Not tainted 4.7.0-rc1+ #4
    Hardware name: HP HP EliteBook 745 G3/807E, BIOS N73 Ver. 01.08 01/28/2016
    ...

    Suggested-by: Thomas Gleixner
    Signed-off-by: Borislav Petkov
    Cc: Rui Huang
    Cc: Sherry Hurwitz
    Cc: Guenter Roeck
    Acked-by: Huang Rui
    Tested-by: Huang Rui
    Fixes: fa7943449943 ("hwmon: (fam15h_power) Add compute unit accumulated power")
    Signed-off-by: Guenter Roeck

    Borislav Petkov
     

19 Apr, 2016

5 commits

  • This patch adds a platform check function to make code more readable.

    Signed-off-by: Huang Rui
    Signed-off-by: Guenter Roeck

    Huang Rui
     
  • This patch adds the description to explain the TDP reporting mechanism
    and accumulated power algorithm.

    Signed-off-by: Huang Rui
    Cc: Borislav Petkov
    Signed-off-by: Guenter Roeck

    Huang Rui
     
  • This patch introduces an algorithm that computes the average power by
    reading a delta value of “core power accumulator” register during
    measurement interval, and then dividing delta value by the length of
    the time interval.

    User is able to use power1_average entry to measure the processor power
    consumption and power1_average_interval entry to set the interval.

    A simple example:

    ray@hr-ub:~/tip$ sensors
    fam15h_power-pci-00c4
    Adapter: PCI adapter
    power1: 19.58 mW (avg = 2.55 mW, interval = 0.01 s)
    (crit = 15.00 W)

    ...

    The result is current average processor power consumption in 10
    millisecond. The unit of the result is uWatt.

    Suggested-by: Guenter Roeck
    Signed-off-by: Huang Rui
    Cc: Borislav Petkov
    Signed-off-by: Guenter Roeck

    Huang Rui
     
  • PTSC is the performance timestamp counter value in a cpu core and the
    cores in one compute unit have the fixed frequency. So it picks up the
    performance timestamp counter value of the first core per compute unit
    to measure the interval for average power per compute unit.

    Signed-off-by: Huang Rui
    Cc: Borislav Petkov
    Signed-off-by: Guenter Roeck

    Huang Rui
     
  • This patch adds a member in fam15h_power_data which specifies the
    compute unit accumulated power. It adds do_read_registers_on_cu to do
    all the read to all MSRs and run it on one of the online cores on each
    compute unit with smp_call_function_many(). This behavior can decrease
    IPI numbers.

    Suggested-by: Borislav Petkov
    Signed-off-by: Huang Rui
    Signed-off-by: Guenter Roeck

    Huang Rui
     

28 Jan, 2016

1 commit


19 Dec, 2015

1 commit


01 Nov, 2015

3 commits


27 Aug, 2015

4 commits


12 Nov, 2014

1 commit


17 Sep, 2014

2 commits


04 Aug, 2014

2 commits


15 Jan, 2014

1 commit


08 Apr, 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

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
     

30 Oct, 2012

1 commit


24 Sep, 2012

2 commits

  • Convert to use devm_ functions to reduce code size and simplify the code.

    Cc: Andreas Herrmann
    Signed-off-by: Guenter Roeck

    Guenter Roeck
     
  • The quirk introduced with commit
    00250ec90963b7ef6678438888f3244985ecde14 (hwmon: fam15h_power: fix
    bogus values with current BIOSes) is not only required during driver
    load but also when system resumes from suspend. The BIOS might set the
    previously recommended (but unsuitable) initilization value for the
    running average range register during resume.

    Signed-off-by: Andreas Herrmann
    Tested-by: Andreas Hartmann
    Signed-off-by: Jean Delvare
    Cc: stable@vger.kernel.org # 3.0+

    Andreas Herrmann
     

22 Jul, 2012

1 commit

  • Expression with two unsigned integer variables is calculated as unsigned integer
    before it is converted to u64. This may result in an integer overflow.
    Fix by typecasting the left operand to u64 before performing the left shift.

    This patch addresses Coverity #402320: Unintentional integer overflow.

    Signed-off-by: Guenter Roeck
    Acked-by: Jean Delvare
    Acked-by: Andreas Herrmann

    Guenter Roeck
     

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
     

26 Apr, 2012

1 commit

  • pci_match_id() takes an *array* of IDs which must be properly zero-
    terminated.

    Reported-by: Ben Hutchings
    Cc: stable@vger.kernel.org # 3.0+: 00250ec hwmon: fam15h_power: fix bogus values
    Cc: stable@vger.kernel.org # 3.0+
    Signed-off-by: Guenter Roeck
    Acked-by: Jean Delvare

    Guenter Roeck
     

19 Apr, 2012

1 commit

  • Newer BKDG[1] versions recommend a different initialization value for
    the running average range register in the northbridge. This improves
    the power reading by avoiding counter saturations resulting in bogus
    values for anything below about 80% of TDP power consumption.
    Updated BIOSes will have this new value set up from the beginning,
    but meanwhile we correct this value ourselves.
    This needs to be done on all northbridges, even on those where the
    driver itself does not register at.

    This fixes the driver on all current machines to provide proper
    values for idle load.

    [1]
    http://support.amd.com/us/Processor_TechDocs/42301_15h_Mod_00h-0Fh_BKDG.pdf
    Chapter 3.8: D18F5xE0 Processor TDP Running Average (p. 452)

    Signed-off-by: Andre Przywara
    Acked-by: Jean Delvare
    [guenter.roeck@ericsson.com: Removed unnecessary return statement]
    Signed-off-by: Guenter Roeck
    Cc: stable@vger.kernel.org # 3.0+

    Andre Przywara
     

23 Mar, 2012

2 commits


26 May, 2011

1 commit

  • This CPU family provides NB register values to gather following
    TDP information

    * ProcessorPwrWatts: Specifies in Watts the maximum amount of power
    the processor can support.
    * CurrPwrWatts: Specifies in Watts the current amount of power being
    consumed by the processor.

    This driver provides

    * power1_crit (ProcessorPwrWatts)
    * power1_input (CurrPwrWatts)

    Signed-off-by: Andreas Herrmann
    Signed-off-by: Jean Delvare

    Andreas Herrmann