From patchwork Mon Feb 23 11:57:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 5865071 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F1EF09F399 for ; Mon, 23 Feb 2015 11:57:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 30E8B200E7 for ; Mon, 23 Feb 2015 11:57:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1ACE420173 for ; Mon, 23 Feb 2015 11:57:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752957AbbBWL5f (ORCPT ); Mon, 23 Feb 2015 06:57:35 -0500 Received: from mail-ie0-f181.google.com ([209.85.223.181]:39070 "EHLO mail-ie0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752570AbbBWL5e (ORCPT ); Mon, 23 Feb 2015 06:57:34 -0500 Received: by iecvy18 with SMTP id vy18so22559131iec.6; Mon, 23 Feb 2015 03:57:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=PfRth/Q/L0VebJCXttmBqEnMq119vm9rXoaQO9Zeq0Q=; b=gk4TG2qKXLtycBEmJfHJolJ5ruUXxEVZmBAlxccDkaDRnQT189BnKcyE8atOPNpo/n K8m/ExePmtFj3SBMp9gSbqfk3/jKha1BRZ5ev9pzHE6KjjLHJb0CUchn2qePI/lqbNHT qiwbSSblMOUrpklFY3THxxMFHaZBezpDHxHE7AE4fxGFwWXuVXIcXShoiYWyzUc/phH+ 3za+jnE72mnP+HfadrFhN6B6dD/kWnrkF8ziz0lblzGBO5EG8JdMQsA+Sv/6fBDqgX+w 3INNMQ/cWgQdThqo3kcLpPSVksUH03pufpB3hKTuSMPbl3SoycBcHAVArSYBWxbUil1K a1iw== MIME-Version: 1.0 X-Received: by 10.42.77.9 with SMTP id g9mr11201140ick.78.1424692653516; Mon, 23 Feb 2015 03:57:33 -0800 (PST) Received: by 10.43.143.206 with HTTP; Mon, 23 Feb 2015 03:57:33 -0800 (PST) In-Reply-To: References: <20150222213513.GA15224@amd> Date: Mon, 23 Feb 2015 12:57:33 +0100 Message-ID: Subject: Re: 3.19: Sony playstation controller causes kernel oops From: David Herrmann To: Jiri Kosina Cc: Pavel Machek , kernel list , "open list:HID CORE LAYER" , rydberg@bitmath.org, Frank Praznik Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Jiri On Sun, Feb 22, 2015 at 10:50 PM, Jiri Kosina 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 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 the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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); -- To unsubscribe from this list: send the line "unsubscribe linux-input" in