All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Populate hci_set_hw_info for Intel and Realtek
@ 2024-04-22  7:24 Archie Pusaka
  2024-04-22  7:32 ` Paul Menzel
  2024-04-22  7:56 ` bluez.test.bot
  0 siblings, 2 replies; 4+ messages in thread
From: Archie Pusaka @ 2024-04-22  7:24 UTC (permalink / raw)
  To: linux-bluetooth, Luiz Augusto von Dentz, Johan Hedberg,
	Marcel Holtmann
  Cc: CrosBT Upstreaming, Archie Pusaka, Abhishek Pandit-Subedi,
	linux-kernel

From: Archie Pusaka <apusaka@chromium.org>

The hardware information surfaced via debugfs might be usable by the
userspace to set some configuration knobs. This patch sets the hw_info
for Intel and Realtek chipsets.

Signed-off-by: Archie Pusaka <apusaka@chromium.org>
Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@google.com>

---

 drivers/bluetooth/btintel.c | 9 +++++++++
 drivers/bluetooth/btrtl.c   | 7 +++++++
 2 files changed, 16 insertions(+)

diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index a19ebe47bd951..dc48352166a52 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -2956,6 +2956,11 @@ static int btintel_setup_combined(struct hci_dev *hdev)
 			err = -EINVAL;
 		}
 
+		hci_set_hw_info(hdev,
+				"INTEL platform=%u variant=%u revision=%u",
+				ver.hw_platform, ver.hw_variant,
+				ver.hw_revision);
+
 		goto exit_error;
 	}
 
@@ -3060,6 +3065,10 @@ static int btintel_setup_combined(struct hci_dev *hdev)
 		break;
 	}
 
+	hci_set_hw_info(hdev, "INTEL platform=%u variant=%u",
+			INTEL_HW_PLATFORM(ver_tlv.cnvi_bt),
+			INTEL_HW_VARIANT(ver_tlv.cnvi_bt));
+
 exit_error:
 	kfree_skb(skb);
 
diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index cc50de69e8dc9..4f1e37b4f7802 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -1339,6 +1339,13 @@ int btrtl_setup_realtek(struct hci_dev *hdev)
 
 	btrtl_set_quirks(hdev, btrtl_dev);
 
+	hci_set_hw_info(hdev,
+			"RTL lmp_subver=%u hci_rev=%u hci_ver=%u hci_bus=%u",
+			btrtl_dev->ic_info->lmp_subver,
+			btrtl_dev->ic_info->hci_rev,
+			btrtl_dev->ic_info->hci_ver,
+			btrtl_dev->ic_info->hci_bus);
+
 	btrtl_free(btrtl_dev);
 	return ret;
 }
-- 
2.44.0.769.g3c40516874-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Bluetooth: Populate hci_set_hw_info for Intel and Realtek
  2024-04-22  7:24 [PATCH] Bluetooth: Populate hci_set_hw_info for Intel and Realtek Archie Pusaka
@ 2024-04-22  7:32 ` Paul Menzel
  2024-04-22  8:25   ` Archie Pusaka
  2024-04-22  7:56 ` bluez.test.bot
  1 sibling, 1 reply; 4+ messages in thread
From: Paul Menzel @ 2024-04-22  7:32 UTC (permalink / raw)
  To: Archie Pusaka, Archie Pusaka
  Cc: linux-bluetooth, Luiz Augusto von Dentz, Johan Hedberg,
	Marcel Holtmann, chromeos-bluetooth-upstreaming,
	Abhishek Pandit-Subedi, linux-kernel

Dear Archie,


Thank you for your patch.

Am 22.04.24 um 09:24 schrieb Archie Pusaka:
> From: Archie Pusaka <apusaka@chromium.org>
> 
> The hardware information surfaced via debugfs might be usable by the
> userspace to set some configuration knobs. This patch sets the hw_info
> for Intel and Realtek chipsets.

Could you please add an example paste to the commit message?

> Signed-off-by: Archie Pusaka <apusaka@chromium.org>
> Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@google.com>
> 
> ---
> 
>   drivers/bluetooth/btintel.c | 9 +++++++++
>   drivers/bluetooth/btrtl.c   | 7 +++++++
>   2 files changed, 16 insertions(+)
> 
> diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
> index a19ebe47bd951..dc48352166a52 100644
> --- a/drivers/bluetooth/btintel.c
> +++ b/drivers/bluetooth/btintel.c
> @@ -2956,6 +2956,11 @@ static int btintel_setup_combined(struct hci_dev *hdev)
>   			err = -EINVAL;
>   		}
>   
> +		hci_set_hw_info(hdev,
> +				"INTEL platform=%u variant=%u revision=%u",
> +				ver.hw_platform, ver.hw_variant,
> +				ver.hw_revision);
> +
>   		goto exit_error;
>   	}
>   
> @@ -3060,6 +3065,10 @@ static int btintel_setup_combined(struct hci_dev *hdev)
>   		break;
>   	}
>   
> +	hci_set_hw_info(hdev, "INTEL platform=%u variant=%u",
> +			INTEL_HW_PLATFORM(ver_tlv.cnvi_bt),
> +			INTEL_HW_VARIANT(ver_tlv.cnvi_bt));
> +

Why does it need to be added at two places?

>   exit_error:
>   	kfree_skb(skb);
>   
> diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
> index cc50de69e8dc9..4f1e37b4f7802 100644
> --- a/drivers/bluetooth/btrtl.c
> +++ b/drivers/bluetooth/btrtl.c
> @@ -1339,6 +1339,13 @@ int btrtl_setup_realtek(struct hci_dev *hdev)
>   
>   	btrtl_set_quirks(hdev, btrtl_dev);
>   
> +	hci_set_hw_info(hdev,
> +			"RTL lmp_subver=%u hci_rev=%u hci_ver=%u hci_bus=%u",
> +			btrtl_dev->ic_info->lmp_subver,
> +			btrtl_dev->ic_info->hci_rev,
> +			btrtl_dev->ic_info->hci_ver,
> +			btrtl_dev->ic_info->hci_bus);
> +
>   	btrtl_free(btrtl_dev);
>   	return ret;
>   }


Kind regards,

Paul

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Bluetooth: Populate hci_set_hw_info for Intel and Realtek
  2024-04-22  7:24 [PATCH] Bluetooth: Populate hci_set_hw_info for Intel and Realtek Archie Pusaka
  2024-04-22  7:32 ` Paul Menzel
@ 2024-04-22  7:56 ` bluez.test.bot
  1 sibling, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2024-04-22  7:56 UTC (permalink / raw)
  To: linux-bluetooth, apusaka

[-- Attachment #1: Type: text/plain, Size: 2749 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=846521

---Test result---

Test Summary:
CheckPatch                    PASS      1.14 seconds
GitLint                       PASS      0.26 seconds
SubjectPrefix                 PASS      0.09 seconds
BuildKernel                   PASS      30.67 seconds
CheckAllWarning               PASS      33.38 seconds
CheckSparse                   PASS      38.88 seconds
CheckSmatch                   FAIL      36.77 seconds
BuildKernel32                 PASS      29.10 seconds
TestRunnerSetup               PASS      524.07 seconds
TestRunner_l2cap-tester       PASS      18.38 seconds
TestRunner_iso-tester         PASS      30.65 seconds
TestRunner_bnep-tester        PASS      4.68 seconds
TestRunner_mgmt-tester        FAIL      111.18 seconds
TestRunner_rfcomm-tester      PASS      7.23 seconds
TestRunner_sco-tester         PASS      14.97 seconds
TestRunner_ioctl-tester       PASS      7.51 seconds
TestRunner_mesh-tester        PASS      5.68 seconds
TestRunner_smp-tester         PASS      6.74 seconds
TestRunner_userchan-tester    PASS      4.81 seconds
IncrementalBuild              PASS      27.98 seconds

Details
##############################
Test: CheckSmatch - FAIL
Desc: Run smatch tool with source
Output:

Segmentation fault (core dumped)
make[4]: *** [scripts/Makefile.build:244: net/bluetooth/hci_core.o] Error 139
make[4]: *** Deleting file 'net/bluetooth/hci_core.o'
make[3]: *** [scripts/Makefile.build:485: net/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:485: net] Error 2
make[2]: *** Waiting for unfinished jobs....
Segmentation fault (core dumped)
make[4]: *** [scripts/Makefile.build:244: drivers/bluetooth/bcm203x.o] Error 139
make[4]: *** Deleting file 'drivers/bluetooth/bcm203x.o'
make[4]: *** Waiting for unfinished jobs....
Segmentation fault (core dumped)
make[4]: *** [scripts/Makefile.build:244: drivers/bluetooth/bpa10x.o] Error 139
make[4]: *** Deleting file 'drivers/bluetooth/bpa10x.o'
make[3]: *** [scripts/Makefile.build:485: drivers/bluetooth] Error 2
make[2]: *** [scripts/Makefile.build:485: drivers] Error 2
make[1]: *** [/github/workspace/src/src/Makefile:1919: .] Error 2
make: *** [Makefile:240: __sub-make] Error 2
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 492, Passed: 489 (99.4%), Failed: 1, Not Run: 2

Failed Test Cases
LL Privacy - Start Discovery 2 (Disable RL)          Failed       0.170 seconds


---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Bluetooth: Populate hci_set_hw_info for Intel and Realtek
  2024-04-22  7:32 ` Paul Menzel
@ 2024-04-22  8:25   ` Archie Pusaka
  0 siblings, 0 replies; 4+ messages in thread
From: Archie Pusaka @ 2024-04-22  8:25 UTC (permalink / raw)
  To: Paul Menzel
  Cc: Archie Pusaka, linux-bluetooth, Luiz Augusto von Dentz,
	Johan Hedberg, Marcel Holtmann, chromeos-bluetooth-upstreaming,
	Abhishek Pandit-Subedi, linux-kernel

Hi Paul,

On Mon, 22 Apr 2024 at 15:32, Paul Menzel <pmenzel@molgen.mpg.de> wrote:
>
> Dear Archie,
>
>
> Thank you for your patch.
>
> Am 22.04.24 um 09:24 schrieb Archie Pusaka:
> > From: Archie Pusaka <apusaka@chromium.org>
> >
> > The hardware information surfaced via debugfs might be usable by the
> > userspace to set some configuration knobs. This patch sets the hw_info
> > for Intel and Realtek chipsets.
>
> Could you please add an example paste to the commit message?
>
Sure, I will add those.

> > Signed-off-by: Archie Pusaka <apusaka@chromium.org>
> > Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@google.com>
> >
> > ---
> >
> >   drivers/bluetooth/btintel.c | 9 +++++++++
> >   drivers/bluetooth/btrtl.c   | 7 +++++++
> >   2 files changed, 16 insertions(+)
> >
> > diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
> > index a19ebe47bd951..dc48352166a52 100644
> > --- a/drivers/bluetooth/btintel.c
> > +++ b/drivers/bluetooth/btintel.c
> > @@ -2956,6 +2956,11 @@ static int btintel_setup_combined(struct hci_dev *hdev)
> >                       err = -EINVAL;
> >               }
> >
> > +             hci_set_hw_info(hdev,
> > +                             "INTEL platform=%u variant=%u revision=%u",
> > +                             ver.hw_platform, ver.hw_variant,
> > +                             ver.hw_revision);
> > +
> >               goto exit_error;
> >       }
> >
> > @@ -3060,6 +3065,10 @@ static int btintel_setup_combined(struct hci_dev *hdev)
> >               break;
> >       }
> >
> > +     hci_set_hw_info(hdev, "INTEL platform=%u variant=%u",
> > +                     INTEL_HW_PLATFORM(ver_tlv.cnvi_bt),
> > +                     INTEL_HW_VARIANT(ver_tlv.cnvi_bt));
> > +
>
> Why does it need to be added at two places?
>
Intel put the HW information into two structs, the "intel_version ver"
and "intel_version_tlv ver_tlv".
I don't know the history of the two structs, but that requires us to
have the hw info set in two places.
At most only one of them is executed though.

> >   exit_error:
> >       kfree_skb(skb);
> >
> > diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
> > index cc50de69e8dc9..4f1e37b4f7802 100644
> > --- a/drivers/bluetooth/btrtl.c
> > +++ b/drivers/bluetooth/btrtl.c
> > @@ -1339,6 +1339,13 @@ int btrtl_setup_realtek(struct hci_dev *hdev)
> >
> >       btrtl_set_quirks(hdev, btrtl_dev);
> >
> > +     hci_set_hw_info(hdev,
> > +                     "RTL lmp_subver=%u hci_rev=%u hci_ver=%u hci_bus=%u",
> > +                     btrtl_dev->ic_info->lmp_subver,
> > +                     btrtl_dev->ic_info->hci_rev,
> > +                     btrtl_dev->ic_info->hci_ver,
> > +                     btrtl_dev->ic_info->hci_bus);
> > +
> >       btrtl_free(btrtl_dev);
> >       return ret;
> >   }
>
>
> Kind regards,
>
> Paul

Thanks!

Archie

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-22  8:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-22  7:24 [PATCH] Bluetooth: Populate hci_set_hw_info for Intel and Realtek Archie Pusaka
2024-04-22  7:32 ` Paul Menzel
2024-04-22  8:25   ` Archie Pusaka
2024-04-22  7:56 ` bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.