linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Bluetooth: btnxpuart: Fix btnxpuart_close
@ 2024-03-04 18:14 Francesco Dolcini
  2024-03-04 18:57 ` [v2] " bluez.test.bot
  2024-03-04 21:30 ` [PATCH v2] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Francesco Dolcini @ 2024-03-04 18:14 UTC (permalink / raw)
  To: Amitkumar Karwar, Neeraj Kale, Marcel Holtmann,
	Luiz Augusto von Dentz
  Cc: Marcel Ziswiler, linux-bluetooth, linux-kernel, stable,
	Francesco Dolcini

From: Marcel Ziswiler <marcel.ziswiler@toradex.com>

Fix scheduling while atomic BUG in btnxpuart_close(), properly
purge the transmit queue and free the receive skb.

[   10.973809] BUG: scheduling while atomic: kworker/u9:0/80/0x00000002
...
[   10.980740] CPU: 3 PID: 80 Comm: kworker/u9:0 Not tainted 6.8.0-rc7-0.0.0-devel-00005-g61fdfceacf09 #1
[   10.980751] Hardware name: Toradex Verdin AM62 WB on Dahlia Board (DT)
[   10.980760] Workqueue: hci0 hci_power_off [bluetooth]
[   10.981169] Call trace:
...
[   10.981363]  uart_update_mctrl+0x58/0x78
[   10.981373]  uart_dtr_rts+0x104/0x114
[   10.981381]  tty_port_shutdown+0xd4/0xdc
[   10.981396]  tty_port_close+0x40/0xbc
[   10.981407]  uart_close+0x34/0x9c
[   10.981414]  ttyport_close+0x50/0x94
[   10.981430]  serdev_device_close+0x40/0x50
[   10.981442]  btnxpuart_close+0x24/0x98 [btnxpuart]
[   10.981469]  hci_dev_close_sync+0x2d8/0x718 [bluetooth]
[   10.981728]  hci_dev_do_close+0x2c/0x70 [bluetooth]
[   10.981862]  hci_power_off+0x20/0x64 [bluetooth]

Fixes: 689ca16e5232 ("Bluetooth: NXP: Add protocol support for NXP Bluetooth chipsets")
Cc: stable@vger.kernel.org
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Neeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
[ fd: reword commit message ]
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
v2:
 - reword commit message
 - added rb neeraj
v1: https://lore.kernel.org/all/20231018145540.34014-2-marcel@ziswiler.com/
---
 drivers/bluetooth/btnxpuart.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
index 55b6e3dcd4ec..0b93c2ff29e4 100644
--- a/drivers/bluetooth/btnxpuart.c
+++ b/drivers/bluetooth/btnxpuart.c
@@ -1252,6 +1252,9 @@ static int btnxpuart_close(struct hci_dev *hdev)
 
 	ps_wakeup(nxpdev);
 	serdev_device_close(nxpdev->serdev);
+	skb_queue_purge(&nxpdev->txq);
+	kfree_skb(nxpdev->rx_skb);
+	nxpdev->rx_skb = NULL;
 	clear_bit(BTNXPUART_SERDEV_OPEN, &nxpdev->tx_state);
 	return 0;
 }
-- 
2.39.2


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

* RE: [v2] Bluetooth: btnxpuart: Fix btnxpuart_close
  2024-03-04 18:14 [PATCH v2] Bluetooth: btnxpuart: Fix btnxpuart_close Francesco Dolcini
@ 2024-03-04 18:57 ` bluez.test.bot
  2024-03-04 21:30 ` [PATCH v2] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2024-03-04 18:57 UTC (permalink / raw)
  To: linux-bluetooth, francesco

[-- Attachment #1: Type: text/plain, Size: 2329 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=832198

---Test result---

Test Summary:
CheckPatch                    PASS      0.51 seconds
GitLint                       FAIL      0.48 seconds
SubjectPrefix                 PASS      0.07 seconds
BuildKernel                   PASS      27.58 seconds
CheckAllWarning               PASS      30.44 seconds
CheckSparse                   PASS      35.86 seconds
CheckSmatch                   PASS      97.72 seconds
BuildKernel32                 PASS      26.68 seconds
TestRunnerSetup               PASS      496.38 seconds
TestRunner_l2cap-tester       PASS      17.95 seconds
TestRunner_iso-tester         FAIL      32.68 seconds
TestRunner_bnep-tester        PASS      4.69 seconds
TestRunner_mgmt-tester        PASS      110.39 seconds
TestRunner_rfcomm-tester      PASS      7.27 seconds
TestRunner_sco-tester         PASS      14.93 seconds
TestRunner_ioctl-tester       PASS      7.74 seconds
TestRunner_mesh-tester        PASS      5.82 seconds
TestRunner_smp-tester         PASS      6.77 seconds
TestRunner_userchan-tester    PASS      7.76 seconds
IncrementalBuild              PASS      25.67 seconds

Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[v2] Bluetooth: btnxpuart: Fix btnxpuart_close

WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
10: B1 Line exceeds max length (105>80): "[   10.980740] CPU: 3 PID: 80 Comm: kworker/u9:0 Not tainted 6.8.0-rc7-0.0.0-devel-00005-g61fdfceacf09 #1"
##############################
Test: TestRunner_iso-tester - FAIL
Desc: Run iso-tester with test-runner
Output:
Total: 117, Passed: 116 (99.1%), Failed: 1, Not Run: 0

Failed Test Cases
ISO Connect2 Suspend - Success                       Failed       4.228 seconds


---
Regards,
Linux Bluetooth


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

* Re: [PATCH v2] Bluetooth: btnxpuart: Fix btnxpuart_close
  2024-03-04 18:14 [PATCH v2] Bluetooth: btnxpuart: Fix btnxpuart_close Francesco Dolcini
  2024-03-04 18:57 ` [v2] " bluez.test.bot
@ 2024-03-04 21:30 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2024-03-04 21:30 UTC (permalink / raw)
  To: Francesco Dolcini
  Cc: amitkumar.karwar, neeraj.sanjaykale, marcel, luiz.dentz,
	marcel.ziswiler, linux-bluetooth, linux-kernel, stable,
	francesco.dolcini

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Mon,  4 Mar 2024 19:14:21 +0100 you wrote:
> From: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> 
> Fix scheduling while atomic BUG in btnxpuart_close(), properly
> purge the transmit queue and free the receive skb.
> 
> [   10.973809] BUG: scheduling while atomic: kworker/u9:0/80/0x00000002
> ...
> [   10.980740] CPU: 3 PID: 80 Comm: kworker/u9:0 Not tainted 6.8.0-rc7-0.0.0-devel-00005-g61fdfceacf09 #1
> [   10.980751] Hardware name: Toradex Verdin AM62 WB on Dahlia Board (DT)
> [   10.980760] Workqueue: hci0 hci_power_off [bluetooth]
> [   10.981169] Call trace:
> ...
> [   10.981363]  uart_update_mctrl+0x58/0x78
> [   10.981373]  uart_dtr_rts+0x104/0x114
> [   10.981381]  tty_port_shutdown+0xd4/0xdc
> [   10.981396]  tty_port_close+0x40/0xbc
> [   10.981407]  uart_close+0x34/0x9c
> [   10.981414]  ttyport_close+0x50/0x94
> [   10.981430]  serdev_device_close+0x40/0x50
> [   10.981442]  btnxpuart_close+0x24/0x98 [btnxpuart]
> [   10.981469]  hci_dev_close_sync+0x2d8/0x718 [bluetooth]
> [   10.981728]  hci_dev_do_close+0x2c/0x70 [bluetooth]
> [   10.981862]  hci_power_off+0x20/0x64 [bluetooth]
> 
> [...]

Here is the summary with links:
  - [v2] Bluetooth: btnxpuart: Fix btnxpuart_close
    https://git.kernel.org/bluetooth/bluetooth-next/c/3f40a47f3589

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2024-03-04 21:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-04 18:14 [PATCH v2] Bluetooth: btnxpuart: Fix btnxpuart_close Francesco Dolcini
2024-03-04 18:57 ` [v2] " bluez.test.bot
2024-03-04 21:30 ` [PATCH v2] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).