mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-11-03 21:48:15 +00:00 
			
		
		
		
	i2c: i2c-cdns: Start read transaction after write to transfer_size reg
Avoid a race condition where read transaction is started keeping expected bytes as 0. Which sometimes would result in sending STOP signal as no data is expected. Observed on QEMU platform. Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com> Reviewed-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Link: https://lore.kernel.org/r/487c8026791bfd60719403a2df2c54bb0ae99232.1646122610.git.michal.simek@xilinx.com
This commit is contained in:
		
							parent
							
								
									d926695cc5
								
							
						
					
					
						commit
						1bc2a79a4c
					
				@ -375,7 +375,6 @@ static int cdns_i2c_read_data(struct i2c_cdns_bus *i2c_bus, u32 addr, u8 *data,
 | 
			
		||||
				curr_recv_count = recv_count;
 | 
			
		||||
			}
 | 
			
		||||
		} else if (recv_count && !hold_quirk && !curr_recv_count) {
 | 
			
		||||
			writel(addr, ®s->address);
 | 
			
		||||
			if (recv_count > CDNS_I2C_TRANSFER_SIZE) {
 | 
			
		||||
				writel(CDNS_I2C_TRANSFER_SIZE,
 | 
			
		||||
				       ®s->transfer_size);
 | 
			
		||||
@ -384,6 +383,7 @@ static int cdns_i2c_read_data(struct i2c_cdns_bus *i2c_bus, u32 addr, u8 *data,
 | 
			
		||||
				writel(recv_count, ®s->transfer_size);
 | 
			
		||||
				curr_recv_count = recv_count;
 | 
			
		||||
			}
 | 
			
		||||
			writel(addr, ®s->address);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user