From patchwork Fri Apr 1 11:32:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1612173 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KVJ2H1DBpz9sVB for ; Fri, 1 Apr 2022 22:33:09 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1naFWW-0003hE-Im; Fri, 01 Apr 2022 11:33:00 +0000 Received: from mail-pl1-f169.google.com ([209.85.214.169]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1naFWU-0003gc-Nh for kernel-team@lists.ubuntu.com; Fri, 01 Apr 2022 11:32:58 +0000 Received: by mail-pl1-f169.google.com with SMTP id e5so2245775pls.4 for ; Fri, 01 Apr 2022 04:32:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QpLAS3LD9m2UQUrE21XTniIE2YkfbmG0IXKBg2yXQOo=; b=uvD4z9WztJzeW15BmaSilyvstBztqFVxPOwJs6LV5iNMW7dMuBHwJqteIg1fEnTQMs EemLpGLaLgi0J/zvgxX9uZltyUtIH4xMuErUT4pNGNIEEQHBH9G8KI0kEwvfZ42fFnYA 5L8grOEAutnQeJ3WqbNPvegzjIL8ucnns0BL37pwZ6h1NzVtuW2OS0+2Tk1KpuiZ4p2y vTjeOcLcIsfuGVYyieavK6nrEiGToBQ0Uv8/vDbwmPC3BD/CUYlVeq+HVFddV05tubgu 5N1rBXL9auih8weDlJG9Wvcx4TZMUhkrKJz9x4KE7dKzOiOmw6bsrgDdB4alPYOqOpeI FezA== X-Gm-Message-State: AOAM533K9O5zB2SPTSRoIhVPM9Em8lbsaJf2cvlJQ8B83cenEYbBMCMr o3jhNWrlgsUtoI78jbMuUo6Ftrnulh0= X-Google-Smtp-Source: ABdhPJxPGA3D8LmC19BCZgCJBYGzmQ5IMwofdI3gvha+ZLwbnbXOhf1vMQ4HSOwzbHCG1VCSQ5SIiA== X-Received: by 2002:a17:90a:31cf:b0:1c9:f9b8:68c7 with SMTP id j15-20020a17090a31cf00b001c9f9b868c7mr11543989pjf.34.1648812776747; Fri, 01 Apr 2022 04:32:56 -0700 (PDT) Received: from localhost (114-40-226-197.dynamic-ip.hinet.net. [114.40.226.197]) by smtp.gmail.com with ESMTPSA id h14-20020a63384e000000b00366ba5335e7sm2198602pgn.72.2022.04.01.04.32.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Apr 2022 04:32:56 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/1][SRU][OEM-5.14/OEM-5.17/Jammy/Unstable] Bluetooth: btusb: Improve stability for QCA devices Date: Fri, 1 Apr 2022 19:32:52 +0800 Message-Id: <20220401113252.2379213-2-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220401113252.2379213-1-vicamo.yang@canonical.com> References: <20220401113252.2379213-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.169; envelope-from=vicamo@gmail.com; helo=mail-pl1-f169.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Zijun Hu BugLink: https://bugs.launchpad.net/bugs/1967067 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 Signed-off-by: Marcel Holtmann (cherry picked from commit 599ece4f8f073097904d411ee70280a2ec890ad3) Signed-off-by: You-Sheng Yang Acked-by: Stefan Bader Acked-by: Kleber Sacilotto de Souza --- drivers/bluetooth/btusb.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 27776b23a27f..5de98d3fd032 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -3232,6 +3232,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 @@ -3558,6 +3559,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;