diff options
-rw-r--r-- | drivers/serial/8250.c | 17 | ||||
-rw-r--r-- | include/linux/spinlock.h | 8 | ||||
-rw-r--r-- | kernel/spinlock.c | 8 |
3 files changed, 20 insertions, 13 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 3bbf0cc6e53f..30e8beb71430 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -682,8 +682,6 @@ static void autoconfig_16550a(struct uart_8250_port *up) | |||
682 | * from EXCR1. Switch back to bank 0, change it in MCR. Then | 682 | * from EXCR1. Switch back to bank 0, change it in MCR. Then |
683 | * switch back to bank 2, read it from EXCR1 again and check | 683 | * switch back to bank 2, read it from EXCR1 again and check |
684 | * it's changed. If so, set baud_base in EXCR2 to 921600. -- dwmw2 | 684 | * it's changed. If so, set baud_base in EXCR2 to 921600. -- dwmw2 |
685 | * On PowerPC we don't want to change baud_base, as we have | ||
686 | * a number of different divisors. -- Tom Rini | ||
687 | */ | 685 | */ |
688 | serial_outp(up, UART_LCR, 0); | 686 | serial_outp(up, UART_LCR, 0); |
689 | status1 = serial_in(up, UART_MCR); | 687 | status1 = serial_in(up, UART_MCR); |
@@ -699,16 +697,25 @@ static void autoconfig_16550a(struct uart_8250_port *up) | |||
699 | serial_outp(up, UART_MCR, status1); | 697 | serial_outp(up, UART_MCR, status1); |
700 | 698 | ||
701 | if ((status2 ^ status1) & UART_MCR_LOOP) { | 699 | if ((status2 ^ status1) & UART_MCR_LOOP) { |
702 | #ifndef CONFIG_PPC | 700 | unsigned short quot; |
701 | |||
703 | serial_outp(up, UART_LCR, 0xE0); | 702 | serial_outp(up, UART_LCR, 0xE0); |
703 | |||
704 | quot = serial_inp(up, UART_DLM) << 8; | ||
705 | quot += serial_inp(up, UART_DLL); | ||
706 | quot <<= 3; | ||
707 | |||
704 | status1 = serial_in(up, 0x04); /* EXCR1 */ | 708 | status1 = serial_in(up, 0x04); /* EXCR1 */ |
705 | status1 &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */ | 709 | status1 &= ~0xB0; /* Disable LOCK, mask out PRESL[01] */ |
706 | status1 |= 0x10; /* 1.625 divisor for baud_base --> 921600 */ | 710 | status1 |= 0x10; /* 1.625 divisor for baud_base --> 921600 */ |
707 | serial_outp(up, 0x04, status1); | 711 | serial_outp(up, 0x04, status1); |
712 | |||
713 | serial_outp(up, UART_DLL, quot & 0xff); | ||
714 | serial_outp(up, UART_DLM, quot >> 8); | ||
715 | |||
708 | serial_outp(up, UART_LCR, 0); | 716 | serial_outp(up, UART_LCR, 0); |
709 | up->port.uartclk = 921600*16; | ||
710 | #endif | ||
711 | 717 | ||
718 | up->port.uartclk = 921600*16; | ||
712 | up->port.type = PORT_NS16550A; | 719 | up->port.type = PORT_NS16550A; |
713 | up->capabilities |= UART_NATSEMI; | 720 | up->capabilities |= UART_NATSEMI; |
714 | return; | 721 | return; |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index e895f3eaf53a..d6ba068719b6 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -248,7 +248,7 @@ typedef struct { | |||
248 | 248 | ||
249 | #define _spin_trylock_bh(lock) ({preempt_disable(); local_bh_disable(); \ | 249 | #define _spin_trylock_bh(lock) ({preempt_disable(); local_bh_disable(); \ |
250 | _raw_spin_trylock(lock) ? \ | 250 | _raw_spin_trylock(lock) ? \ |
251 | 1 : ({preempt_enable(); local_bh_enable(); 0;});}) | 251 | 1 : ({preempt_enable_no_resched(); local_bh_enable(); 0;});}) |
252 | 252 | ||
253 | #define _spin_lock(lock) \ | 253 | #define _spin_lock(lock) \ |
254 | do { \ | 254 | do { \ |
@@ -383,7 +383,7 @@ do { \ | |||
383 | #define _spin_unlock_bh(lock) \ | 383 | #define _spin_unlock_bh(lock) \ |
384 | do { \ | 384 | do { \ |
385 | _raw_spin_unlock(lock); \ | 385 | _raw_spin_unlock(lock); \ |
386 | preempt_enable(); \ | 386 | preempt_enable_no_resched(); \ |
387 | local_bh_enable(); \ | 387 | local_bh_enable(); \ |
388 | __release(lock); \ | 388 | __release(lock); \ |
389 | } while (0) | 389 | } while (0) |
@@ -391,7 +391,7 @@ do { \ | |||
391 | #define _write_unlock_bh(lock) \ | 391 | #define _write_unlock_bh(lock) \ |
392 | do { \ | 392 | do { \ |
393 | _raw_write_unlock(lock); \ | 393 | _raw_write_unlock(lock); \ |
394 | preempt_enable(); \ | 394 | preempt_enable_no_resched(); \ |
395 | local_bh_enable(); \ | 395 | local_bh_enable(); \ |
396 | __release(lock); \ | 396 | __release(lock); \ |
397 | } while (0) | 397 | } while (0) |
@@ -423,8 +423,8 @@ do { \ | |||
423 | #define _read_unlock_bh(lock) \ | 423 | #define _read_unlock_bh(lock) \ |
424 | do { \ | 424 | do { \ |
425 | _raw_read_unlock(lock); \ | 425 | _raw_read_unlock(lock); \ |
426 | preempt_enable_no_resched(); \ | ||
426 | local_bh_enable(); \ | 427 | local_bh_enable(); \ |
427 | preempt_enable(); \ | ||
428 | __release(lock); \ | 428 | __release(lock); \ |
429 | } while (0) | 429 | } while (0) |
430 | 430 | ||
diff --git a/kernel/spinlock.c b/kernel/spinlock.c index e15ed17863f1..0c3f9d8bbe17 100644 --- a/kernel/spinlock.c +++ b/kernel/spinlock.c | |||
@@ -294,7 +294,7 @@ EXPORT_SYMBOL(_spin_unlock_irq); | |||
294 | void __lockfunc _spin_unlock_bh(spinlock_t *lock) | 294 | void __lockfunc _spin_unlock_bh(spinlock_t *lock) |
295 | { | 295 | { |
296 | _raw_spin_unlock(lock); | 296 | _raw_spin_unlock(lock); |
297 | preempt_enable(); | 297 | preempt_enable_no_resched(); |
298 | local_bh_enable(); | 298 | local_bh_enable(); |
299 | } | 299 | } |
300 | EXPORT_SYMBOL(_spin_unlock_bh); | 300 | EXPORT_SYMBOL(_spin_unlock_bh); |
@@ -318,7 +318,7 @@ EXPORT_SYMBOL(_read_unlock_irq); | |||
318 | void __lockfunc _read_unlock_bh(rwlock_t *lock) | 318 | void __lockfunc _read_unlock_bh(rwlock_t *lock) |
319 | { | 319 | { |
320 | _raw_read_unlock(lock); | 320 | _raw_read_unlock(lock); |
321 | preempt_enable(); | 321 | preempt_enable_no_resched(); |
322 | local_bh_enable(); | 322 | local_bh_enable(); |
323 | } | 323 | } |
324 | EXPORT_SYMBOL(_read_unlock_bh); | 324 | EXPORT_SYMBOL(_read_unlock_bh); |
@@ -342,7 +342,7 @@ EXPORT_SYMBOL(_write_unlock_irq); | |||
342 | void __lockfunc _write_unlock_bh(rwlock_t *lock) | 342 | void __lockfunc _write_unlock_bh(rwlock_t *lock) |
343 | { | 343 | { |
344 | _raw_write_unlock(lock); | 344 | _raw_write_unlock(lock); |
345 | preempt_enable(); | 345 | preempt_enable_no_resched(); |
346 | local_bh_enable(); | 346 | local_bh_enable(); |
347 | } | 347 | } |
348 | EXPORT_SYMBOL(_write_unlock_bh); | 348 | EXPORT_SYMBOL(_write_unlock_bh); |
@@ -354,7 +354,7 @@ int __lockfunc _spin_trylock_bh(spinlock_t *lock) | |||
354 | if (_raw_spin_trylock(lock)) | 354 | if (_raw_spin_trylock(lock)) |
355 | return 1; | 355 | return 1; |
356 | 356 | ||
357 | preempt_enable(); | 357 | preempt_enable_no_resched(); |
358 | local_bh_enable(); | 358 | local_bh_enable(); |
359 | return 0; | 359 | return 0; |
360 | } | 360 | } |