Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
d830fa45
Commit
d830fa45
authored
Dec 16, 2008
by
Paul Mundt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
serial: sh-sci: Tidy up fifo overrun error handling.
Signed-off-by:
Paul Mundt
<
lethal@linux-sh.org
>
parent
762c69e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
27 deletions
+29
-27
drivers/serial/sh-sci.c
drivers/serial/sh-sci.c
+24
-21
drivers/serial/sh-sci.h
drivers/serial/sh-sci.h
+5
-6
No files found.
drivers/serial/sh-sci.c
View file @
d830fa45
...
@@ -625,6 +625,27 @@ static inline int sci_handle_errors(struct uart_port *port)
...
@@ -625,6 +625,27 @@ static inline int sci_handle_errors(struct uart_port *port)
return
copied
;
return
copied
;
}
}
static
inline
int
sci_handle_fifo_overrun
(
struct
uart_port
*
port
)
{
struct
tty_struct
*
tty
=
port
->
info
->
port
.
tty
;
int
copied
=
0
;
if
(
port
->
type
!=
PORT_SCIF
)
return
0
;
if
((
sci_in
(
port
,
SCLSR
)
&
SCIF_ORER
)
!=
0
)
{
sci_out
(
port
,
SCLSR
,
0
);
tty_insert_flip_char
(
tty
,
0
,
TTY_OVERRUN
);
tty_flip_buffer_push
(
tty
);
dev_notice
(
port
->
dev
,
"overrun error
\n
"
);
copied
++
;
}
return
copied
;
}
static
inline
int
sci_handle_breaks
(
struct
uart_port
*
port
)
static
inline
int
sci_handle_breaks
(
struct
uart_port
*
port
)
{
{
int
copied
=
0
;
int
copied
=
0
;
...
@@ -647,20 +668,11 @@ static inline int sci_handle_breaks(struct uart_port *port)
...
@@ -647,20 +668,11 @@ static inline int sci_handle_breaks(struct uart_port *port)
dev_dbg
(
port
->
dev
,
"BREAK detected
\n
"
);
dev_dbg
(
port
->
dev
,
"BREAK detected
\n
"
);
}
}
#if defined(SCIF_ORER)
/* XXX: Handle SCIF overrun error */
if
(
port
->
type
!=
PORT_SCI
&&
(
sci_in
(
port
,
SCLSR
)
&
SCIF_ORER
)
!=
0
)
{
sci_out
(
port
,
SCLSR
,
0
);
if
(
tty_insert_flip_char
(
tty
,
0
,
TTY_OVERRUN
))
{
copied
++
;
dev_notice
(
port
->
dev
,
"overrun error
\n
"
);
}
}
#endif
if
(
copied
)
if
(
copied
)
tty_flip_buffer_push
(
tty
);
tty_flip_buffer_push
(
tty
);
copied
+=
sci_handle_fifo_overrun
(
port
);
return
copied
;
return
copied
;
}
}
...
@@ -698,16 +710,7 @@ static irqreturn_t sci_er_interrupt(int irq, void *ptr)
...
@@ -698,16 +710,7 @@ static irqreturn_t sci_er_interrupt(int irq, void *ptr)
sci_out
(
port
,
SCxSR
,
SCxSR_RDxF_CLEAR
(
port
));
sci_out
(
port
,
SCxSR
,
SCxSR_RDxF_CLEAR
(
port
));
}
}
}
else
{
}
else
{
#if defined(SCIF_ORER)
sci_handle_fifo_overrun
(
port
);
if
((
sci_in
(
port
,
SCLSR
)
&
SCIF_ORER
)
!=
0
)
{
struct
tty_struct
*
tty
=
port
->
info
->
port
.
tty
;
sci_out
(
port
,
SCLSR
,
0
);
tty_insert_flip_char
(
tty
,
0
,
TTY_OVERRUN
);
tty_flip_buffer_push
(
tty
);
dev_notice
(
port
->
dev
,
"overrun error
\n
"
);
}
#endif
sci_rx_interrupt
(
irq
,
ptr
);
sci_rx_interrupt
(
irq
,
ptr
);
}
}
...
...
drivers/serial/sh-sci.h
View file @
d830fa45
...
@@ -232,6 +232,10 @@
...
@@ -232,6 +232,10 @@
# define SCIF_TXROOM_MAX 16
# define SCIF_TXROOM_MAX 16
#endif
#endif
#ifndef SCIF_ORER
#define SCIF_ORER 0x0000
#endif
#define SCxSR_TEND(port) (((port)->type == PORT_SCI) ? SCI_TEND : SCIF_TEND)
#define SCxSR_TEND(port) (((port)->type == PORT_SCI) ? SCI_TEND : SCIF_TEND)
#define SCxSR_ERRORS(port) (((port)->type == PORT_SCI) ? SCI_ERRORS : SCIF_ERRORS)
#define SCxSR_ERRORS(port) (((port)->type == PORT_SCI) ? SCI_ERRORS : SCIF_ERRORS)
#define SCxSR_RDxF(port) (((port)->type == PORT_SCI) ? SCI_RDRF : SCIF_RDF)
#define SCxSR_RDxF(port) (((port)->type == PORT_SCI) ? SCI_RDRF : SCIF_RDF)
...
@@ -239,12 +243,7 @@
...
@@ -239,12 +243,7 @@
#define SCxSR_FER(port) (((port)->type == PORT_SCI) ? SCI_FER : SCIF_FER)
#define SCxSR_FER(port) (((port)->type == PORT_SCI) ? SCI_FER : SCIF_FER)
#define SCxSR_PER(port) (((port)->type == PORT_SCI) ? SCI_PER : SCIF_PER)
#define SCxSR_PER(port) (((port)->type == PORT_SCI) ? SCI_PER : SCIF_PER)
#define SCxSR_BRK(port) (((port)->type == PORT_SCI) ? 0x00 : SCIF_BRK)
#define SCxSR_BRK(port) (((port)->type == PORT_SCI) ? 0x00 : SCIF_BRK)
#define SCxSR_ORER(port) (((port)->type == PORT_SCI) ? SCI_ORER : SCIF_ORER)
#if defined(CONFIG_CPU_SUBTYPE_SH7705)
# define SCxSR_ORER(port) (((port)->type == PORT_SCI) ? SCI_ORER : SCIF_ORER)
#else
# define SCxSR_ORER(port) (((port)->type == PORT_SCI) ? SCI_ORER : 0x0000)
#endif
#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
defined(CONFIG_CPU_SUBTYPE_SH7720) || \
defined(CONFIG_CPU_SUBTYPE_SH7720) || \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment