Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp9034448rwi; Tue, 25 Oct 2022 14:20:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Cb/LPm6z7qQhRytXUqLVA2lbe4+6yqEFGtQ0DcDAlGV5TyDjcXefbR2gdLhyMo0eeAASq X-Received: by 2002:a05:6402:274c:b0:461:9921:60cf with SMTP id z12-20020a056402274c00b00461992160cfmr15605711edd.353.1666732814182; Tue, 25 Oct 2022 14:20:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666732814; cv=none; d=google.com; s=arc-20160816; b=DT4Kc3HfDjneHvGC2OAvLjJ30o5lt/H/Ti67MxU5Si9NdwIcOt68oVmx4e25zjqp7Z MDo5TFJte6J/S9NEgxmwKMmFhgk650IRMykqqGqD9RcI8zokn73gdPLOXzeuyveceTE5 BVeNpSuOHrebMbgkqIJMW2e+4hxMuzXiHzy4S4sp/tP40v7vMlZqQs2YmYKaz7g4cc2O mUx3ysUP6IJIMoVEEA/umw3su4DPE4mZSXEREEgqGgID+cffKYVRutQbY9t+dcdbnIek lcergNFQCg40pjyK2iyfww1U0pzmrbN40ZXsW0idp6RF2yQCiE4dCdyBlkacNEMAlsm8 XJwQ== 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 :message-id:date:subject:to:from:dkim-signature; bh=ygM60BjTK/Gp3D6hT+2zvWdUnoEjruIpLetF6G5CN4c=; b=xODtQNSjVI7tuGgEr1GO6/Z/vPpngHoHGE1cCy5OhFJrYmF5p2PHv7pI9SePG/Udnl mN0n5k8KcBorTpqiR+2y6dPihJks1mirkyWfuEAyq/Jle/lSXc2etvJgoZF4oBy6O4rH sPh9jMe1+RDsV54taExWuWNse/WRN3tNm3AfLVRbaRmftrsUKPrF1kYEu9dXxQEU7mbS b849ZUnliXR12LQ857neT1Dfd3QfGJK494uZahoSfv6JWfWITQgI7hW7RlFLeIvlloBR 7LcRK4zQoMkYjA5u0WhQP8O8n9nlJpVGUDsUkM6TkufTov8pQWfLVhUT5Ea7nVnI7bEJ phcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GMrmHZL+; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd36-20020a1709076e2400b0078dcf11ccf7si4100464ejc.802.2022.10.25.14.18.47; Tue, 25 Oct 2022 14:20:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GMrmHZL+; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231241AbiJYVNF (ORCPT + 99 others); Tue, 25 Oct 2022 17:13:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230179AbiJYVNE (ORCPT ); Tue, 25 Oct 2022 17:13:04 -0400 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DA8D106A56 for ; Tue, 25 Oct 2022 14:13:02 -0700 (PDT) Received: by mail-il1-x133.google.com with SMTP id r1so1361201ilg.6 for ; Tue, 25 Oct 2022 14:13:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=ygM60BjTK/Gp3D6hT+2zvWdUnoEjruIpLetF6G5CN4c=; b=GMrmHZL+v8HAi54XLvlIYuiKB78jSMkQv7J8rSPq4uLhsos0lYxOY8LRggaDsr6BED fSXjrlyImUKZmBLk9+l0jIV0noT7fpUJb0ELhCzfhJVKe4wl/lvNDuMdWY5wtGvFCtmI +0tuz1avJDA4xE3iPJaz2r3MazQro36AZulKDaVwvEpBVQWtE0+T3UK2OLZYAj9GfBwO GcYKGxNJTNjqRqfnyEmLjLwIMTR54EXhCSrRpH7HIuFgTWMhQWATSAfehmTflj6VKcjv Ecpbyek/HQB3Le1tvqKM9pN6OO7hSdAKiM4ARSzqC97mCZWKNnt4CdcE4zPRD6j/0SCD 63rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ygM60BjTK/Gp3D6hT+2zvWdUnoEjruIpLetF6G5CN4c=; b=ADTkowkrQ5FJypCaGOaEsC/EGRFIX5QjLfZXDIu5u+IuL230vDw4crP+Ih/ni/MFVK fYCT9sE6i/Sdki1lya7L2QojFnAVLcqbIIFecaHNgpscM9CHMEtfIsxknaYo3cox6bh/ vVponPEdj8rsUD/3CEhX0SV4TJtDzmKkeHBRg8wihW81GE913tXWyOl0Rw9DqVT5kaqX E+uCCwjd3GQbEE8jvVBZ9AbDT+bRlvG5KNkkTgv/w1kIxpS+fbrSt9TJRhXPWo4lltYM M/r9WfmAPyu8OgpQckvBE+UFMuIISBh8KlpK2/aht5XenSSJULKomh+1tgGlY20cnJPO 6Q9w== X-Gm-Message-State: ACrzQf1W4C4ckZTMR5zWFRKCLA8ZfwcHbpv5TjtbkHccCsitFtmw2wUG ax/CM77uofD48yCrAIkvyZyTj5ixeAA= X-Received: by 2002:a92:1912:0:b0:2fc:f539:9da9 with SMTP id 18-20020a921912000000b002fcf5399da9mr25546353ilz.262.1666732381126; Tue, 25 Oct 2022 14:13:01 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id w11-20020a02394b000000b003636c046e73sm1253337jae.95.2022.10.25.14.12.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 14:13:00 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH 1/2] Bluetooth: btusb: Add CONFIG_BT_HCIBTUSB_POLL_SYNC Date: Tue, 25 Oct 2022 14:12:57 -0700 Message-Id: <20221025211258.1385541-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz This adds CONFIG_BT_HCIBTUSB_POLL_SYNC which can be used to set the default behavior of Bluetooth USB controller with respect to poll synchronization of its endpoits. Signed-off-by: Luiz Augusto von Dentz --- drivers/bluetooth/Kconfig | 10 ++++++++++ drivers/bluetooth/btusb.c | 3 +++ 2 files changed, 13 insertions(+) diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index e30707405455..fc36057d546d 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig @@ -45,6 +45,16 @@ config BT_HCIBTUSB_AUTOSUSPEND This can be overridden by passing btusb.enable_autosuspend=[y|n] on the kernel commandline. +config BT_HCIBTUSB_POLL_SYNC + bool "Enable USB poll_sync for Bluetooth USB devices by default" + depends on BT_HCIBTUSB + help + poll_sync synchronizes the USB data and event endpoints by + prioritizing the later. + + Say Y here to enable USB poll_sync for Bluetooth USB devices by + default. + config BT_HCIBTUSB_BCM bool "Broadcom protocol support" depends on BT_HCIBTUSB diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 30dd443f395f..bf978d3659cb 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -32,6 +32,7 @@ static bool disable_scofix; static bool force_scofix; static bool enable_autosuspend = IS_ENABLED(CONFIG_BT_HCIBTUSB_AUTOSUSPEND); +static bool enable_poll_sync = IS_ENABLED(CONFIG_BT_HCIBTUSB_POLL_SYNC); static bool reset = true; static struct usb_driver btusb_driver; @@ -3973,6 +3974,8 @@ static int btusb_probe(struct usb_interface *intf, if (enable_autosuspend) usb_enable_autosuspend(data->udev); + data->poll_sync = enable_poll_sync; + err = hci_register_dev(hdev); if (err < 0) goto out_free_dev; -- 2.37.3