From: "Mukesh, Savaliya" <msavaliy@codeaurora.org>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: akashast@codeaurora.org, linux-serial@vger.kernel.org,
saravanak@google.com, sspatil@google.com, tkjos@google.com
Subject: Re: [PATCH V2] serial: msm_geni_serial_console : Add Earlycon support
Date: Thu, 14 May 2020 19:03:18 +0530 [thread overview]
Message-ID: <572765da-6dae-3056-3fc2-188b92291777@codeaurora.org> (raw)
In-Reply-To: <20200506120532.GB3047211@kroah.com>
On 5/6/2020 5:35 PM, Greg KH wrote:
> On Wed, May 06, 2020 at 05:03:31PM +0530, Mukesh, Savaliya wrote:
>> + /*
>> + * If the WM bit never set, then the Tx state machine is not
>> + * in a valid state, so break, cancel/abort any existing
>> + * command. Unfortunately the current data being written is
>> + * lost.
>> + */
>> + while (!msm_geni_serial_poll_bit(uport, SE_GENI_M_IRQ_STATUS,
>> + M_TX_FIFO_WATERMARK_EN, true))
>> + break;
> Am I reading this correctly in that if the bit is set properly, you will
> just loop for forever?
>
> That feels wrong, are you sure this is correct?
It seems correct to me. The API returns true if function sees the BIT is
set else returns false.
Mostly it's true and returns true, hence it shouldn't loop.
>
>> + chars_to_write = min((unsigned int)(count - i),
>> + avail_fifo_bytes);
>> + if ((chars_to_write << 1) > avail_fifo_bytes)
>> + chars_to_write = (avail_fifo_bytes >> 1);
>> + uart_console_write(uport, (s + i), chars_to_write,
>> + msm_geni_serial_wr_char);
>> + writel_relaxed(M_TX_FIFO_WATERMARK_EN,
>> + uport->membase+SE_GENI_M_IRQ_CLEAR);
>> + /* Ensure this goes through before polling for WM IRQ again.*/
>> + mb();
> Again, writel() on its own should be fine here, and elsewhere.
Removed mb() from whole file as _relaxed takes care of it.
>
> thanks,
>
> greg k-h
next prev parent reply other threads:[~2020-05-14 13:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-06 11:33 [PATCH V2] serial: msm_geni_serial_console : Add Earlycon support Mukesh, Savaliya
2020-05-06 12:02 ` Greg KH
2020-05-06 12:48 ` Will Deacon
2020-05-06 12:59 ` Greg KH
2020-05-14 13:33 ` Mukesh, Savaliya
2020-05-14 13:32 ` Mukesh, Savaliya
2020-05-14 14:02 ` Greg KH
2020-05-06 12:05 ` Greg KH
2020-05-14 13:33 ` Mukesh, Savaliya [this message]
2020-05-14 14:02 ` Greg KH
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=572765da-6dae-3056-3fc2-188b92291777@codeaurora.org \
--to=msavaliy@codeaurora.org \
--cc=akashast@codeaurora.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-serial@vger.kernel.org \
--cc=saravanak@google.com \
--cc=sspatil@google.com \
--cc=tkjos@google.com \
/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;
as well as URLs for NNTP newsgroup(s).