linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial: qcom_geni_serial: To correct QUP Version detection logic
@ 2020-09-02  5:56 Paras Sharma
  2020-09-02  6:04 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Paras Sharma @ 2020-09-02  5:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-arm-msm, linux-serial, linux-kernel, akashast,
	Paras Sharma

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 3 or greater.

Hence new implementation checks if version is greater than or equal
to 0x20050000 which would work for any future version.

Signed-off-by: Paras Sharma <parashar@codeaurora.org>
---
 drivers/tty/serial/qcom_geni_serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index f0b1b47..e18b431 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -1000,7 +1000,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 >= 0x20050000)
 		sampling_rate /= 2;
 
 	clk_rate = get_clk_div_rate(baud, sampling_rate, &clk_div);
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member 
of Code Aurora Forum, hosted by The Linux Foundation


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] serial: qcom_geni_serial: To correct QUP Version detection logic
  2020-09-02  5:56 [PATCH] serial: qcom_geni_serial: To correct QUP Version detection logic Paras Sharma
@ 2020-09-02  6:04 ` Greg Kroah-Hartman
  2020-09-10  6:24   ` parashar
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2020-09-02  6:04 UTC (permalink / raw)
  To: Paras Sharma
  Cc: Jiri Slaby, linux-arm-msm, linux-serial, linux-kernel, akashast

On Wed, Sep 02, 2020 at 11:26:51AM +0530, 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 3 or greater.
> 
> Hence new implementation checks if version is greater than or equal
> to 0x20050000 which would work for any future version.
> 
> Signed-off-by: Paras Sharma <parashar@codeaurora.org>
> ---
>  drivers/tty/serial/qcom_geni_serial.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Is this a v2 patch?  What changed from the first one?

> 
> diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
> index f0b1b47..e18b431 100644
> --- a/drivers/tty/serial/qcom_geni_serial.c
> +++ b/drivers/tty/serial/qcom_geni_serial.c
> @@ -1000,7 +1000,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 >= 0x20050000)

That's an odd "magic value", can't you use the existing macros to define
this somehow so it makes sense?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] serial: qcom_geni_serial: To correct QUP Version detection logic
  2020-09-02  6:04 ` Greg Kroah-Hartman
@ 2020-09-10  6:24   ` parashar
  0 siblings, 0 replies; 3+ messages in thread
From: parashar @ 2020-09-10  6:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-arm-msm, linux-serial, linux-kernel, akashast

On 2020-09-02 11:34, Greg Kroah-Hartman wrote:
> On Wed, Sep 02, 2020 at 11:26:51AM +0530, 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 3 or greater.
>> 
>> Hence new implementation checks if version is greater than or equal
>> to 0x20050000 which would work for any future version.
>> 
>> Signed-off-by: Paras Sharma <parashar@codeaurora.org>
>> ---
>>  drivers/tty/serial/qcom_geni_serial.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Is this a v2 patch?  What changed from the first one?

This patch is in continuation of 
https://patchwork.kernel.org/patch/11708805/ .
It should have been V3 , i will correct it in my next patch .
In the previous version ,i had added a new condition to separately check 
if QUP se major version is greater than or equal to 3.
In this ,i replaced the older logic of separately checking major and 
minor versions for 2.5 and 3 with value of Qup version 0x20050000 .
This checks for version greater than 2.5 directly.
This would reduce the logic and will work for any future versions.

> 
>> 
>> diff --git a/drivers/tty/serial/qcom_geni_serial.c 
>> b/drivers/tty/serial/qcom_geni_serial.c
>> index f0b1b47..e18b431 100644
>> --- a/drivers/tty/serial/qcom_geni_serial.c
>> +++ b/drivers/tty/serial/qcom_geni_serial.c
>> @@ -1000,7 +1000,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 >= 0x20050000)
> 
> That's an odd "magic value", can't you use the existing macros to 
> define
> this somehow so it makes sense?

The stable tag is not required because the board supporting version > 
3 is not in any of the previous kernel versions.
I will define a separate macro for this value in my next patch.

> 
> thanks,
> 
> greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-10  6:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-02  5:56 [PATCH] serial: qcom_geni_serial: To correct QUP Version detection logic Paras Sharma
2020-09-02  6:04 ` Greg Kroah-Hartman
2020-09-10  6:24   ` parashar

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).