mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	pmac_zilog,kdb: Fix console poll hook to return instead of loop
kdb <-> kgdb transitioning does not work properly with this UART driver because the get character routine loops indefinitely as opposed to returning NO_POLL_CHAR per the expectation of the KDB I/O driver API. The symptom is a kernel hang when trying to switch debug modes. Cc: Alan Cox <alan@linux.intel.com> Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
		
							parent
							
								
									0059202101
								
							
						
					
					
						commit
						38f8eefccf
					
				
					 1 changed files with 9 additions and 3 deletions
				
			
		|  | @ -1348,10 +1348,16 @@ static int pmz_verify_port(struct uart_port *port, struct serial_struct *ser) | ||||||
| static int pmz_poll_get_char(struct uart_port *port) | static int pmz_poll_get_char(struct uart_port *port) | ||||||
| { | { | ||||||
| 	struct uart_pmac_port *uap = (struct uart_pmac_port *)port; | 	struct uart_pmac_port *uap = (struct uart_pmac_port *)port; | ||||||
|  | 	int tries = 2; | ||||||
| 
 | 
 | ||||||
| 	while ((read_zsreg(uap, R0) & Rx_CH_AV) == 0) | 	while (tries) { | ||||||
| 		udelay(5); | 		if ((read_zsreg(uap, R0) & Rx_CH_AV) != 0) | ||||||
| 	return read_zsdata(uap); | 			return read_zsdata(uap); | ||||||
|  | 		if (tries--) | ||||||
|  | 			udelay(5); | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	return NO_POLL_CHAR; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void pmz_poll_put_char(struct uart_port *port, unsigned char c) | static void pmz_poll_put_char(struct uart_port *port, unsigned char c) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Jason Wessel
						Jason Wessel