Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3063600pxb; Tue, 19 Jan 2021 12:47:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxS18eynM4sq/aQ8b0ppsvX+o/Pn5BFUQFhNowBc3vUWXa8q6OViMYQbSUE3+QBPCnwbap3 X-Received: by 2002:aa7:cf94:: with SMTP id z20mr459765edx.75.1611089238655; Tue, 19 Jan 2021 12:47:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611089238; cv=none; d=google.com; s=arc-20160816; b=ajP6L6/a8vvHrcjjqNPcbixbFMyyQF2RMf236eSgCQ6EMn2VcsAHw1In4jhZR8+75W IDTHvN/duMtwV4bRKDylAwQDqS0hdDj4oB4GeajRhKj4Ugy9dVCe1yMNEVb++sc1+tor EcHRdl+/7pmM8AKZ7rJ1x1qAP6QagmLU1Ygm6nnrrGWOUOf6Zn6xMB/F2SneFxob7NeK sOsxERJqG7snWor3oMPk1Lzm6zFohpb+DIdMEBYmYEdauHV7uc/sDT/HW/nWo/s72CC7 dfcNKlrAOhorMNQZgULhfuED+YQpRoqG/81dVKBLMu9e4f3VZm91HYN9GnC7MU8yhxGF f0hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2KPL8bz/DsmwTeTaJ4A3VI/judTjbMrQhWrVgCOV11c=; b=ZUgwjQHaBRFAfbOzvsllit5ldu4ijndF78uvgAQywNArkYtIXF0v2DBDGC8FDcsR3Z Bdx7Cji67+nW2NQz8ENbuCofwTIXPunqa7ueeKkBULFr5qJNMKC4jczjk4Rpt5E5UrlQ 4rA8SR9ksQZ5YyGmUhnMaXR3eUIPc4KOb8NY12Xt9u01EnOYGFAcQWcrUmJtboXS3Hw4 rQT8UTl7v5aiV0gaPqnwhE8HRnkyG7Ne/jV8ryPOVUk0e6o3Liu0uRd54GE0cG23dqQ1 LrD7QEcKbhh8m7wmM8tIjHnsvx6Eb7hpGZ0BqNZzuGp0aQ+cuvyzuqG2i7ONcq5nR7OX l2iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GTbi5NVA; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-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. [23.128.96.18]) by mx.google.com with ESMTP id gn22si8457546ejc.74.2021.01.19.12.46.45; Tue, 19 Jan 2021 12:47:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GTbi5NVA; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-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 S1728603AbhASUoW (ORCPT + 99 others); Tue, 19 Jan 2021 15:44:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730331AbhASUoF (ORCPT ); Tue, 19 Jan 2021 15:44:05 -0500 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38C19C0613C1 for ; Tue, 19 Jan 2021 12:43:25 -0800 (PST) Received: by mail-pj1-x1036.google.com with SMTP id p15so694200pjv.3 for ; Tue, 19 Jan 2021 12:43:25 -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=2KPL8bz/DsmwTeTaJ4A3VI/judTjbMrQhWrVgCOV11c=; b=GTbi5NVABmar6gXKJ2rGY5w0Kaoyj6OX4eP8CdhOHzJWUoLXhcRZajGg/NE8jsrund mq55GrutSYVzE7mKJG3Vk0oF/L/8KWQqzgxAwirtgJdLbmCGvLLrOXv1NrdfazU5Ihsq dOwiEDoKR9IKQNWfMGxKvkkPwmHW/cBYIhA7I= 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=2KPL8bz/DsmwTeTaJ4A3VI/judTjbMrQhWrVgCOV11c=; b=P83UCSBsh+hxFGL/d+Tn/HabYNR6Cyr7UIYs/YEZJG6oJVOiS36PnizWjhKv9xJMMB QU99lgTciFdZoeIkLimMRhdngoM5bbR15KDwBBisV3R4jhejFTNhWdsjZFiYU1ggGj1p iEvZOILecY25pu75e/3RQJPCNwACaNBej7odKpomdiKi9SODvOy8oatZPT4ewFR0VKsO LnnULbU+vOapUZCyJt2zMuBsyt38Tkq6loLAhCirRAoGd96cMo2XA6gqRARVJVRIRmMY TQ5LzaFWhLpC+WRABljA28ijBFyDJl+dta971FhnfLOJlyEMyEwg9JZpfu6vTxNY2Qr8 5wgg== X-Gm-Message-State: AOAM530xvVIIdA0MGpPOrCnEKMLcboEQ1k4RPOxM2QqYXkS1zy8Mc0TX 21KsQM46HmF7DKqhUpkvowyCAw== X-Received: by 2002:a17:903:1c2:b029:de:ad0a:2dbf with SMTP id e2-20020a17090301c2b02900dead0a2dbfmr6620147plh.44.1611089004824; Tue, 19 Jan 2021 12:43:24 -0800 (PST) Received: from apsdesk.mtv.corp.google.com ([2620:15c:202:1:7220:84ff:fe09:2b94]) by smtp.gmail.com with ESMTPSA id x15sm13835pfa.80.2021.01.19.12.43.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jan 2021 12:43:24 -0800 (PST) From: Abhishek Pandit-Subedi To: marcel@holtmann.org Cc: chromeos-bluetooth-upstreaming@chromium.org, mcchou@chromium.org, michaelfsun@google.com, linux-bluetooth@vger.kernel.org, apusaka@chromium.org, Abhishek Pandit-Subedi , Daniel Winkler , Johan Hedberg , Luiz Augusto von Dentz , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] Bluetooth: btusb: Trigger gpio reset quicker Date: Tue, 19 Jan 2021 12:43:13 -0800 Message-Id: <20210119124258.2.I52cc5d2b62fdeb5f3c5249d41f3631ae25d8dc71@changeid> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog In-Reply-To: <20210119204315.2611811-1-abhishekpandit@chromium.org> References: <20210119204315.2611811-1-abhishekpandit@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Currently, btusb will only trigger gpio reset during cmd_timeout after 5 commands fail. This number is arbitrarily large and can result in resets taking longer to occur than necessary. Reduce this number to 3, which was chosen as a recommended value by Intel (their firmware allow two commands in flight so they recommend resetting on the third failed command). Signed-off-by: Abhishek Pandit-Subedi Reviewed-by: Miao-chen Chou Reviewed-by: Daniel Winkler --- drivers/bluetooth/btusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 03341e6cbf3ed..880e9cd4ee713 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -578,7 +578,7 @@ static void btusb_gpio_cmd_timeout(struct hci_dev *hdev) { struct btusb_data *data = hci_get_drvdata(hdev); - if (++data->cmd_timeout_cnt < 5) + if (++data->cmd_timeout_cnt < 3) return; if (!data->reset_gpio) { -- 2.30.0.284.gd98b1dd5eaa7-goog