Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5626802pxb; Mon, 14 Feb 2022 03:53:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJyHCIeaaYrK/Erz9pNm3kCzKVJ0YNho77JmXA/Vt4J6amvPDIClxRVO3i22n/bfuE6SU00K X-Received: by 2002:a05:6402:191:: with SMTP id r17mr14968817edv.348.1644839580557; Mon, 14 Feb 2022 03:53:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644839580; cv=none; d=google.com; s=arc-20160816; b=dBVWPPwwKfzmzUsCzr2v2uGCZmpMtQ56Rb8cFEj3gkYdHtGOaF4W3yslCrVNGjb3/m Iuoq32OboPMMVnFirD6fIIng6osPTeDO0Go+DbnEXAlHeqGbV3S/3vj1xDoCyDj/X9Cj Y3A7JdpDTxf7vSev7OauDCFC/f6Ml/U4zpRtj4hX1M5BMP+7+qDaXaOWd8xNOd7YtyK8 Hr+b2FmlKOpZNP9T6YUZTxR/Hjf3IogI683+fcLweeN04E6pYquqCM8sKWUdKXn5xJPU 2nCtijIVGtBh4eXDrPry2uyaETaZ4cwY1jx2K2omS9yVA+QJ6NhRtOu3aKcwot/gQ+86 R5Eg== 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:dmarc-filter :sender:dkim-signature; bh=rcn9ALIlWKMM2fTTA+HHH8I55YhsQbojYCrOJlAIZU4=; b=ywmgYP4KtiCroPVoZ87n976ufi1RdtoVUxHuQNzvQL1PILFc5oVrbmbymZZiHpdm/V hC+wIcrMOoNE42nU/O6XlzSVoHsKa3jzUg37ElQfyMQJMXc9Wu/jX6QHsBnJ/brHQl7r 4e/KAoozhr8sqXInfSUvQT8VMdOzwahpXquhIVPirtMqbc0ojQSKEIuMDfghDQX6dnkS odyY68egmwSwNJUoFyghgRXUFJKP92Gs52uxYZsvmk7cJ0C9MCRi7F7dt4Xr6D2Uft6I rYLeHIMNZSqa5iLCE8ppNBpJ9m7dFx8jg3f824RV5zHY8Pww0Z9CQ7x4nP+tRRbmEe6r oMlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=J+7iEfwF; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr11si11796467ejc.237.2022.02.14.03.52.23; Mon, 14 Feb 2022 03:53:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=J+7iEfwF; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350300AbiBNLPN (ORCPT + 99 others); Mon, 14 Feb 2022 06:15:13 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:45268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350087AbiBNLPG (ORCPT ); Mon, 14 Feb 2022 06:15:06 -0500 Received: from so254-9.mailgun.net (so254-9.mailgun.net [198.61.254.9]) by lindbergh.monkeyblade.net (Postfix) with UTF8SMTPS id 85563ADFF8 for ; Mon, 14 Feb 2022 02:43:54 -0800 (PST) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1644835435; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=rcn9ALIlWKMM2fTTA+HHH8I55YhsQbojYCrOJlAIZU4=; b=J+7iEfwFJGrg00+hUMASg8e8mxBt0mve0sCzaDONZGIwqiRp58jux1m4Akp9zETtB0lpRcX/ fL8DvzKOLTR6AcMIpK88O4/TYCRfb30tlj/0BlWOhS57BFmwOWwdBaJQvCmMArLLQQfEi2w3 aQFgFnhgV2vbaw36OJm7HR8z8S4= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI2MTA3ZSIsICJsaW51eC1ibHVldG9vdGhAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd 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 620a326519d16b66a926d089 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 14 Feb 2022 10:43:49 GMT Sender: zijuhu=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id A12CAC43165; Mon, 14 Feb 2022 10:43:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 Received: from zijuhu-gv.qualcomm.com (unknown [180.166.53.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: zijuhu) by smtp.codeaurora.org (Postfix) with ESMTPSA id A47C4C43164; Mon, 14 Feb 2022 10:43:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org A47C4C43164 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=codeaurora.org From: Zijun Hu To: marcel@holtmann.org, johan.hedberg@gmail.com, luiz.dentz@gmail.com Cc: linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-arm-msm@vger.kernel.org, c-hbandi@codeaurora.org, hemantg@codeaurora.org, rjliao@codeaurora.org, zijuhu@codeaurora.org, tjiang@codeaurora.org, Zijun Hu Subject: [PATCH v4] Bluetooth: btusb: Improve stability for QCA devices Date: Mon, 14 Feb 2022 18:43:39 +0800 Message-Id: <1644835419-23943-1-git-send-email-zijuhu@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Zijun Hu WCN6855 2.1 will reset to apply firmware downloaded, so wait a moment for reset done then go ahead to improve stability. Signed-off-by: Zijun Hu --- drivers/bluetooth/btusb.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index ef5d52f0e123..9e0d59d4382a 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2999,6 +2999,7 @@ static int btusb_set_bdaddr_wcn6855(struct hci_dev *hdev, #define QCA_PATCH_UPDATED 0x80 #define QCA_DFU_TIMEOUT 3000 #define QCA_FLAG_MULTI_NVM 0x80 +#define QCA_BT_RESET_WAIT_MS 100 #define WCN6855_2_0_RAM_VERSION_GF 0x400c1200 #define WCN6855_2_1_RAM_VERSION_GF 0x400c1211 @@ -3325,6 +3326,13 @@ static int btusb_setup_qca(struct hci_dev *hdev) err = btusb_setup_qca_load_nvm(hdev, &ver, info); if (err < 0) return err; + + /* WCN6855 2.1 will reset to apply firmware downloaded here, so + * wait ~100ms for reset Done then go ahead, otherwise, it maybe + * cause potential enable failure. + */ + if (info->rom_version == 0x00130201) + msleep(QCA_BT_RESET_WAIT_MS); } return 0; -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project