public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
* linux-next: manual merge of the driver-core tree with the suspend tree
@ 2010-02-02  6:01 Stephen Rothwell
  2010-02-02 15:22 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2010-02-02  6:01 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-next, linux-kernel, Thomas Gleixner, Rafael J. Wysocki

Hi Greg,

Today's linux-next merge of the driver-core tree got a conflict in
drivers/base/power/main.c between commit
de20f9bde404252647645f9f948c8c5de16cc51d ("PM: Asynchronous suspend and
resume of devices") from the suspend tree and commit
df5a0aec4591ae8a5deb67bc8cb6be3d0812abb2 ("drivers/base: Convert dev->sem
to mutex") from the driver-core tree.

I fixed it up (see below) and can carry the fix as necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb•auug.org.au

diff --cc drivers/base/power/main.c
index 0e26a6f,05848a9..0000000
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@@ -507,11 -476,8 +507,11 @@@ static int device_resume(struct device 
  	TRACE_DEVICE(dev);
  	TRACE_RESUME(0);
  
 +	dpm_wait(dev->parent, async);
- 	down(&dev->sem);
+ 	mutex_lock(&dev->mutex);
  
 +	dev->power.status = DPM_RESUMING;
 +
  	if (dev->bus) {
  		if (dev->bus->pm) {
  			pm_dev_dbg(dev, state, "");
@@@ -543,8 -509,7 +543,8 @@@
  		}
  	}
   End:
- 	up(&dev->sem);
+ 	mutex_unlock(&dev->mutex);
 +	complete_all(&dev->power.completion);
  
  	TRACE_RESUME(error);
  	return error;
@@@ -808,12 -740,8 +808,12 @@@ static int __device_suspend(struct devi
  {
  	int error = 0;
  
 +	dpm_wait_for_children(dev, async);
- 	down(&dev->sem);
+ 	mutex_lock(&dev->mutex);
  
 +	if (async_error)
 +		goto End;
 +
  	if (dev->class) {
  		if (dev->class->pm) {
  			pm_dev_dbg(dev, state, "class ");
@@@ -844,13 -772,8 +844,13 @@@
  			error = legacy_suspend(dev, state, dev->bus->suspend);
  		}
  	}
 +
 +	if (!error)
 +		dev->power.status = DPM_OFF;
 +
   End:
- 	up(&dev->sem);
+ 	mutex_unlock(&dev->mutex);
 +	complete_all(&dev->power.completion);
  
  	return error;
  }

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

* Re: linux-next: manual merge of the driver-core tree with the suspend tree
  2010-02-02  6:01 linux-next: manual merge of the driver-core tree with the suspend tree Stephen Rothwell
@ 2010-02-02 15:22 ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2010-02-02 15:22 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: linux-next, linux-kernel, Thomas Gleixner, Rafael J. Wysocki

On Tue, Feb 02, 2010 at 05:01:55PM +1100, Stephen Rothwell wrote:
> Hi Greg,
> 
> Today's linux-next merge of the driver-core tree got a conflict in
> drivers/base/power/main.c between commit
> de20f9bde404252647645f9f948c8c5de16cc51d ("PM: Asynchronous suspend and
> resume of devices") from the suspend tree and commit
> df5a0aec4591ae8a5deb67bc8cb6be3d0812abb2 ("drivers/base: Convert dev->sem
> to mutex") from the driver-core tree.
> 
> I fixed it up (see below) and can carry the fix as necessary.

Fix looks fine, thanks for doing this.

greg k-h

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

* linux-next: manual merge of the driver-core tree with the suspend tree
@ 2010-02-18  8:59 Stephen Rothwell
  2010-02-19  1:19 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2010-02-18  8:59 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-next, linux-kernel, Rafael J. Wysocki

Hi Greg,

Today's linux-next merge of the driver-core tree got a conflict in
include/linux/device.h between commits
5a14fb87905e0023a608af8a471097a22fa72f5e ("PM: Asynchronous suspend and
resume of devices") and 1b8647aa4d52c8ee82df3d3018b0fa2830a149a1 ("PM:
Add facility for advanced testing of async suspend/resume") from the
suspend tree and commit 44d58957cf0332f5c9d0f2a05e2919240dd207fc ("Driver
core: create lock/unlock functions for struct device") from the
driver-core tree.

Juts overlapping additions.  I fixed it up (see below) and can carry the
fix as necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb•auug.org.au

diff --cc include/linux/device.h
index b30527d,8891cfb..0000000
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@@ -472,23 -490,21 +490,38 @@@ static inline int device_is_registered(
  	return dev->kobj.state_in_sysfs;
  }
  
 +static inline void device_enable_async_suspend(struct device *dev)
 +{
 +	if (dev->power.status == DPM_ON)
 +		dev->power.async_suspend = true;
 +}
 +
 +static inline void device_disable_async_suspend(struct device *dev)
 +{
 +	if (dev->power.status == DPM_ON)
 +		dev->power.async_suspend = false;
 +}
 +
 +static inline bool device_async_suspend_enabled(struct device *dev)
 +{
 +	return !!dev->power.async_suspend;
 +}
 +
+ static inline void device_lock(struct device *dev)
+ {
+ 	mutex_lock(&dev->mutex);
+ }
+ 
+ static inline int device_trylock(struct device *dev)
+ {
+ 	return mutex_trylock(&dev->mutex);
+ }
+ 
+ static inline void device_unlock(struct device *dev)
+ {
+ 	mutex_unlock(&dev->mutex);
+ }
+ 
  void driver_init(void);
  
  /*

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

* Re: linux-next: manual merge of the driver-core tree with the suspend tree
  2010-02-18  8:59 Stephen Rothwell
@ 2010-02-19  1:19 ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2010-02-19  1:19 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Rafael J. Wysocki

On Thu, Feb 18, 2010 at 07:59:23PM +1100, Stephen Rothwell wrote:
> Hi Greg,
> 
> Today's linux-next merge of the driver-core tree got a conflict in
> include/linux/device.h between commits
> 5a14fb87905e0023a608af8a471097a22fa72f5e ("PM: Asynchronous suspend and
> resume of devices") and 1b8647aa4d52c8ee82df3d3018b0fa2830a149a1 ("PM:
> Add facility for advanced testing of async suspend/resume") from the
> suspend tree and commit 44d58957cf0332f5c9d0f2a05e2919240dd207fc ("Driver
> core: create lock/unlock functions for struct device") from the
> driver-core tree.
> 
> Juts overlapping additions.  I fixed it up (see below) and can carry the
> fix as necessary.

Looks good to me, thanks for handling the overlap.

greg k-h

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

end of thread, other threads:[~2010-02-19  1:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-02  6:01 linux-next: manual merge of the driver-core tree with the suspend tree Stephen Rothwell
2010-02-02 15:22 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2010-02-18  8:59 Stephen Rothwell
2010-02-19  1:19 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox