From patchwork Thu Mar 26 13:06:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 6099041 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 032FCBF910 for ; Thu, 26 Mar 2015 13:06:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 189FB203AD for ; Thu, 26 Mar 2015 13:06:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5D9B9203F3 for ; Thu, 26 Mar 2015 13:06:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752901AbbCZNG2 (ORCPT ); Thu, 26 Mar 2015 09:06:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45367 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752893AbbCZNGZ (ORCPT ); Thu, 26 Mar 2015 09:06:25 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 636A0B599E; Thu, 26 Mar 2015 13:06:25 +0000 (UTC) Received: from warthog.procyon.org.uk ([10.3.112.15]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2QD6LR2018589; Thu, 26 Mar 2015 09:06:23 -0400 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH] cx23885: Always initialise dev->slock spinlock From: David Howells To: hans.verkuil@cisco.com Cc: dhowells@redhat.com, crope@iki.fi, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Date: Thu, 26 Mar 2015 13:06:21 +0000 Message-ID: <20150326130621.12064.62788.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 The slock spinlock in the cx23885_dev struct is only initialised if analogue video is being used, but is used in other places too, leading to the attached lockdep complaint. Move the lock initialisation so that it is done unconditionally. INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. CPU: 1 PID: 4413 Comm: scandvb Tainted: G W 4.0.0-rc1-fsdevel+ #25 Hardware name: System manufacturer System Product Name/P5Q PRO TURBO, BIOS 0701 10/08/2012 0000000000000000 ffff880129d779d8 ffffffff8162bbdf 0000000000000006 0000000000000000 ffff880129d77aa8 ffffffff810780e3 0000000000000001 0000000000000046 0000000000000004 ffffffff81c3f180 0000000000000000 Call Trace: [] dump_stack+0x4c/0x65 [] __lock_acquire+0x7b5/0x1a0e [] lock_acquire+0x97/0x10c [] ? cx23885_buf_queue+0x69/0x142 [cx23885] [] ? amd_set_subcaches+0x19b/0x19b [] _raw_spin_lock_irqsave+0x36/0x4a [] ? cx23885_buf_queue+0x69/0x142 [cx23885] [] cx23885_buf_queue+0x69/0x142 [cx23885] [] buffer_queue+0x17/0x19 [cx23885] [] __enqueue_in_driver+0x6a/0x6f [videobuf2_core] [] vb2_start_streaming+0x37/0x129 [videobuf2_core] [] vb2_internal_streamon+0xc5/0x105 [videobuf2_core] [] __vb2_init_fileio+0x224/0x286 [videobuf2_core] [] ? vb2_thread_start+0x7b/0x15f [videobuf2_core] [] ? vb2_dvb_start_feed+0x86/0x86 [videobuf2_dvb] [] vb2_thread_start+0xc1/0x15f [videobuf2_core] [] ? dmx_section_feed_start_filtering+0x2f/0x14f [] vb2_dvb_start_feed+0x5b/0x86 [videobuf2_dvb] [] dmx_section_feed_start_filtering+0xfd/0x14f [] dvb_dmxdev_filter_start+0x23f/0x315 [] dvb_demux_do_ioctl+0x1fb/0x556 [] dvb_usercopy+0xb4/0x11c [] ? dvb_dmxdev_ts_callback+0xd0/0xd0 [] dvb_demux_ioctl+0x10/0x14 [] do_vfs_ioctl+0x3c1/0x474 [] ? file_has_perm+0x5b/0x7f [] ? __audit_syscall_entry+0xbc/0xde [] SyS_ioctl+0x55/0x7a [] system_call_fastpath+0x12/0x17 Signed-off-by: David Howells --- drivers/media/pci/cx23885/cx23885-core.c | 1 + drivers/media/pci/cx23885/cx23885-video.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in 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/media/pci/cx23885/cx23885-core.c b/drivers/media/pci/cx23885/cx23885-core.c index 1ad4994..7aee76a 100644 --- a/drivers/media/pci/cx23885/cx23885-core.c +++ b/drivers/media/pci/cx23885/cx23885-core.c @@ -825,6 +825,7 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) int i; spin_lock_init(&dev->pci_irqmask_lock); + spin_lock_init(&dev->slock); mutex_init(&dev->lock); mutex_init(&dev->gpio_lock); diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c index 5e93c68..2232b38 100644 --- a/drivers/media/pci/cx23885/cx23885-video.c +++ b/drivers/media/pci/cx23885/cx23885-video.c @@ -1137,7 +1137,6 @@ int cx23885_video_register(struct cx23885_dev *dev) int err; dprintk(1, "%s()\n", __func__); - spin_lock_init(&dev->slock); /* Initialize VBI template */ cx23885_vbi_template = cx23885_video_template;