From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 28ABBC4332F for ; Sun, 8 Sep 2019 12:58:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F12DA2082C for ; Sun, 8 Sep 2019 12:58:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567947504; bh=2gEiWUMo+r8ceNgyIp4bCwzqFIUDE/X9RxFk3DgEliE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=nGRUX3DIwyOZUKeQlVHuxrMDTxypYbEfkQTb4nsfksl9mV0Df4Az+kKfg6cttrGlQ y65+owZ2a7mz/+UTVw4LnzO0EsxYkbypaB7wKCREQuztThbF4E/vLp3CF3tbsJxXt0 u2W96DBhGtWxFiUXYhifSA1S+YtqlDzqIPmQ1uFQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730619AbfIHMrP (ORCPT ); Sun, 8 Sep 2019 08:47:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:35390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730611AbfIHMrO (ORCPT ); Sun, 8 Sep 2019 08:47:14 -0400 Received: from localhost (unknown [62.28.240.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 98F1F21A4C; Sun, 8 Sep 2019 12:47:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946834; bh=2gEiWUMo+r8ceNgyIp4bCwzqFIUDE/X9RxFk3DgEliE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bnztR6x0kkPiOMGpjU11yGBvBW5w0vGjqZn1e1iB7lW43FzL4sdQMTaW34Fk6rTh9 wAUaOM3UCJWxNE4KtF9qIqGOpKSw113SSK+Wi1DdI8YuNrGEuUW0Pr1cv4Pe7Ft7Da /pssXJNWm3IpJ674Qyd5W2lbN0aDEsY9Mg6xOfzk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthias Kaehlcke , Marcel Holtmann , Sasha Levin Subject: [PATCH 4.19 18/57] Bluetooth: btqca: Add a short delay before downloading the NVM Date: Sun, 8 Sep 2019 13:41:42 +0100 Message-Id: <20190908121132.597425440@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121125.608195329@linuxfoundation.org> References: <20190908121125.608195329@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ Upstream commit 8059ba0bd0e4694e51c2ee6438a77b325f06c0d5 ] On WCN3990 downloading the NVM sometimes fails with a "TLV response size mismatch" error: [ 174.949955] Bluetooth: btqca.c:qca_download_firmware() hci0: QCA Downloading qca/crnv21.bin [ 174.958718] Bluetooth: btqca.c:qca_tlv_send_segment() hci0: QCA TLV response size mismatch It seems the controller needs a short time after downloading the firmware before it is ready for the NVM. A delay as short as 1 ms seems sufficient, make it 10 ms just in case. No event is received during the delay, hence we don't just silently drop an extra event. Signed-off-by: Matthias Kaehlcke Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- drivers/bluetooth/btqca.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c index ec9e03a6b7786..9e70f7c7e5659 100644 --- a/drivers/bluetooth/btqca.c +++ b/drivers/bluetooth/btqca.c @@ -363,6 +363,9 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, return err; } + /* Give the controller some time to get ready to receive the NVM */ + msleep(10); + /* Download NVM configuration */ config.type = TLV_TYPE_NVM; if (soc_type == QCA_WCN3990) -- 2.20.1