mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	PM / sleep: trace_device_pm_callback coverage in dpm_prepare/complete
Move the trace_device_pm_callback locations for dpm_prepare and dpm_complete to encompass the attempt to capture the device mutex prior to callback. This is needed by analyze_suspend to identify gaps in the trace output caused by the delay in locking the mutex for a device. Signed-off-by: Todd Brandt <todd.e.brandt@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
		
							parent
							
								
									7f436055cb
								
							
						
					
					
						commit
						32e8d689dc
					
				
					 1 changed files with 5 additions and 6 deletions
				
			
		| 
						 | 
					@ -920,9 +920,7 @@ static void device_complete(struct device *dev, pm_message_t state)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (callback) {
 | 
						if (callback) {
 | 
				
			||||||
		pm_dev_dbg(dev, state, info);
 | 
							pm_dev_dbg(dev, state, info);
 | 
				
			||||||
		trace_device_pm_callback_start(dev, info, state.event);
 | 
					 | 
				
			||||||
		callback(dev);
 | 
							callback(dev);
 | 
				
			||||||
		trace_device_pm_callback_end(dev, 0);
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	device_unlock(dev);
 | 
						device_unlock(dev);
 | 
				
			||||||
| 
						 | 
					@ -954,7 +952,9 @@ void dpm_complete(pm_message_t state)
 | 
				
			||||||
		list_move(&dev->power.entry, &list);
 | 
							list_move(&dev->power.entry, &list);
 | 
				
			||||||
		mutex_unlock(&dpm_list_mtx);
 | 
							mutex_unlock(&dpm_list_mtx);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							trace_device_pm_callback_start(dev, "", state.event);
 | 
				
			||||||
		device_complete(dev, state);
 | 
							device_complete(dev, state);
 | 
				
			||||||
 | 
							trace_device_pm_callback_end(dev, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		mutex_lock(&dpm_list_mtx);
 | 
							mutex_lock(&dpm_list_mtx);
 | 
				
			||||||
		put_device(dev);
 | 
							put_device(dev);
 | 
				
			||||||
| 
						 | 
					@ -1585,11 +1585,8 @@ static int device_prepare(struct device *dev, pm_message_t state)
 | 
				
			||||||
		callback = dev->driver->pm->prepare;
 | 
							callback = dev->driver->pm->prepare;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (callback) {
 | 
						if (callback)
 | 
				
			||||||
		trace_device_pm_callback_start(dev, info, state.event);
 | 
					 | 
				
			||||||
		ret = callback(dev);
 | 
							ret = callback(dev);
 | 
				
			||||||
		trace_device_pm_callback_end(dev, ret);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	device_unlock(dev);
 | 
						device_unlock(dev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1631,7 +1628,9 @@ int dpm_prepare(pm_message_t state)
 | 
				
			||||||
		get_device(dev);
 | 
							get_device(dev);
 | 
				
			||||||
		mutex_unlock(&dpm_list_mtx);
 | 
							mutex_unlock(&dpm_list_mtx);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							trace_device_pm_callback_start(dev, "", state.event);
 | 
				
			||||||
		error = device_prepare(dev, state);
 | 
							error = device_prepare(dev, state);
 | 
				
			||||||
 | 
							trace_device_pm_callback_end(dev, error);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		mutex_lock(&dpm_list_mtx);
 | 
							mutex_lock(&dpm_list_mtx);
 | 
				
			||||||
		if (error) {
 | 
							if (error) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue