[Bug 60824] [PATCH][regression] Cambridge Silicon Radio, Ltd Bluetooth Dongle unusable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.kernel.org/show_bug.cgi?id=60824

--- Comment #228 from pverda@xxxxxxxx ---
Apparently there are quite some dongles that choke on suspending. These dongles
really need the module option enable_autosuspend=0 and will not work without
it. Unfortunately the Barrot quirck in btusb_setup_csr prevents this to
function properly. To avoid this I propose the following modification in the
module btusb.c

In function btusb_setup_csr changing this:
<code>
                pm_runtime_allow(&data->udev->dev);

                ret = pm_runtime_suspend(&data->udev->dev);
                if (ret >= 0)
                        msleep(200);
                else
                        bt_dev_err(hdev, "CSR: Failed to suspend the device for
our Barrot 8041a02 receive-issue workaround");

                pm_runtime_forbid(&data->udev->dev);

                device_set_wakeup_capable(&data->udev->dev, false);

                /* Re-enable autosuspend if this was requested */
                if (enable_autosuspend)
                        usb_enable_autosuspend(data->udev);
</code>
into this:
<code>
                if (enable_autosuspend) {
                        pm_runtime_allow(&data->udev->dev);

                        ret = pm_runtime_suspend(&data->udev->dev);
                        if (ret >= 0)
                                msleep(200);
                        else
                                bt_dev_err(hdev, "CSR: Failed to suspend the
device for our Barrot 8041a02 receive-issue workaround");

                        pm_runtime_forbid(&data->udev->dev);

                        device_set_wakeup_capable(&data->udev->dev, false);

                        /* Re-enable autosuspend if this was requested */
                        usb_enable_autosuspend(data->udev);
                }
</code>
If the module options are absent, as it is supposed to be for plug and play,
there is no difference. The default of enable_autosuspend = true. The
modification of the function also honors the true meaning of
enable_autosuspend. That is stop suspending if made 0.
I have tested the above modification in my system: Fedora 35 with kernel
5.16.17-200 and it works. My dongle is one that needs kernel options
enable_autosuspend=0 and reset=1.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are the assignee for the bug.



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux