Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid

Pull HID fixes from Jiri Kosina:

- fix usage of sleeping lock in atomic context from Jiri Kosina

- build fix for hid-steelseries under certain .config setups by Simon Wood

- simple mismerge fix from Fernando Luis Vázquez Cao

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
HID: debug: fix RCU preemption issue
HID: hid-steelseries fix led class build issue
HID: reintroduce fix-up for certain Sony RF receivers

+18 -11
+2 -1
drivers/hid/hid-core.c
··· 1685 1685 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_NAVIGATION_CONTROLLER) }, 1686 1686 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) }, 1687 1687 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) }, 1688 + { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE) }, 1688 1689 { HID_USB_DEVICE(USB_VENDOR_ID_STEELSERIES, USB_DEVICE_ID_STEELSERIES_SRWS1) }, 1689 1690 { HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) }, 1690 1691 { HID_USB_DEVICE(USB_VENDOR_ID_THINGM, USB_DEVICE_ID_BLINK1) }, ··· 2342 2341 2343 2342 init_waitqueue_head(&hdev->debug_wait); 2344 2343 INIT_LIST_HEAD(&hdev->debug_list); 2345 - mutex_init(&hdev->debug_list_lock); 2344 + spin_lock_init(&hdev->debug_list_lock); 2346 2345 sema_init(&hdev->driver_lock, 1); 2347 2346 sema_init(&hdev->driver_input_lock, 1); 2348 2347
+9 -6
drivers/hid/hid-debug.c
··· 579 579 { 580 580 int i; 581 581 struct hid_debug_list *list; 582 + unsigned long flags; 582 583 583 - mutex_lock(&hdev->debug_list_lock); 584 + spin_lock_irqsave(&hdev->debug_list_lock, flags); 584 585 list_for_each_entry(list, &hdev->debug_list, node) { 585 586 for (i = 0; i < strlen(buf); i++) 586 587 list->hid_debug_buf[(list->tail + i) % HID_DEBUG_BUFSIZE] = 587 588 buf[i]; 588 589 list->tail = (list->tail + i) % HID_DEBUG_BUFSIZE; 589 590 } 590 - mutex_unlock(&hdev->debug_list_lock); 591 + spin_unlock_irqrestore(&hdev->debug_list_lock, flags); 591 592 592 593 wake_up_interruptible(&hdev->debug_wait); 593 594 } ··· 978 977 { 979 978 int err = 0; 980 979 struct hid_debug_list *list; 980 + unsigned long flags; 981 981 982 982 if (!(list = kzalloc(sizeof(struct hid_debug_list), GFP_KERNEL))) { 983 983 err = -ENOMEM; ··· 994 992 file->private_data = list; 995 993 mutex_init(&list->read_mutex); 996 994 997 - mutex_lock(&list->hdev->debug_list_lock); 995 + spin_lock_irqsave(&list->hdev->debug_list_lock, flags); 998 996 list_add_tail(&list->node, &list->hdev->debug_list); 999 - mutex_unlock(&list->hdev->debug_list_lock); 997 + spin_unlock_irqrestore(&list->hdev->debug_list_lock, flags); 1000 998 1001 999 out: 1002 1000 return err; ··· 1090 1088 static int hid_debug_events_release(struct inode *inode, struct file *file) 1091 1089 { 1092 1090 struct hid_debug_list *list = file->private_data; 1091 + unsigned long flags; 1093 1092 1094 - mutex_lock(&list->hdev->debug_list_lock); 1093 + spin_lock_irqsave(&list->hdev->debug_list_lock, flags); 1095 1094 list_del(&list->node); 1096 - mutex_unlock(&list->hdev->debug_list_lock); 1095 + spin_unlock_irqrestore(&list->hdev->debug_list_lock, flags); 1097 1096 kfree(list->hid_debug_buf); 1098 1097 kfree(list); 1099 1098
+6 -3
drivers/hid/hid-steelseries.c
··· 18 18 19 19 #include "hid-ids.h" 20 20 21 - #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) 21 + #if IS_BUILTIN(CONFIG_LEDS_CLASS) || \ 22 + (IS_MODULE(CONFIG_LEDS_CLASS) && IS_MODULE(CONFIG_HID_STEELSERIES)) 22 23 #define SRWS1_NUMBER_LEDS 15 23 24 struct steelseries_srws1_data { 24 25 __u16 led_state; ··· 108 107 0xC0 /* End Collection */ 109 108 }; 110 109 111 - #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) 110 + #if IS_BUILTIN(CONFIG_LEDS_CLASS) || \ 111 + (IS_MODULE(CONFIG_LEDS_CLASS) && IS_MODULE(CONFIG_HID_STEELSERIES)) 112 112 static void steelseries_srws1_set_leds(struct hid_device *hdev, __u16 leds) 113 113 { 114 114 struct list_head *report_list = &hdev->report_enum[HID_OUTPUT_REPORT].report_list; ··· 372 370 static struct hid_driver steelseries_srws1_driver = { 373 371 .name = "steelseries_srws1", 374 372 .id_table = steelseries_srws1_devices, 375 - #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) 373 + #if IS_BUILTIN(CONFIG_LEDS_CLASS) || \ 374 + (IS_MODULE(CONFIG_LEDS_CLASS) && IS_MODULE(CONFIG_HID_STEELSERIES)) 376 375 .probe = steelseries_srws1_probe, 377 376 .remove = steelseries_srws1_remove, 378 377 #endif
+1 -1
include/linux/hid.h
··· 515 515 struct dentry *debug_rdesc; 516 516 struct dentry *debug_events; 517 517 struct list_head debug_list; 518 - struct mutex debug_list_lock; 518 + spinlock_t debug_list_lock; 519 519 wait_queue_head_t debug_wait; 520 520 }; 521 521