mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	misc: fastrpc: consider address offset before sending to DSP
While passing address phy address to DSP, take care of the offset
calculated from virtual address vma.
Fixes: c68cfb718c ("misc: fastrpc: Add support for context Invoke method")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
			
			
This commit is contained in:
		
							parent
							
								
									977e6c8d1d
								
							
						
					
					
						commit
						80f3afd72b
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
					@ -679,8 +679,16 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx)
 | 
				
			||||||
		pages[i].size = roundup(len, PAGE_SIZE);
 | 
							pages[i].size = roundup(len, PAGE_SIZE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (ctx->maps[i]) {
 | 
							if (ctx->maps[i]) {
 | 
				
			||||||
 | 
								struct vm_area_struct *vma = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			rpra[i].pv = (u64) ctx->args[i].ptr;
 | 
								rpra[i].pv = (u64) ctx->args[i].ptr;
 | 
				
			||||||
			pages[i].addr = ctx->maps[i]->phys;
 | 
								pages[i].addr = ctx->maps[i]->phys;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								vma = find_vma(current->mm, ctx->args[i].ptr);
 | 
				
			||||||
 | 
								if (vma)
 | 
				
			||||||
 | 
									pages[i].addr += ctx->args[i].ptr -
 | 
				
			||||||
 | 
											 vma->vm_start;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			rlen -= ALIGN(args, FASTRPC_ALIGN) - args;
 | 
								rlen -= ALIGN(args, FASTRPC_ALIGN) - args;
 | 
				
			||||||
			args = ALIGN(args, FASTRPC_ALIGN);
 | 
								args = ALIGN(args, FASTRPC_ALIGN);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue