forked from mirrors/linux
		
	remoteproc: Modify recovery path to use rproc_{start,stop}()
Replace rproc_shutdown() by rproc_stop() and rproc_boot() by rproc_start() in the recovery path, in order to avoid remoteproc resources re-allocation overhead and to assist with extracting the coredumps after stopping the remote processor. Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
		
							parent
							
								
									1efa30d089
								
							
						
					
					
						commit
						7e83cab824
					
				
					 1 changed files with 26 additions and 9 deletions
				
			
		|  | @ -1051,23 +1051,40 @@ static int rproc_stop(struct rproc *rproc) | ||||||
|  */ |  */ | ||||||
| int rproc_trigger_recovery(struct rproc *rproc) | int rproc_trigger_recovery(struct rproc *rproc) | ||||||
| { | { | ||||||
| 	dev_err(&rproc->dev, "recovering %s\n", rproc->name); | 	const struct firmware *firmware_p; | ||||||
|  | 	struct device *dev = &rproc->dev; | ||||||
|  | 	int ret; | ||||||
|  | 
 | ||||||
|  | 	dev_err(dev, "recovering %s\n", rproc->name); | ||||||
| 
 | 
 | ||||||
| 	init_completion(&rproc->crash_comp); | 	init_completion(&rproc->crash_comp); | ||||||
| 
 | 
 | ||||||
| 	/* shut down the remote */ | 	ret = mutex_lock_interruptible(&rproc->lock); | ||||||
| 	/* TODO: make sure this works with rproc->power > 1 */ | 	if (ret) | ||||||
| 	rproc_shutdown(rproc); | 		return ret; | ||||||
|  | 
 | ||||||
|  | 	ret = rproc_stop(rproc); | ||||||
|  | 	if (ret) | ||||||
|  | 		goto unlock_mutex; | ||||||
| 
 | 
 | ||||||
| 	/* wait until there is no more rproc users */ | 	/* wait until there is no more rproc users */ | ||||||
| 	wait_for_completion(&rproc->crash_comp); | 	wait_for_completion(&rproc->crash_comp); | ||||||
| 
 | 
 | ||||||
| 	/*
 | 	/* load firmware */ | ||||||
| 	 * boot the remote processor up again | 	ret = request_firmware(&firmware_p, rproc->firmware, dev); | ||||||
| 	 */ | 	if (ret < 0) { | ||||||
| 	rproc_boot(rproc); | 		dev_err(dev, "request_firmware failed: %d\n", ret); | ||||||
|  | 		goto unlock_mutex; | ||||||
|  | 	} | ||||||
| 
 | 
 | ||||||
| 	return 0; | 	/* boot the remote processor up again */ | ||||||
|  | 	ret = rproc_start(rproc, firmware_p); | ||||||
|  | 
 | ||||||
|  | 	release_firmware(firmware_p); | ||||||
|  | 
 | ||||||
|  | unlock_mutex: | ||||||
|  | 	mutex_unlock(&rproc->lock); | ||||||
|  | 	return ret; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Sarangdhar Joshi
						Sarangdhar Joshi