From patchwork Mon Jul 19 14:51:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 481308 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8573DC07E95 for ; Mon, 19 Jul 2021 15:12:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 73DDC61249 for ; Mon, 19 Jul 2021 15:12:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243115AbhGSObv (ORCPT ); Mon, 19 Jul 2021 10:31:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:40508 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244616AbhGSO3x (ORCPT ); Mon, 19 Jul 2021 10:29:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DD5C66113A; Mon, 19 Jul 2021 15:10:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626707416; bh=grkEjosmlW7zlW8HPokuK+9bc9XrMK0ts/pfTBaXc38=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2Bmh29wwQSBY5i2xNB9JWVCI2OJrwuog0SNB6f9VkZff62ii50XS5+j6AkMTzO+DS z6M3F6GE3M1ta/t922POMPsevj4lkB00NWsxQxILMOJGQyZiN9LchBxlTkM6v7wS3x u9ZHpIHrX5yi4+DwH1drnz4HmRMSewCdkVuTL5JA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tim Jiang , Marcel Holtmann , Sasha Levin Subject: [PATCH 4.9 155/245] Bluetooth: btusb: fix bt fiwmare downloading failure issue for qca btsoc. Date: Mon, 19 Jul 2021 16:51:37 +0200 Message-Id: <20210719144945.409865923@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144940.288257948@linuxfoundation.org> References: <20210719144940.288257948@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tim Jiang [ Upstream commit 4f00bfb372674d586c4a261bfc595cbce101fbb6 ] This is btsoc timing issue, after host start to downloading bt firmware, ep2 need time to switch from function acl to function dfu, so host add 20ms delay as workaround. Signed-off-by: Tim Jiang Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- drivers/bluetooth/btusb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 4e3b24a0511f..30c09b9ddbf0 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2508,6 +2508,11 @@ static int btusb_setup_qca_download_fw(struct hci_dev *hdev, sent += size; count -= size; + /* ep2 need time to switch from function acl to function dfu, + * so we add 20ms delay here. + */ + msleep(20); + while (count) { size = min_t(size_t, count, QCA_DFU_PACKET_LEN);