mirror of
				git://git.openwrt.org/openwrt/openwrt.git
				synced 2025-11-03 14:34:27 -05:00 
			
		
		
		
	kernel: rtl8306: fix port link status
In case the link changes from down to up, the register is only updated on read. If the link failed/was down, this bit will be 0 until after reading this bit again. Fixes a reported link down by swconfig alebit the link is up (query for the link again will show the correct link status) Signed-off-by: Mathias Kresin <dev@kresin.me>
This commit is contained in:
		
							parent
							
								
									47be42c347
								
							
						
					
					
						commit
						096dff8fcd
					
				@ -592,7 +592,11 @@ rtl_get_port_link(struct switch_dev *dev, int port, struct switch_port_link *lin
 | 
			
		||||
	if (port >= RTL8306_NUM_PORTS)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
 | 
			
		||||
	/* in case the link changes from down to up, the register is only updated on read */
 | 
			
		||||
	link->link = rtl_get(dev, RTL_PORT_REG(port, LINK));
 | 
			
		||||
	if (!link->link)
 | 
			
		||||
		link->link = rtl_get(dev, RTL_PORT_REG(port, LINK));
 | 
			
		||||
 | 
			
		||||
	if (!link->link)
 | 
			
		||||
		return 0;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user