024-bugfix-serial-register-status.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. Index: linux-2.6.21.7/drivers/serial/pxa.c
  2. ===================================================================
  3. --- linux-2.6.21.7.orig/drivers/serial/pxa.c
  4. +++ linux-2.6.21.7/drivers/serial/pxa.c
  5. @@ -57,6 +57,8 @@ struct uart_pxa_port {
  6. unsigned int lsr_break_flag;
  7. unsigned int cken;
  8. char *name;
  9. + unsigned int msr;
  10. + unsigned int lsr;
  11. };
  12. static inline unsigned int serial_in(struct uart_pxa_port *up, int offset)
  13. @@ -159,6 +161,7 @@ static inline void receive_chars(struct
  14. ignore_char:
  15. *status = serial_in(up, UART_LSR);
  16. + up->lsr = *status;
  17. } while ((*status & UART_LSR_DR) && (max_count-- > 0));
  18. tty_flip_buffer_push(tty);
  19. }
  20. @@ -211,7 +214,7 @@ static inline void check_modem_status(st
  21. int status;
  22. status = serial_in(up, UART_MSR);
  23. -
  24. + up->msr = status;
  25. if ((status & UART_MSR_ANY_DELTA) == 0)
  26. return;
  27. @@ -242,6 +245,7 @@ static inline irqreturn_t serial_pxa_irq
  28. //printk(KERN_WARNING "serial_pxa_irq: odd -- interrupt triggered, but no interrupt in IIR: %08x\n",iir);
  29. }
  30. lsr = serial_in(up, UART_LSR);
  31. + up->lsr = lsr;
  32. if (lsr & UART_LSR_DR)
  33. receive_chars(up, &lsr);
  34. check_modem_status(up);
  35. @@ -258,7 +262,7 @@ static unsigned int serial_pxa_tx_empty(
  36. unsigned int ret;
  37. spin_lock_irqsave(&up->port.lock, flags);
  38. - ret = serial_in(up, UART_LSR) & UART_LSR_TEMT ? TIOCSER_TEMT : 0;
  39. + ret = up->lsr & UART_LSR_TEMT ? TIOCSER_TEMT : 0;
  40. spin_unlock_irqrestore(&up->port.lock, flags);
  41. return ret;
  42. @@ -270,7 +274,7 @@ static unsigned int serial_pxa_get_mctrl
  43. unsigned char status;
  44. unsigned int ret;
  45. - status = serial_in(up, UART_MSR);
  46. + status = up->msr;
  47. ret = 0;
  48. if (status & UART_MSR_DCD)
  49. @@ -400,10 +404,10 @@ static int serial_pxa_startup(struct uar
  50. /*
  51. * And clear the interrupt registers again for luck.
  52. */
  53. - (void) serial_in(up, UART_LSR);
  54. + up->lsr = serial_in(up, UART_LSR);
  55. (void) serial_in(up, UART_RX);
  56. (void) serial_in(up, UART_IIR);
  57. - (void) serial_in(up, UART_MSR);
  58. + up->msr = serial_in(up, UART_MSR);
  59. return 0;
  60. }