Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp5020900imc; Mon, 25 Feb 2019 15:51:30 -0800 (PST) X-Google-Smtp-Source: AHgI3Iaii4lnPJ/Ztqgu31orpqFQZzwx4jc/WKVN3Lmmp5J4d2YvXz9qPaOoRhlpSldLG++w2CHC X-Received: by 2002:a63:c307:: with SMTP id c7mr21645498pgd.386.1551138690360; Mon, 25 Feb 2019 15:51:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551138690; cv=none; d=google.com; s=arc-20160816; b=C2tmkD8clRI+ggJ4gxiGcZTOxQ95jYcw4+uqhRdzuqkz3E6Y/A1Z0m7xaKkNP+3f/i TQCSnIASvE3uq5lIbwNcngR3NOssm5LNc32oDVws+PaqPhL2ro/5zX5+Mi+VbXRajk7X vf7tLDVXHDg5gjqtE+QDVQzX+1G0unO5gQ/qqvIHfQNPl6RKVu+EEaDMrSSrXwH5coG6 3wTF3sy8OEccd9wMSx9AonQlJzUkeicjefNEM6knppjJsEtLpq1nOgXVEi/LwWgRfYwZ ddeQw3Ce4YiDI+xSALAgUyAnC/4Op/OjAfwjieJnxzHKUJjAtylCfmSIDUtOZE/5E+RA B7XA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nZx4AbNCe6L73jZzmCjF10GRBr7OroTz9VymClKbKAE=; b=CWhESyjuc9SegI7G5kQxL34s5WvRIkzSlMwUoHCdBwrNYqnM0tRo6AeZaTSlD84Vv2 GxrafK7M1SRyHOVNvB7KKI57htl/1xwJDY3sIGKlufHAyYz2CG4+/FQTl4S7sOKMDPBB 1vTwSsmtPJTU1o0NyYxB+t3U/kjhPN2ZLpO9rdkOtgJS2uGIkpep8z/fzvW4ELsZN3cZ ptwj0BUH030sm1sSSbNHWrz1fbN55p0i5Qyz1L5whTu8ZZ3MM88XWwecwCdyTctvvZz7 jH3Wg58nZ13FvzqCoUxunYNy/pGaVND8TaXSFqkDYZLyzRGnkYdYacsRyjlx786jVCsJ 0Lrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lAdeAK66; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y142si11684659pfb.149.2019.02.25.15.50.59; Mon, 25 Feb 2019 15:51:30 -0800 (PST) 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=@chromium.org header.s=google header.b=lAdeAK66; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729054AbfBYXuX (ORCPT + 99 others); Mon, 25 Feb 2019 18:50:23 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:33502 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729009AbfBYXuW (ORCPT ); Mon, 25 Feb 2019 18:50:22 -0500 Received: by mail-pl1-f193.google.com with SMTP id y10so5276006plp.0 for ; Mon, 25 Feb 2019 15:50:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nZx4AbNCe6L73jZzmCjF10GRBr7OroTz9VymClKbKAE=; b=lAdeAK66PTFs2p1LGCNlO/0e+/CIDyEcvCkyWenoh9L1XFcOczrV8Zf/E22qv5PS6L wmXlAKtEOs4j3S1kEjScGXqJ1HvjwWVDsPVEEkiedxYVVsBVHyrk7XiwXfFg+6VdojES Bhazfdqg/deYryct67pphHAjzQP4nZKJZbuD8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nZx4AbNCe6L73jZzmCjF10GRBr7OroTz9VymClKbKAE=; b=YhQhCuaghd3SxhpDNoYe77kXLshIO9kLE2V/Zj8Wx4Vi5LezsU+63+RY74iUmysxxw 40Xn+DSaw4GlWp0mRp7vU9FgMnlCdtCn63YvmQmXCDLKwoLvhFnhAgiNW6BSY1qi9t3p Wai4g2ZGAmZBCYNz/xG2KnML5LkeOoNofNKJwXi8magEJtJqne91TlqErFGyYkJ2Bohq 8gAdx/11TmLeMoONtyw9SAGxkI/iToPYtEXsO8Y/jS9eeAPYEntdwmH0mEauxgl3HLVQ yaJFC5zhYVjLLWJ/CmRT6ax5HQmac3updYYVtMwrfxY0xyXkXVgR6hU/ju15fH3HujGX 8LcQ== X-Gm-Message-State: AHQUAuYuDmKDWcqPCSdDb6p+WdaYAz+ZkuR7BICEFI2D1/ult+iQLHf3 12T2Xz97eBxZuGPpds00tRoACQ== X-Received: by 2002:a17:902:12e:: with SMTP id 43mr23131259plb.31.1551138622370; Mon, 25 Feb 2019 15:50:22 -0800 (PST) Received: from mka.mtv.corp.google.com ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id y7sm17522967pgf.42.2019.02.25.15.50.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Feb 2019 15:50:21 -0800 (PST) From: Matthias Kaehlcke To: Marcel Holtmann , Johan Hedberg Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Balakrishna Godavarthi , Matthias Kaehlcke Subject: [PATCH 3/3] Bluetooth: hci_qca: Add delay after power-off pulse Date: Mon, 25 Feb 2019 15:49:54 -0800 Message-Id: <20190225234954.82942-4-mka@chromium.org> X-Mailer: git-send-email 2.21.0.rc0.258.g878e2cd30e-goog In-Reply-To: <20190225234954.82942-1-mka@chromium.org> References: <20190225234954.82942-1-mka@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org During initialization the power-on pulse is currently sent inmediately after the prior power-off pulse. With this initialization often fails at boot time: [ 15.205224] Bluetooth: hci0: setting up wcn3990 [ 17.341062] Bluetooth: hci0: command 0xfc00 tx timeout [ 22.101453] ERROR: Bluetooth initialization failed [ 25.337740] Bluetooth: hci0: Reading QCA version information failed (-110) After a power-off pulse wait 10ms to give the controller time to power off. Signed-off-by: Matthias Kaehlcke --- drivers/bluetooth/hci_qca.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index eacc108c422d0..c89c1ed87ffe9 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -1036,8 +1036,11 @@ static int qca_send_power_pulse(struct hci_uart *hu, bool on) usleep_range(100, 200); hci_uart_set_flow_control(hu, false); + /* Give to controller time to boot/shutdown */ if (on) msleep(100); + else + msleep(10); return 0; } -- 2.21.0.rc0.258.g878e2cd30e-goog