All of lore.kernel.org
 help / color / mirror / Atom feed
* 3.19: Sony playstation controller causes kernel oops
@ 2015-02-22 21:35 Pavel Machek
  2015-02-22 21:50 ` Jiri Kosina
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Machek @ 2015-02-22 21:35 UTC (permalink / raw)
  To: kernel list; +Cc: jkosina, linux-input, rydberg

[-- Attachment #1: Type: text/plain, Size: 5046 bytes --]

Hi!

I plugged in part of PS move to the PC, to let it charge. Got: full
dmesg in attachment. I believe I charged it in PC before, but it may
be year ago or more.

Ideas?
								Pavel

[124225.084151] usb 2-1: USB disconnect, device number 2
[124227.240047] usb 2-1: new full-speed USB device number 3 using uhci_hcd
[124227.519329] usb 2-1: New USB device found, idVendor=054c, idProduct=042f
[124227.519335] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[124227.519338] usb 2-1: Product: Navigation Controller
[124227.519341] usb 2-1: Manufacturer: Sony
[124227.599936] input: Sony Navigation Controller as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0/0003:054C:042F.0005/input/input50
[124227.657352] sony 0003:054C:042F.0005: input,hiddev0,hidraw3: USB HID v1.11 Joystick [Sony Navigation Controller] on usb-0000:00:1d.0-1/input0
[124227.692076] BUG: spinlock bad magic on CPU#0, kworker/0:0/15184
[124227.692088]  lock: sony_dev_list_lock+0x0/0x38, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
[124227.692092] CPU: 0 PID: 15184 Comm: kworker/0:0 Tainted: G        W      3.19.0 #17
[124227.692094] Hardware name:                  /DG41MJ, BIOS MJG4110H.86A.0006.2009.1223.1155 12/23/2009
[124227.692100] Workqueue: usb_hub_wq hub_event
[124227.692103]  ffffffff85b83800 ffff880001153468 ffffffff84949b24 0000000000000007
[124227.692109]  0000000000000000 ffff880001153488 ffffffff84081330 ffffffff85b83800
[124227.692114]  ffffffff84d64cc0 ffff8800011534a8 ffffffff840813b1 ffffffff85b83800
[124227.692119] Call Trace:
[124227.692125]  [<ffffffff84949b24>] dump_stack+0x45/0x57
[124227.692131]  [<ffffffff84081330>] spin_dump+0x80/0xe0
[124227.692135]  [<ffffffff840813b1>] spin_bug+0x21/0x30
[124227.692139]  [<ffffffff8408154c>] do_raw_spin_lock+0x12c/0x190
[124227.692142]  [<ffffffff8495218a>] _raw_spin_lock_irqsave+0x3a/0x50
[124227.692147]  [<ffffffff846c9f76>] ? sony_probe+0x556/0xd60
[124227.692151]  [<ffffffff846c9f76>] sony_probe+0x556/0xd60
[124227.692156]  [<ffffffff846be02d>] ? hid_match_id+0x2d/0x50
[124227.692160]  [<ffffffff846bea24>] hid_device_probe+0xd4/0x150
[124227.692165]  [<ffffffff844b7320>] ? driver_probe_device+0x3d0/0x3d0
[124227.692169]  [<ffffffff844b6fdb>] driver_probe_device+0x8b/0x3d0
[124227.692173]  [<ffffffff844b7320>] ? driver_probe_device+0x3d0/0x3d0
[124227.692176]  [<ffffffff844b735b>] __device_attach+0x3b/0x40
[124227.692180]  [<ffffffff844b4f93>] bus_for_each_drv+0x63/0xa0
[124227.692183]  [<ffffffff844b6ee0>] device_attach+0x90/0xb0
[124227.692187]  [<ffffffff844b6300>] bus_probe_device+0xb0/0xe0
[124227.692191]  [<ffffffff844b402d>] device_add+0x48d/0x660
[124227.692195]  [<ffffffff846be6d1>] hid_add_device+0xc1/0x290
[124227.692199]  [<ffffffff84081221>] ? __raw_spin_lock_init+0x31/0x60
[124227.692203]  [<ffffffff846d4657>] usbhid_probe+0x327/0x480
[124227.692208]  [<ffffffff845be566>] usb_probe_interface+0x1d6/0x350
[124227.692211]  [<ffffffff844b7320>] ? driver_probe_device+0x3d0/0x3d0
[124227.692215]  [<ffffffff844b6fdb>] driver_probe_device+0x8b/0x3d0
[124227.692219]  [<ffffffff844b7320>] ? driver_probe_device+0x3d0/0x3d0
[124227.692222]  [<ffffffff844b735b>] __device_attach+0x3b/0x40
[124227.692226]  [<ffffffff844b4f93>] bus_for_each_drv+0x63/0xa0
[124227.692229]  [<ffffffff844b6ee0>] device_attach+0x90/0xb0
[124227.692233]  [<ffffffff844b6300>] bus_probe_device+0xb0/0xe0
[124227.692236]  [<ffffffff844b402d>] device_add+0x48d/0x660
[124227.692240]  [<ffffffff845bc363>] usb_set_configuration+0x563/0x960
[124227.692245]  [<ffffffff8417cf82>] ? kernfs_add_one+0xe2/0x170
[124227.692249]  [<ffffffff844b7320>] ? driver_probe_device+0x3d0/0x3d0
[124227.692254]  [<ffffffff845c6fa9>] generic_probe+0x29/0x90
[124227.692258]  [<ffffffff845be33d>] usb_probe_device+0x2d/0x80
[124227.692262]  [<ffffffff844b6fdb>] driver_probe_device+0x8b/0x3d0
[124227.692265]  [<ffffffff844b7320>] ? driver_probe_device+0x3d0/0x3d0
[124227.692269]  [<ffffffff844b735b>] __device_attach+0x3b/0x40
[124227.692272]  [<ffffffff844b4f93>] bus_for_each_drv+0x63/0xa0
[124227.692276]  [<ffffffff844b6ee0>] device_attach+0x90/0xb0
[124227.692279]  [<ffffffff844b6300>] bus_probe_device+0xb0/0xe0
[124227.692283]  [<ffffffff844b402d>] device_add+0x48d/0x660
[124227.692286]  [<ffffffff845b1770>] usb_new_device+0x2b0/0x500
[124227.692290]  [<ffffffff845b3286>] hub_event+0x886/0x1620
[124227.692295]  [<ffffffff8405662b>] process_one_work+0x1ab/0x430
[124227.692299]  [<ffffffff840565c6>] ? process_one_work+0x146/0x430
[124227.692303]  [<ffffffff84056e4b>] worker_thread+0x6b/0x480
[124227.692307]  [<ffffffff84056de0>] ? cancel_delayed_work+0x80/0x80
[124227.692311]  [<ffffffff8405bfb0>] kthread+0x100/0x120
[124227.692315]  [<ffffffff8405beb0>] ? kthread_create_on_node+0x230/0x230
[124227.692319]  [<ffffffff84952bec>] ret_from_fork+0x7c/0xb0
[124227.692323]  [<ffffffff8405beb0>] ? kthread_create_on_node+0x230/0x230

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: delme.gz --]
[-- Type: application/gzip, Size: 26516 bytes --]

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

* Re: 3.19: Sony playstation controller causes kernel oops
  2015-02-22 21:35 3.19: Sony playstation controller causes kernel oops Pavel Machek
@ 2015-02-22 21:50 ` Jiri Kosina
  2015-02-23 11:57   ` David Herrmann
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Kosina @ 2015-02-22 21:50 UTC (permalink / raw)
  To: Pavel Machek
  Cc: kernel list, linux-input, rydberg, Frank Praznik, David Herrmann

[ some CCs added and full dmesg kept for reference ]

On Sun, 22 Feb 2015, Pavel Machek wrote:

> Hi!
> 
> I plugged in part of PS move to the PC, to let it charge. Got: full
> dmesg in attachment. I believe I charged it in PC before, but it may
> be year ago or more.
>
> Ideas?

Ok, this is embarassing. I guess the patch below fixes it, right? (the 
spinlock got introduced in d2d782fccee, so I guess you didn't have it a 
year ago)

diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 31e9d25..3756a62 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -2140,6 +2140,7 @@ static int __init sony_init(void)
 {
 	dbg_hid("Sony:%s\n", __func__);
 
+	spin_lock_init(&sony_dev_list_lock);
 	return hid_register_driver(&sony_driver);
 }
 

> [124225.084151] usb 2-1: USB disconnect, device number 2
> [124227.240047] usb 2-1: new full-speed USB device number 3 using uhci_hcd
> [124227.519329] usb 2-1: New USB device found, idVendor=054c, idProduct=042f
> [124227.519335] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
> [124227.519338] usb 2-1: Product: Navigation Controller
> [124227.519341] usb 2-1: Manufacturer: Sony
> [124227.599936] input: Sony Navigation Controller as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0/0003:054C:042F.0005/input/input50
> [124227.657352] sony 0003:054C:042F.0005: input,hiddev0,hidraw3: USB HID v1.11 Joystick [Sony Navigation Controller] on usb-0000:00:1d.0-1/input0
> [124227.692076] BUG: spinlock bad magic on CPU#0, kworker/0:0/15184
> [124227.692088]  lock: sony_dev_list_lock+0x0/0x38, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
> [124227.692092] CPU: 0 PID: 15184 Comm: kworker/0:0 Tainted: G        W      3.19.0 #17
> [124227.692094] Hardware name:                  /DG41MJ, BIOS MJG4110H.86A.0006.2009.1223.1155 12/23/2009
> [124227.692100] Workqueue: usb_hub_wq hub_event
> [124227.692103]  ffffffff85b83800 ffff880001153468 ffffffff84949b24 0000000000000007
> [124227.692109]  0000000000000000 ffff880001153488 ffffffff84081330 ffffffff85b83800
> [124227.692114]  ffffffff84d64cc0 ffff8800011534a8 ffffffff840813b1 ffffffff85b83800
> [124227.692119] Call Trace:
> [124227.692125]  [<ffffffff84949b24>] dump_stack+0x45/0x57
> [124227.692131]  [<ffffffff84081330>] spin_dump+0x80/0xe0
> [124227.692135]  [<ffffffff840813b1>] spin_bug+0x21/0x30
> [124227.692139]  [<ffffffff8408154c>] do_raw_spin_lock+0x12c/0x190
> [124227.692142]  [<ffffffff8495218a>] _raw_spin_lock_irqsave+0x3a/0x50
> [124227.692147]  [<ffffffff846c9f76>] ? sony_probe+0x556/0xd60
> [124227.692151]  [<ffffffff846c9f76>] sony_probe+0x556/0xd60
> [124227.692156]  [<ffffffff846be02d>] ? hid_match_id+0x2d/0x50
> [124227.692160]  [<ffffffff846bea24>] hid_device_probe+0xd4/0x150
> [124227.692165]  [<ffffffff844b7320>] ? driver_probe_device+0x3d0/0x3d0
> [124227.692169]  [<ffffffff844b6fdb>] driver_probe_device+0x8b/0x3d0
> [124227.692173]  [<ffffffff844b7320>] ? driver_probe_device+0x3d0/0x3d0
> [124227.692176]  [<ffffffff844b735b>] __device_attach+0x3b/0x40
> [124227.692180]  [<ffffffff844b4f93>] bus_for_each_drv+0x63/0xa0
> [124227.692183]  [<ffffffff844b6ee0>] device_attach+0x90/0xb0
> [124227.692187]  [<ffffffff844b6300>] bus_probe_device+0xb0/0xe0
> [124227.692191]  [<ffffffff844b402d>] device_add+0x48d/0x660
> [124227.692195]  [<ffffffff846be6d1>] hid_add_device+0xc1/0x290
> [124227.692199]  [<ffffffff84081221>] ? __raw_spin_lock_init+0x31/0x60
> [124227.692203]  [<ffffffff846d4657>] usbhid_probe+0x327/0x480
> [124227.692208]  [<ffffffff845be566>] usb_probe_interface+0x1d6/0x350
> [124227.692211]  [<ffffffff844b7320>] ? driver_probe_device+0x3d0/0x3d0
> [124227.692215]  [<ffffffff844b6fdb>] driver_probe_device+0x8b/0x3d0
> [124227.692219]  [<ffffffff844b7320>] ? driver_probe_device+0x3d0/0x3d0
> [124227.692222]  [<ffffffff844b735b>] __device_attach+0x3b/0x40
> [124227.692226]  [<ffffffff844b4f93>] bus_for_each_drv+0x63/0xa0
> [124227.692229]  [<ffffffff844b6ee0>] device_attach+0x90/0xb0
> [124227.692233]  [<ffffffff844b6300>] bus_probe_device+0xb0/0xe0
> [124227.692236]  [<ffffffff844b402d>] device_add+0x48d/0x660
> [124227.692240]  [<ffffffff845bc363>] usb_set_configuration+0x563/0x960
> [124227.692245]  [<ffffffff8417cf82>] ? kernfs_add_one+0xe2/0x170
> [124227.692249]  [<ffffffff844b7320>] ? driver_probe_device+0x3d0/0x3d0
> [124227.692254]  [<ffffffff845c6fa9>] generic_probe+0x29/0x90
> [124227.692258]  [<ffffffff845be33d>] usb_probe_device+0x2d/0x80
> [124227.692262]  [<ffffffff844b6fdb>] driver_probe_device+0x8b/0x3d0
> [124227.692265]  [<ffffffff844b7320>] ? driver_probe_device+0x3d0/0x3d0
> [124227.692269]  [<ffffffff844b735b>] __device_attach+0x3b/0x40
> [124227.692272]  [<ffffffff844b4f93>] bus_for_each_drv+0x63/0xa0
> [124227.692276]  [<ffffffff844b6ee0>] device_attach+0x90/0xb0
> [124227.692279]  [<ffffffff844b6300>] bus_probe_device+0xb0/0xe0
> [124227.692283]  [<ffffffff844b402d>] device_add+0x48d/0x660
> [124227.692286]  [<ffffffff845b1770>] usb_new_device+0x2b0/0x500
> [124227.692290]  [<ffffffff845b3286>] hub_event+0x886/0x1620
> [124227.692295]  [<ffffffff8405662b>] process_one_work+0x1ab/0x430
> [124227.692299]  [<ffffffff840565c6>] ? process_one_work+0x146/0x430
> [124227.692303]  [<ffffffff84056e4b>] worker_thread+0x6b/0x480
> [124227.692307]  [<ffffffff84056de0>] ? cancel_delayed_work+0x80/0x80
> [124227.692311]  [<ffffffff8405bfb0>] kthread+0x100/0x120
> [124227.692315]  [<ffffffff8405beb0>] ? kthread_create_on_node+0x230/0x230
> [124227.692319]  [<ffffffff84952bec>] ret_from_fork+0x7c/0xb0
> [124227.692323]  [<ffffffff8405beb0>] ? kthread_create_on_node+0x230/0x230

-- 
Jiri Kosina
SUSE Labs

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

* Re: 3.19: Sony playstation controller causes kernel oops
  2015-02-22 21:50 ` Jiri Kosina
@ 2015-02-23 11:57   ` David Herrmann
  2015-02-23 12:02     ` Jiri Kosina
  0 siblings, 1 reply; 4+ messages in thread
From: David Herrmann @ 2015-02-23 11:57 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: Pavel Machek, kernel list, open list:HID CORE LAYER, rydberg,
	Frank Praznik

Hi Jiri

On Sun, Feb 22, 2015 at 10:50 PM, Jiri Kosina <jkosina@suse.cz> wrote:
> [ some CCs added and full dmesg kept for reference ]
>
> On Sun, 22 Feb 2015, Pavel Machek wrote:
>
>> Hi!
>>
>> I plugged in part of PS move to the PC, to let it charge. Got: full
>> dmesg in attachment. I believe I charged it in PC before, but it may
>> be year ago or more.
>>
>> Ideas?
>
> Ok, this is embarassing. I guess the patch below fixes it, right? (the
> spinlock got introduced in d2d782fccee, so I guess you didn't have it a
> year ago)
>
> diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
> index 31e9d25..3756a62 100644
> --- a/drivers/hid/hid-sony.c
> +++ b/drivers/hid/hid-sony.c
> @@ -2140,6 +2140,7 @@ static int __init sony_init(void)
>  {
>         dbg_hid("Sony:%s\n", __func__);
>
> +       spin_lock_init(&sony_dev_list_lock);
>         return hid_register_driver(&sony_driver);
>  }

Nice catch. I'd prefer the patch below, though. For both:
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>

The bug is non-critical (global memory, so initialized to 0 which is
fine for spinlocks). It only spits out warnings if you enable
lock-debugging. We might mark it for stable 3.14+.

Thanks
David


diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 31e9d25..5d3e40a 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -804,7 +804,7 @@ union sixaxis_output_report_01 {
 #define DS4_REPORT_0x81_SIZE 7
 #define SIXAXIS_REPORT_0xF2_SIZE 18

-static spinlock_t sony_dev_list_lock;
+static DEFINE_SPINLOCK(sony_dev_list_lock);
 static LIST_HEAD(sony_device_list);
 static DEFINE_IDA(sony_device_id_allocator);

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

* Re: 3.19: Sony playstation controller causes kernel oops
  2015-02-23 11:57   ` David Herrmann
@ 2015-02-23 12:02     ` Jiri Kosina
  0 siblings, 0 replies; 4+ messages in thread
From: Jiri Kosina @ 2015-02-23 12:02 UTC (permalink / raw)
  To: David Herrmann
  Cc: Pavel Machek, kernel list, open list:HID CORE LAYER, rydberg,
	Frank Praznik

On Mon, 23 Feb 2015, David Herrmann wrote:

> Hi Jiri
> 
> On Sun, Feb 22, 2015 at 10:50 PM, Jiri Kosina <jkosina@suse.cz> wrote:
> > [ some CCs added and full dmesg kept for reference ]
> >
> > On Sun, 22 Feb 2015, Pavel Machek wrote:
> >
> >> Hi!
> >>
> >> I plugged in part of PS move to the PC, to let it charge. Got: full
> >> dmesg in attachment. I believe I charged it in PC before, but it may
> >> be year ago or more.
> >>
> >> Ideas?
> >
> > Ok, this is embarassing. I guess the patch below fixes it, right? (the
> > spinlock got introduced in d2d782fccee, so I guess you didn't have it a
> > year ago)
> >
> > diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
> > index 31e9d25..3756a62 100644
> > --- a/drivers/hid/hid-sony.c
> > +++ b/drivers/hid/hid-sony.c
> > @@ -2140,6 +2140,7 @@ static int __init sony_init(void)
> >  {
> >         dbg_hid("Sony:%s\n", __func__);
> >
> > +       spin_lock_init(&sony_dev_list_lock);
> >         return hid_register_driver(&sony_driver);
> >  }
> 
> Nice catch. I'd prefer the patch below, though. For both:
> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>

Thanks. I already used the DEFINE_SPINLOCK() variant and pushed it 
our earlier today.

There was also missing sc->lock initialization in per-device probe, Frank 
sent patch for that as well.

Both now applied and pushed out.

-- 
Jiri Kosina
SUSE Labs

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

end of thread, other threads:[~2015-02-23 12:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-22 21:35 3.19: Sony playstation controller causes kernel oops Pavel Machek
2015-02-22 21:50 ` Jiri Kosina
2015-02-23 11:57   ` David Herrmann
2015-02-23 12:02     ` Jiri Kosina

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.