Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-05 Thread Chen Gang
On 10/6/14 5:32, Rafael J. Wysocki wrote:
> On Saturday, October 04, 2014 10:19:50 PM Chen Gang wrote:
>> 'cpu_data' is too common to be already used by some architectures (e.g.
>> um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
>> compiling break. The related error (with allmodconfig under um):
>>
>> CC  drivers/base/platform.o
>>   In file included from ./arch/x86/um/asm/processor.h:31:0,
>>from ./arch/um/include/asm/uaccess.h:16,
>>from ./arch/um/include/asm/thread_info.h:13,
>>from include/linux/thread_info.h:54,
>>from include/asm-generic/current.h:4,
>>from arch/um/include/generated/asm/current.h:1,
>>from include/linux/mutex.h:13,
>>from include/linux/kernfs.h:13,
>>from include/linux/sysfs.h:15,
>>from include/linux/kobject.h:21,
>>from include/linux/device.h:17,
>>from include/linux/platform_device.h:14,
>>from drivers/base/platform.c:14:
>>   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
>> identifier or '(' before '&' token
>>#define cpu_data (_cpu_data)
>>  ^
>>   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
>> struct gpd_cpu_data *cpu_data;
>>^
>>
>> Also need notice about 80 columns boundary.
>>
>>
>> Signed-off-by: Chen Gang 
> 
> This problem has already been fixed by a patch from Ulf Hansson that's
> in my tree (along with the commit that introduced the problem in the first
> place).
> 

OK, thanks, that is good news to us all.

> And you forgot to say that the problem was only occuring in linux-next.
> 

OK, thanks, next, I shall mark 'next' in subject, e.g. [PATH next] ...


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-05 Thread Rafael J. Wysocki
On Saturday, October 04, 2014 10:19:50 PM Chen Gang wrote:
> 'cpu_data' is too common to be already used by some architectures (e.g.
> um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
> compiling break. The related error (with allmodconfig under um):
> 
> CC  drivers/base/platform.o
>   In file included from ./arch/x86/um/asm/processor.h:31:0,
>from ./arch/um/include/asm/uaccess.h:16,
>from ./arch/um/include/asm/thread_info.h:13,
>from include/linux/thread_info.h:54,
>from include/asm-generic/current.h:4,
>from arch/um/include/generated/asm/current.h:1,
>from include/linux/mutex.h:13,
>from include/linux/kernfs.h:13,
>from include/linux/sysfs.h:15,
>from include/linux/kobject.h:21,
>from include/linux/device.h:17,
>from include/linux/platform_device.h:14,
>from drivers/base/platform.c:14:
>   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
> identifier or '(' before '&' token
>#define cpu_data (_cpu_data)
>  ^
>   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
> struct gpd_cpu_data *cpu_data;
>^
> 
> Also need notice about 80 columns boundary.
> 
> 
> Signed-off-by: Chen Gang 

This problem has already been fixed by a patch from Ulf Hansson that's
in my tree (along with the commit that introduced the problem in the first
place).

And you forgot to say that the problem was only occuring in linux-next.

I'm sorry for everyone's loss of time related to this.

> ---
>  drivers/base/power/domain.c | 54 
> ++---
>  include/linux/pm_domain.h   |  2 +-
>  2 files changed, 28 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 18cc68d..d8d2739 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -142,13 +142,13 @@ static void genpd_recalc_cpu_exit_latency(struct 
> generic_pm_domain *genpd)
>  {
>   s64 usecs64;
>  
> - if (!genpd->cpu_data)
> + if (!genpd->pm_cpu_data)
>   return;
>  
>   usecs64 = genpd->power_on_latency_ns;
>   do_div(usecs64, NSEC_PER_USEC);
> - usecs64 += genpd->cpu_data->saved_exit_latency;
> - genpd->cpu_data->idle_state->exit_latency = usecs64;
> + usecs64 += genpd->pm_cpu_data->saved_exit_latency;
> + genpd->pm_cpu_data->idle_state->exit_latency = usecs64;
>  }
>  
>  /**
> @@ -188,9 +188,9 @@ static int __pm_genpd_poweron(struct generic_pm_domain 
> *genpd)
>   return 0;
>   }
>  
> - if (genpd->cpu_data) {
> + if (genpd->pm_cpu_data) {
>   cpuidle_pause_and_lock();
> - genpd->cpu_data->idle_state->disabled = true;
> + genpd->pm_cpu_data->idle_state->disabled = true;
>   cpuidle_resume_and_unlock();
>   goto out;
>   }
> @@ -513,17 +513,17 @@ static int pm_genpd_poweroff(struct generic_pm_domain 
> *genpd)
>   }
>   }
>  
> - if (genpd->cpu_data) {
> + if (genpd->pm_cpu_data) {
>   /*
> -  * If cpu_data is set, cpuidle should turn the domain off when
> -  * the CPU in it is idle.  In that case we don't decrement the
> -  * subdomain counts of the master domains, so that power is not
> -  * removed from the current domain prematurely as a result of
> -  * cutting off the masters' power.
> +  * If pm_cpu_data is set, cpuidle should turn the domain off
> +  * when the CPU in it is idle.  In that case we don't decrement
> +  * the subdomain counts of the master domains, so that power is
> +  * not removed from the current domain prematurely as a result
> +  * of cutting off the masters' power.
>*/
>   genpd->status = GPD_STATE_POWER_OFF;
>   cpuidle_pause_and_lock();
> - genpd->cpu_data->idle_state->disabled = false;
> + genpd->pm_cpu_data->idle_state->disabled = false;
>   cpuidle_resume_and_unlock();
>   goto out;
>   }
> @@ -1698,7 +1698,7 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain 
> *genpd,
>  int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state)
>  {
>   struct cpuidle_driver *cpuidle_drv;
> - struct gpd_cpu_data *cpu_data;
> + struct gpd_cpu_data *pm_cpu_data;
>   struct cpuidle_state *idle_state;
>   int ret = 0;
>  
> @@ -1707,12 +1707,12 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain 
> *genpd, int state)
>  
>   genpd_acquire_lock(genpd);
>  
> - if (genpd->cpu_data) {
> + if (genpd->pm_cpu_data) {
>   ret = -EEXIST;
>

Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-05 Thread Rafael J. Wysocki
On Saturday, October 04, 2014 10:19:50 PM Chen Gang wrote:
 'cpu_data' is too common to be already used by some architectures (e.g.
 um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
 compiling break. The related error (with allmodconfig under um):
 
 CC  drivers/base/platform.o
   In file included from ./arch/x86/um/asm/processor.h:31:0,
from ./arch/um/include/asm/uaccess.h:16,
from ./arch/um/include/asm/thread_info.h:13,
from include/linux/thread_info.h:54,
from include/asm-generic/current.h:4,
from arch/um/include/generated/asm/current.h:1,
from include/linux/mutex.h:13,
from include/linux/kernfs.h:13,
from include/linux/sysfs.h:15,
from include/linux/kobject.h:21,
from include/linux/device.h:17,
from include/linux/platform_device.h:14,
from drivers/base/platform.c:14:
   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
 identifier or '(' before '' token
#define cpu_data (boot_cpu_data)
  ^
   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
 struct gpd_cpu_data *cpu_data;
^
 
 Also need notice about 80 columns boundary.
 
 
 Signed-off-by: Chen Gang gang.chen.5...@gmail.com

This problem has already been fixed by a patch from Ulf Hansson that's
in my tree (along with the commit that introduced the problem in the first
place).

And you forgot to say that the problem was only occuring in linux-next.

I'm sorry for everyone's loss of time related to this.

 ---
  drivers/base/power/domain.c | 54 
 ++---
  include/linux/pm_domain.h   |  2 +-
  2 files changed, 28 insertions(+), 28 deletions(-)
 
 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
 index 18cc68d..d8d2739 100644
 --- a/drivers/base/power/domain.c
 +++ b/drivers/base/power/domain.c
 @@ -142,13 +142,13 @@ static void genpd_recalc_cpu_exit_latency(struct 
 generic_pm_domain *genpd)
  {
   s64 usecs64;
  
 - if (!genpd-cpu_data)
 + if (!genpd-pm_cpu_data)
   return;
  
   usecs64 = genpd-power_on_latency_ns;
   do_div(usecs64, NSEC_PER_USEC);
 - usecs64 += genpd-cpu_data-saved_exit_latency;
 - genpd-cpu_data-idle_state-exit_latency = usecs64;
 + usecs64 += genpd-pm_cpu_data-saved_exit_latency;
 + genpd-pm_cpu_data-idle_state-exit_latency = usecs64;
  }
  
  /**
 @@ -188,9 +188,9 @@ static int __pm_genpd_poweron(struct generic_pm_domain 
 *genpd)
   return 0;
   }
  
 - if (genpd-cpu_data) {
 + if (genpd-pm_cpu_data) {
   cpuidle_pause_and_lock();
 - genpd-cpu_data-idle_state-disabled = true;
 + genpd-pm_cpu_data-idle_state-disabled = true;
   cpuidle_resume_and_unlock();
   goto out;
   }
 @@ -513,17 +513,17 @@ static int pm_genpd_poweroff(struct generic_pm_domain 
 *genpd)
   }
   }
  
 - if (genpd-cpu_data) {
 + if (genpd-pm_cpu_data) {
   /*
 -  * If cpu_data is set, cpuidle should turn the domain off when
 -  * the CPU in it is idle.  In that case we don't decrement the
 -  * subdomain counts of the master domains, so that power is not
 -  * removed from the current domain prematurely as a result of
 -  * cutting off the masters' power.
 +  * If pm_cpu_data is set, cpuidle should turn the domain off
 +  * when the CPU in it is idle.  In that case we don't decrement
 +  * the subdomain counts of the master domains, so that power is
 +  * not removed from the current domain prematurely as a result
 +  * of cutting off the masters' power.
*/
   genpd-status = GPD_STATE_POWER_OFF;
   cpuidle_pause_and_lock();
 - genpd-cpu_data-idle_state-disabled = false;
 + genpd-pm_cpu_data-idle_state-disabled = false;
   cpuidle_resume_and_unlock();
   goto out;
   }
 @@ -1698,7 +1698,7 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain 
 *genpd,
  int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state)
  {
   struct cpuidle_driver *cpuidle_drv;
 - struct gpd_cpu_data *cpu_data;
 + struct gpd_cpu_data *pm_cpu_data;
   struct cpuidle_state *idle_state;
   int ret = 0;
  
 @@ -1707,12 +1707,12 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain 
 *genpd, int state)
  
   genpd_acquire_lock(genpd);
  
 - if (genpd-cpu_data) {
 + if (genpd-pm_cpu_data) {
   ret = -EEXIST;
   goto out;
   }
 - cpu_data = kzalloc(sizeof(*cpu_data), GFP_KERNEL);
 - if (!cpu_data) {
 + 

Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-05 Thread Chen Gang
On 10/6/14 5:32, Rafael J. Wysocki wrote:
 On Saturday, October 04, 2014 10:19:50 PM Chen Gang wrote:
 'cpu_data' is too common to be already used by some architectures (e.g.
 um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
 compiling break. The related error (with allmodconfig under um):

 CC  drivers/base/platform.o
   In file included from ./arch/x86/um/asm/processor.h:31:0,
from ./arch/um/include/asm/uaccess.h:16,
from ./arch/um/include/asm/thread_info.h:13,
from include/linux/thread_info.h:54,
from include/asm-generic/current.h:4,
from arch/um/include/generated/asm/current.h:1,
from include/linux/mutex.h:13,
from include/linux/kernfs.h:13,
from include/linux/sysfs.h:15,
from include/linux/kobject.h:21,
from include/linux/device.h:17,
from include/linux/platform_device.h:14,
from drivers/base/platform.c:14:
   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
 identifier or '(' before '' token
#define cpu_data (boot_cpu_data)
  ^
   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
 struct gpd_cpu_data *cpu_data;
^

 Also need notice about 80 columns boundary.


 Signed-off-by: Chen Gang gang.chen.5...@gmail.com
 
 This problem has already been fixed by a patch from Ulf Hansson that's
 in my tree (along with the commit that introduced the problem in the first
 place).
 

OK, thanks, that is good news to us all.

 And you forgot to say that the problem was only occuring in linux-next.
 

OK, thanks, next, I shall mark 'next' in subject, e.g. [PATH next] ...


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-04 Thread Chen Gang
On 10/5/14 10:42, Randy Dunlap wrote:
> On 10/04/14 09:00, Greg KH wrote:
>> On Sat, Oct 04, 2014 at 10:19:50PM +0800, Chen Gang wrote:
>>> 'cpu_data' is too common to be already used by some architectures (e.g.
>>> um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
>>> compiling break. The related error (with allmodconfig under um):
>>>
>>> CC  drivers/base/platform.o
>>>   In file included from ./arch/x86/um/asm/processor.h:31:0,
>>>from ./arch/um/include/asm/uaccess.h:16,
>>>from ./arch/um/include/asm/thread_info.h:13,
>>>from include/linux/thread_info.h:54,
>>>from include/asm-generic/current.h:4,
>>>from arch/um/include/generated/asm/current.h:1,
>>>from include/linux/mutex.h:13,
>>>from include/linux/kernfs.h:13,
>>>from include/linux/sysfs.h:15,
>>>from include/linux/kobject.h:21,
>>>from include/linux/device.h:17,
>>>from include/linux/platform_device.h:14,
>>>from drivers/base/platform.c:14:
>>>   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
>>> identifier or '(' before '&' token
>>>#define cpu_data (_cpu_data)
>>>  ^
>>>   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
>>> struct gpd_cpu_data *cpu_data;
>>>^
>>>
>>> Also need notice about 80 columns boundary.
>>
>> I don't object to this change at all, but it could be easier to solve
>> this by fixing up 'cpu_data' to be named something a bit less "generic"?
>> What does x86 use for this data type?
> 
> The patch makes sense to me.
> 
> These arch-es already have 'cpu_data' in some form:
> 
> mips, sparc, arm64, blackfin, frv, mn10300, parisc, um(l), c6x, x86, xtensa,
> alpha, m32r, arm, ia64, metag, sn.
> 

Yeah, and m32r, mn10300 and um may let cpu_data as macro variable, which
may cause this issue. And others let cpu_data as function (or like a
function), I guess, they may not cause this issue.


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-04 Thread Randy Dunlap
On 10/04/14 09:00, Greg KH wrote:
> On Sat, Oct 04, 2014 at 10:19:50PM +0800, Chen Gang wrote:
>> 'cpu_data' is too common to be already used by some architectures (e.g.
>> um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
>> compiling break. The related error (with allmodconfig under um):
>>
>> CC  drivers/base/platform.o
>>   In file included from ./arch/x86/um/asm/processor.h:31:0,
>>from ./arch/um/include/asm/uaccess.h:16,
>>from ./arch/um/include/asm/thread_info.h:13,
>>from include/linux/thread_info.h:54,
>>from include/asm-generic/current.h:4,
>>from arch/um/include/generated/asm/current.h:1,
>>from include/linux/mutex.h:13,
>>from include/linux/kernfs.h:13,
>>from include/linux/sysfs.h:15,
>>from include/linux/kobject.h:21,
>>from include/linux/device.h:17,
>>from include/linux/platform_device.h:14,
>>from drivers/base/platform.c:14:
>>   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
>> identifier or '(' before '&' token
>>#define cpu_data (_cpu_data)
>>  ^
>>   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
>> struct gpd_cpu_data *cpu_data;
>>^
>>
>> Also need notice about 80 columns boundary.
> 
> I don't object to this change at all, but it could be easier to solve
> this by fixing up 'cpu_data' to be named something a bit less "generic"?
> What does x86 use for this data type?

The patch makes sense to me.

These arch-es already have 'cpu_data' in some form:

mips, sparc, arm64, blackfin, frv, mn10300, parisc, um(l), c6x, x86, xtensa,
alpha, m32r, arm, ia64, metag, sn.


-- 
~Randy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-04 Thread Chen Gang
On 10/5/14 9:23, Greg KH wrote:
> On Sun, Oct 05, 2014 at 09:13:09AM +0800, Chen Gang wrote:
>> On 10/5/14 0:00, Greg KH wrote:
>>> On Sat, Oct 04, 2014 at 10:19:50PM +0800, Chen Gang wrote:
 'cpu_data' is too common to be already used by some architectures (e.g.
 um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
 compiling break. The related error (with allmodconfig under um):

 CC  drivers/base/platform.o
   In file included from ./arch/x86/um/asm/processor.h:31:0,
from ./arch/um/include/asm/uaccess.h:16,
from ./arch/um/include/asm/thread_info.h:13,
from include/linux/thread_info.h:54,
from include/asm-generic/current.h:4,
from arch/um/include/generated/asm/current.h:1,
from include/linux/mutex.h:13,
from include/linux/kernfs.h:13,
from include/linux/sysfs.h:15,
from include/linux/kobject.h:21,
from include/linux/device.h:17,
from include/linux/platform_device.h:14,
from drivers/base/platform.c:14:
   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
 identifier or '(' before '&' token
#define cpu_data (_cpu_data)
  ^
   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
 struct gpd_cpu_data *cpu_data;
^

 Also need notice about 80 columns boundary.
>>>
>>> I don't object to this change at all, but it could be easier to solve
>>> this by fixing up 'cpu_data' to be named something a bit less "generic"?
>>> What does x86 use for this data type?
>>>
>>
>> It is for some kinds of arm cpu (I let this patch pass arm s3c600
>> def_config building).  Other architectures did not use it, at present.
> 
> So why not change the name for these archs that have such a generic name
> to something not so generic?
> 

All the code are really generic, I don't know whether it will be used
under other architectures in the future (I guess, it will, or it need
not be put to "drivers/base/power/" and "include/linux").

At present, it is not used by other architectures, but it already has
negative effect with other architectures (I found it during compiling
um architecture).

So for me, this issue is not only within arm itself, but also in common
drivers.


Thanks
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-04 Thread Chen Gang
On 10/5/14 9:13, Chen Gang wrote:
> On 10/5/14 0:00, Greg KH wrote:
>> On Sat, Oct 04, 2014 at 10:19:50PM +0800, Chen Gang wrote:
>>> 'cpu_data' is too common to be already used by some architectures (e.g.
>>> um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
>>> compiling break. The related error (with allmodconfig under um):
>>>
>>> CC  drivers/base/platform.o
>>>   In file included from ./arch/x86/um/asm/processor.h:31:0,
>>>from ./arch/um/include/asm/uaccess.h:16,
>>>from ./arch/um/include/asm/thread_info.h:13,
>>>from include/linux/thread_info.h:54,
>>>from include/asm-generic/current.h:4,
>>>from arch/um/include/generated/asm/current.h:1,
>>>from include/linux/mutex.h:13,
>>>from include/linux/kernfs.h:13,
>>>from include/linux/sysfs.h:15,
>>>from include/linux/kobject.h:21,
>>>from include/linux/device.h:17,
>>>from include/linux/platform_device.h:14,
>>>from drivers/base/platform.c:14:
>>>   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
>>> identifier or '(' before '&' token
>>>#define cpu_data (_cpu_data)
>>>  ^
>>>   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
>>> struct gpd_cpu_data *cpu_data;
>>>^
>>>
>>> Also need notice about 80 columns boundary.
>>
>> I don't object to this change at all, but it could be easier to solve
>> this by fixing up 'cpu_data' to be named something a bit less "generic"?
>> What does x86 use for this data type?
>>
> 
> It is for some kinds of arm cpu (I let this patch pass arm s3c600

Oh, sorry, typo issue, it is s3c6400 def_config.

> def_config building).  Other architectures did not use it, at present.
> 
> If necessary to complete the comments, please let me know, I shall send
> patch v2 for it.
> 
> Thanks.
> 

-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-04 Thread Greg KH
On Sun, Oct 05, 2014 at 09:13:09AM +0800, Chen Gang wrote:
> On 10/5/14 0:00, Greg KH wrote:
> > On Sat, Oct 04, 2014 at 10:19:50PM +0800, Chen Gang wrote:
> >> 'cpu_data' is too common to be already used by some architectures (e.g.
> >> um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
> >> compiling break. The related error (with allmodconfig under um):
> >>
> >> CC  drivers/base/platform.o
> >>   In file included from ./arch/x86/um/asm/processor.h:31:0,
> >>from ./arch/um/include/asm/uaccess.h:16,
> >>from ./arch/um/include/asm/thread_info.h:13,
> >>from include/linux/thread_info.h:54,
> >>from include/asm-generic/current.h:4,
> >>from arch/um/include/generated/asm/current.h:1,
> >>from include/linux/mutex.h:13,
> >>from include/linux/kernfs.h:13,
> >>from include/linux/sysfs.h:15,
> >>from include/linux/kobject.h:21,
> >>from include/linux/device.h:17,
> >>from include/linux/platform_device.h:14,
> >>from drivers/base/platform.c:14:
> >>   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
> >> identifier or '(' before '&' token
> >>#define cpu_data (_cpu_data)
> >>  ^
> >>   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
> >> struct gpd_cpu_data *cpu_data;
> >>^
> >>
> >> Also need notice about 80 columns boundary.
> > 
> > I don't object to this change at all, but it could be easier to solve
> > this by fixing up 'cpu_data' to be named something a bit less "generic"?
> > What does x86 use for this data type?
> > 
> 
> It is for some kinds of arm cpu (I let this patch pass arm s3c600
> def_config building).  Other architectures did not use it, at present.

So why not change the name for these archs that have such a generic name
to something not so generic?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-04 Thread Chen Gang
On 10/5/14 0:00, Greg KH wrote:
> On Sat, Oct 04, 2014 at 10:19:50PM +0800, Chen Gang wrote:
>> 'cpu_data' is too common to be already used by some architectures (e.g.
>> um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
>> compiling break. The related error (with allmodconfig under um):
>>
>> CC  drivers/base/platform.o
>>   In file included from ./arch/x86/um/asm/processor.h:31:0,
>>from ./arch/um/include/asm/uaccess.h:16,
>>from ./arch/um/include/asm/thread_info.h:13,
>>from include/linux/thread_info.h:54,
>>from include/asm-generic/current.h:4,
>>from arch/um/include/generated/asm/current.h:1,
>>from include/linux/mutex.h:13,
>>from include/linux/kernfs.h:13,
>>from include/linux/sysfs.h:15,
>>from include/linux/kobject.h:21,
>>from include/linux/device.h:17,
>>from include/linux/platform_device.h:14,
>>from drivers/base/platform.c:14:
>>   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
>> identifier or '(' before '&' token
>>#define cpu_data (_cpu_data)
>>  ^
>>   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
>> struct gpd_cpu_data *cpu_data;
>>^
>>
>> Also need notice about 80 columns boundary.
> 
> I don't object to this change at all, but it could be easier to solve
> this by fixing up 'cpu_data' to be named something a bit less "generic"?
> What does x86 use for this data type?
> 

It is for some kinds of arm cpu (I let this patch pass arm s3c600
def_config building).  Other architectures did not use it, at present.

If necessary to complete the comments, please let me know, I shall send
patch v2 for it.

Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-04 Thread Greg KH
On Sat, Oct 04, 2014 at 10:19:50PM +0800, Chen Gang wrote:
> 'cpu_data' is too common to be already used by some architectures (e.g.
> um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
> compiling break. The related error (with allmodconfig under um):
> 
> CC  drivers/base/platform.o
>   In file included from ./arch/x86/um/asm/processor.h:31:0,
>from ./arch/um/include/asm/uaccess.h:16,
>from ./arch/um/include/asm/thread_info.h:13,
>from include/linux/thread_info.h:54,
>from include/asm-generic/current.h:4,
>from arch/um/include/generated/asm/current.h:1,
>from include/linux/mutex.h:13,
>from include/linux/kernfs.h:13,
>from include/linux/sysfs.h:15,
>from include/linux/kobject.h:21,
>from include/linux/device.h:17,
>from include/linux/platform_device.h:14,
>from drivers/base/platform.c:14:
>   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
> identifier or '(' before '&' token
>#define cpu_data (_cpu_data)
>  ^
>   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
> struct gpd_cpu_data *cpu_data;
>^
> 
> Also need notice about 80 columns boundary.

I don't object to this change at all, but it could be easier to solve
this by fixing up 'cpu_data' to be named something a bit less "generic"?
What does x86 use for this data type?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-04 Thread Chen Gang
'cpu_data' is too common to be already used by some architectures (e.g.
um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
compiling break. The related error (with allmodconfig under um):

CC  drivers/base/platform.o
  In file included from ./arch/x86/um/asm/processor.h:31:0,
   from ./arch/um/include/asm/uaccess.h:16,
   from ./arch/um/include/asm/thread_info.h:13,
   from include/linux/thread_info.h:54,
   from include/asm-generic/current.h:4,
   from arch/um/include/generated/asm/current.h:1,
   from include/linux/mutex.h:13,
   from include/linux/kernfs.h:13,
   from include/linux/sysfs.h:15,
   from include/linux/kobject.h:21,
   from include/linux/device.h:17,
   from include/linux/platform_device.h:14,
   from drivers/base/platform.c:14:
  ./arch/um/include/asm/processor-generic.h:107:19: error: expected identifier 
or '(' before '&' token
   #define cpu_data (_cpu_data)
 ^
  include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
struct gpd_cpu_data *cpu_data;
   ^

Also need notice about 80 columns boundary.


Signed-off-by: Chen Gang 
---
 drivers/base/power/domain.c | 54 ++---
 include/linux/pm_domain.h   |  2 +-
 2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 18cc68d..d8d2739 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -142,13 +142,13 @@ static void genpd_recalc_cpu_exit_latency(struct 
generic_pm_domain *genpd)
 {
s64 usecs64;
 
-   if (!genpd->cpu_data)
+   if (!genpd->pm_cpu_data)
return;
 
usecs64 = genpd->power_on_latency_ns;
do_div(usecs64, NSEC_PER_USEC);
-   usecs64 += genpd->cpu_data->saved_exit_latency;
-   genpd->cpu_data->idle_state->exit_latency = usecs64;
+   usecs64 += genpd->pm_cpu_data->saved_exit_latency;
+   genpd->pm_cpu_data->idle_state->exit_latency = usecs64;
 }
 
 /**
@@ -188,9 +188,9 @@ static int __pm_genpd_poweron(struct generic_pm_domain 
*genpd)
return 0;
}
 
-   if (genpd->cpu_data) {
+   if (genpd->pm_cpu_data) {
cpuidle_pause_and_lock();
-   genpd->cpu_data->idle_state->disabled = true;
+   genpd->pm_cpu_data->idle_state->disabled = true;
cpuidle_resume_and_unlock();
goto out;
}
@@ -513,17 +513,17 @@ static int pm_genpd_poweroff(struct generic_pm_domain 
*genpd)
}
}
 
-   if (genpd->cpu_data) {
+   if (genpd->pm_cpu_data) {
/*
-* If cpu_data is set, cpuidle should turn the domain off when
-* the CPU in it is idle.  In that case we don't decrement the
-* subdomain counts of the master domains, so that power is not
-* removed from the current domain prematurely as a result of
-* cutting off the masters' power.
+* If pm_cpu_data is set, cpuidle should turn the domain off
+* when the CPU in it is idle.  In that case we don't decrement
+* the subdomain counts of the master domains, so that power is
+* not removed from the current domain prematurely as a result
+* of cutting off the masters' power.
 */
genpd->status = GPD_STATE_POWER_OFF;
cpuidle_pause_and_lock();
-   genpd->cpu_data->idle_state->disabled = false;
+   genpd->pm_cpu_data->idle_state->disabled = false;
cpuidle_resume_and_unlock();
goto out;
}
@@ -1698,7 +1698,7 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain 
*genpd,
 int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state)
 {
struct cpuidle_driver *cpuidle_drv;
-   struct gpd_cpu_data *cpu_data;
+   struct gpd_cpu_data *pm_cpu_data;
struct cpuidle_state *idle_state;
int ret = 0;
 
@@ -1707,12 +1707,12 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain 
*genpd, int state)
 
genpd_acquire_lock(genpd);
 
-   if (genpd->cpu_data) {
+   if (genpd->pm_cpu_data) {
ret = -EEXIST;
goto out;
}
-   cpu_data = kzalloc(sizeof(*cpu_data), GFP_KERNEL);
-   if (!cpu_data) {
+   pm_cpu_data = kzalloc(sizeof(*pm_cpu_data), GFP_KERNEL);
+   if (!pm_cpu_data) {
ret = -ENOMEM;
goto out;
}
@@ -1730,9 +1730,9 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain 
*genpd, int state)
ret = -EAGAIN;
goto err;
}
-   cpu_data->idle_state = 

Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-04 Thread Chen Gang
After this patch, our um can pass allmodconfig compiling.

Thanks.

On 10/4/14 22:19, Chen Gang wrote:
> 'cpu_data' is too common to be already used by some architectures (e.g.
> um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
> compiling break. The related error (with allmodconfig under um):
> 
> CC  drivers/base/platform.o
>   In file included from ./arch/x86/um/asm/processor.h:31:0,
>from ./arch/um/include/asm/uaccess.h:16,
>from ./arch/um/include/asm/thread_info.h:13,
>from include/linux/thread_info.h:54,
>from include/asm-generic/current.h:4,
>from arch/um/include/generated/asm/current.h:1,
>from include/linux/mutex.h:13,
>from include/linux/kernfs.h:13,
>from include/linux/sysfs.h:15,
>from include/linux/kobject.h:21,
>from include/linux/device.h:17,
>from include/linux/platform_device.h:14,
>from drivers/base/platform.c:14:
>   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
> identifier or '(' before '&' token
>#define cpu_data (_cpu_data)
>  ^
>   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
> struct gpd_cpu_data *cpu_data;
>^
> 
> Also need notice about 80 columns boundary.
> 
> 
> Signed-off-by: Chen Gang 
> ---
>  drivers/base/power/domain.c | 54 
> ++---
>  include/linux/pm_domain.h   |  2 +-
>  2 files changed, 28 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 18cc68d..d8d2739 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -142,13 +142,13 @@ static void genpd_recalc_cpu_exit_latency(struct 
> generic_pm_domain *genpd)
>  {
>   s64 usecs64;
>  
> - if (!genpd->cpu_data)
> + if (!genpd->pm_cpu_data)
>   return;
>  
>   usecs64 = genpd->power_on_latency_ns;
>   do_div(usecs64, NSEC_PER_USEC);
> - usecs64 += genpd->cpu_data->saved_exit_latency;
> - genpd->cpu_data->idle_state->exit_latency = usecs64;
> + usecs64 += genpd->pm_cpu_data->saved_exit_latency;
> + genpd->pm_cpu_data->idle_state->exit_latency = usecs64;
>  }
>  
>  /**
> @@ -188,9 +188,9 @@ static int __pm_genpd_poweron(struct generic_pm_domain 
> *genpd)
>   return 0;
>   }
>  
> - if (genpd->cpu_data) {
> + if (genpd->pm_cpu_data) {
>   cpuidle_pause_and_lock();
> - genpd->cpu_data->idle_state->disabled = true;
> + genpd->pm_cpu_data->idle_state->disabled = true;
>   cpuidle_resume_and_unlock();
>   goto out;
>   }
> @@ -513,17 +513,17 @@ static int pm_genpd_poweroff(struct generic_pm_domain 
> *genpd)
>   }
>   }
>  
> - if (genpd->cpu_data) {
> + if (genpd->pm_cpu_data) {
>   /*
> -  * If cpu_data is set, cpuidle should turn the domain off when
> -  * the CPU in it is idle.  In that case we don't decrement the
> -  * subdomain counts of the master domains, so that power is not
> -  * removed from the current domain prematurely as a result of
> -  * cutting off the masters' power.
> +  * If pm_cpu_data is set, cpuidle should turn the domain off
> +  * when the CPU in it is idle.  In that case we don't decrement
> +  * the subdomain counts of the master domains, so that power is
> +  * not removed from the current domain prematurely as a result
> +  * of cutting off the masters' power.
>*/
>   genpd->status = GPD_STATE_POWER_OFF;
>   cpuidle_pause_and_lock();
> - genpd->cpu_data->idle_state->disabled = false;
> + genpd->pm_cpu_data->idle_state->disabled = false;
>   cpuidle_resume_and_unlock();
>   goto out;
>   }
> @@ -1698,7 +1698,7 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain 
> *genpd,
>  int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state)
>  {
>   struct cpuidle_driver *cpuidle_drv;
> - struct gpd_cpu_data *cpu_data;
> + struct gpd_cpu_data *pm_cpu_data;
>   struct cpuidle_state *idle_state;
>   int ret = 0;
>  
> @@ -1707,12 +1707,12 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain 
> *genpd, int state)
>  
>   genpd_acquire_lock(genpd);
>  
> - if (genpd->cpu_data) {
> + if (genpd->pm_cpu_data) {
>   ret = -EEXIST;
>   goto out;
>   }
> - cpu_data = kzalloc(sizeof(*cpu_data), GFP_KERNEL);
> - if (!cpu_data) {
> + pm_cpu_data = kzalloc(sizeof(*pm_cpu_data), GFP_KERNEL);
> + if (!pm_cpu_data) {
>   ret = -ENOMEM;
> 

[PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-04 Thread Chen Gang
'cpu_data' is too common to be already used by some architectures (e.g.
um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
compiling break. The related error (with allmodconfig under um):

CC  drivers/base/platform.o
  In file included from ./arch/x86/um/asm/processor.h:31:0,
   from ./arch/um/include/asm/uaccess.h:16,
   from ./arch/um/include/asm/thread_info.h:13,
   from include/linux/thread_info.h:54,
   from include/asm-generic/current.h:4,
   from arch/um/include/generated/asm/current.h:1,
   from include/linux/mutex.h:13,
   from include/linux/kernfs.h:13,
   from include/linux/sysfs.h:15,
   from include/linux/kobject.h:21,
   from include/linux/device.h:17,
   from include/linux/platform_device.h:14,
   from drivers/base/platform.c:14:
  ./arch/um/include/asm/processor-generic.h:107:19: error: expected identifier 
or '(' before '' token
   #define cpu_data (boot_cpu_data)
 ^
  include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
struct gpd_cpu_data *cpu_data;
   ^

Also need notice about 80 columns boundary.


Signed-off-by: Chen Gang gang.chen.5...@gmail.com
---
 drivers/base/power/domain.c | 54 ++---
 include/linux/pm_domain.h   |  2 +-
 2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 18cc68d..d8d2739 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -142,13 +142,13 @@ static void genpd_recalc_cpu_exit_latency(struct 
generic_pm_domain *genpd)
 {
s64 usecs64;
 
-   if (!genpd-cpu_data)
+   if (!genpd-pm_cpu_data)
return;
 
usecs64 = genpd-power_on_latency_ns;
do_div(usecs64, NSEC_PER_USEC);
-   usecs64 += genpd-cpu_data-saved_exit_latency;
-   genpd-cpu_data-idle_state-exit_latency = usecs64;
+   usecs64 += genpd-pm_cpu_data-saved_exit_latency;
+   genpd-pm_cpu_data-idle_state-exit_latency = usecs64;
 }
 
 /**
@@ -188,9 +188,9 @@ static int __pm_genpd_poweron(struct generic_pm_domain 
*genpd)
return 0;
}
 
-   if (genpd-cpu_data) {
+   if (genpd-pm_cpu_data) {
cpuidle_pause_and_lock();
-   genpd-cpu_data-idle_state-disabled = true;
+   genpd-pm_cpu_data-idle_state-disabled = true;
cpuidle_resume_and_unlock();
goto out;
}
@@ -513,17 +513,17 @@ static int pm_genpd_poweroff(struct generic_pm_domain 
*genpd)
}
}
 
-   if (genpd-cpu_data) {
+   if (genpd-pm_cpu_data) {
/*
-* If cpu_data is set, cpuidle should turn the domain off when
-* the CPU in it is idle.  In that case we don't decrement the
-* subdomain counts of the master domains, so that power is not
-* removed from the current domain prematurely as a result of
-* cutting off the masters' power.
+* If pm_cpu_data is set, cpuidle should turn the domain off
+* when the CPU in it is idle.  In that case we don't decrement
+* the subdomain counts of the master domains, so that power is
+* not removed from the current domain prematurely as a result
+* of cutting off the masters' power.
 */
genpd-status = GPD_STATE_POWER_OFF;
cpuidle_pause_and_lock();
-   genpd-cpu_data-idle_state-disabled = false;
+   genpd-pm_cpu_data-idle_state-disabled = false;
cpuidle_resume_and_unlock();
goto out;
}
@@ -1698,7 +1698,7 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain 
*genpd,
 int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state)
 {
struct cpuidle_driver *cpuidle_drv;
-   struct gpd_cpu_data *cpu_data;
+   struct gpd_cpu_data *pm_cpu_data;
struct cpuidle_state *idle_state;
int ret = 0;
 
@@ -1707,12 +1707,12 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain 
*genpd, int state)
 
genpd_acquire_lock(genpd);
 
-   if (genpd-cpu_data) {
+   if (genpd-pm_cpu_data) {
ret = -EEXIST;
goto out;
}
-   cpu_data = kzalloc(sizeof(*cpu_data), GFP_KERNEL);
-   if (!cpu_data) {
+   pm_cpu_data = kzalloc(sizeof(*pm_cpu_data), GFP_KERNEL);
+   if (!pm_cpu_data) {
ret = -ENOMEM;
goto out;
}
@@ -1730,9 +1730,9 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain 
*genpd, int state)
ret = -EAGAIN;
goto err;
}
-   cpu_data-idle_state = idle_state;
-

Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-04 Thread Chen Gang
After this patch, our um can pass allmodconfig compiling.

Thanks.

On 10/4/14 22:19, Chen Gang wrote:
 'cpu_data' is too common to be already used by some architectures (e.g.
 um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
 compiling break. The related error (with allmodconfig under um):
 
 CC  drivers/base/platform.o
   In file included from ./arch/x86/um/asm/processor.h:31:0,
from ./arch/um/include/asm/uaccess.h:16,
from ./arch/um/include/asm/thread_info.h:13,
from include/linux/thread_info.h:54,
from include/asm-generic/current.h:4,
from arch/um/include/generated/asm/current.h:1,
from include/linux/mutex.h:13,
from include/linux/kernfs.h:13,
from include/linux/sysfs.h:15,
from include/linux/kobject.h:21,
from include/linux/device.h:17,
from include/linux/platform_device.h:14,
from drivers/base/platform.c:14:
   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
 identifier or '(' before '' token
#define cpu_data (boot_cpu_data)
  ^
   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
 struct gpd_cpu_data *cpu_data;
^
 
 Also need notice about 80 columns boundary.
 
 
 Signed-off-by: Chen Gang gang.chen.5...@gmail.com
 ---
  drivers/base/power/domain.c | 54 
 ++---
  include/linux/pm_domain.h   |  2 +-
  2 files changed, 28 insertions(+), 28 deletions(-)
 
 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
 index 18cc68d..d8d2739 100644
 --- a/drivers/base/power/domain.c
 +++ b/drivers/base/power/domain.c
 @@ -142,13 +142,13 @@ static void genpd_recalc_cpu_exit_latency(struct 
 generic_pm_domain *genpd)
  {
   s64 usecs64;
  
 - if (!genpd-cpu_data)
 + if (!genpd-pm_cpu_data)
   return;
  
   usecs64 = genpd-power_on_latency_ns;
   do_div(usecs64, NSEC_PER_USEC);
 - usecs64 += genpd-cpu_data-saved_exit_latency;
 - genpd-cpu_data-idle_state-exit_latency = usecs64;
 + usecs64 += genpd-pm_cpu_data-saved_exit_latency;
 + genpd-pm_cpu_data-idle_state-exit_latency = usecs64;
  }
  
  /**
 @@ -188,9 +188,9 @@ static int __pm_genpd_poweron(struct generic_pm_domain 
 *genpd)
   return 0;
   }
  
 - if (genpd-cpu_data) {
 + if (genpd-pm_cpu_data) {
   cpuidle_pause_and_lock();
 - genpd-cpu_data-idle_state-disabled = true;
 + genpd-pm_cpu_data-idle_state-disabled = true;
   cpuidle_resume_and_unlock();
   goto out;
   }
 @@ -513,17 +513,17 @@ static int pm_genpd_poweroff(struct generic_pm_domain 
 *genpd)
   }
   }
  
 - if (genpd-cpu_data) {
 + if (genpd-pm_cpu_data) {
   /*
 -  * If cpu_data is set, cpuidle should turn the domain off when
 -  * the CPU in it is idle.  In that case we don't decrement the
 -  * subdomain counts of the master domains, so that power is not
 -  * removed from the current domain prematurely as a result of
 -  * cutting off the masters' power.
 +  * If pm_cpu_data is set, cpuidle should turn the domain off
 +  * when the CPU in it is idle.  In that case we don't decrement
 +  * the subdomain counts of the master domains, so that power is
 +  * not removed from the current domain prematurely as a result
 +  * of cutting off the masters' power.
*/
   genpd-status = GPD_STATE_POWER_OFF;
   cpuidle_pause_and_lock();
 - genpd-cpu_data-idle_state-disabled = false;
 + genpd-pm_cpu_data-idle_state-disabled = false;
   cpuidle_resume_and_unlock();
   goto out;
   }
 @@ -1698,7 +1698,7 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain 
 *genpd,
  int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state)
  {
   struct cpuidle_driver *cpuidle_drv;
 - struct gpd_cpu_data *cpu_data;
 + struct gpd_cpu_data *pm_cpu_data;
   struct cpuidle_state *idle_state;
   int ret = 0;
  
 @@ -1707,12 +1707,12 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain 
 *genpd, int state)
  
   genpd_acquire_lock(genpd);
  
 - if (genpd-cpu_data) {
 + if (genpd-pm_cpu_data) {
   ret = -EEXIST;
   goto out;
   }
 - cpu_data = kzalloc(sizeof(*cpu_data), GFP_KERNEL);
 - if (!cpu_data) {
 + pm_cpu_data = kzalloc(sizeof(*pm_cpu_data), GFP_KERNEL);
 + if (!pm_cpu_data) {
   ret = -ENOMEM;
   goto out;
   }
 @@ -1730,9 +1730,9 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain 
 *genpd, int state)
  

Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-04 Thread Greg KH
On Sat, Oct 04, 2014 at 10:19:50PM +0800, Chen Gang wrote:
 'cpu_data' is too common to be already used by some architectures (e.g.
 um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
 compiling break. The related error (with allmodconfig under um):
 
 CC  drivers/base/platform.o
   In file included from ./arch/x86/um/asm/processor.h:31:0,
from ./arch/um/include/asm/uaccess.h:16,
from ./arch/um/include/asm/thread_info.h:13,
from include/linux/thread_info.h:54,
from include/asm-generic/current.h:4,
from arch/um/include/generated/asm/current.h:1,
from include/linux/mutex.h:13,
from include/linux/kernfs.h:13,
from include/linux/sysfs.h:15,
from include/linux/kobject.h:21,
from include/linux/device.h:17,
from include/linux/platform_device.h:14,
from drivers/base/platform.c:14:
   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
 identifier or '(' before '' token
#define cpu_data (boot_cpu_data)
  ^
   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
 struct gpd_cpu_data *cpu_data;
^
 
 Also need notice about 80 columns boundary.

I don't object to this change at all, but it could be easier to solve
this by fixing up 'cpu_data' to be named something a bit less generic?
What does x86 use for this data type?

thanks,

greg k-h
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-04 Thread Chen Gang
On 10/5/14 0:00, Greg KH wrote:
 On Sat, Oct 04, 2014 at 10:19:50PM +0800, Chen Gang wrote:
 'cpu_data' is too common to be already used by some architectures (e.g.
 um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
 compiling break. The related error (with allmodconfig under um):

 CC  drivers/base/platform.o
   In file included from ./arch/x86/um/asm/processor.h:31:0,
from ./arch/um/include/asm/uaccess.h:16,
from ./arch/um/include/asm/thread_info.h:13,
from include/linux/thread_info.h:54,
from include/asm-generic/current.h:4,
from arch/um/include/generated/asm/current.h:1,
from include/linux/mutex.h:13,
from include/linux/kernfs.h:13,
from include/linux/sysfs.h:15,
from include/linux/kobject.h:21,
from include/linux/device.h:17,
from include/linux/platform_device.h:14,
from drivers/base/platform.c:14:
   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
 identifier or '(' before '' token
#define cpu_data (boot_cpu_data)
  ^
   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
 struct gpd_cpu_data *cpu_data;
^

 Also need notice about 80 columns boundary.
 
 I don't object to this change at all, but it could be easier to solve
 this by fixing up 'cpu_data' to be named something a bit less generic?
 What does x86 use for this data type?
 

It is for some kinds of arm cpu (I let this patch pass arm s3c600
def_config building).  Other architectures did not use it, at present.

If necessary to complete the comments, please let me know, I shall send
patch v2 for it.

Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-04 Thread Greg KH
On Sun, Oct 05, 2014 at 09:13:09AM +0800, Chen Gang wrote:
 On 10/5/14 0:00, Greg KH wrote:
  On Sat, Oct 04, 2014 at 10:19:50PM +0800, Chen Gang wrote:
  'cpu_data' is too common to be already used by some architectures (e.g.
  um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
  compiling break. The related error (with allmodconfig under um):
 
  CC  drivers/base/platform.o
In file included from ./arch/x86/um/asm/processor.h:31:0,
 from ./arch/um/include/asm/uaccess.h:16,
 from ./arch/um/include/asm/thread_info.h:13,
 from include/linux/thread_info.h:54,
 from include/asm-generic/current.h:4,
 from arch/um/include/generated/asm/current.h:1,
 from include/linux/mutex.h:13,
 from include/linux/kernfs.h:13,
 from include/linux/sysfs.h:15,
 from include/linux/kobject.h:21,
 from include/linux/device.h:17,
 from include/linux/platform_device.h:14,
 from drivers/base/platform.c:14:
./arch/um/include/asm/processor-generic.h:107:19: error: expected 
  identifier or '(' before '' token
 #define cpu_data (boot_cpu_data)
   ^
include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
  struct gpd_cpu_data *cpu_data;
 ^
 
  Also need notice about 80 columns boundary.
  
  I don't object to this change at all, but it could be easier to solve
  this by fixing up 'cpu_data' to be named something a bit less generic?
  What does x86 use for this data type?
  
 
 It is for some kinds of arm cpu (I let this patch pass arm s3c600
 def_config building).  Other architectures did not use it, at present.

So why not change the name for these archs that have such a generic name
to something not so generic?

thanks,

greg k-h
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-04 Thread Chen Gang
On 10/5/14 9:13, Chen Gang wrote:
 On 10/5/14 0:00, Greg KH wrote:
 On Sat, Oct 04, 2014 at 10:19:50PM +0800, Chen Gang wrote:
 'cpu_data' is too common to be already used by some architectures (e.g.
 um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
 compiling break. The related error (with allmodconfig under um):

 CC  drivers/base/platform.o
   In file included from ./arch/x86/um/asm/processor.h:31:0,
from ./arch/um/include/asm/uaccess.h:16,
from ./arch/um/include/asm/thread_info.h:13,
from include/linux/thread_info.h:54,
from include/asm-generic/current.h:4,
from arch/um/include/generated/asm/current.h:1,
from include/linux/mutex.h:13,
from include/linux/kernfs.h:13,
from include/linux/sysfs.h:15,
from include/linux/kobject.h:21,
from include/linux/device.h:17,
from include/linux/platform_device.h:14,
from drivers/base/platform.c:14:
   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
 identifier or '(' before '' token
#define cpu_data (boot_cpu_data)
  ^
   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
 struct gpd_cpu_data *cpu_data;
^

 Also need notice about 80 columns boundary.

 I don't object to this change at all, but it could be easier to solve
 this by fixing up 'cpu_data' to be named something a bit less generic?
 What does x86 use for this data type?

 
 It is for some kinds of arm cpu (I let this patch pass arm s3c600

Oh, sorry, typo issue, it is s3c6400 def_config.

 def_config building).  Other architectures did not use it, at present.
 
 If necessary to complete the comments, please let me know, I shall send
 patch v2 for it.
 
 Thanks.
 

-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-04 Thread Chen Gang
On 10/5/14 9:23, Greg KH wrote:
 On Sun, Oct 05, 2014 at 09:13:09AM +0800, Chen Gang wrote:
 On 10/5/14 0:00, Greg KH wrote:
 On Sat, Oct 04, 2014 at 10:19:50PM +0800, Chen Gang wrote:
 'cpu_data' is too common to be already used by some architectures (e.g.
 um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
 compiling break. The related error (with allmodconfig under um):

 CC  drivers/base/platform.o
   In file included from ./arch/x86/um/asm/processor.h:31:0,
from ./arch/um/include/asm/uaccess.h:16,
from ./arch/um/include/asm/thread_info.h:13,
from include/linux/thread_info.h:54,
from include/asm-generic/current.h:4,
from arch/um/include/generated/asm/current.h:1,
from include/linux/mutex.h:13,
from include/linux/kernfs.h:13,
from include/linux/sysfs.h:15,
from include/linux/kobject.h:21,
from include/linux/device.h:17,
from include/linux/platform_device.h:14,
from drivers/base/platform.c:14:
   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
 identifier or '(' before '' token
#define cpu_data (boot_cpu_data)
  ^
   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
 struct gpd_cpu_data *cpu_data;
^

 Also need notice about 80 columns boundary.

 I don't object to this change at all, but it could be easier to solve
 this by fixing up 'cpu_data' to be named something a bit less generic?
 What does x86 use for this data type?


 It is for some kinds of arm cpu (I let this patch pass arm s3c600
 def_config building).  Other architectures did not use it, at present.
 
 So why not change the name for these archs that have such a generic name
 to something not so generic?
 

All the code are really generic, I don't know whether it will be used
under other architectures in the future (I guess, it will, or it need
not be put to drivers/base/power/ and include/linux).

At present, it is not used by other architectures, but it already has
negative effect with other architectures (I found it during compiling
um architecture).

So for me, this issue is not only within arm itself, but also in common
drivers.


Thanks
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-04 Thread Randy Dunlap
On 10/04/14 09:00, Greg KH wrote:
 On Sat, Oct 04, 2014 at 10:19:50PM +0800, Chen Gang wrote:
 'cpu_data' is too common to be already used by some architectures (e.g.
 um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
 compiling break. The related error (with allmodconfig under um):

 CC  drivers/base/platform.o
   In file included from ./arch/x86/um/asm/processor.h:31:0,
from ./arch/um/include/asm/uaccess.h:16,
from ./arch/um/include/asm/thread_info.h:13,
from include/linux/thread_info.h:54,
from include/asm-generic/current.h:4,
from arch/um/include/generated/asm/current.h:1,
from include/linux/mutex.h:13,
from include/linux/kernfs.h:13,
from include/linux/sysfs.h:15,
from include/linux/kobject.h:21,
from include/linux/device.h:17,
from include/linux/platform_device.h:14,
from drivers/base/platform.c:14:
   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
 identifier or '(' before '' token
#define cpu_data (boot_cpu_data)
  ^
   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
 struct gpd_cpu_data *cpu_data;
^

 Also need notice about 80 columns boundary.
 
 I don't object to this change at all, but it could be easier to solve
 this by fixing up 'cpu_data' to be named something a bit less generic?
 What does x86 use for this data type?

The patch makes sense to me.

These arch-es already have 'cpu_data' in some form:

mips, sparc, arm64, blackfin, frv, mn10300, parisc, um(l), c6x, x86, xtensa,
alpha, m32r, arm, ia64, metag, sn.


-- 
~Randy
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] drivers: base: power: domain: Use 'pm_cpu_data' instead of 'cpu_data' for compiling break

2014-10-04 Thread Chen Gang
On 10/5/14 10:42, Randy Dunlap wrote:
 On 10/04/14 09:00, Greg KH wrote:
 On Sat, Oct 04, 2014 at 10:19:50PM +0800, Chen Gang wrote:
 'cpu_data' is too common to be already used by some architectures (e.g.
 um, m32r, and mn10300), so need use 'pm_cpu_data' instead of, or cause
 compiling break. The related error (with allmodconfig under um):

 CC  drivers/base/platform.o
   In file included from ./arch/x86/um/asm/processor.h:31:0,
from ./arch/um/include/asm/uaccess.h:16,
from ./arch/um/include/asm/thread_info.h:13,
from include/linux/thread_info.h:54,
from include/asm-generic/current.h:4,
from arch/um/include/generated/asm/current.h:1,
from include/linux/mutex.h:13,
from include/linux/kernfs.h:13,
from include/linux/sysfs.h:15,
from include/linux/kobject.h:21,
from include/linux/device.h:17,
from include/linux/platform_device.h:14,
from drivers/base/platform.c:14:
   ./arch/um/include/asm/processor-generic.h:107:19: error: expected 
 identifier or '(' before '' token
#define cpu_data (boot_cpu_data)
  ^
   include/linux/pm_domain.h:74:23: note: in expansion of macro 'cpu_data'
 struct gpd_cpu_data *cpu_data;
^

 Also need notice about 80 columns boundary.

 I don't object to this change at all, but it could be easier to solve
 this by fixing up 'cpu_data' to be named something a bit less generic?
 What does x86 use for this data type?
 
 The patch makes sense to me.
 
 These arch-es already have 'cpu_data' in some form:
 
 mips, sparc, arm64, blackfin, frv, mn10300, parisc, um(l), c6x, x86, xtensa,
 alpha, m32r, arm, ia64, metag, sn.
 

Yeah, and m32r, mn10300 and um may let cpu_data as macro variable, which
may cause this issue. And others let cpu_data as function (or like a
function), I guess, they may not cause this issue.


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/