Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2308261pxb; Fri, 5 Feb 2021 14:35:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7SjcT9+k35vFYXCkfQdgGD+z9u7ZtOlem4k5DYH3sPE+DPOPn5/qP9T81xunUQ12aHGTx X-Received: by 2002:aa7:da17:: with SMTP id r23mr5569798eds.176.1612564551568; Fri, 05 Feb 2021 14:35:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612564551; cv=none; d=google.com; s=arc-20160816; b=AcE+x8/5dzdwkNg/ATuFM+VFS/i6oH9Yh4gnLkTdhlvFA30PgvWC0GgUVdzdX07Xno 7+fyXE4EFs/VfG68Emqa6cHIxRL33cSbpjgmigId+DyZgotw79+L408qa58RtgIxB+WJ X15gJbf8yx9fGDEv1CXm5LU8zPgju8LoQGM6C1eHfCP7+TL+kt+1sR6EimLbpBIBUnyK vK6yMSkHDe9g8287ls94WtMLuu+dU3LdPN/UdDIFP7wrRcEmcepClqX7brIxwSsvlJd2 hARovnVEDUMKeUI9s6t9lshhxVgnuP8wcTmtIL18qIUhT4AluxMpuK5J7R5SIXzkmv/F RppQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=KSWfNFRen8sl9r3t90YvimajlT9UNKUH9jI+XWxxPzs=; b=mBkCctRfd5GcjIwYI5/orLRr6FB8PwWP897z4nzTL295fh0ZWDY+EqhEHnANx25sv6 dKVU5J0h0Che4EqxN0dg3ZqGIdrYDk2l/3gQ31VFFfwS9Rl5LDBQbcMgEexpMKVRvWf+ QPbtq/DkoS+AFou93apxgAGETqAQMcpzq3SHaA+ppYaWi+jWqQOpdWuxORXWF/4rj3yS yrMzazEGbyzRxeeznNXYGKkzz3nNC4NOlqNchYUF0OZ0AtqsM1nQOphd/oc2HtpLlwjG qJ9Gi69sfYIdgx5htBnVFRgCV9Htw9e/GeLS0Cr0wLwRYhQ6DWP7oDahRwS7/99336+8 e7UA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-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 y16si5450659edi.542.2021.02.05.14.35.09; Fri, 05 Feb 2021 14:35:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-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-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229813AbhBEWbp (ORCPT + 99 others); Fri, 5 Feb 2021 17:31:45 -0500 Received: from alexa-out.qualcomm.com ([129.46.98.28]:51762 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232455AbhBEORE (ORCPT ); Fri, 5 Feb 2021 09:17:04 -0500 Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 05 Feb 2021 07:37:44 -0800 X-QCInternal: smtphost Received: from ironmsg02-blr.qualcomm.com ([10.86.208.131]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/AES256-SHA; 05 Feb 2021 07:37:42 -0800 X-QCInternal: smtphost Received: from gubbaven-linux.qualcomm.com ([10.206.64.32]) by ironmsg02-blr.qualcomm.com with ESMTP; 05 Feb 2021 21:07:18 +0530 Received: by gubbaven-linux.qualcomm.com (Postfix, from userid 2365015) id 3161A21E01; Fri, 5 Feb 2021 21:07:18 +0530 (IST) From: Venkata Lakshmi Narayana Gubba To: marcel@holtmann.org, johan.hedberg@gmail.com Cc: mka@chromium.org, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, hemantg@codeaurora.org, linux-arm-msm@vger.kernel.org, bgodavar@codeaurora.org, rjliao@codeaurora.org, hbandi@codeaurora.org, abhishekpandit@chromium.org, Venkata Lakshmi Narayana Gubba Subject: [PATCH v1] Bluetooth: hci_qca:Fixed issue during suspend Date: Fri, 5 Feb 2021 21:07:16 +0530 Message-Id: <1612539436-8498-1-git-send-email-gubbaven@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org If BT SoC is running with ROM FW then just return in qca_suspend function as ROM FW does not support in-band sleep. Fixes: 2be43abac5a8 ("Bluetooth: hci_qca: Wait for timeout during suspend") Signed-off-by: Venkata Lakshmi Narayana Gubba --- drivers/bluetooth/hci_qca.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index ff2fb68..de36af6 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -77,7 +77,8 @@ enum qca_flags { QCA_MEMDUMP_COLLECTION, QCA_HW_ERROR_EVENT, QCA_SSR_TRIGGERED, - QCA_BT_OFF + QCA_BT_OFF, + QCA_ROM_FW }; enum qca_capabilities { @@ -1664,6 +1665,7 @@ static int qca_setup(struct hci_uart *hu) if (ret) return ret; + clear_bit(QCA_ROM_FW, &qca->flags); /* Patch downloading has to be done without IBS mode */ set_bit(QCA_IBS_DISABLED, &qca->flags); @@ -1721,12 +1723,14 @@ static int qca_setup(struct hci_uart *hu) hu->hdev->cmd_timeout = qca_cmd_timeout; } else if (ret == -ENOENT) { /* No patch/nvm-config found, run with original fw/config */ + set_bit(QCA_ROM_FW, &qca->flags); ret = 0; } else if (ret == -EAGAIN) { /* * Userspace firmware loader will return -EAGAIN in case no * patch/nvm-config is found, so run with original fw/config. */ + set_bit(QCA_ROM_FW, &qca->flags); ret = 0; } @@ -2103,6 +2107,12 @@ static int __maybe_unused qca_suspend(struct device *dev) set_bit(QCA_SUSPENDING, &qca->flags); + /* if BT SoC is running with default firmware then it does not + * support in-band sleep + */ + if (test_bit(QCA_ROM_FW, &qca->flags)) + return 0; + /* During SSR after memory dump collection, controller will be * powered off and then powered on.If controller is powered off * during SSR then we should wait until SSR is completed. -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation