Skip to contentSkip to conversation

Bluetooth: btintel_pcie: Reset controller before configuring MSI-X

PATCH In review Kiran K 4 participants 5 messages May 11 – May 12 Bluetooth drivers

lore
Share & tools
lore

Kiran K

author
#0 lore raw

PATCH 1/1 Bluetooth: btintel_pcie: Reset controller before configuring MSI-X

From: Sai Teja Aluvala <[email protected]>

Perform the shared hardware reset in btintel_pcie_probe() before configuring MSI-X so the controller starts from a known clean state.

While here, move btintel_pcie_config_msix() out of btintel_pcie_config_pcie() and into the probe sequence, and propagate errors from btintel_pcie_reset_bt() so probe fails cleanly if the shared HW reset does not complete.

---
 drivers/bluetooth/btintel_pcie.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/bluetooth/btintel_pcie.c +8 -3
index fda474406003..6ff08de9ec78 100644
@@ -1646,9 +1646,6 @@ static int btintel_pcie_config_pcie(struct pci_dev *pdev,
 	if (err)
 		return err;
 
-	/* Configure MSI-X with causes list */
-	btintel_pcie_config_msix(data);
-
 	return 0;
 }
 
@@ -2659,6 +2656,14 @@ static int btintel_pcie_probe(struct pci_dev *pdev,
 	if (err)
 		goto exit_error;
 
+	err = btintel_pcie_reset_bt(data);
+	if (err) {
+		dev_err(&pdev->dev, "Bluetooth shared HW reset failed (%d)\n", err);
+		goto exit_error;
+	}
+
+	/* Configure MSI-X with causes list */
+	btintel_pcie_config_msix(data);
 	pci_set_drvdata(pdev, data);
 
 	err = btintel_pcie_alloc(data);
Signature · 1 line
2.53.0
#1 lore raw

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=1092796

---Test result---

Test Summary:

CheckPatch                    PASS      0.67 seconds
GitLint                       PASS      0.28 seconds
SubjectPrefix                 PASS      1.58 seconds
BuildKernel                   PASS      26.84 seconds
CheckAllWarning               PASS      29.54 seconds
CheckSparse                   PASS      28.25 seconds
BuildKernel32                 PASS      26.49 seconds
TestRunnerSetup               PASS      576.72 seconds
IncrementalBuild              PASS      25.73 seconds

https://github.com/bluez/bluetooth-next/pull/166

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to Kiran K

Dear Kiran,

Thank you for your patch.

Am 11.05.26 um 15:27 schrieb Kiran K:

Quoted 4 lines

From: Sai Teja Aluvala <[email protected]>

Perform the shared hardware reset in btintel_pcie_probe() before configuring MSI-X so the controller starts from a known clean state.

Did you run into problems with the current ordering?

Quoted 4 lines

While here, move btintel_pcie_config_msix() out of btintel_pcie_config_pcie() and into the probe sequence, and propagate errors from btintel_pcie_reset_bt() so probe fails cleanly if the shared HW reset does not complete.

“While here” also sounds to me to split the commit into two. But your call.

Please add a paragraph how to test it. (Maybe what log messages to look out for.) Is there a way to force btintel_pcie_reset_bt() to fail?

Quoted 21 lines
---
  drivers/bluetooth/btintel_pcie.c | 11 ++++++++---
  1 file changed, 8 insertions(+), 3 deletions(-)
drivers/bluetooth/btintel_pcie.c +0 -3
index fda474406003..6ff08de9ec78 100644
@@ -1646,9 +1646,6 @@ static int btintel_pcie_config_pcie(struct pci_dev *pdev,
  	if (err)
  		return err;
 
-	/* Configure MSI-X with causes list */
-	btintel_pcie_config_msix(data);
-
  	return 0;
  }
 

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_probe(struct pci_dev *pdev, · line 2661

Quoted 6 lines
drivers/bluetooth/btintel_pcie.c +3 -0
@@ -2659,6 +2656,14 @@ static int btintel_pcie_probe(struct pci_dev *pdev,
  	if (err)
  		goto exit_error;
 
+	err = btintel_pcie_reset_bt(data);
+	if (err) {
+		dev_err(&pdev->dev, "Bluetooth shared HW reset failed (%d)\n", err);

What is “shared HW reset”?

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_probe(struct pci_dev *pdev, · line 2669

Quoted 8 lines
drivers/bluetooth/btintel_pcie.c +5 -0
+		goto exit_error;
+	}
+
+	/* Configure MSI-X with causes list */
+	btintel_pcie_config_msix(data);
  	pci_set_drvdata(pdev, data);
 
  	err = btintel_pcie_alloc(data);

Kind regards,

Paul

author
#3 lore raw

Hi Paul,

Thanks for the comments.

Quoted 8 lines

Subject: Re: [PATCH v1] Bluetooth: btintel_pcie: Reset controller before configuring MSI-X

Dear Kiran,

Thank you for your patch.

Quoted 7 lines

Am 11.05.26 um 15:27 schrieb Kiran K:

Quoted 4 lines

From: Sai Teja Aluvala <[email protected]>

Perform the shared hardware reset in btintel_pcie_probe() before configuring MSI-X so the controller starts from a known clean state.

Did you run into problems with the current ordering?

Yes, we found hardware initialization issue due to which _probe() was failing and the issue was seen only in simics (virtual environment). This happens if hardware is not reset to boot rom mode before initializing.

Quoted 7 lines
Quoted 5 lines

While here, move btintel_pcie_config_msix() out of btintel_pcie_config_pcie() and into the probe sequence, and propagate errors from btintel_pcie_reset_bt() so probe fails cleanly if the shared HW reset does not complete.

“While here” also sounds to me to split the commit into two. But your call.

I will update the commit message in v2 version of the patch.

Quoted 30 lines

Please add a paragraph how to test it. (Maybe what log messages to look out for.) Is there a way to force btintel_pcie_reset_bt() to fail?

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_config_pcie(struct pci_dev

Quoted 12 lines
---
  drivers/bluetooth/btintel_pcie.c | 11 ++++++++---
  1 file changed, 8 insertions(+), 3 deletions(-)
drivers/bluetooth/btintel_pcie.c +0 -0
index fda474406003..6ff08de9ec78 100644
@@ -1646,9 +1646,6 @@ static int btintel_pcie_config_pcie(struct pci_dev

*pdev,

Quoted 13 lines
drivers/bluetooth/btintel_pcie.c +0 -3
  	if (err)
  		return err;
 
-	/* Configure MSI-X with causes list */
-	btintel_pcie_config_msix(data);
-
  	return 0;
  }
 
@@ -2659,6 +2656,14 @@ static int btintel_pcie_probe(struct pci_dev *pdev,
  	if (err)
  		goto exit_error;
 
Quoted 7 lines

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_probe(struct pci_dev *pdev,

Quoted 3 lines
drivers/bluetooth/btintel_pcie.c +3 -0
+	err = btintel_pcie_reset_bt(data);
+	if (err) {
+		dev_err(&pdev->dev, "Bluetooth shared HW reset failed

(%d)\n",

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_probe(struct pci_dev *pdev, · line 2662

Quoted 1 line
drivers/bluetooth/btintel_pcie.c +1 -0
+err);

What is “shared HW reset”?

Shared HW reset refers to initializing hardware to boot rom state.

Quoted 8 lines
Quoted 8 lines
drivers/bluetooth/btintel_pcie.c +5 -0
+		goto exit_error;
+	}
+
+	/* Configure MSI-X with causes list */
+	btintel_pcie_config_msix(data);
  	pci_set_drvdata(pdev, data);
 
Quoted 6 lines
Quoted 1 line
  	err = btintel_pcie_alloc(data);

Kind regards,

Paul

Thanks,
Kiran

#4 lore raw
In reply to Kiran K

Hi Kiran,

Quoted 33 lines · Kiran K

From: Sai Teja Aluvala <[email protected]>

Perform the shared hardware reset in btintel_pcie_probe() before configuring MSI-X so the controller starts from a known clean state.

While here, move btintel_pcie_config_msix() out of btintel_pcie_config_pcie() and into the probe sequence, and propagate errors from btintel_pcie_reset_bt() so probe fails cleanly if the shared HW reset does not complete.

---
 drivers/bluetooth/btintel_pcie.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/bluetooth/btintel_pcie.c +0 -3
index fda474406003..6ff08de9ec78 100644
@@ -1646,9 +1646,6 @@ static int btintel_pcie_config_pcie(struct pci_dev *pdev,
        if (err)
                return err;
 
-       /* Configure MSI-X with causes list */
-       btintel_pcie_config_msix(data);
-
        return 0;
 }
 
@@ -2659,6 +2656,14 @@ static int btintel_pcie_probe(struct pci_dev *pdev,
        if (err)

drivers/bluetooth/btintel_pcie.c static int btintel_pcie_probe(struct pci_dev *pdev, · line 2666

Quoted 10 lines
drivers/bluetooth/btintel_pcie.c +8 -0
                goto exit_error;
 
+       err = btintel_pcie_reset_bt(data);
+       if (err) {
+               dev_err(&pdev->dev, "Bluetooth shared HW reset failed (%d)\n", err);
+               goto exit_error;
+       }
+
+       /* Configure MSI-X with causes list */
+       btintel_pcie_config_msix(data);

Sashiko raised several comments on this:

https://sashiko.dev/#/patchset/20260511132711.1216139-1-kiran.k%40intel.com

Quoted 7 lines
drivers/bluetooth/btintel_pcie.c +0 -1
        pci_set_drvdata(pdev, data);
 
        err = btintel_pcie_alloc(data);
--

2.53.0

Signature · 1 line
Luiz Augusto von Dentz