public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Kunhua Huang <huangkunhua@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] serial: stm32: Automatically generate CR when LF is observed
Date: Wed, 13 May 2015 12:41:11 +0800	[thread overview]
Message-ID: <20150513044111.GA14404@kunhua.org> (raw)
In-Reply-To: <20150512215636.GD5729@bill-the-cat>

On Tue, May 12, 2015 at 05:56:36PM -0400, Tom Rini wrote:
> On Tue, May 12, 2015 at 10:35:55PM +0200, Kamil Lulko wrote:
>
> > Strange, this was already posted by Kunhua Huang - then reverted in
> > commit 698a12bef9e782dcd99c555a739c16eec8669f14. Anyway, yes this
> > carriage return should be added there. I simply forgot it since I had
> > implicit CR for each LF turned on in my terminal. Never thought this
> > would cause so much havoc for users ;)
>
> I reverted it since the author said it wasn't needed with the other
> patch they did being applied.  Daniel, can you confirm the odd behavior
> exists with top of tree? Thanks!
>
> --
> Tom

Sorry about my wrong expression.

In these two patch "[U-Boot] [PATCH v2] stm32f4: fix serial output"
and "[U-Boot] [PATCH v2] stm32f4: add serial print port"
, there are same and similar code as below.


In "[U-Boot] [PATCH v2] stm32f4: fix serial output" :

	struct stm32_serial *usart = (struct stm32_serial *)USART_BASE;
	+
	+	if (c == '\n')
	+		stm32_serial_putc('\r');
	+
	while ((readl(&usart->sr) & USART_SR_FLAG_TXE) == 0)
			;
	writel(c, &usart->dr);

In "[U-Boot] [PATCH v2] stm32f4: add serial print port" :

	-	struct stm32_serial *usart = (struct stm32_serial *)USART_BASE;
	+	struct stm32_serial *usart =
	+		(struct stm32_serial *)usart_base[USART_PORT];
	+
	+	if (c == '\n')
	+		stm32_serial_putc('\r');
	+
		while ((readl(&usart->sr) & USART_SR_FLAG_TXE) == 0)
				;
		writel(c, &usart->dr);

If these "two patch" patch at the same time, it may happened
conflict.

I have reply the mail in "[U-Boot] [U-Boot,v2] stm32f4: add serial print
port" as below,
>Sorry about the mistake of this patch.
>This patch has already include "[PATCH v2] stm32f4: fix serial output".
>If adopt this patch, patch "[PATCH v2] stm32f4: fix serial output" need
>to be discarded.

This means that "add serial print port" has already include
"stm32f4: fix serial output".
So, if patch "add serial print port", then patch "stm32f4: fix serial output"
should not be patch.

But patch these "two patch" and then revert it. It will cause the code
disappear.

Thanks to Daniel Thompson.

  reply	other threads:[~2015-05-13  4:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12 19:25 [U-Boot] [PATCH] serial: stm32: Automatically generate CR when LF is observed Daniel Thompson
2015-05-12 20:35 ` Kamil Lulko
2015-05-12 21:56   ` Tom Rini
2015-05-13  4:41     ` Kunhua Huang [this message]
2015-05-13 14:11     ` Daniel Thompson

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=20150513044111.GA14404@kunhua.org \
    --to=huangkunhua@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox