Page MenuHomeFreeBSD

Introduce hw.ubt.usb_isoc_enable loader tunable to disable isochronous transfer.
ClosedPublic

Authored by naito.yuichiro_gmail.com on Dec 6 2021, 2:11 AM.
Tags
None
Referenced Files
F82007013: D33282.id99632.diff
Wed, Apr 24, 10:57 AM
F82007012: D33282.id99644.diff
Wed, Apr 24, 10:57 AM
F82007011: D33282.id99643.diff
Wed, Apr 24, 10:57 AM
Unknown Object (File)
Thu, Apr 18, 7:23 AM
Unknown Object (File)
Thu, Apr 18, 7:22 AM
Unknown Object (File)
Thu, Apr 18, 7:14 AM
Unknown Object (File)
Thu, Apr 18, 6:44 AM
Unknown Object (File)
Thu, Apr 18, 6:40 AM

Details

Summary

This patch is a workaround for PR #238235.
If users want to disable isochronous transfer on ubt (like me), set loader tunable hw.ubt.usb_isoc_enable=0.
The default value of hw.ubt.usb_isoc_enable is 1 that works as same as before.
And the value of hw.ubt.usb_isoc_enable can be seen by sysctl.

Test Plan

hw.ubt.usb_isoc_enable=0 stops interrupt storms.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

hselasky added inline comments.
sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
157

Should be CTLFLAG_RWTUN .

1560

This might get out of sync.

Please remove this "if" and ensure xfer pointers are checked for NULL.

isochronous_transfer -> usb_isoc_enable

naito.yuichiro_gmail.com retitled this revision from Introduce hw.ubt.isochronous_transfer loader tunable to disable isochronous transfer. to Introduce hw.ubt.usb_isoc_enable loader tunable to disable isochronous transfer..
naito.yuichiro_gmail.com edited the summary of this revision. (Show Details)
naito.yuichiro_gmail.com edited the test plan for this revision. (Show Details)

Thanks for the comments.
I updated my patch that includes following fixes.

  1. Do not change ubt_task() implementation, and check if sc_xfer is NULL in the ubt_xfer_start macro. So that make it easy to keep consistent with usbd_transfer_setup() in ubt_attach function.
  1. ubt sysctl variable flag changed to CTLFLAG_RDTUN.
  1. sysctl variable name changed to usb_isoc_enable.

I also updated the title of this review and summary context.

sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
144

usbd_transfer_start() is already NULL safe. No need to check for NULL here!

157

nodes should be CTLFLAG_RW

sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
144

Ah,OK. I see the usbd_transfer_start() code.I will revert this macro change.

157

I will change to CTLFLAG_RW.

  • Revert usbd_transfer_start macro change. As a result, nothing changed from original.
  • Use CTLFLAG_RW flag for sysctl node.
sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
160

, 1, should just be , 0, . This field is only used for constants.

--HPS

sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
160

OK. I'll change to , 0,.

  • change val argument of SYSCTL_INT macro to 0.
This revision is now accepted and ready to land.Dec 7 2021, 10:03 AM