aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-11-15 15:10:32 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-11-15 15:10:32 -0500
commit537a2f889ac847468c9aa040910c247b218302a7 (patch)
treeea21b1dfd11e4234b108059c84c2a42887dc9254 /drivers
parentfab349cceb25f92bac1400601c5ef8345a166958 (diff)
parent272966c070237c8cb540fe67e06df51bc6ea9cc2 (diff)
Merge branch 'sh/for-2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* 'sh/for-2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: serial: sh-sci: Reorder the SCxTDR write after the TDxE clear. sh: __copy_user function can corrupt the stack in case of exception sh: Fixed the TMU0 reload value on resume sh: Don't factor in PAGE_OFFSET for valid_phys_addr_range() check. sh: early printk port type fix i2c: fix i2c-sh_mobile rx underrun sh: Provide a sane valid_phys_addr_range() to prevent TLB reset with PMB. usb: r8a66597-hcd: fix wrong data access in SuperH on-chip USB fix sci type for SH7723 serial: sh-sci: fix cannot work SH7723 SCIFA sh: Handle fixmap TLB eviction more coherently.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-sh_mobile.c3
-rw-r--r--drivers/serial/sh-sci.c22
-rw-r--r--drivers/serial/sh-sci.h16
3 files changed, 22 insertions, 19 deletions
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index 640cbb237328..3384a717fec0 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -318,7 +318,8 @@ static int sh_mobile_i2c_isr_rx(struct sh_mobile_i2c_data *pd)
318 } else 318 } else
319 data = i2c_op(pd, OP_RX, 0); 319 data = i2c_op(pd, OP_RX, 0);
320 320
321 pd->msg->buf[real_pos] = data; 321 if (real_pos >= 0)
322 pd->msg->buf[real_pos] = data;
322 } while (0); 323 } while (0);
323 324
324 pd->pos++; 325 pd->pos++;
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index 5c0f32c7fbf6..165fc010978c 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -144,9 +144,9 @@ static void put_char(struct uart_port *port, char c)
144 status = sci_in(port, SCxSR); 144 status = sci_in(port, SCxSR);
145 } while (!(status & SCxSR_TDxE(port))); 145 } while (!(status & SCxSR_TDxE(port)));
146 146
147 sci_out(port, SCxTDR, c);
148 sci_in(port, SCxSR); /* Dummy read */ 147 sci_in(port, SCxSR); /* Dummy read */
149 sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); 148 sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port));
149 sci_out(port, SCxTDR, c);
150 150
151 spin_unlock_irqrestore(&port->lock, flags); 151 spin_unlock_irqrestore(&port->lock, flags);
152} 152}
@@ -478,10 +478,10 @@ static void sci_transmit_chars(struct uart_port *port)
478 return; 478 return;
479 } 479 }
480 480
481 if (port->type == PORT_SCIF) 481 if (port->type == PORT_SCI)
482 count = scif_txroom(port);
483 else
484 count = sci_txroom(port); 482 count = sci_txroom(port);
483 else
484 count = scif_txroom(port);
485 485
486 do { 486 do {
487 unsigned char c; 487 unsigned char c;
@@ -510,7 +510,7 @@ static void sci_transmit_chars(struct uart_port *port)
510 } else { 510 } else {
511 ctrl = sci_in(port, SCSCR); 511 ctrl = sci_in(port, SCSCR);
512 512
513 if (port->type == PORT_SCIF) { 513 if (port->type != PORT_SCI) {
514 sci_in(port, SCxSR); /* Dummy read */ 514 sci_in(port, SCxSR); /* Dummy read */
515 sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); 515 sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port));
516 } 516 }
@@ -536,10 +536,10 @@ static inline void sci_receive_chars(struct uart_port *port)
536 return; 536 return;
537 537
538 while (1) { 538 while (1) {
539 if (port->type == PORT_SCIF) 539 if (port->type == PORT_SCI)
540 count = scif_rxroom(port);
541 else
542 count = sci_rxroom(port); 540 count = sci_rxroom(port);
541 else
542 count = scif_rxroom(port);
543 543
544 /* Don't copy more bytes than there is room for in the buffer */ 544 /* Don't copy more bytes than there is room for in the buffer */
545 count = tty_buffer_request_room(tty, count); 545 count = tty_buffer_request_room(tty, count);
@@ -714,7 +714,7 @@ static inline int sci_handle_breaks(struct uart_port *port)
714 714
715#if defined(SCIF_ORER) 715#if defined(SCIF_ORER)
716 /* XXX: Handle SCIF overrun error */ 716 /* XXX: Handle SCIF overrun error */
717 if (port->type == PORT_SCIF && (sci_in(port, SCLSR) & SCIF_ORER) != 0) { 717 if (port->type != PORT_SCI && (sci_in(port, SCLSR) & SCIF_ORER) != 0) {
718 sci_out(port, SCLSR, 0); 718 sci_out(port, SCLSR, 0);
719 if (tty_insert_flip_char(tty, 0, TTY_OVERRUN)) { 719 if (tty_insert_flip_char(tty, 0, TTY_OVERRUN)) {
720 copied++; 720 copied++;
@@ -1042,7 +1042,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
1042 1042
1043 sci_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */ 1043 sci_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */
1044 1044
1045 if (port->type == PORT_SCIF) 1045 if (port->type != PORT_SCI)
1046 sci_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST); 1046 sci_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST);
1047 1047
1048 smr_val = sci_in(port, SCSMR) & 3; 1048 smr_val = sci_in(port, SCSMR) & 3;
@@ -1085,6 +1085,7 @@ static const char *sci_type(struct uart_port *port)
1085 case PORT_SCI: return "sci"; 1085 case PORT_SCI: return "sci";
1086 case PORT_SCIF: return "scif"; 1086 case PORT_SCIF: return "scif";
1087 case PORT_IRDA: return "irda"; 1087 case PORT_IRDA: return "irda";
1088 case PORT_SCIFA: return "scifa";
1088 } 1089 }
1089 1090
1090 return NULL; 1091 return NULL;
@@ -1112,6 +1113,7 @@ static void sci_config_port(struct uart_port *port, int flags)
1112 s->init_pins = sci_init_pins_sci; 1113 s->init_pins = sci_init_pins_sci;
1113 break; 1114 break;
1114 case PORT_SCIF: 1115 case PORT_SCIF:
1116 case PORT_SCIFA:
1115 s->init_pins = sci_init_pins_scif; 1117 s->init_pins = sci_init_pins_scif;
1116 break; 1118 break;
1117 case PORT_IRDA: 1119 case PORT_IRDA:
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h
index 6163a45f968f..9f33b064172e 100644
--- a/drivers/serial/sh-sci.h
+++ b/drivers/serial/sh-sci.h
@@ -289,18 +289,18 @@
289#define CPU_SCIx_FNS(name, sci_offset, sci_size, scif_offset, scif_size)\ 289#define CPU_SCIx_FNS(name, sci_offset, sci_size, scif_offset, scif_size)\
290 static inline unsigned int sci_##name##_in(struct uart_port *port) \ 290 static inline unsigned int sci_##name##_in(struct uart_port *port) \
291 { \ 291 { \
292 if (port->type == PORT_SCI) { \ 292 if (port->type == PORT_SCIF) { \
293 SCI_IN(sci_size, sci_offset) \ 293 SCI_IN(scif_size, scif_offset) \
294 } else { \ 294 } else { /* PORT_SCI or PORT_SCIFA */ \
295 SCI_IN(scif_size, scif_offset); \ 295 SCI_IN(sci_size, sci_offset); \
296 } \ 296 } \
297 } \ 297 } \
298 static inline void sci_##name##_out(struct uart_port *port, unsigned int value) \ 298 static inline void sci_##name##_out(struct uart_port *port, unsigned int value) \
299 { \ 299 { \
300 if (port->type == PORT_SCI) { \ 300 if (port->type == PORT_SCIF) { \
301 SCI_OUT(sci_size, sci_offset, value) \ 301 SCI_OUT(scif_size, scif_offset, value) \
302 } else { \ 302 } else { /* PORT_SCI or PORT_SCIFA */ \
303 SCI_OUT(scif_size, scif_offset, value); \ 303 SCI_OUT(sci_size, sci_offset, value); \
304 } \ 304 } \
305 } 305 }
306 306