Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3205779pxb; Tue, 13 Apr 2021 22:55:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLG5Qz08xYhCcjsJp22TYpmPqa4J+XWu5Ami1ZwZlOiJAoo6hdJweNduXebyuKt9bflnrI X-Received: by 2002:a17:90a:c091:: with SMTP id o17mr1662974pjs.185.1618379731725; Tue, 13 Apr 2021 22:55:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618379731; cv=none; d=google.com; s=arc-20160816; b=J5GS7qL1HxwXTB3cDM4bNTeEb2RzrpC6GD58IOtybfP/MbFzPgz4hJ//Gq5y7DOU1Z Y1yzF76qahXKBxIQuqEpOUgj3GJYDU5ApEg9iakpHl7z+rc0JPWAsdkIH0jgl6ukGHi4 1+i99Yu8TAVhpCOfsNudZdLk05TW3m1RQbBjQ4pmVFJjMc4IpLHJjavgv9JUpmnjZDkH oo7DB123n3pfhljiUOdnjxBPUE9VHYdZiRwV20aVn6UHCiHckLWRm+0DBBAUh81RQBtN E0uX47JjR1BkldGYSQc2uiilwnXsqcO1Kz+IUXLh+hkg/GN9vWzR2/lkVQDPMpkZWyQD xb9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=btF2ilb5R7sabpP1NAbqzbrhUj10y169Uz/AAqWnj38=; b=o1vCcIpE5F2WD00AAVQhurPuk0ht6n6UnEmWu3MtfX0YifyKIKhNZKMA5out1RvQ9I PQNrXvhutQbOGgcGnmh9Fsq4vdKBpohEuFHFlSR4IUhkg+QOZHsiWJWDlkbni5GSG628 8GKk6qEDSmQyfETpPI5US0J64OrqzK4qdY3tfvLEonOC+EQM9gIZXng+4x21zbblgujT fczyZseYEGg8AVMY69EwhT267fkUO/6cunl25mxd6yF7gRZNJwWwIQ0gu8U0qj4bYKHU c+1YMc1VAS1dijX4tCyen5O+IccoKskmVqvjkxtbMxip3C7lD5jZaP6yBVLyvnN8cxGL Nqhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x8si6269152pjo.21.2021.04.13.22.55.19; Tue, 13 Apr 2021 22:55:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347748AbhDMStX convert rfc822-to-8bit (ORCPT + 99 others); Tue, 13 Apr 2021 14:49:23 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:40776 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347747AbhDMStW (ORCPT ); Tue, 13 Apr 2021 14:49:22 -0400 Received: from marcel-macbook.holtmann.net (p5b3d235a.dip0.t-ipconnect.de [91.61.35.90]) by mail.holtmann.org (Postfix) with ESMTPSA id A2801CECCC; Tue, 13 Apr 2021 20:56:44 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: [PATCH v3 1/2] Bluetooth: btusb: support link statistics telemetry events From: Marcel Holtmann In-Reply-To: <20210413101812.323079-1-josephsih@chromium.org> Date: Tue, 13 Apr 2021 20:48:59 +0200 Cc: "open list:BLUETOOTH DRIVERS" , Luiz Augusto von Dentz , =?utf-8?Q?Pali_Roh=C3=A1r?= , josephsih@google.com, CrosBT Upstreaming , Chethan T N , Miao-chen Chou , Kiran K , Johan Hedberg , linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <2D46F127-6669-4394-B3D5-1677D4BF72EE@holtmann.org> References: <20210413101812.323079-1-josephsih@chromium.org> To: Joseph Hwang X-Mailer: Apple Mail (2.3654.60.0.2.21) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Joseph, > This patch supports the link statistics telemetry events for > Intel controllers > > To avoid the overhead, this debug feature is disabled by default. > > Reviewed-by: Miao-chen Chou > Signed-off-by: Chethan T N > Signed-off-by: Kiran K > Signed-off-by: Joseph Hwang > --- > > Changes in v3: > - fix the long line in the commit message > > Changes in v2: > - take care of intel_newgen as well as intel_new > - fix the long lines in mgmt.c > > drivers/bluetooth/btintel.c | 20 +++++++++++++++++++- > drivers/bluetooth/btusb.c | 18 ------------------ > 2 files changed, 19 insertions(+), 19 deletions(-) > > diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c > index e44b6993cf91..de1dbdc01e5a 100644 > --- a/drivers/bluetooth/btintel.c > +++ b/drivers/bluetooth/btintel.c > @@ -1248,8 +1248,10 @@ EXPORT_SYMBOL_GPL(btintel_read_debug_features); > int btintel_set_debug_features(struct hci_dev *hdev, > const struct intel_debug_features *features) > { > - u8 mask[11] = { 0x0a, 0x92, 0x02, 0x07, 0x00, 0x00, 0x00, 0x00, > + u8 mask[11] = { 0x0a, 0x92, 0x02, 0x7f, 0x00, 0x00, 0x00, 0x00, > 0x00, 0x00, 0x00 }; > + u8 period[5] = { 0x04, 0x91, 0x02, 0x01, 0x00 }; > + u8 trace_enable = 0x02; > struct sk_buff *skb; > > if (!features) > @@ -1266,8 +1268,24 @@ int btintel_set_debug_features(struct hci_dev *hdev, > PTR_ERR(skb)); > return PTR_ERR(skb); > } > + kfree_skb(skb); > + > + skb = __hci_cmd_sync(hdev, 0xfc8b, 5, period, HCI_INIT_TIMEOUT); > + if (IS_ERR(skb)) { > + bt_dev_err(hdev, "Setting periodicity for link statistics traces failed (%ld)", > + PTR_ERR(skb)); > + return PTR_ERR(skb); > + } > + kfree_skb(skb); > > + skb = __hci_cmd_sync(hdev, 0xfca1, 1, &trace_enable, HCI_INIT_TIMEOUT); > + if (IS_ERR(skb)) { > + bt_dev_err(hdev, "Enable tracing of link statistics events failed (%ld)", > + PTR_ERR(skb)); > + return PTR_ERR(skb); > + } > kfree_skb(skb); > + > return 0; > } > EXPORT_SYMBOL_GPL(btintel_set_debug_features); > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c > index 192cb8c191bc..f29946f15f59 100644 > --- a/drivers/bluetooth/btusb.c > +++ b/drivers/bluetooth/btusb.c > @@ -2811,7 +2811,6 @@ static int btusb_setup_intel_new(struct hci_dev *hdev) > u32 boot_param; > char ddcname[64]; > int err; > - struct intel_debug_features features; > > BT_DBG("%s", hdev->name); > > @@ -2865,14 +2864,6 @@ static int btusb_setup_intel_new(struct hci_dev *hdev) > btintel_load_ddc_config(hdev, ddcname); > } > > - /* Read the Intel supported features and if new exception formats > - * supported, need to load the additional DDC config to enable. > - */ > - btintel_read_debug_features(hdev, &features); > - > - /* Set DDC mask for available debug features */ > - btintel_set_debug_features(hdev, &features); > - > /* Read the Intel version information after loading the FW */ > err = btintel_read_version(hdev, &ver); > if (err) > @@ -2911,7 +2902,6 @@ static int btusb_setup_intel_newgen(struct hci_dev *hdev) > u32 boot_param; > char ddcname[64]; > int err; > - struct intel_debug_features features; > struct intel_version_tlv version; > > bt_dev_dbg(hdev, ""); > @@ -2961,14 +2951,6 @@ static int btusb_setup_intel_newgen(struct hci_dev *hdev) > */ > btintel_load_ddc_config(hdev, ddcname); > > - /* Read the Intel supported features and if new exception formats > - * supported, need to load the additional DDC config to enable. > - */ > - btintel_read_debug_features(hdev, &features); > - > - /* Set DDC mask for available debug features */ > - btintel_set_debug_features(hdev, &features); > - > /* Read the Intel version information after loading the FW */ > err = btintel_read_version_tlv(hdev, &version); > if (err) so I don’t like this kind of removing and adding things at the same time. Please separate these patches properly. Regards Marcel