linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Akash Asthana <akashast@codeaurora.org>
To: Paras Sharma <parashar@codeaurora.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>,
	linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V4] serial: qcom_geni_serial: To correct QUP Version detection logic
Date: Tue, 15 Sep 2020 18:09:06 +0530	[thread overview]
Message-ID: <6662d92f-5b68-527a-cfb1-9c407c338953@codeaurora.org> (raw)
In-Reply-To: <1600067957-8216-1-git-send-email-parashar@codeaurora.org>

Hi Paras,

On 9/14/2020 12:49 PM, Paras Sharma wrote:
> The current implementation reduces the sampling rate by half
> if qup HW version is  greater is than 2.5 by checking if the
> geni SE major version is greater than 2 and geni SE minor version
> is greater than 5.This implementation fails when the version is
> greater than or equal to 3.
>
> Hence, a new macro QUP_SE_VERSION_2_5 is defined having value
> for major number 2 and minor number 5 as 0x20050000.Hence,if
> ver is greater than this value,sampling rate is halved.
> This logic would work for any future qup version.

Can we rewrite commit message something like below:

For QUP IP versions 2.5 and above the oversampling rate is halved from 
32 to 16.

Commit ce734600545f ("tty: serial: qcom_geni_serial: Update the 
oversampling rate") is pushed to handle this scenario.

But the existing logic is failing to classify QUP 3.0 to correct group ( 
2.5 and above).

As result SE clocks are not configured properly for baud rate and 
garbage data is sampled to FIFOs from the line.


So, fix the logic to detect QUP with versions 2.5 and above.

>
> Fixes: ce734600545f ("tty: serial: qcom_geni_serial: Update the oversampling rate")
> Signed-off-by: Paras Sharma <parashar@codeaurora.org>
> ---
> Changes in V4:
> Created a new macro QUP_SE_VERSION_2_5 for Qup se version 2.5

You can mention changes in V3 and V2 here.

>
>   drivers/tty/serial/qcom_geni_serial.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
> index f0b1b47..9b74b1e 100644
> --- a/drivers/tty/serial/qcom_geni_serial.c
> +++ b/drivers/tty/serial/qcom_geni_serial.c
> @@ -106,6 +106,9 @@
>   /* We always configure 4 bytes per FIFO word */
>   #define BYTES_PER_FIFO_WORD		4
>   
> +/* QUP SE VERSION value for major number 2 and minor number 5 */
> +#define QUP_SE_VERSION_2_5                  0x20050000
> +

How about moving this Macro to common header, qcom-geni-se.h so that if 
needed other QUP driver also can use it.

Regards,

Akash

>   struct qcom_geni_private_data {
>   	/* NOTE: earlycon port will have NULL here */
>   	struct uart_driver *drv;
> @@ -1000,7 +1003,7 @@ static void qcom_geni_serial_set_termios(struct uart_port *uport,
>   	sampling_rate = UART_OVERSAMPLING;
>   	/* Sampling rate is halved for IP versions >= 2.5 */
>   	ver = geni_se_get_qup_hw_version(&port->se);
> -	if (GENI_SE_VERSION_MAJOR(ver) >= 2 && GENI_SE_VERSION_MINOR(ver) >= 5)
> +	if (ver >= QUP_SE_VERSION_2_5)
>   		sampling_rate /= 2;
>   
>   	clk_rate = get_clk_div_rate(baud, sampling_rate, &clk_div);

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project


  reply	other threads:[~2020-09-15 12:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14  7:19 [PATCH V4] serial: qcom_geni_serial: To correct QUP Version detection logic Paras Sharma
2020-09-15 12:39 ` Akash Asthana [this message]
2020-09-16 11:19 ` Greg Kroah-Hartman

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=6662d92f-5b68-527a-cfb1-9c407c338953@codeaurora.org \
    --to=akashast@codeaurora.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=parashar@codeaurora.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 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).