[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <871rkdpic4.fsf@kernel.org>
Date: Tue, 11 Aug 2020 13:50:19 +0300
From: Felipe Balbi <balbi@...nel.org>
To: Paras Sharma <parashar@...eaurora.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Jiri Slaby <jslaby@...e.com>, linux-arm-msm@...r.kernel.org,
linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org,
Paras Sharma <parashar@...eaurora.org>
Subject: Re: [PATCH V2] serial: qcom_geni_serial: To correct QUP Version detection logic
Hi,
Paras Sharma <parashar@...eaurora.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@...eaurora.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
Download attachment "signature.asc" of type "application/pgp-signature" (833 bytes)
Powered by blists - more mailing lists