Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp237231pxk; Tue, 1 Sep 2020 23:00:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLpWi40RpTGzrAjbRdxXlhQWXbLdztGfgO0VZVZAe2ztpL9ziFKdCryHDltVP5ZQ+c+w+a X-Received: by 2002:a50:c182:: with SMTP id m2mr4873739edf.70.1599026432634; Tue, 01 Sep 2020 23:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599026432; cv=none; d=google.com; s=arc-20160816; b=HPNZqdq7dX4lkoxyvEVUvwFfHqwt5Pz8GFpngLkwjecQ5NrmfgyCj7P1ORf9Jrfzg/ BzsexW6MbKlOx+e06QMWpPuhrmQgeygD4y71+zo0rXu7cmQt3UN0VG09ZbRLV5C86pCO /mp1EnFAlxypGP3MMxmvF+IdcQ2BVmFUwrFBobU1hSpI/JV8Zw9NSRWN8m7liKx5wJGs YeVUfkzqXBQGx6w//MBVHAvtVRmAvkE01lGcn/Ikg7w/1l6y+XI/8BIs4hWi4gljubvK w2q2aekLLuIfjo+O0AUJVpvHlwxIEbYf0F8DndhRcTH1SKP8qERNyc2XVFkCXWccxw6C KT5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=b/xiIqTh++X/55c3yAwoggWlVShZmVb8hvdZlZLuRbI=; b=RR+7oq5/vQVo2tTKh8xmfeOUgzsZGARKKmRQvEUBA0EVZJXF+z7a2PsMHOJgmqpIN/ dXMkQcoXtilcZwshzNn3QMjLSGgon8X8Stxbf7H6Y0quF3zQ8fXJkIssvo1koBiogfw+ uxIo+l05viYNKquo3RAZS6JJydMP4QD5XKAxPI4r6UK8xpHXpDqRj391DBlX0lvOGjtS Ie2nmnc7CjQiMO8aala66RnixLkKuUxqccGvodvD2LGUvasSHblZAN7IBLZpaZgp9gHV cFvI5SMLi3hFys2WdcayUPDs9QAm6dnj7C3shacNaY7AgJpPBYWeGbmMy6SsHv0nX0oD CUUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s12si1860897ejc.338.2020.09.01.23.00.08; Tue, 01 Sep 2020 23:00:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726384AbgIBF5M (ORCPT + 99 others); Wed, 2 Sep 2020 01:57:12 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:48966 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725774AbgIBF5L (ORCPT ); Wed, 2 Sep 2020 01:57:11 -0400 Received: from ironmsg07-lv.qualcomm.com (HELO ironmsg07-lv.qulacomm.com) ([10.47.202.151]) by alexa-out.qualcomm.com with ESMTP; 01 Sep 2020 22:57:08 -0700 Received: from ironmsg02-blr.qualcomm.com ([10.86.208.131]) by ironmsg07-lv.qulacomm.com with ESMTP/TLS/AES256-SHA; 01 Sep 2020 22:57:07 -0700 Received: from parashar-linux.qualcomm.com ([10.206.13.63]) by ironmsg02-blr.qualcomm.com with ESMTP; 02 Sep 2020 11:26:54 +0530 Received: by parashar-linux.qualcomm.com (Postfix, from userid 2363307) id 880842157D; Wed, 2 Sep 2020 11:26:53 +0530 (IST) From: Paras Sharma To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, akashast@codeaurora.org, Paras Sharma Subject: [PATCH] serial: qcom_geni_serial: To correct QUP Version detection logic Date: Wed, 2 Sep 2020 11:26:51 +0530 Message-Id: <1599026211-12800-1-git-send-email-parashar@codeaurora.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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