Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2134975imu; Thu, 17 Jan 2019 08:57:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN6W3ZzoYxFXk33CdiaL9epu8gR53kD3bKC4X1UwbxOoDftXPxfiuPxN5KVbtw7CZlSrflvi X-Received: by 2002:a17:902:20c8:: with SMTP id v8mr15812134plg.319.1547744252615; Thu, 17 Jan 2019 08:57:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547744252; cv=none; d=google.com; s=arc-20160816; b=O1pT1znGNpUcg19V+E5cdMYQzR5ntN6H6/DzBg4pC1Ii4/o4m54Q2j8m+Qek4Us6nP OLAJGSu8Kr9F6vlBLhNGrfPwetnJEQiAyfZZUg665R5mAYms7jjva8Ne+gqEeCsowx8g Ngw0ABaAkeNUMsFWn8Je98gGcLQ9UIZWHigstMs5KMJyW8T0wyjEo3KAFVZFqHcVl9bE AbzFKjuaHEzGP6C1wOI2HcUkINvciW768rQFWfrliTcagICS7KfnAUkFzemjQ+MMa7TI E7f6B4g2XXBFZdN1701lCGfu/Nb8gIYVdSuUMv2wCoK3eI58KOF6mj8ERGEPoKiqSrmU xr+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature; bh=BWJ70OKvp+PcEMZwRc7UxKsk4+TBrhVaL9+K10xOBpA=; b=NWdFI+7IrsQp9AE63BsHOeQym7VuJ3LWqsBDOjUR2q0xu9pfEwsqEvtkcPSak1MkKc Z77bxPd6+g5/JVAXPQnsl+eo4WfXn3tV0Jca12kVHBALaqPbydsSEUHE2Tbv9yFck4cR Mu4GAJoEiq5bMdhWnfxGWqS6u08zp3OPO1VI0U7vMJG2JpkucB6KaoAHBXCYZDNJaOE1 S7QN+CmLrbDUA2wgwhg+8afhYVzanD774oaKiG54gSOMWzD3l7Hfo4bxqB8rkMpURpXC zqBqyKuN3VlV2LI32qZ4UISJQQpy0PlGzzepI3OzbSURvFjQLuYTD24oGlbLIXjm5UaS mvKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b="kXQXFaq/"; dkim=pass header.i=@codeaurora.org header.s=default header.b=pDyFPPGT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21si2128933pgb.371.2019.01.17.08.57.17; Thu, 17 Jan 2019 08:57:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b="kXQXFaq/"; dkim=pass header.i=@codeaurora.org header.s=default header.b=pDyFPPGT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729237AbfAQQzi (ORCPT + 99 others); Thu, 17 Jan 2019 11:55:38 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:37770 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728767AbfAQQzh (ORCPT ); Thu, 17 Jan 2019 11:55:37 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5F74660A31; Thu, 17 Jan 2019 16:55:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1547744136; bh=RTpGQeuvcb5f3Ott/HNxLlLNxn36tu+Iomnxy8WHh18=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kXQXFaq/YbKYqwMzqrUc9+KLe32K9/yPS+Qk6+Cgs5QtWi7YCjibJFZ98mqGZ7DXU trrUGbofFW+fSCm5olvfP/O5jnppFWro1nDXoc1RhiO1hdfNxxg1spNp8LzHiI+ACn DWaYoU25Is/tfnlCcQZhAwmTYeFtrfnA/fLSomT4= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id A0BED60A44; Thu, 17 Jan 2019 16:55:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1547744134; bh=RTpGQeuvcb5f3Ott/HNxLlLNxn36tu+Iomnxy8WHh18=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=pDyFPPGTonbD/WD8pocLmSTYt7hmAwcrflfKvD14cOxmVhZoeM7el7Vj/kKsZYKt7 YMFGZe55+5M8qqYYOOzpA/AOFomRgdJOnwySC49BVFTcDuPtQ3es9ZLwDPsc5kiOwM ADhDiLOIK8qw8XqGIBiswg2MmpQThaMvsYiCGgUQ= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 17 Jan 2019 22:25:33 +0530 From: Balakrishna Godavarthi To: Johan Hovold Cc: Matthias Kaehlcke , marcel@holtmann.org, johan.hedberg@gmail.com, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, hemantg@codeaurora.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH v8 1/3] Bluetooth: hci_qca: use wait_until_sent() for power pulses In-Reply-To: <20190117161331.GW3691@localhost> References: <20190116114603.500-1-bgodavar@codeaurora.org> <20190116114603.500-2-bgodavar@codeaurora.org> <20190116202253.GS261387@google.com> <482d8987d38f60dae1844bc30050cd06@codeaurora.org> <20190117161331.GW3691@localhost> Message-ID: <21ac40f7314788e2d25b97628f998eb3@codeaurora.org> X-Sender: bgodavar@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-01-17 21:43, Johan Hovold wrote: > On Thu, Jan 17, 2019 at 03:55:17PM +0530, Balakrishna Godavarthi wrote: >> Hi Matthias, >> >> On 2019-01-17 01:52, Matthias Kaehlcke wrote: > >> >> - /* Wait for 100 uS for SoC to settle down */ >> >> - usleep_range(100, 200); >> >> + serdev_device_wait_until_sent(hu->serdev, timeout); >> >> + /* Wait of 5ms is required for assuring to send the byte on the Tx >> >> + * line and also for the controller to settle down for the received >> >> + * byte. >> >> + */ >> >> + usleep_range(5000, 6000); >> > >> > I incorrectly claimed that there might be still bytes sitting in the >> > UART FIFO when serdev_device_wait_until_sent() returns, Johan >> > corrected me on that (thanks!). So if it takes the SoC 100us to settle >> > down we should be good with the original code. >> >> [Bala]: sure will revert, i think he commented that wait_until_sent() >> will only guarantee circular buffer is empty. if wait_until_sent() >> guarantee us that the data was transmitted from the FIFO, then 100us >> will work. > > No, Matthias is correct; I claimed that the UART FIFO will be empty (at > least as long as flow control is disabled, otherwise it may never empty > and we therefore also have a time out). > > Johan [Bala]: Thanks Johan for clarification. -- Regards Balakrishna.