Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4116231ybe; Mon, 9 Sep 2019 04:35:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzygghl1ovgIASZHQkmrPf2Fo1qzV1LYBjngdibWHjpVdbH5hlqzNnCNHJbH1uTcr13G3K2 X-Received: by 2002:a17:906:af8c:: with SMTP id mj12mr19628938ejb.58.1568028929346; Mon, 09 Sep 2019 04:35:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568028929; cv=none; d=google.com; s=arc-20160816; b=SpXqK7ax/Qoagi5wn3AKVL9OETaG0+R05frJsjKmUOaByU3yuyYiOBSREHYdfdMq5W rgxuPPOR3f6MN00ho9RZyoR4DO4qQPgy+FJuOmoNLowPY0B+tb5NAubq1xVtey+QNR1s w7PO+9hN1+xKxHBC6zxZhtMQSxFM2K32fENL3J0CmRg1ThPrybz7yW0enzHG1hDRBLpY gSE2u/AWu+XTppsVoNgtwKTYpm9Pu+xmqJ5Ui3ASDGSl/v/yZSDZ7Ze5Szle1qC18gKy Tf8tIWJuSD8pQzS3F+D3v/hhm6+MEfiCK8d0MEfyjuF8bQw+e1Ax51tgjjmid5JrsRoJ 0bAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uyZG7k5Tmzo8bE5yEnMQlN2ZRPQv5NHl2yHRs/Wrw3E=; b=wxFdZOWE9aklkRYEKOi+EpvMSBYrZwVOuqTmnWU/D220/WGGUdmm531omQkrIBuajT suuI+Cl0xh4v+omwwwVyVX3MwbdkjtERPJFFYbLF3Nps1EY/U8unWumUOCiltpqYn4KP XtxiqhhQhdgtkmn+WKHoEOttrEgYC22MTsdJ3FJOYDh2pJ2YyMg+2dHYKM9pudS7RpTq f4TCNGAAxk9+Y+MimCsIDN/35tdff4Zj/tPy0MPjMSZo9lL7f8jCQ5srVPzaYdQnYBHa NG/mCtOdE3FrUMmxO4aX3JSwJv2gLODxTI9RCgVA2rckS8/nGSIr59GTFhPb512pNcBr K/Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bnztR6x0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e14si8514336eda.104.2019.09.09.04.35.04; Mon, 09 Sep 2019 04:35:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bnztR6x0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730632AbfIHMrR (ORCPT + 99 others); Sun, 8 Sep 2019 08:47:17 -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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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