Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2094123imu; Thu, 17 Jan 2019 08:17:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN4jAZFnxAAz1M5uI77izcHgAKFrIAiz51kMopzqZOCGqTUeudtDg1zj7T0zjiJ5rxNTMDVV X-Received: by 2002:a63:2406:: with SMTP id k6mr13518088pgk.229.1547741842383; Thu, 17 Jan 2019 08:17:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547741842; cv=none; d=google.com; s=arc-20160816; b=A0fXnqePzU6/uW2lRKeiV+yFnyVbsBw/WRb4lXdnQ8S9NGpA+3ojCFZaNQEH9focOO gLuXn9l475FJS8820luANraTHuV240e8hogGJJl2DzOTOMMXqDAxP+HxsETspjH7Azv7 YXCaJMnT7EoPWKmSHZF6fqxqp7YUYDg6VO2LE0RKh77xRYAjHBfAQudJKr4FJF0wJ8L8 MrpmqjuBJyvD+M3DTCG441rCfvsu61xuxEAAoqEW04j+ZDpRuePFCC9cHtwW2f6+3ECb caxQ6MNBbWBonSLu4QIHylBjUUH7vd8rNHkoKgxiAwYX+ZZfGmHVFgpgYooJhacKujt4 vcog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Xrf4OgcoX/o8KoO2sZMtl9mUjSQNkr86QqteBtAC5f4=; b=dorSRcIlRckBkJGpkECyuh+xdSI6CqHXB7M3cyR/9noI/dwmSkNSrmvlUAST2GPkfx ZpyzV4rNOAFLYvuJYkPeD/n67vpbPyaTia0/u1aIBRE+b9jDlDeBndMteSwkOD9P7L6B Km5gZsv5TuQrQFwJnh3pzLLuBiQtXXJiqrv+zILJI0JYPMga4ohb1CFsEsO633qfXxkQ anj1WGwmEQAOaNVh6iqVqd0uAWavHJMq716+jQ/gW7Sdtks3/405/7MizR6eyxNNRbmB hQkEttUKvdVetmqcJiyO2Kcpek6Qsru43PGUO2l/Boz5AeJVAmlH+ynVbqC5vR90/j+x wgIw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q16si1862486pgh.185.2019.01.17.08.17.03; Thu, 17 Jan 2019 08:17:22 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728828AbfAQQNd (ORCPT + 99 others); Thu, 17 Jan 2019 11:13:33 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:34456 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728488AbfAQQNd (ORCPT ); Thu, 17 Jan 2019 11:13:33 -0500 Received: by mail-lj1-f196.google.com with SMTP id u89-v6so9069676lje.1; Thu, 17 Jan 2019 08:13:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Xrf4OgcoX/o8KoO2sZMtl9mUjSQNkr86QqteBtAC5f4=; b=n7taBPQs+wOohr+lL9OZ/ZH45p744p8/+l76ktdonAKa1fOPv4GrDqxvuU9j/MPn+v sZDuFq/z7JlKORDhPk/04phJAXcitlZMx7q81iSoOxmmaqDGeL/gMXcP65YrFLPqWR75 HUPXS/6rBaC+DntN/k7lqhGC1teyJ7O2w2ZYWcS5WjINEQPespHzbqlhF+sRWYUVouHd 132urDjjt2K7AsjW7QAgbbVtJHm32ePm12QRlQ9sYf1ajILIjTpLB6sIBNWVAT31iQRF J21d0FMwtJsq4P+Rie8Hj9vCsUV5cGh7RnsArLuLUr8P7a2Nl+TUXUPgaIx+OuWvIotN 0FXw== X-Gm-Message-State: AJcUukfRLbUGmk7E5fxu5lXLsNdsWAIQykvRDw3bqlBaEeSz7DTfsbBb 7UijlGp1E/n8WBBwZjzSnlxibL6K X-Received: by 2002:a2e:1bc5:: with SMTP id c66-v6mr9965409ljf.96.1547741610877; Thu, 17 Jan 2019 08:13:30 -0800 (PST) Received: from xi.terra (c-74bee655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.190.116]) by smtp.gmail.com with ESMTPSA id a2-v6sm309658lji.13.2019.01.17.08.13.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jan 2019 08:13:29 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1gkAIN-0007hM-17; Thu, 17 Jan 2019 17:13:31 +0100 Date: Thu, 17 Jan 2019 17:13:31 +0100 From: Johan Hovold To: Balakrishna Godavarthi 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 Message-ID: <20190117161331.GW3691@localhost> References: <20190116114603.500-1-bgodavar@codeaurora.org> <20190116114603.500-2-bgodavar@codeaurora.org> <20190116202253.GS261387@google.com> <482d8987d38f60dae1844bc30050cd06@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <482d8987d38f60dae1844bc30050cd06@codeaurora.org> User-Agent: Mutt/1.11.2 (2019-01-07) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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