Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp7707598ybh; Thu, 8 Aug 2019 21:53:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsoREmzs3EZDcw6Cb4wX12E/WhALXIwhfutcFcUQeKM4BE3Rp6BAtr9dTddovCssXYBb5W X-Received: by 2002:a17:90a:8d0c:: with SMTP id c12mr7286891pjo.140.1565326428081; Thu, 08 Aug 2019 21:53:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565326428; cv=none; d=google.com; s=arc-20160816; b=KBd1tRZzKDpIMabD71nFnxbyNviBjsSYzgbVQf+g7YWjxdFQoLZvgGVQflxutuCyGV 3dy8tN3wzWpnRtBUKMBekUdRb5U9LpXAdCsYVnip0vvMaMtwUGmfSOcHWxki0clNEgeG ckz5gsDlTCIE9H63bYDwEYRv9FtZLf62kxO5e9KHApQfwT+vxfsU3wrKkXHp3vsf47ah 7KWNa92P3I3ic4ue/ZuSbEE/Fko/OrpRC8HLeNkJd1yaeHROcb9fT5T3RbdLfjiI7v7L aS2VSZ/mjG5+HvK30fsUqq+hTg2KG1uOjtuBEV1g92qaK85wB3jbN/TN//diNyQncFEk H5LQ== 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=Ek9OpOgumAt4ydv/FgvqQraEJSBTevUXUMVaITQMvOk=; b=olcYH+RaVF391S6fkUK6yWQyDiFikszu/GHkyCk5D18LiqtbmjMSuE2fdYO9/fiur3 LZwtQsEBTUMxP+Fk3knwSCkK0KXwORwJe7O44THovudevdaltQrWhh+7N7yLBBnECQ9d j1UPCwxQ7ZKRTQ4k2Uo3VGaDWQybFhL1edCmctfDJ3cgO9Lp1aj671Ra/qJLQB5tmDTh wbA8SnqB5TfiQCP+tFomUHau6/XcIi5eYz+LnMzLhxw2NUmN6ftaxXCa43L8k/I6FU8T VPqBchFgYzzyIYXZdoPlJhjEOHtghCbCqc+1cqWHYr/cMRejZefSUIbSEWkylYPvdSBP IDJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=aWqbSXqC; dkim=pass header.i=@codeaurora.org header.s=default header.b=DmKF8B8C; 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 q25si51164915pgv.114.2019.08.08.21.53.32; Thu, 08 Aug 2019 21:53:48 -0700 (PDT) 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=aWqbSXqC; dkim=pass header.i=@codeaurora.org header.s=default header.b=DmKF8B8C; 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 S1727063AbfHIEvj (ORCPT + 99 others); Fri, 9 Aug 2019 00:51:39 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:40792 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725989AbfHIEvh (ORCPT ); Fri, 9 Aug 2019 00:51:37 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C718561418; Fri, 9 Aug 2019 04:51:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1565326296; bh=iw4lsWYTbQS4yhyC0rTNbF2CidP7RA8CNdq3sqREgIc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=aWqbSXqCBWTfkL7DL813WgFK4a+utOGpUzfftFgQjhxacQlndREE6BuWuQxh4Bmdn kfL74d1zK8AkPlU2Fc8QkvrVH4qQpFWeWKpyVgEZ2l1hwVXzu1Qw7mPgU3Zl5cVKKm BtJ7tV16NKyrAV0NAfpxmKQiIHR8hy2OR7I7D88A= 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 12B3760ACF; Fri, 9 Aug 2019 04:51:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1565326295; bh=iw4lsWYTbQS4yhyC0rTNbF2CidP7RA8CNdq3sqREgIc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=DmKF8B8C7sNb8KHEDTPTrPYPY2im9cOTwMIHphvvKCZ8KvcvPq0pP5cdepjL5+bkX 1C6o39vccWw8Vj7AQX0b+kkD5TDHfsJqXBRvjC/RRDiMtJNUVsVbHtMjgnlojY5CPL yJzYqvHYbMJVRGOL9o/ypERI2pZezBXEydqB42cY= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 09 Aug 2019 10:21:35 +0530 From: Harish Bandi To: Balakrishna Godavarthi Cc: marcel@holtmann.org, johan.hedberg@gmail.com, mka@chromium.org, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, hemantg@codeaurora.org, linux-arm-msm@vger.kernel.org, anubhavg@codeaurora.org Subject: Re: [PATCH v1] Bluetooth: hci_qca: wait for Pre shutdown to command complete event before sending the Power off pulse In-Reply-To: <83f6833dd901e42e2f86d20ff0898526@codeaurora.org> References: <1565256353-4476-1-git-send-email-c-hbandi@codeaurora.org> <83f6833dd901e42e2f86d20ff0898526@codeaurora.org> Message-ID: <69e95b7d65f5c58f94473dcbe116d0d2@codeaurora.org> X-Sender: c-hbandi@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 Hi Bala, On 2019-08-08 16:25, Balakrishna Godavarthi wrote: > Hi Harish, > > On 2019-08-08 14:55, Harish Bandi wrote: >> When SoC receives pre shut down command, it share the same >> with other COEX shared clients. So SoC needs a short >> time after sending VS pre shutdown command before >> turning off the regulators and sending the power off pulse. >> >> Signed-off-by: Harish Bandi >> --- >> drivers/bluetooth/btqca.c | 5 +++-- >> drivers/bluetooth/hci_qca.c | 2 ++ >> 2 files changed, 5 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c >> index 2221935..f20991e 100644 >> --- a/drivers/bluetooth/btqca.c >> +++ b/drivers/bluetooth/btqca.c >> @@ -106,8 +106,9 @@ int qca_send_pre_shutdown_cmd(struct hci_dev >> *hdev) >> >> bt_dev_dbg(hdev, "QCA pre shutdown cmd"); >> >> - skb = __hci_cmd_sync(hdev, QCA_PRE_SHUTDOWN_CMD, 0, >> - NULL, HCI_INIT_TIMEOUT); >> + skb = __hci_cmd_sync_ev(hdev, QCA_PRE_SHUTDOWN_CMD, 0, >> + NULL, HCI_EV_CMD_COMPLETE, HCI_INIT_TIMEOUT); > > [Bala]: nit: can you also add reason in commit text for adding > HCI_EV_CMD_COMPLETE [Harish] - I will add reason fo HCI_EV_CMD_COMPLETE in commit text and post new patch. > >> + >> if (IS_ERR(skb)) { >> err = PTR_ERR(skb); >> bt_dev_err(hdev, "QCA preshutdown_cmd failed (%d)", err); >> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c >> index 16db6c0..566aa28 100644 >> --- a/drivers/bluetooth/hci_qca.c >> +++ b/drivers/bluetooth/hci_qca.c >> @@ -1386,6 +1386,8 @@ static int qca_power_off(struct hci_dev *hdev) >> /* Perform pre shutdown command */ >> qca_send_pre_shutdown_cmd(hdev); >> >> + usleep_range(8000, 10000); >> + >> qca_power_shutdown(hu); >> return 0; >> } > > Reviewed-by: Balakrishna Godavarthi Thanks, Harish