|  | @@ -511,6 +511,7 @@ static int smsc75xx_dump_statistics ( struct smsc75xx_device *smsc75xx ) {
 | 
		
	
		
			
			| 511 | 511 |   */
 | 
		
	
		
			
			| 512 | 512 |  static int smsc75xx_reset ( struct smsc75xx_device *smsc75xx ) {
 | 
		
	
		
			
			| 513 | 513 |  	uint32_t hw_cfg;
 | 
		
	
		
			
			|  | 514 | +	unsigned int i;
 | 
		
	
		
			
			| 514 | 515 |  	int rc;
 | 
		
	
		
			
			| 515 | 516 |  
 | 
		
	
		
			
			| 516 | 517 |  	/* Reset device */
 | 
		
	
	
		
			
			|  | @@ -519,18 +520,22 @@ static int smsc75xx_reset ( struct smsc75xx_device *smsc75xx ) {
 | 
		
	
		
			
			| 519 | 520 |  		return rc;
 | 
		
	
		
			
			| 520 | 521 |  
 | 
		
	
		
			
			| 521 | 522 |  	/* Wait for reset to complete */
 | 
		
	
		
			
			| 522 |  | -	udelay ( SMSC75XX_RESET_DELAY_US );
 | 
		
	
		
			
			|  | 523 | +	for ( i = 0 ; i < SMSC75XX_RESET_MAX_WAIT_MS ; i++ ) {
 | 
		
	
		
			
			| 523 | 524 |  
 | 
		
	
		
			
			| 524 |  | -	/* Check that reset has completed */
 | 
		
	
		
			
			| 525 |  | -	if ( ( rc = smsc75xx_readl ( smsc75xx, SMSC75XX_HW_CFG,
 | 
		
	
		
			
			| 526 |  | -				     &hw_cfg ) ) != 0 )
 | 
		
	
		
			
			| 527 |  | -		return rc;
 | 
		
	
		
			
			| 528 |  | -	if ( hw_cfg & SMSC75XX_HW_CFG_LRST ) {
 | 
		
	
		
			
			| 529 |  | -		DBGC ( smsc75xx, "SMSC75XX %p failed to reset\n", smsc75xx );
 | 
		
	
		
			
			| 530 |  | -		return -ETIMEDOUT;
 | 
		
	
		
			
			|  | 525 | +		/* Check if reset has completed */
 | 
		
	
		
			
			|  | 526 | +		if ( ( rc = smsc75xx_readl ( smsc75xx, SMSC75XX_HW_CFG,
 | 
		
	
		
			
			|  | 527 | +					     &hw_cfg ) ) != 0 )
 | 
		
	
		
			
			|  | 528 | +			return rc;
 | 
		
	
		
			
			|  | 529 | +		if ( ! ( hw_cfg & SMSC75XX_HW_CFG_LRST ) )
 | 
		
	
		
			
			|  | 530 | +			return 0;
 | 
		
	
		
			
			|  | 531 | +
 | 
		
	
		
			
			|  | 532 | +		/* Delay */
 | 
		
	
		
			
			|  | 533 | +		mdelay ( 1 );
 | 
		
	
		
			
			| 531 | 534 |  	}
 | 
		
	
		
			
			| 532 | 535 |  
 | 
		
	
		
			
			| 533 |  | -	return 0;
 | 
		
	
		
			
			|  | 536 | +	DBGC ( smsc75xx, "SMSC75XX %p timed out waiting for reset\n",
 | 
		
	
		
			
			|  | 537 | +	       smsc75xx );
 | 
		
	
		
			
			|  | 538 | +	return -ETIMEDOUT;
 | 
		
	
		
			
			| 534 | 539 |  }
 | 
		
	
		
			
			| 535 | 540 |  
 | 
		
	
		
			
			| 536 | 541 |  /******************************************************************************
 |