linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: edubezval@gmail.com (Eduardo Valentin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v1 6/6] ACPI: thermal: processor: Use the generic cpufreq infrastructure
Date: Mon, 2 Jun 2014 13:36:02 -0400	[thread overview]
Message-ID: <20140602173602.GB5902@developer> (raw)
In-Reply-To: <20140602102047.GB2795@e104805>

Hello Amit, Javi,

On Mon, Jun 02, 2014 at 11:20:48AM +0100, Javi Merino wrote:
> On Mon, Jun 02, 2014 at 10:21:48AM +0100, Amit Kachhap wrote:
> > Hi Javi,
> > 
> > On 5/29/14, Javi Merino <javi.merino@arm.com> wrote:
> > > Hi Amit,
> > >
> > > On Thu, May 29, 2014 at 09:15:34AM +0100, Amit Daniel Kachhap wrote:
> > >> This patch upgrades the ACPI cpufreq cooling portions to use the generic
> > >> cpufreq cooling infrastructure. There should not be any functionality
> > >> related changes as the same behaviour is provided by the generic
> > >> cpufreq APIs with the notifier mechanism.
> > >>
> > >> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
> > >> ---
> > >>  drivers/acpi/processor_driver.c  |    6 +-
> > >>  drivers/acpi/processor_thermal.c |  235
> > >> ++++++++++++++++++--------------------
> > >>  include/acpi/processor.h         |    3 +-
> > >>  3 files changed, 115 insertions(+), 129 deletions(-)
> > >>
> > >> diff --git a/drivers/acpi/processor_driver.c
> > >> b/drivers/acpi/processor_driver.c
> > >> index 7f70f31..10aba4a 100644
> > >> --- a/drivers/acpi/processor_driver.c
> > >> +++ b/drivers/acpi/processor_driver.c
> > >> @@ -36,6 +36,7 @@
> > >>  #include <linux/cpuidle.h>
> > >>  #include <linux/slab.h>
> > >>  #include <linux/acpi.h>
> > >> +#include <linux/cpu_cooling.h>
> > >>
> > >>  #include <acpi/processor.h>
> > >>
> > >> @@ -178,8 +179,7 @@ static int __acpi_processor_start(struct acpi_device
> > >> *device)
> > >>         if (!cpuidle_get_driver() || cpuidle_get_driver() ==
> > >> &acpi_idle_driver)
> > >>                 acpi_processor_power_init(pr);
> > >>
> > >> -       pr->cdev = thermal_cooling_device_register("Processor", device,
> > >> -
> > >> &processor_cooling_ops);
> > >> +       pr->cdev = acpi_processor_cooling_register(device);
> > >
> > > With this you have removed the only cooling device whose type was
> > > "Processor".  There's special code for dealing with this cooling
> > > device in drivers/thermal/thermal_core.c:passive_store():
> > >
> > > 		list_for_each_entry(cdev, &thermal_cdev_list, node) {
> > > 			if (!strncmp("Processor", cdev->type,
> > > 				     sizeof("Processor")))
> > > 				thermal_zone_bind_cooling_device(tz,
> > > 						THERMAL_TRIPS_NONE, cdev,
> > > 						THERMAL_NO_LIMIT,
> > > 						THERMAL_NO_LIMIT);
> > > 		}
> > > 		mutex_unlock(&thermal_list_lock);
> > > 		if (!tz->passive_delay)
> > >
> > > With your change, that code is now "dead" as it can't do anything.  No
> > > I don't know what should you do with it, either remove it or make it
> > > match the cpufreq cooling device.  But this patch should deal with
> > > that code as well.
> > nice catch. I somehow missed modifying this section.
> > I think the following changes should fix this,
> > -                       if (!strncmp("Processor", cdev->type,
> > -                                    sizeof("Processor")))
> > +                       if (!strncmp("thermal-cpufreq", cdev->type,
> > +                                    sizeof("thermal-cpufreq")))
> >                                 thermal_zone_bind_cooling_device(tz,
> > 
> 
> That should do it.  I don't really understand why this code is
> specifically looking for ACPI processor cooling devices but I guess
> that's the least disrupting change you can make.

Well, I suggest we move slightly carefuly here. The problem is that this
change actually breaks ABI. If so, we need to follow the kernel ABI
change rules. We should never break userspace.

Rui, Do you recall what users are aware of this sysfs entry?

Cheers,

> 
> Cheers,
> Javi
> 

      reply	other threads:[~2014-06-02 17:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-29  8:15 [PATCH v1 0/6] ACPI: thermal: Migrate cpufreq cooling to generic cpu_cooling layer Amit Daniel Kachhap
2014-05-29  8:15 ` [PATCH v1 1/6] thermal: cpu_cooling: Fix the notification mechanism by using per cpu structure Amit Daniel Kachhap
2014-05-29  8:15 ` [PATCH v1 2/6] thermal: cpu_cooling: Support passing driver private data Amit Daniel Kachhap
2014-05-29 12:06   ` Javi Merino
2014-06-02  9:24     ` Amit Kachhap
2014-06-02 18:57       ` Eduardo Valentin
2014-05-29  8:15 ` [PATCH v1 3/6] thermal: thermal-core: Add notifications support for the cooling states Amit Daniel Kachhap
2014-05-29 12:24   ` Javi Merino
2014-06-02  9:31     ` Amit Kachhap
2014-06-02 10:14       ` Javi Merino
2014-05-29  8:15 ` [PATCH v1 4/6] thermal: cpu_cooling: Add support to find up/low frequency levels Amit Daniel Kachhap
2014-05-29  8:15 ` [PATCH v1 5/6] thermal: thermal_core: Remove the max cooling limit check in registration Amit Daniel Kachhap
2014-05-29  8:15 ` [PATCH v1 6/6] ACPI: thermal: processor: Use the generic cpufreq infrastructure Amit Daniel Kachhap
2014-05-29 12:42   ` Javi Merino
2014-06-02  9:21     ` Amit Kachhap
2014-06-02 10:20       ` Javi Merino
2014-06-02 17:36         ` Eduardo Valentin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140602173602.GB5902@developer \
    --to=edubezval@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).