From: Nish Aravamudan <nish.aravamudan@gmail.com>
To: Kumar Gala <galak@freescale.com>
Cc: Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org,
linuxppc-embedded <linuxppc-embedded@ozlabs.org>
Subject: Re: [PATCH] cpm_uart: Fix dpram allocation and non-console uarts
Date: Wed, 17 Aug 2005 22:42:36 -0700 [thread overview]
Message-ID: <29495f1d0508172242734e1c99@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0508082239180.5117@nylon.am.freescale.net>
On 8/8/05, Kumar Gala <galak@freescale.com> wrote:
> (A believe Marcelo would like to see this in 2.6.13, but I'll let him
> fight over that ;)
>=20
> * Makes dpram allocations work
> * Makes non-console UART work on both 8xx and 82xx
> * Fixed whitespace in files that were touched
>=20
> Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
> Signed-off-by: Pantelis Antoniou <panto@intracom.gr>
> Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
>=20
> ---
> commit 1de80554bcae877dce3b6d878053eb092ef65c72
> tree aba124824607fea1070e86501ddccc9decce362d
> parent ad81111fd554c9d3c14c0a50885e076af2f9ac9b
> author Kumar K. Gala <kumar.gala@freescale.com> Mon, 08 Aug 2005 22:35:39=
-0500
> committer Kumar K. Gala <kumar.gala@freescale.com> Mon, 08 Aug 2005 22:35=
:39 -0500
<snip>
> diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm=
_uart/cpm_uart_core.c
> --- a/drivers/serial/cpm_uart/cpm_uart_core.c
> +++ b/drivers/serial/cpm_uart/cpm_uart_core.c
<snip>
> @@ -376,9 +396,19 @@ static int cpm_uart_startup(struct uart_
> pinfo->sccp->scc_sccm |=3D UART_SCCM_RX;
> }
>=20
> + if (!(pinfo->flags & FLAG_CONSOLE))
> + cpm_line_cr_cmd(line,CPM_CR_INIT_TRX);
> return 0;
> }
>=20
> +inline void cpm_uart_wait_until_send(struct uart_cpm_port *pinfo)
> +{
> + unsigned long target_jiffies =3D jiffies + pinfo->wait_closing;
> +
> + while (!time_after(jiffies, target_jiffies))
> + schedule();
> +}
Not sure about that call here. Does the state need to be set so that
you won't be run again immediately? In any case, I think direct
schedule() callers are discouraged? Do you want to call a yield() or
schedule_timeout({0,1}) instead maybe?
> /*
> * Shutdown the uart
> */
> @@ -394,6 +424,12 @@ static void cpm_uart_shutdown(struct uar
>=20
> /* If the port is not the console, disable Rx and Tx. */
> if (!(pinfo->flags & FLAG_CONSOLE)) {
> + /* Wait for all the BDs marked sent */
> + while(!cpm_uart_tx_empty(port))
> + schedule_timeout(2);
<snip>
I think you are using 2 jiffies to guarantee that at least one jiffy
elapses, which is fine. But, if you do not set the state beforehand,
schedule_timeout() returns immediately, so you have a busy-wait here.
Thanks,
Nish
WARNING: multiple messages have this Message-ID (diff)
From: Nish Aravamudan <nish.aravamudan@gmail.com>
To: Kumar Gala <galak@freescale.com>
Cc: Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org,
linuxppc-embedded <linuxppc-embedded@ozlabs.org>,
vbordug@ru.mvista.com, panto@intracom.gr,
marcelo.tosatti@cyclades.com
Subject: Re: [PATCH] cpm_uart: Fix dpram allocation and non-console uarts
Date: Wed, 17 Aug 2005 22:42:36 -0700 [thread overview]
Message-ID: <29495f1d0508172242734e1c99@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0508082239180.5117@nylon.am.freescale.net>
On 8/8/05, Kumar Gala <galak@freescale.com> wrote:
> (A believe Marcelo would like to see this in 2.6.13, but I'll let him
> fight over that ;)
>
> * Makes dpram allocations work
> * Makes non-console UART work on both 8xx and 82xx
> * Fixed whitespace in files that were touched
>
> Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
> Signed-off-by: Pantelis Antoniou <panto@intracom.gr>
> Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
>
> ---
> commit 1de80554bcae877dce3b6d878053eb092ef65c72
> tree aba124824607fea1070e86501ddccc9decce362d
> parent ad81111fd554c9d3c14c0a50885e076af2f9ac9b
> author Kumar K. Gala <kumar.gala@freescale.com> Mon, 08 Aug 2005 22:35:39 -0500
> committer Kumar K. Gala <kumar.gala@freescale.com> Mon, 08 Aug 2005 22:35:39 -0500
<snip>
> diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
> --- a/drivers/serial/cpm_uart/cpm_uart_core.c
> +++ b/drivers/serial/cpm_uart/cpm_uart_core.c
<snip>
> @@ -376,9 +396,19 @@ static int cpm_uart_startup(struct uart_
> pinfo->sccp->scc_sccm |= UART_SCCM_RX;
> }
>
> + if (!(pinfo->flags & FLAG_CONSOLE))
> + cpm_line_cr_cmd(line,CPM_CR_INIT_TRX);
> return 0;
> }
>
> +inline void cpm_uart_wait_until_send(struct uart_cpm_port *pinfo)
> +{
> + unsigned long target_jiffies = jiffies + pinfo->wait_closing;
> +
> + while (!time_after(jiffies, target_jiffies))
> + schedule();
> +}
Not sure about that call here. Does the state need to be set so that
you won't be run again immediately? In any case, I think direct
schedule() callers are discouraged? Do you want to call a yield() or
schedule_timeout({0,1}) instead maybe?
> /*
> * Shutdown the uart
> */
> @@ -394,6 +424,12 @@ static void cpm_uart_shutdown(struct uar
>
> /* If the port is not the console, disable Rx and Tx. */
> if (!(pinfo->flags & FLAG_CONSOLE)) {
> + /* Wait for all the BDs marked sent */
> + while(!cpm_uart_tx_empty(port))
> + schedule_timeout(2);
<snip>
I think you are using 2 jiffies to guarantee that at least one jiffy
elapses, which is fine. But, if you do not set the state beforehand,
schedule_timeout() returns immediately, so you have a busy-wait here.
Thanks,
Nish
next prev parent reply other threads:[~2005-08-18 5:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-09 3:40 [PATCH] cpm_uart: Fix dpram allocation and non-console uarts Kumar Gala
2005-08-09 3:40 ` Kumar Gala
2005-08-18 5:42 ` Nish Aravamudan [this message]
2005-08-18 5:42 ` Nish Aravamudan
2005-08-21 21:12 ` Marcelo Tosatti
2005-08-21 21:12 ` Marcelo Tosatti
2005-08-22 4:14 ` Nishanth Aravamudan
2005-08-22 4:14 ` Nishanth Aravamudan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=29495f1d0508172242734e1c99@mail.gmail.com \
--to=nish.aravamudan@gmail.com \
--cc=akpm@osdl.org \
--cc=galak@freescale.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-embedded@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.