Add more USB runtime power management
This commit is contained in:
parent
606af2d7c2
commit
2b89a044b6
19
kernel.spec
19
kernel.spec
@ -710,6 +710,12 @@ Patch12130: wacom-07-move-bamboo-touch-irq-to-its-own-function.patch
|
||||
Patch12035: wacom-08-add-support-for-bamboo-pen.patch
|
||||
Patch12040: wacom-09-disable-bamboo-touchpad-when-pen-is-being-used.patch
|
||||
|
||||
# Runtime power management
|
||||
Patch12200: linux-2.6-bluetooth-autosuspend.patch
|
||||
Patch12201: linux-2.6-uvc-autosuspend.patch
|
||||
Patch12202: linux-2.6-qcserial-autosuspend.patch
|
||||
Patch12203: linux-2.6-usb-pci-autosuspend.patch
|
||||
|
||||
%endif
|
||||
|
||||
BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
|
||||
@ -1299,6 +1305,12 @@ ApplyPatch wacom-07-move-bamboo-touch-irq-to-its-own-function.patch
|
||||
ApplyPatch wacom-08-add-support-for-bamboo-pen.patch
|
||||
ApplyPatch wacom-09-disable-bamboo-touchpad-when-pen-is-being-used.patch
|
||||
|
||||
# Runtime PM
|
||||
ApplyPatch linux-2.6-bluetooth-autosuspend.patch
|
||||
ApplyPatch linux-2.6-uvc-autosuspend.patch
|
||||
ApplyPatch linux-2.6-qcserial-autosuspend.patch
|
||||
ApplyPatch linux-2.6-usb-pci-autosuspend.patch
|
||||
|
||||
# END OF PATCH APPLICATIONS
|
||||
|
||||
%endif
|
||||
@ -1906,6 +1918,13 @@ fi
|
||||
# || ||
|
||||
|
||||
%changelog
|
||||
* Fri Sep 17 2010 Matthew Garrett <mjg@redhat.com>
|
||||
- linux-2.6-bluetooth-autosuspend.patch
|
||||
linux-2.6-uvc-autosuspend.patch
|
||||
linux-2.6-qcserial-autosuspend.patch
|
||||
linux-2.6-usb-pci-autosuspend.patch - Get some more devices into USB
|
||||
autosuspend by default, and then put unused USB controllers to sleep
|
||||
|
||||
* Thu Sep 16 2010 Hans de Goede <hdegoede@redhat.com>
|
||||
- Small fix to virtio_console poll fix from upstream review
|
||||
|
||||
|
159
linux-2.6-bluetooth-autosuspend.patch
Normal file
159
linux-2.6-bluetooth-autosuspend.patch
Normal file
@ -0,0 +1,159 @@
|
||||
commit 6aa42966dea9a1fc02a714211ea489c3278bf8d4
|
||||
Author: Matthew Garrett <mjg@redhat.com>
|
||||
Date: Thu Sep 16 13:34:55 2010 -0400
|
||||
|
||||
bluetooth: Take a runtime pm reference on hid connections
|
||||
|
||||
Bluetooth runtime PM interacts badly with input devices - the connection
|
||||
will be dropped if the device becomes idle, resulting in noticable lag when
|
||||
the user interacts with the input device again. Bump the pm runtime count
|
||||
when the device is associated and release it when it's disassociated in
|
||||
order to avoid this.
|
||||
|
||||
Signed-off-by: Matthew Garrett <mjg@redhat.com>
|
||||
|
||||
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
|
||||
index bfe641b..a4489a7 100644
|
||||
--- a/net/bluetooth/hidp/core.c
|
||||
+++ b/net/bluetooth/hidp/core.c
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <linux/file.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/wait.h>
|
||||
+#include <linux/pm_runtime.h>
|
||||
#include <net/sock.h>
|
||||
|
||||
#include <linux/input.h>
|
||||
@@ -622,6 +623,14 @@ static int hidp_session(void *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static struct hci_dev *hidp_get_hci(struct hidp_session *session)
|
||||
+{
|
||||
+ bdaddr_t *src = &bt_sk(session->ctrl_sock->sk)->src;
|
||||
+ bdaddr_t *dst = &bt_sk(session->ctrl_sock->sk)->dst;
|
||||
+
|
||||
+ return hci_get_route(dst, src);
|
||||
+}
|
||||
+
|
||||
static struct device *hidp_get_device(struct hidp_session *session)
|
||||
{
|
||||
bdaddr_t *src = &bt_sk(session->ctrl_sock->sk)->src;
|
||||
@@ -819,6 +828,7 @@ fault:
|
||||
int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock, struct socket *intr_sock)
|
||||
{
|
||||
struct hidp_session *session, *s;
|
||||
+ struct hci_dev *hdev;
|
||||
int err;
|
||||
|
||||
BT_DBG("");
|
||||
@@ -889,6 +899,10 @@ int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock,
|
||||
hidp_input_event(session->input, EV_LED, 0, 0);
|
||||
}
|
||||
|
||||
+ hdev = hidp_get_hci(session);
|
||||
+ pm_runtime_get(hdev->parent);
|
||||
+ hci_dev_put(hdev);
|
||||
+
|
||||
up_write(&hidp_session_sem);
|
||||
return 0;
|
||||
|
||||
@@ -925,6 +939,7 @@ failed:
|
||||
int hidp_del_connection(struct hidp_conndel_req *req)
|
||||
{
|
||||
struct hidp_session *session;
|
||||
+ struct hci_dev *hdev;
|
||||
int err = 0;
|
||||
|
||||
BT_DBG("");
|
||||
@@ -952,6 +967,9 @@ int hidp_del_connection(struct hidp_conndel_req *req)
|
||||
} else
|
||||
err = -ENOENT;
|
||||
|
||||
+ hdev = hidp_get_hci(session);
|
||||
+ pm_runtime_put(hdev->parent);
|
||||
+ hci_dev_put(hdev);
|
||||
up_read(&hidp_session_sem);
|
||||
return err;
|
||||
}
|
||||
|
||||
commit 482eca592615e85b048753750b101d051b77fde9
|
||||
Author: Matthew Garrett <mjg@redhat.com>
|
||||
Date: Thu Sep 16 13:49:24 2010 -0400
|
||||
|
||||
bluetooth: Remove some unnecessary error messages
|
||||
|
||||
The main reason for these urbs to error out on submission is that runtime
|
||||
pm has kicked in, which is unnecessary noise. Let's just drop them.
|
||||
|
||||
Signed-off-by: Matthew Garrett <mjg@redhat.com>
|
||||
|
||||
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
|
||||
index d22ce3c..3ace025 100644
|
||||
--- a/drivers/bluetooth/btusb.c
|
||||
+++ b/drivers/bluetooth/btusb.c
|
||||
@@ -229,11 +229,8 @@ static void btusb_intr_complete(struct urb *urb)
|
||||
usb_anchor_urb(urb, &data->intr_anchor);
|
||||
|
||||
err = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
- if (err < 0) {
|
||||
- BT_ERR("%s urb %p failed to resubmit (%d)",
|
||||
- hdev->name, urb, -err);
|
||||
+ if (err < 0)
|
||||
usb_unanchor_urb(urb);
|
||||
- }
|
||||
}
|
||||
|
||||
static int btusb_submit_intr_urb(struct hci_dev *hdev, gfp_t mem_flags)
|
||||
@@ -313,11 +310,8 @@ static void btusb_bulk_complete(struct urb *urb)
|
||||
usb_mark_last_busy(data->udev);
|
||||
|
||||
err = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
- if (err < 0) {
|
||||
- BT_ERR("%s urb %p failed to resubmit (%d)",
|
||||
- hdev->name, urb, -err);
|
||||
+ if (err < 0)
|
||||
usb_unanchor_urb(urb);
|
||||
- }
|
||||
}
|
||||
|
||||
static int btusb_submit_bulk_urb(struct hci_dev *hdev, gfp_t mem_flags)
|
||||
@@ -402,11 +396,8 @@ static void btusb_isoc_complete(struct urb *urb)
|
||||
usb_anchor_urb(urb, &data->isoc_anchor);
|
||||
|
||||
err = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
- if (err < 0) {
|
||||
- BT_ERR("%s urb %p failed to resubmit (%d)",
|
||||
- hdev->name, urb, -err);
|
||||
+ if (err < 0)
|
||||
usb_unanchor_urb(urb);
|
||||
- }
|
||||
}
|
||||
|
||||
static void inline __fill_isoc_descriptor(struct urb *urb, int len, int mtu)
|
||||
|
||||
commit fd763c5b14ed99ac2401f8e8f1a07c3687ae01cc
|
||||
Author: Matthew Garrett <mjg@redhat.com>
|
||||
Date: Thu Sep 16 13:37:38 2010 -0400
|
||||
|
||||
bluetooth: Enable USB autosuspend by default on btusb
|
||||
|
||||
We've done this for a while in Fedora without any obvious problems other
|
||||
than some interaction with input devices. Those should be fixed now, so
|
||||
let's try this in mainline.
|
||||
|
||||
Signed-off-by: Matthew Garrett <mjg@redhat.com>
|
||||
|
||||
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
|
||||
index 3ace025..03b64e4 100644
|
||||
--- a/drivers/bluetooth/btusb.c
|
||||
+++ b/drivers/bluetooth/btusb.c
|
||||
@@ -1014,6 +1014,8 @@ static int btusb_probe(struct usb_interface *intf,
|
||||
|
||||
usb_set_intfdata(intf, data);
|
||||
|
||||
+ usb_enable_autosuspend(interface_to_usbdev(intf));
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
23
linux-2.6-qcserial-autosuspend.patch
Normal file
23
linux-2.6-qcserial-autosuspend.patch
Normal file
@ -0,0 +1,23 @@
|
||||
commit 0fe584342da141957c8642191b508ad39e9b19e6
|
||||
Author: Matthew Garrett <mjg@redhat.com>
|
||||
Date: Thu Sep 16 13:39:31 2010 -0400
|
||||
|
||||
usbserial: Enable USB autosuspend by default on qcserial
|
||||
|
||||
Seems to work fine in my testing.
|
||||
|
||||
Signed-off-by: Matthew Garrett <mjg@redhat.com>
|
||||
|
||||
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
|
||||
index cde67ca..2846ad8 100644
|
||||
--- a/drivers/usb/serial/qcserial.c
|
||||
+++ b/drivers/usb/serial/qcserial.c
|
||||
@@ -118,6 +118,8 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
|
||||
|
||||
spin_lock_init(&data->susp_lock);
|
||||
|
||||
+ usb_enable_autosuspend(serial->dev);
|
||||
+
|
||||
switch (nintf) {
|
||||
case 1:
|
||||
/* QDL mode */
|
22
linux-2.6-usb-pci-autosuspend.patch
Normal file
22
linux-2.6-usb-pci-autosuspend.patch
Normal file
@ -0,0 +1,22 @@
|
||||
commit 15d89120d03116adbbf3226a85fbd2fff0b12576
|
||||
Author: Matthew Garrett <mjg@redhat.com>
|
||||
Date: Fri Sep 17 11:09:12 2010 -0400
|
||||
|
||||
Enable USB PCI autosuspend by default
|
||||
|
||||
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
|
||||
index c3f9854..3c020e6 100644
|
||||
--- a/drivers/usb/core/hcd-pci.c
|
||||
+++ b/drivers/usb/core/hcd-pci.c
|
||||
@@ -248,8 +248,10 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
|
||||
goto err4;
|
||||
set_hs_companion(dev, hcd);
|
||||
|
||||
- if (pci_dev_run_wake(dev))
|
||||
+ if (pci_dev_run_wake(dev)) {
|
||||
pm_runtime_put_noidle(&dev->dev);
|
||||
+ pm_runtime_allow(&dev->dev);
|
||||
+ }
|
||||
return retval;
|
||||
|
||||
err4:
|
22
linux-2.6-uvc-autosuspend.patch
Normal file
22
linux-2.6-uvc-autosuspend.patch
Normal file
@ -0,0 +1,22 @@
|
||||
commit 4a3757e0ae269f710292dd75013532c5a57ccb00
|
||||
Author: Matthew Garrett <mjg@redhat.com>
|
||||
Date: Thu Sep 16 13:38:38 2010 -0400
|
||||
|
||||
uvc: Enable USB autosuspend by default on uvcvideo
|
||||
|
||||
We've been doing this for a while in Fedora without any complaints.
|
||||
|
||||
Signed-off-by: Matthew Garrett <mjg@redhat.com>
|
||||
|
||||
diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c
|
||||
index 8bdd940..28ed5b4 100644
|
||||
--- a/drivers/media/video/uvc/uvc_driver.c
|
||||
+++ b/drivers/media/video/uvc/uvc_driver.c
|
||||
@@ -1814,6 +1814,7 @@ static int uvc_probe(struct usb_interface *intf,
|
||||
}
|
||||
|
||||
uvc_trace(UVC_TRACE_PROBE, "UVC device initialized.\n");
|
||||
+ usb_enable_autosuspend(udev);
|
||||
return 0;
|
||||
|
||||
error:
|
Loading…
Reference in New Issue
Block a user