Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4428581ybe; Mon, 9 Sep 2019 09:08:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXPVtM9QsGRkcTwS7ynFW4xkFChX4GPwRWDB8P/eJIUWGo4ogyt2nPRce5T7Hpq8WizR23 X-Received: by 2002:a17:906:edcb:: with SMTP id sb11mr20010359ejb.144.1568045311141; Mon, 09 Sep 2019 09:08:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568045311; cv=none; d=google.com; s=arc-20160816; b=Mn7Vu6m5eKnAIWkiF9H+RkbXmkuoqRt+nVqZNfYitnd73NTATQBy+5YiFdueehw/kA 0zHJJNwj4vLVv1Xz+j92KMU2fIIpdRb6BdH1Flbe5pXyueo1+MUIdGD/GETrmNq4lMnM o3OiphC7nniiy1xycWO7ZSoUhqpUCz5k/UbzuxtvYUoSLShqYgRzQgeZwpTH9g7fDPvE 8kgrQBodXACNbVMUcK5GniAJry35rGOiGnACs0AUfFWRFgDiCst9sfbRuQq9R+LtO6bA BzeSawZFDY8aiWR142+zfchHnxJxnEX9UU+Vk7wE7B/wSmbX0+hKD4YQ3NJ2zSPuejTR 0yzQ== 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=4bzYPeGKRcrDOEBxfu8Irr7AQKAia22aCgpk3SqAQcs=; b=ZfafHC2roH16Lixt3fsCWP9Rgz0UTKoW85DEexKUOcyrb/Y8T3wrlEXO0j8Qh0A7Sn NCFr172BAZTaogs6XZg+4qP7X37S5RDmAQ9TXGZigKgXYtyrscF3K2Ifk7gQTg+40hEn EhNvdN4Rf5JwtcKjkjx2+zllq7032Ob85wxe8y8ydlFFy2aP2QEXhlOv4XhUIc+5HpZf QOLtk20lDQgkxpYcJG8i+V1jiCYt8HJytuTq1Pb8c5c1ZhP9c31tuB8hFtXsqn0z7dws wJiHCgKO1BQvijNpsv9L4xZmOqUl1O14aMiOLC5UMO13ErYYs6HQPKRavdLbE9f3KQGp F1Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jCn5zNkw; 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 j10si9555998ede.70.2019.09.09.09.08.07; Mon, 09 Sep 2019 09:08:31 -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=jCn5zNkw; 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 S1732780AbfIHMzw (ORCPT + 99 others); Sun, 8 Sep 2019 08:55:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:41604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732193AbfIHMui (ORCPT ); Sun, 8 Sep 2019 08:50:38 -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 48FB8218AC; Sun, 8 Sep 2019 12:50:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567947037; bh=1Hz3gvQ0f2YPPR+1FUpI7H+4HAKYesWoaGOm0olvD3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jCn5zNkwhq28bmhIPWkZOShqr7jwWttqgb/TpJJ8zCW9wyVobtyQuzniBJmBZA5ey odcHBUDSR8RNIPsM62dqPGCQ0o870UU8QZYAshEYORVKfxjcQhgjN9QKl47V8PmHnj Z4iE/Bf9W/7y4wGy8NraJOMXyLCrEoe6JkWy8e44= 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 5.2 36/94] Bluetooth: btqca: Add a short delay before downloading the NVM Date: Sun, 8 Sep 2019 13:41:32 +0100 Message-Id: <20190908121151.472382621@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121150.420989666@linuxfoundation.org> References: <20190908121150.420989666@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 aff1d22223bd4..0ee5acb685a10 100644 --- a/drivers/bluetooth/btqca.c +++ b/drivers/bluetooth/btqca.c @@ -350,6 +350,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 (qca_is_wcn399x(soc_type)) -- 2.20.1