* [PATCH] ppc32: Fix SCC Uart write problem after 2. open()
@ 2005-10-31 10:53 Heiko Schocher
0 siblings, 0 replies; 4+ messages in thread
From: Heiko Schocher @ 2005-10-31 10:53 UTC (permalink / raw)
To: linuxppc-dev
Hello,
on a MPC8260 based Board, i succesfully wrote chars
over a SCC in UART Mode, but after i closed the port
and opened it again, the write() call failed!
(cpm_uart_tx_empty()returns continually 0).
The following Patch will fix this problem.
thanks
Heiko Schocher
---
drivers/serial/cpm_uart/cpm_uart_core.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c
b/drivers/serial/cpm_uart/cpm_uart_core.c
index 25825f2..4c3ea05 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -445,6 +445,10 @@ static void cpm_uart_shutdown(struct uar
/* Shut them really down and reinit buffer descriptors */
cpm_line_cr_cmd(line, CPM_CR_STOP_TX);
cpm_uart_initbd(pinfo);
+ if (IS_SMC(pinfo))
+ cpm_uart_init_smc(pinfo);
+ else
+ cpm_uart_init_scc(pinfo);
}
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ppc32: Fix SCC Uart write problem after 2. open()
@ 2005-11-01 7:17 Heiko Schocher
2005-11-01 16:08 ` Dan Malek
0 siblings, 1 reply; 4+ messages in thread
From: Heiko Schocher @ 2005-11-01 7:17 UTC (permalink / raw)
To: linuxppc-dev
Hello,
Sorry, here comes the resubmit of the Patch because
corruption of whitespaces.
on a MPC8260 based Board, i succesfully wrote chars
over a SCC in UART Mode, but after i closed the port
and opened it again, the write() call failed!
(cpm_uart_tx_empty()returns continually 0).
The following Patch will fix this problem.
thanks
Heiko Schocher
[PATCH] ppc32: Fix SCC Uart write problem after 2. open().
Signed-off-by: Heiko Schocher <hs@denx•de>
---
commit f27d5789521e3f70a293075a63d195b22f8156ed
tree 1b459d4a9a2795e39e1d415ff21f2a25a0d0fbe5
parent d2fcbaa6d5fcb3c1f80c98997dbcf6f6ee075f1b
author Heiko Schocher <hs@pollux.(none)> Mon, 31 Oct 2005 15:46:50 +0100
committer Heiko Schocher <hs@pollux.(none)> Mon, 31 Oct 2005 15:46:50 +0100
drivers/serial/cpm_uart/cpm_uart_core.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c
b/drivers/serial/cpm_uart/cpm_uart_core.c
index a452c38..ac05ee9 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -445,6 +445,10 @@ static void cpm_uart_shutdown(struct uar
/* Shut them really down and reinit buffer descriptors */
cpm_line_cr_cmd(line, CPM_CR_STOP_TX);
cpm_uart_initbd(pinfo);
+ if (IS_SMC(pinfo))
+ cpm_uart_init_smc(pinfo);
+ else
+ cpm_uart_init_scc(pinfo);
}
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ppc32: Fix SCC Uart write problem after 2. open()
2005-11-01 7:17 [PATCH] ppc32: Fix SCC Uart write problem after 2. open() Heiko Schocher
@ 2005-11-01 16:08 ` Dan Malek
2005-11-03 18:37 ` Heiko Schocher
0 siblings, 1 reply; 4+ messages in thread
From: Dan Malek @ 2005-11-01 16:08 UTC (permalink / raw)
To: hs; +Cc: linuxppc-dev@ozlabs•org list
On Nov 1, 2005, at 2:17 AM, Heiko Schocher wrote:
> The following Patch will fix this problem.
This is wrong. We should never have to reinitialize the
buffer descriptors (which I see the driver does in some cases)
and we certainly should never have to reinitialize the
SCC or SMC peripherals like this.
Once the driver has initialized the SCC or SMC and set up
the buffer descriptors during kernel start up, it should never
be done again. The only thing we should do is stop/start
the transmitter or receiver, and they should continue operation
with the next buffer descriptor in the ring.
This patch just covers up a driver bug, find and fix the real bug.
Thanks.
-- Dan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ppc32: Fix SCC Uart write problem after 2. open()
2005-11-01 16:08 ` Dan Malek
@ 2005-11-03 18:37 ` Heiko Schocher
0 siblings, 0 replies; 4+ messages in thread
From: Heiko Schocher @ 2005-11-03 18:37 UTC (permalink / raw)
To: Dan Malek; +Cc: linuxppc-dev
Hello,
On Wed Nov 2 03:08:30 EST 2005 Dan Malek wrote:
>> The following Patch will fix this problem.
> This patch just covers up a driver bug, find and fix the real bug.
i think i found it.
Please have a look at the following patch against current Linux 2.6
tree.
thanks
Heiko Schocher
[PATCH] ppc32: update fix: SCC write after 2nd open().
we never reinitialize the buffer descriptor or the
SCC.
Signed-off-by: Heiko Schocher <hs@denx•de>
---
drivers/serial/cpm_uart/cpm_uart_core.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c
b/drivers/serial/cpm_uart/cpm_uart_core.c
index 25825f2..e03369c 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -163,7 +163,6 @@ static void cpm_uart_start_tx(struct uar
smcp->smc_smcmr |= SMCMR_TEN;
} else {
sccp->scc_sccm |= UART_SCCM_TX;
- pinfo->sccp->scc_gsmrl |= SCC_GSMRL_ENT;
}
}
}
@@ -397,7 +396,7 @@ static int cpm_uart_startup(struct uart_
}
if (!(pinfo->flags & FLAG_CONSOLE))
- cpm_line_cr_cmd(line,CPM_CR_INIT_TRX);
+ cpm_line_cr_cmd(line,CPM_CR_RESTART_TX);
return 0;
}
@@ -442,9 +441,8 @@ static void cpm_uart_shutdown(struct uar
sccp->scc_sccm &= ~(UART_SCCM_TX | UART_SCCM_RX);
}
- /* Shut them really down and reinit buffer descriptors */
+ /* Shut them really down */
cpm_line_cr_cmd(line, CPM_CR_STOP_TX);
- cpm_uart_initbd(pinfo);
}
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-11-03 18:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-01 7:17 [PATCH] ppc32: Fix SCC Uart write problem after 2. open() Heiko Schocher
2005-11-01 16:08 ` Dan Malek
2005-11-03 18:37 ` Heiko Schocher
-- strict thread matches above, loose matches on Subject: below --
2005-10-31 10:53 Heiko Schocher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox