lkml.org 
[lkml]   [2013]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH v4 1/1] Introduce Intel RAPL cooling device driver
    From
    Date
    On Tue, 2013-04-09 at 16:46 -0700, Jacob Pan wrote:
    > RAPL(Running Average Power Limit) interface provides platform software
    > with the ability to monitor, control, and get notifications on SOC
    > power consumptions.

    yet more trivia and style quibbles.

    > diff --git a/drivers/platform/x86/intel_rapl.c b/drivers/platform/x86/intel_rapl.c
    []
    > +static int rapl_get_max_state(struct thermal_cooling_device *cdev,
    > + unsigned long *state)
    > +{
    > + int ret;
    > + u64 val;
    > +
    > + struct rapl_domain *rd = (struct rapl_domain *)cdev->devdata;

    Don't need to cast void *

    struct rapl_domain *rd = cdev->devdata;

    is just fine.

    > +static int rapl_get_cur_state(struct thermal_cooling_device *cdev, unsigned long
    > + *state)
    > +{
    > + struct rapl_domain *rd = (struct rapl_domain *)cdev->devdata;

    etc

    > +static void set_pkg_thermal_irq(bool enable)
    > +{
    []
    > + if (boot_cpu_has(X86_FEATURE_PTS))
    > + rdmsr(MSR_IA32_PACKAGE_THERM_INTERRUPT, l, h);
    > + else
    > + return;

    if (!boot_cpu_has(X86_FEATURE_PTS))
    return;

    rdmsc(etc...)

    > +
    > + if (enable == false)

    Don't test for == false

    > + l &= ~PACKAGE_THERM_INT_PLN_ENABLE;
    > + else
    > + l |= PACKAGE_THERM_INT_PLN_ENABLE;
    > +
    > + if (boot_cpu_has(X86_FEATURE_PLN))
    > + wrmsr(MSR_IA32_PACKAGE_THERM_INTERRUPT, l, h);

    if (boot_cpu_has(X86_FEATURE_PTS)) {
    if (enable)
    l |= PACKAGE_THERM_INT_PLN_ENABLE;
    else
    l &= ~PACKAGE_THERM_INT_PLN_ENABLE;
    wrmsr(MSR_IA32_PACKAGE_THERM_INTERRUPT, l, h);
    }




    \
     
     \ /
      Last update: 2013-04-10 02:21    [W:3.130 / U:0.096 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site