Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2914805pxk; Tue, 15 Sep 2020 05:51:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyT7/TTsZECwTKtPeSm/1ZSmtrUlTZj2hUKIxiH3OvhFzqEFusjyEekwwXUWGNg8a+bUeTn X-Received: by 2002:a17:906:2b06:: with SMTP id a6mr19799092ejg.209.1600174282527; Tue, 15 Sep 2020 05:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600174282; cv=none; d=google.com; s=arc-20160816; b=Pp4oJbmB5pWm/TXzituPPXw7BHbhK9I/sPe9/6O7hsUsJLdS7XC+f/Y/3m7WdE62dw 8xcw+1OGJ+2sm9bSrhuPQbR21XSSbt+zEMvlEXulC81gNCnNSeajqE6gfnVxS4oQ2XLp cGsEgAlFEZPez4zqPf8BURLRLhn4FzXGJOQmcQlaeQ3/TxIa7N17oTYLCzIwv6Dd2p+b OvMn2DEz6QBp9SB4/pBSHptYWUVJFLZz8xvklkjLDuRe0heaCbthTrIvCRAzarrd/4Wz k9uVe7MD7gW4Pd7gVhQv+5rVEM+L2ESVp4T19HSwvuDKUSjYRTIa1esNAl7U9kaBOgHX iI3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature; bh=q83tXlqY1YChLzPyWawlyehR7bL/8FKHR0ivbfmuZug=; b=c7dCQNW5uwsLxqoX+F4Ld1cRmXMQP0zCYqVaNEUVOVNBiiNR4ufUSAra8ZECVczSFz I6u9LvQG22labf17mwW90cNFboClMOdmXT1JpLk3MO4lg4SreV18qXo09TuDo4bDfMdI Voq2DAd09tCAEOwm1k6v2ACzF6gwfBL4EWdAKvqx+5sPCEA27/3mubRbQVGBaIMz/yeJ 6/9ZmXAF0Uvf63kfdUUBMXTDYDD9o0/UgPY9hxb0nYGHVSuOHWh3LtlZXl97qx8PFvE0 qSZ7HAyEWn6x9+HGyZrANN8gMdhyEnZI+fvFswqcm8/aBAL88WwYxtS9KqXN6yLe0vip fE5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=jdyT1mdi; 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 k6si9742477edr.111.2020.09.15.05.50.59; Tue, 15 Sep 2020 05:51:22 -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; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=jdyT1mdi; 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 S1726507AbgIOMrt (ORCPT + 99 others); Tue, 15 Sep 2020 08:47:49 -0400 Received: from mail29.static.mailgun.info ([104.130.122.29]:57563 "EHLO mail29.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726435AbgIOMjf (ORCPT ); Tue, 15 Sep 2020 08:39:35 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1600173574; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=q83tXlqY1YChLzPyWawlyehR7bL/8FKHR0ivbfmuZug=; b=jdyT1mdikY1bNCY4vvSxAaH20230rbpu3lQSKYN+kkjIvGB8qrMG5Sf2ZghUXqiKWJQcBpI5 fh2Okcn04MDtk2neMIsXxzIRKNmwNjbEG8a4UVSC0vNM8znlzSjlsxZZ7vo326hlb98e+vmg hD7vZoL19a6G67hnBMTjTl18o8I= X-Mailgun-Sending-Ip: 104.130.122.29 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-west-2.postgun.com with SMTP id 5f60b5f9252c522440b1afb5 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 15 Sep 2020 12:39:21 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 00CB2C433FE; Tue, 15 Sep 2020 12:39:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A,SPF_FAIL,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.43.98] (unknown [47.8.185.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: akashast) by smtp.codeaurora.org (Postfix) with ESMTPSA id D4B44C433CA; Tue, 15 Sep 2020 12:39:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D4B44C433CA Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=akashast@codeaurora.org Subject: Re: [PATCH V4] serial: qcom_geni_serial: To correct QUP Version detection logic To: Paras Sharma , Greg Kroah-Hartman Cc: Jiri Slaby , linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org References: <1600067957-8216-1-git-send-email-parashar@codeaurora.org> From: Akash Asthana Message-ID: <6662d92f-5b68-527a-cfb1-9c407c338953@codeaurora.org> Date: Tue, 15 Sep 2020 18:09:06 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <1600067957-8216-1-git-send-email-parashar@codeaurora.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > --- > 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