Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4035798ybe; Mon, 9 Sep 2019 03:10:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDF5LIPfrAa2Ckcug58Yj7lDfWQe8v3VVwiTDZK52hs1sz+k9Xy2KS38bhsBFICnp+2QDN X-Received: by 2002:a17:906:ce56:: with SMTP id se22mr18500969ejb.72.1568023855467; Mon, 09 Sep 2019 03:10:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568023855; cv=none; d=google.com; s=arc-20160816; b=VrkcxQXLz4OY+ybZvRnKW7TOIBNJcZgU2HSxm+9NToDOUT+ECTD9fWrBrrqqrwml2V KhjrRZJ4VWsbO8tQtSoWcyNbGHRGAAWWr9mZuJS+XGlmCESZmgk1BASG74LsD7xfgb9R H1+wA3JB6l/0ICP9PJK5TaZNqYIzzo+NYZ8+7/ls9adb+LYzpxI4LQEq2/51L2I+Rbkr UL/jCiMlhuD1GIkfOWF70WxEfzq1YNmvq09kIHIVST8enJK2PW3bfkjfh7a6I8h1BTzr zkhkRd+mVjbXPiIeVSzqpTxuPZAJEtCTJkvcoIB2pfLKj12UkbVtP9oKPyyFxewbEmRt joYA== 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=iwZgqg/87Kr3pRnJGo/2TD9kvfUUNzgc/R8QEwNGvZk=; b=B/QRfSP5bgwRJycNcbzC/YKEmg5PIzr2evn1OUgw49SCjrQR1tRyO9lI5zH7jNLhJI D7rc1BMp8MFdERPOqGLe+cm8cWkHHS+85bOF3rq2+RulqzZAYz0r73CwIsbidoFwWlBD s9VmEmW3fl5pPhiTLUfhR9l8usR0ftNc8TuV3LEX243kxYKAg1tmqJPJEjx3jtxxO2Po vdJ446RE0L7PbMRUWPpCsmxOn0wZzPI7SnvQlkV+iIEtYL0V/8ExFWqD2dWlZ2vGEep1 pOXLh9neqhRTFWmN8kqK5Xw+HrafQVeFqt7KeS/Hv9wa9/d5445iHllFxCNgfI4kac9H PnUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZaWAG1va; 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 j4si6393829edl.192.2019.09.09.03.10.31; Mon, 09 Sep 2019 03:10:55 -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=ZaWAG1va; 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 S1730170AbfIHMpk (ORCPT + 99 others); Sun, 8 Sep 2019 08:45:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:32790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730156AbfIHMpi (ORCPT ); Sun, 8 Sep 2019 08:45: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 24D91216C8; Sun, 8 Sep 2019 12:45:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946737; bh=/1+YFRA8MRn5iJdk3k+ittjd4Ien8qJzrzDQDKkmjQg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZaWAG1vaEHqgTalMfBkcKdhSmicmLpQmHRefyLbpZLVKliLWtL41if9UiR4zuacIe VFpDiV0WCCwwKv0w0+oX4EiJk7EUjiEvflGAFJku0sZe0NiyOa3DqMR5usZBkFQ3tG xjB7NRHk2P7bV45tSQ1TbQuheP8qxItmaP9OanJE= 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.14 04/40] Bluetooth: btqca: Add a short delay before downloading the NVM Date: Sun, 8 Sep 2019 13:41:37 +0100 Message-Id: <20190908121115.297090022@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121114.260662089@linuxfoundation.org> References: <20190908121114.260662089@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 0bbdfcef2aa84..a48a61f22f823 100644 --- a/drivers/bluetooth/btqca.c +++ b/drivers/bluetooth/btqca.c @@ -363,6 +363,9 @@ int qca_uart_setup_rome(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; snprintf(config.fwname, sizeof(config.fwname), "qca/nvm_%08x.bin", -- 2.20.1