Linux-Serial Archive on lore.kernel.org
 help / color / Atom feed
From: Felipe Balbi <balbi@kernel.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,
	Paras Sharma <parashar@codeaurora.org>
Subject: Re: [PATCH V2] serial: qcom_geni_serial: To correct QUP Version detection logic
Date: Tue, 11 Aug 2020 13:50:19 +0300
Message-ID: <871rkdpic4.fsf@kernel.org> (raw)
In-Reply-To: <1597131794-1076-1-git-send-email-parashar@codeaurora.org>


[-- Attachment #1: Type: text/plain, Size: 1653 bytes --]


Hi,

Paras Sharma <parashar@codeaurora.org> writes:
> The current implementation reduces the sampling rate by half
> if qup HW version greater is than 2.5 by checking if the geni
                    ^^^^^^^^^^^^^^^
                    is greater than

could, possibly, be fixed while applying.

> SE major version is greater than 2 and geni SE minor version
> is greater than 5.
>
> This implementation fails when the version is 3 or greater.
>
> Hence by adding the another check for geni SE major version,
> this problem can be solved.
>
> Signed-off-by: Paras Sharma <parashar@codeaurora.org>
> ---
>  drivers/tty/serial/qcom_geni_serial.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
> index 3aa29d2..a9f92d8 100644
> --- a/drivers/tty/serial/qcom_geni_serial.c
> +++ b/drivers/tty/serial/qcom_geni_serial.c
> @@ -995,7 +995,8 @@ 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 ((GENI_SE_VERSION_MAJOR(ver) >= 2 && GENI_SE_VERSION_MINOR(ver) >= 5)
> +		|| GENI_SE_VERSION_MAJOR(ver) >= 3)

it looks like having a single GENI_SE_VERSION() that returns MAJOR and
MINOR without STEP would look better here. Then you could use:

	if (GENI_SE_VERSION(ver) >= 0x20050000)

and it would work for any future version. Not a strong opinion, though

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

      parent reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11  7:43 Paras Sharma
2020-08-11  8:23 ` Greg Kroah-Hartman
2020-08-28  8:18   ` Greg Kroah-Hartman
2020-08-11 10:50 ` Felipe Balbi [this message]

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=871rkdpic4.fsf@kernel.org \
    --to=balbi@kernel.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

Linux-Serial Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-serial/0 linux-serial/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-serial linux-serial/ https://lore.kernel.org/linux-serial \
		linux-serial@vger.kernel.org
	public-inbox-index linux-serial

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-serial


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git