Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp674520imm; Sat, 14 Jul 2018 09:35:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfGwpugpTl0zjB/mGZxsh0S4+lqbbOrhDkh8BhnjDLoB1iiMv0mSMYLA7eGlBo4dN/jgeSS X-Received: by 2002:a17:902:b81:: with SMTP id 1-v6mr10798542plr.164.1531586130612; Sat, 14 Jul 2018 09:35:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531586130; cv=none; d=google.com; s=arc-20160816; b=uM4GgU0O/Sd6LaXK/MlktytvLYz+j+g2tGsg/pxly1vmcFrXQ7to8+vUh85iHkrVVX cg1Ba8b7X1uY66OmL9tMlP/z+bc+fv4LrLKhnULUh5jm+FLPynRzF8zW/WeU7TkeybTv 7hB9wcHCS+HQtLCHZ6UQdS8jvJy9AVQVcIiBkYhaGxhA3gHGIt77XNLi3uFlLZIe3apq WIkLYDNM7CCOhsTKPzSOJd0DPTWzyYjEmCxs+3aIUTusmB3EOZuX5E8NbRfu5uLnNE5o qACA+bsGoiuQAYjYAn7EmQ4ufGDJDARqjlh5m6Y6Hqu8S61hzojH8zpT4TcZu2Q3Eyoq OaOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:arc-authentication-results; bh=N0HfeEYMEe3urTwDfSZ3A+Tc9/P6UcqRXPu0LSiHkrI=; b=GLyem8N18pgMXVDacNxl6G/5SJu4KiBamvQYwr9ql5rMScT0QGdyGNs/75EYTB8u+A y8+6q7pUAebgrfxwtSSLytucrmNkIyErtFt5WTG7ua1/GVEUi9IZxxo49r0it5bWqi1q 5ZTzR7UoGElJsBRNI1Xoc2mkskHYDxVpwA1iWVLEQz9KvhzSfgcHqBZ9rUmNQN/9RvMP foPMxbp67LJe7RfydUGpzGmPoa9Ik+R6DVcNOWluRigilQrGAYhdBVp0OPgm5pDOVxd0 6jav96T/pyNiiOn9up8IUld4IOXIUlyRzY8aUdYVNBAHigr5ETGWwYEctbIxpQqfStEU zceA== ARC-Authentication-Results: i=1; mx.google.com; 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 ce9-v6si27818926plb.364.2018.07.14.09.35.15; Sat, 14 Jul 2018 09:35:30 -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; 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 S1727580AbeGNQyJ convert rfc822-to-8bit (ORCPT + 99 others); Sat, 14 Jul 2018 12:54:09 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:47340 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726618AbeGNQyJ (ORCPT ); Sat, 14 Jul 2018 12:54:09 -0400 Received: from [192.168.0.117] (188.146.224.185.nat.umts.dynamic.t-mobile.pl [188.146.224.185]) by mail.holtmann.org (Postfix) with ESMTPSA id 9386ACF163; Sat, 14 Jul 2018 18:41:23 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: [PATCH v5 4/7] Bluetooth: Add new quirk for non-persistent setup settings From: Marcel Holtmann In-Reply-To: <4b188c8a508340598dda233f6d49a16c9ac8784e.1531150733.git.sean.wang@mediatek.com> Date: Sat, 14 Jul 2018 18:34:29 +0200 Cc: robh+dt@kernel.org, mark.rutland@arm.com, Johan Hedberg , devicetree@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <2825B722-E75C-4A3C-8110-879205E46C0E@holtmann.org> References: <4b188c8a508340598dda233f6d49a16c9ac8784e.1531150733.git.sean.wang@mediatek.com> To: sean.wang@mediatek.com X-Mailer: Apple Mail (2.3445.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sean, > Add a new quirk HCI_QUIRK_NON_PERSISTENT_SETUP allowing that a quirk that > runs setup() after every open() and not just after the first open(). > > Signed-off-by: Sean Wang > --- > include/net/bluetooth/hci.h | 9 +++++++++ > net/bluetooth/hci_core.c | 3 ++- > 2 files changed, 11 insertions(+), 1 deletion(-) > > diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h > index 73e48be..d3ec5b2a8 100644 > --- a/include/net/bluetooth/hci.h > +++ b/include/net/bluetooth/hci.h > @@ -183,6 +183,15 @@ enum { > * during the hdev->setup vendor callback. > */ > HCI_QUIRK_NON_PERSISTENT_DIAG, > + > + /* When this quirk is set, setup() would be run after every > + * open() and not just after the first open(). > + * > + * This quirk can be set before hci_register_dev is called or > + * during the hdev->setup vendor callback. > + * > + */ > + HCI_QUIRK_NON_PERSISTENT_SETUP, > }; > > /* HCI device flags */ > diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c > index f5c21004..0111280 100644 > --- a/net/bluetooth/hci_core.c > +++ b/net/bluetooth/hci_core.c > @@ -1396,7 +1396,8 @@ static int hci_dev_do_open(struct hci_dev *hdev) > atomic_set(&hdev->cmd_cnt, 1); > set_bit(HCI_INIT, &hdev->flags); > > - if (hci_dev_test_flag(hdev, HCI_SETUP)) { > + if (hci_dev_test_flag(hdev, HCI_SETUP) || > + test_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks)) { > hci_sock_dev_event(hdev, HCI_DEV_SETUP); can you include the extract of btmon on how the HCI_DEV_SETUP event shows up in the traces? I remember that I asked about something like that. Regards Marcel