linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/3] firmware loader: fix build failure
@ 2012-08-17 14:06 Ming Lei
  2012-08-17 14:06 ` [PATCH v1 1/3] firmware loader: fix compile failure if !PM Ming Lei
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Ming Lei @ 2012-08-17 14:06 UTC (permalink / raw)
  To: Linus Torvalds, Greg Kroah-Hartman
  Cc: Rafael J. Wysocki, Borislav Petkov, linux-kernel, linux-pm

Hi Greg,

These 3 patches fix build failure reported by Fengguang aginst
driver-core -next tree.

The 2nd patch introduces dpm_for_each_dev in drivers/base/power
to fix link failure if firmware loader is complied as moudle.

v1:
        - add 'static inline' on dpm_for_each_dev if !PM_SLEEP(2/3)
        - check 'fn' in dpm_for_each_dev(2/3)

Thanks,
--
Ming Lei



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v1 1/3] firmware loader: fix compile failure if !PM
  2012-08-17 14:06 [PATCH v1 0/3] firmware loader: fix build failure Ming Lei
@ 2012-08-17 14:06 ` Ming Lei
  2012-08-17 14:06 ` [PATCH v1 2/3] PM / Sleep: introduce dpm_for_each_dev Ming Lei
  2012-08-17 14:07 ` [PATCH v1 3/3] firmware loader: fix build failure if FW_LOADER is m Ming Lei
  2 siblings, 0 replies; 12+ messages in thread
From: Ming Lei @ 2012-08-17 14:06 UTC (permalink / raw)
  To: Linus Torvalds, Greg Kroah-Hartman
  Cc: Rafael J. Wysocki, Borislav Petkov, linux-kernel, linux-pm, Ming Lei

'return 0' should be added to fw_pm_notify if !PM because
return value of the funcion is defined as 'int'.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
 drivers/base/firmware_class.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 5bd2100..4c8d8ef 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -1242,7 +1242,9 @@ static int fw_pm_notify(struct notifier_block *notify_block,
 #else
 static int fw_pm_notify(struct notifier_block *notify_block,
 			unsigned long mode, void *unused)
-{}
+{
+	return 0;
+}
 #endif
 
 static void __init fw_cache_init(void)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v1 2/3] PM / Sleep: introduce dpm_for_each_dev
  2012-08-17 14:06 [PATCH v1 0/3] firmware loader: fix build failure Ming Lei
  2012-08-17 14:06 ` [PATCH v1 1/3] firmware loader: fix compile failure if !PM Ming Lei
@ 2012-08-17 14:06 ` Ming Lei
  2012-08-17 22:02   ` Rafael J. Wysocki
  2012-08-17 14:07 ` [PATCH v1 3/3] firmware loader: fix build failure if FW_LOADER is m Ming Lei
  2 siblings, 1 reply; 12+ messages in thread
From: Ming Lei @ 2012-08-17 14:06 UTC (permalink / raw)
  To: Linus Torvalds, Greg Kroah-Hartman
  Cc: Rafael J. Wysocki, Borislav Petkov, linux-kernel, linux-pm, Ming Lei

dpm_list and its pm lock provide a good way to iterate all
devices in system. Except this way, there is no other easy
way to iterate devices in system.

firmware loader need to cache firmware images for devices
before system sleep, so introduce the function to meet its
demand.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
 drivers/base/power/main.c |   22 ++++++++++++++++++++++
 include/linux/pm.h        |    5 +++++
 2 files changed, 27 insertions(+)

diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 57f5814..23b417f 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1349,3 +1349,25 @@ int device_pm_wait_for_dev(struct device *subordinate, struct device *dev)
 	return async_error;
 }
 EXPORT_SYMBOL_GPL(device_pm_wait_for_dev);
+
+/**
+ * dpm_for_each_dev - device iterator.
+ * @data: data for the callback.
+ * @fn: function to be called for each device.
+ *
+ * Iterate over devices in dpm_list, and call @fn for each device,
+ * passing it @data.
+ */
+void dpm_for_each_dev(void *data, void (*fn)(struct device *, void *))
+{
+	struct device *dev;
+
+	if (!fn)
+		return;
+
+	device_pm_lock();
+	list_for_each_entry(dev, &dpm_list, power.entry)
+		fn(dev, data);
+	device_pm_unlock();
+}
+EXPORT_SYMBOL_GPL(dpm_for_each_dev);
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 44d1f23..007e687 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -640,6 +640,7 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
 	} while (0)
 
 extern int device_pm_wait_for_dev(struct device *sub, struct device *dev);
+extern void dpm_for_each_dev(void *data, void (*fn)(struct device *, void *));
 
 extern int pm_generic_prepare(struct device *dev);
 extern int pm_generic_suspend_late(struct device *dev);
@@ -679,6 +680,10 @@ static inline int device_pm_wait_for_dev(struct device *a, struct device *b)
 	return 0;
 }
 
+static inline void dpm_for_each_dev(void *data, void (*fn)(struct device *, void *))
+{
+}
+
 #define pm_generic_prepare	NULL
 #define pm_generic_suspend	NULL
 #define pm_generic_resume	NULL
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v1 3/3] firmware loader: fix build failure if FW_LOADER is m
  2012-08-17 14:06 [PATCH v1 0/3] firmware loader: fix build failure Ming Lei
  2012-08-17 14:06 ` [PATCH v1 1/3] firmware loader: fix compile failure if !PM Ming Lei
  2012-08-17 14:06 ` [PATCH v1 2/3] PM / Sleep: introduce dpm_for_each_dev Ming Lei
@ 2012-08-17 14:07 ` Ming Lei
  2 siblings, 0 replies; 12+ messages in thread
From: Ming Lei @ 2012-08-17 14:07 UTC (permalink / raw)
  To: Linus Torvalds, Greg Kroah-Hartman
  Cc: Rafael J. Wysocki, Borislav Petkov, linux-kernel, linux-pm, Ming Lei

device_cache_fw_images need to iterate devices in system,
so this patch applies the introduced dpm_for_each_dev to
avoid link failure if CONFIG_FW_LOADER is m.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
 drivers/base/firmware_class.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 4c8d8ef..ed0510a 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -27,7 +27,6 @@
 #include <linux/suspend.h>
 
 #include "base.h"
-#include "power/power.h"
 
 MODULE_AUTHOR("Manuel Estrada Sainz");
 MODULE_DESCRIPTION("Multi purpose firmware loading support");
@@ -1093,7 +1092,7 @@ static int devm_name_match(struct device *dev, void *res,
 	return (fwn->magic == (unsigned long)match_data);
 }
 
-static void dev_cache_fw_image(struct device *dev)
+static void dev_cache_fw_image(struct device *dev, void *data)
 {
 	LIST_HEAD(todo);
 	struct fw_cache_entry *fce;
@@ -1148,7 +1147,6 @@ static void __device_uncache_fw_images(void)
 static void device_cache_fw_images(void)
 {
 	struct firmware_cache *fwc = &fw_cache;
-	struct device *dev;
 	int old_timeout;
 	DEFINE_WAIT(wait);
 
@@ -1165,10 +1163,7 @@ static void device_cache_fw_images(void)
 	old_timeout = loading_timeout;
 	loading_timeout = 10;
 
-	device_pm_lock();
-	list_for_each_entry(dev, &dpm_list, power.entry)
-		dev_cache_fw_image(dev);
-	device_pm_unlock();
+	dpm_for_each_dev(NULL, dev_cache_fw_image);
 
 	/* wait for completion of caching firmware for all devices */
 	spin_lock(&fwc->name_lock);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v1 2/3] PM / Sleep: introduce dpm_for_each_dev
  2012-08-17 14:06 ` [PATCH v1 2/3] PM / Sleep: introduce dpm_for_each_dev Ming Lei
@ 2012-08-17 22:02   ` Rafael J. Wysocki
  2012-08-18  0:43     ` Ming Lei
  0 siblings, 1 reply; 12+ messages in thread
From: Rafael J. Wysocki @ 2012-08-17 22:02 UTC (permalink / raw)
  To: Ming Lei
  Cc: Linus Torvalds, Greg Kroah-Hartman, Borislav Petkov,
	linux-kernel, linux-pm

On Friday, August 17, 2012, Ming Lei wrote:
> dpm_list and its pm lock provide a good way to iterate all
> devices in system. Except this way, there is no other easy
> way to iterate devices in system.
> 
> firmware loader need to cache firmware images for devices
> before system sleep, so introduce the function to meet its
> demand.
> 
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Ming Lei <ming.lei@canonical.com>

Well.

> ---
>  drivers/base/power/main.c |   22 ++++++++++++++++++++++
>  include/linux/pm.h        |    5 +++++
>  2 files changed, 27 insertions(+)
> 
> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
> index 57f5814..23b417f 100644
> --- a/drivers/base/power/main.c
> +++ b/drivers/base/power/main.c
> @@ -1349,3 +1349,25 @@ int device_pm_wait_for_dev(struct device *subordinate, struct device *dev)
>  	return async_error;
>  }
>  EXPORT_SYMBOL_GPL(device_pm_wait_for_dev);
> +
> +/**
> + * dpm_for_each_dev - device iterator.
> + * @data: data for the callback.
> + * @fn: function to be called for each device.
> + *
> + * Iterate over devices in dpm_list, and call @fn for each device,
> + * passing it @data.
> + */
> +void dpm_for_each_dev(void *data, void (*fn)(struct device *, void *))

Is this function actually used more than once?

> +{
> +	struct device *dev;
> +
> +	if (!fn)
> +		return;
> +
> +	device_pm_lock();
> +	list_for_each_entry(dev, &dpm_list, power.entry)
> +		fn(dev, data);
> +	device_pm_unlock();
> +}
> +EXPORT_SYMBOL_GPL(dpm_for_each_dev);
> diff --git a/include/linux/pm.h b/include/linux/pm.h
> index 44d1f23..007e687 100644
> --- a/include/linux/pm.h
> +++ b/include/linux/pm.h
> @@ -640,6 +640,7 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
>  	} while (0)
>  
>  extern int device_pm_wait_for_dev(struct device *sub, struct device *dev);
> +extern void dpm_for_each_dev(void *data, void (*fn)(struct device *, void *));
>  
>  extern int pm_generic_prepare(struct device *dev);
>  extern int pm_generic_suspend_late(struct device *dev);
> @@ -679,6 +680,10 @@ static inline int device_pm_wait_for_dev(struct device *a, struct device *b)
>  	return 0;
>  }
>  
> +static inline void dpm_for_each_dev(void *data, void (*fn)(struct device *, void *))
> +{
> +}
> +
>  #define pm_generic_prepare	NULL
>  #define pm_generic_suspend	NULL
>  #define pm_generic_resume	NULL

Rafael

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v1 2/3] PM / Sleep: introduce dpm_for_each_dev
  2012-08-17 22:02   ` Rafael J. Wysocki
@ 2012-08-18  0:43     ` Ming Lei
  2012-08-18 13:38       ` Rafael J. Wysocki
  0 siblings, 1 reply; 12+ messages in thread
From: Ming Lei @ 2012-08-18  0:43 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linus Torvalds, Greg Kroah-Hartman, Borislav Petkov,
	linux-kernel, linux-pm

On Sat, Aug 18, 2012 at 6:02 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Friday, August 17, 2012, Ming Lei wrote:
>> +void dpm_for_each_dev(void *data, void (*fn)(struct device *, void *))
>
> Is this function actually used more than once?

At least now, it is called each time before system sleep.


Thanks,
--
Ming Lei

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v1 2/3] PM / Sleep: introduce dpm_for_each_dev
  2012-08-18  0:43     ` Ming Lei
@ 2012-08-18 13:38       ` Rafael J. Wysocki
  2012-08-18 14:52         ` Ming Lei
  0 siblings, 1 reply; 12+ messages in thread
From: Rafael J. Wysocki @ 2012-08-18 13:38 UTC (permalink / raw)
  To: Ming Lei
  Cc: Linus Torvalds, Greg Kroah-Hartman, Borislav Petkov,
	linux-kernel, linux-pm

On Saturday, August 18, 2012, Ming Lei wrote:
> On Sat, Aug 18, 2012 at 6:02 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > On Friday, August 17, 2012, Ming Lei wrote:
> >> +void dpm_for_each_dev(void *data, void (*fn)(struct device *, void *))
> >
> > Is this function actually used more than once?
> 
> At least now, it is called each time before system sleep.

My question was about the number of current users of it.  Sorry for not
being clear.

If there are no more anticipated users than the current only one, please
drop the unused (void *) argument.  We can always extend it in the future
if need be and for now passing that NULL every time is just pointless.

And please fold [2/3] into [3/3] in this series.

I'm not particuarly fond of this patch, but I guess it would require some
consderable juggling of #ifdefs to fix the build breakage in a different way.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v1 2/3] PM / Sleep: introduce dpm_for_each_dev
  2012-08-18 13:38       ` Rafael J. Wysocki
@ 2012-08-18 14:52         ` Ming Lei
  2012-08-18 20:33           ` Rafael J. Wysocki
  0 siblings, 1 reply; 12+ messages in thread
From: Ming Lei @ 2012-08-18 14:52 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Linus Torvalds, Greg Kroah-Hartman, Borislav Petkov,
	linux-kernel, linux-pm

On Sat, Aug 18, 2012 at 9:38 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>
> My question was about the number of current users of it.  Sorry for not
> being clear.

Sorry for misunderstanding your question.

>
> If there are no more anticipated users than the current only one, please
> drop the unused (void *) argument.  We can always extend it in the future
> if need be and for now passing that NULL every time is just pointless.

One usage is to get statistics info about devices for debug purpose,
so the parameter is needed to return something.

> And please fold [2/3] into [3/3] in this series.

IMO, it is better to split them to avoid coupling between fw loader and
device PM.

Looks you agreed on the patch, and Greg has added the
patch into his driver-core next tree to fix -next build failure, so could
you just let them be that?

>
> I'm not particuarly fond of this patch, but I guess it would require some
> consderable juggling of #ifdefs to fix the build breakage in a different way.

Firmware loader might be built as module, so without exporting something
from device PM core, the problem can't be fixed.


Thanks,
--
Ming Lei

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v1 2/3] PM / Sleep: introduce dpm_for_each_dev
  2012-08-18 14:52         ` Ming Lei
@ 2012-08-18 20:33           ` Rafael J. Wysocki
  2012-08-18 20:49             ` Rafael J. Wysocki
  0 siblings, 1 reply; 12+ messages in thread
From: Rafael J. Wysocki @ 2012-08-18 20:33 UTC (permalink / raw)
  To: Ming Lei
  Cc: Linus Torvalds, Greg Kroah-Hartman, Borislav Petkov,
	linux-kernel, linux-pm

On Saturday, August 18, 2012, Ming Lei wrote:
> On Sat, Aug 18, 2012 at 9:38 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> >
> > My question was about the number of current users of it.  Sorry for not
> > being clear.
> 
> Sorry for misunderstanding your question.
> 
> >
> > If there are no more anticipated users than the current only one, please
> > drop the unused (void *) argument.  We can always extend it in the future
> > if need be and for now passing that NULL every time is just pointless.
> 
> One usage is to get statistics info about devices for debug purpose,
> so the parameter is needed to return something.

So, what's the name of the _second_ function using dpm_for_each_dev()?

I don't see any and device_cache_fw_images() in [3/3] clearly passes
NULL as the first argument.

> > And please fold [2/3] into [3/3] in this series.
> 
> IMO, it is better to split them to avoid coupling between fw loader and
> device PM.
> 
> Looks you agreed on the patch,

On the idea, not on the actual code.  I told you what I wanted to to change in
it, didn't I?

> and Greg has added the
> patch into his driver-core next tree to fix -next build failure, so could
> you just let them be that?

-next is not cast in stone, you can replace patches in it with other ones
if need be.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v1 2/3] PM / Sleep: introduce dpm_for_each_dev
  2012-08-18 20:33           ` Rafael J. Wysocki
@ 2012-08-18 20:49             ` Rafael J. Wysocki
  2012-08-19  6:20               ` Greg Kroah-Hartman
  0 siblings, 1 reply; 12+ messages in thread
From: Rafael J. Wysocki @ 2012-08-18 20:49 UTC (permalink / raw)
  To: Ming Lei
  Cc: Linus Torvalds, Greg Kroah-Hartman, Borislav Petkov,
	linux-kernel, linux-pm

On Saturday, August 18, 2012, Rafael J. Wysocki wrote:
> On Saturday, August 18, 2012, Ming Lei wrote:
> > On Sat, Aug 18, 2012 at 9:38 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > >
> > > My question was about the number of current users of it.  Sorry for not
> > > being clear.
> > 
> > Sorry for misunderstanding your question.
> > 
> > >
> > > If there are no more anticipated users than the current only one, please
> > > drop the unused (void *) argument.  We can always extend it in the future
> > > if need be and for now passing that NULL every time is just pointless.
> > 
> > One usage is to get statistics info about devices for debug purpose,
> > so the parameter is needed to return something.
> 
> So, what's the name of the _second_ function using dpm_for_each_dev()?
> 
> I don't see any and device_cache_fw_images() in [3/3] clearly passes
> NULL as the first argument.
> 
> > > And please fold [2/3] into [3/3] in this series.
> > 
> > IMO, it is better to split them to avoid coupling between fw loader and
> > device PM.
> > 
> > Looks you agreed on the patch,
> 
> On the idea, not on the actual code.  I told you what I wanted to to change in
> it, didn't I?
> 
> > and Greg has added the
> > patch into his driver-core next tree to fix -next build failure, so could
> > you just let them be that?
> 
> -next is not cast in stone, you can replace patches in it with other ones
> if need be.

And it actually would be better if you replaced the patches that had introduced
the build problems with new fixed ones, because otherwise your whole series
has bisection issues potentially.

And since the Greg's patch queue is quilt-based, for what I can tell, that's
entirely doable.

So the fact that your patches in this series fix build issues in -next
introduced by your previous patches isn't any excuse at all.  There still is
a plenty of time before the v3.7 merge window to fix things properly.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v1 2/3] PM / Sleep: introduce dpm_for_each_dev
  2012-08-18 20:49             ` Rafael J. Wysocki
@ 2012-08-19  6:20               ` Greg Kroah-Hartman
  2012-08-19 20:10                 ` Rafael J. Wysocki
  0 siblings, 1 reply; 12+ messages in thread
From: Greg Kroah-Hartman @ 2012-08-19  6:20 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Ming Lei, Linus Torvalds, Borislav Petkov, linux-kernel, linux-pm

On Sat, Aug 18, 2012 at 10:49:06PM +0200, Rafael J. Wysocki wrote:
> On Saturday, August 18, 2012, Rafael J. Wysocki wrote:
> > On Saturday, August 18, 2012, Ming Lei wrote:
> > > On Sat, Aug 18, 2012 at 9:38 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > > >
> > > > My question was about the number of current users of it.  Sorry for not
> > > > being clear.
> > > 
> > > Sorry for misunderstanding your question.
> > > 
> > > >
> > > > If there are no more anticipated users than the current only one, please
> > > > drop the unused (void *) argument.  We can always extend it in the future
> > > > if need be and for now passing that NULL every time is just pointless.
> > > 
> > > One usage is to get statistics info about devices for debug purpose,
> > > so the parameter is needed to return something.
> > 
> > So, what's the name of the _second_ function using dpm_for_each_dev()?
> > 
> > I don't see any and device_cache_fw_images() in [3/3] clearly passes
> > NULL as the first argument.
> > 
> > > > And please fold [2/3] into [3/3] in this series.
> > > 
> > > IMO, it is better to split them to avoid coupling between fw loader and
> > > device PM.
> > > 
> > > Looks you agreed on the patch,
> > 
> > On the idea, not on the actual code.  I told you what I wanted to to change in
> > it, didn't I?
> > 
> > > and Greg has added the
> > > patch into his driver-core next tree to fix -next build failure, so could
> > > you just let them be that?
> > 
> > -next is not cast in stone, you can replace patches in it with other ones
> > if need be.
> 
> And it actually would be better if you replaced the patches that had introduced
> the build problems with new fixed ones, because otherwise your whole series
> has bisection issues potentially.
> 
> And since the Greg's patch queue is quilt-based, for what I can tell, that's
> entirely doable.

No, my patch queue hasn't been quilt-based for almost 2 years now.  It's
git-based, and I can revert anything that I need to, including this
whole series, but I can't rewrite history, sorry.

greg k-h

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v1 2/3] PM / Sleep: introduce dpm_for_each_dev
  2012-08-19  6:20               ` Greg Kroah-Hartman
@ 2012-08-19 20:10                 ` Rafael J. Wysocki
  0 siblings, 0 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2012-08-19 20:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Ming Lei, Linus Torvalds, Borislav Petkov, linux-kernel, linux-pm

On Sunday, August 19, 2012, Greg Kroah-Hartman wrote:
> On Sat, Aug 18, 2012 at 10:49:06PM +0200, Rafael J. Wysocki wrote:
> > On Saturday, August 18, 2012, Rafael J. Wysocki wrote:
> > > On Saturday, August 18, 2012, Ming Lei wrote:
> > > > On Sat, Aug 18, 2012 at 9:38 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > > > >
> > > > > My question was about the number of current users of it.  Sorry for not
> > > > > being clear.
> > > > 
> > > > Sorry for misunderstanding your question.
> > > > 
> > > > >
> > > > > If there are no more anticipated users than the current only one, please
> > > > > drop the unused (void *) argument.  We can always extend it in the future
> > > > > if need be and for now passing that NULL every time is just pointless.
> > > > 
> > > > One usage is to get statistics info about devices for debug purpose,
> > > > so the parameter is needed to return something.
> > > 
> > > So, what's the name of the _second_ function using dpm_for_each_dev()?
> > > 
> > > I don't see any and device_cache_fw_images() in [3/3] clearly passes
> > > NULL as the first argument.
> > > 
> > > > > And please fold [2/3] into [3/3] in this series.
> > > > 
> > > > IMO, it is better to split them to avoid coupling between fw loader and
> > > > device PM.
> > > > 
> > > > Looks you agreed on the patch,
> > > 
> > > On the idea, not on the actual code.  I told you what I wanted to to change in
> > > it, didn't I?
> > > 
> > > > and Greg has added the
> > > > patch into his driver-core next tree to fix -next build failure, so could
> > > > you just let them be that?
> > > 
> > > -next is not cast in stone, you can replace patches in it with other ones
> > > if need be.
> > 
> > And it actually would be better if you replaced the patches that had introduced
> > the build problems with new fixed ones, because otherwise your whole series
> > has bisection issues potentially.
> > 
> > And since the Greg's patch queue is quilt-based, for what I can tell, that's
> > entirely doable.
> 
> No, my patch queue hasn't been quilt-based for almost 2 years now.  It's
> git-based, and I can revert anything that I need to, including this
> whole series, but I can't rewrite history, sorry.

Well, I was wrong, then, sorry.

Never mind, I'll clean up that mess later. :-)

By the way, that's why I started to use temporary branches that are only
merged into my linux-next branch and don't show up anywhere else for several
days until I'm quite confident they don't introduce silly build issues
for combinations of config options that the patch authors didn't anticipate
(sometimes they are combinations of config options that nobody saner than the
crazy monkey's brother Max whom Linus was talking about some time ago would
ever use in practice; and I honestly doubt that even Max would use some of
them, even on one of his worst days).

Afterward they are just renamed and published if there are no build issues
with them.  Otherwise, I can just nuke them entirely and re-create them from
scratch folding build fixes into the patches that introduced the build
problems.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-08-19 20:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-17 14:06 [PATCH v1 0/3] firmware loader: fix build failure Ming Lei
2012-08-17 14:06 ` [PATCH v1 1/3] firmware loader: fix compile failure if !PM Ming Lei
2012-08-17 14:06 ` [PATCH v1 2/3] PM / Sleep: introduce dpm_for_each_dev Ming Lei
2012-08-17 22:02   ` Rafael J. Wysocki
2012-08-18  0:43     ` Ming Lei
2012-08-18 13:38       ` Rafael J. Wysocki
2012-08-18 14:52         ` Ming Lei
2012-08-18 20:33           ` Rafael J. Wysocki
2012-08-18 20:49             ` Rafael J. Wysocki
2012-08-19  6:20               ` Greg Kroah-Hartman
2012-08-19 20:10                 ` Rafael J. Wysocki
2012-08-17 14:07 ` [PATCH v1 3/3] firmware loader: fix build failure if FW_LOADER is m Ming Lei

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).