All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+kernel@arm.linux.org.uk>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: linux-media@vger.kernel.org
Subject: [PATCH 1/8] [media] em28xx: fix em28xx-input removal
Date: Sat, 20 Dec 2014 12:45:15 +0000	[thread overview]
Message-ID: <E1Y2JPH-0006UN-SW@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20141220124448.GG11285@n2100.arm.linux.org.uk>

Removing the em28xx-rc module results in the following lockdep splat,
which is caused by trying to call cancel_delayed_work_sync() on an
uninitialised delayed work.  Fix this by ensuring we always initialise
the work.

INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
CPU: 0 PID: 2183 Comm: rmmod Not tainted 3.18.0+ #1464
Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
Backtrace:
[<c0012228>] (dump_backtrace) from [<c00123c0>] (show_stack+0x18/0x1c)
 r6:c1419d2c r5:00000000 r4:00000000 r3:00000000
[<c00123a8>] (show_stack) from [<c06e2550>] (dump_stack+0x7c/0x98)
[<c06e24d4>] (dump_stack) from [<c0061c94>] (__lock_acquire+0x16d4/0x1bb0)
 r4:edf19f74 r3:df049380
[<c00605c0>] (__lock_acquire) from [<c00626d4>] (lock_acquire+0xb0/0x124)
 r10:00000000 r9:c003ba90 r8:00000000 r7:00000000 r6:00000000 r5:edf19f74
 r4:00000000
[<c0062624>] (lock_acquire) from [<c003bad4>] (flush_work+0x44/0x264)
 r10:00000000 r9:eaa86000 r8:edf190b0 r7:edf19f74 r6:00000001 r5:edf19f64
 r4:00000000
[<c003ba90>] (flush_work) from [<c003d8f0>] (__cancel_work_timer+0x8c/0x124)
 r7:00000000 r6:00000001 r5:00000000 r4:edf19f64
[<c003d864>] (__cancel_work_timer) from [<c003d99c>] (cancel_delayed_work_sync+0x14/0x18)
 r7:00000000 r6:eccc3600 r5:00000000 r4:edf19000
[<c003d988>] (cancel_delayed_work_sync) from [<bf0b5c10>] (em28xx_ir_fini+0x48/0xd8 [em28xx_rc])
[<bf0b5bc8>] (em28xx_ir_fini [em28xx_rc]) from [<bf08a0a8>] (em28xx_unregister_extension+0x40/0x94 [em28xx])
 r8:c000edc4 r7:00000081 r6:bf092bf4 r5:bf0b6a2c r4:edf19000 r3:bf0b5bc8
[<bf08a068>] (em28xx_unregister_extension [em28xx]) from [<bf0b64dc>] (em28xx_rc_unregister+0x14/0x1c [em28xx_rc])
 r6:00000800 r5:00000000 r4:bf0b6a50 r3:bf0b64c8
[<bf0b64c8>] (em28xx_rc_unregister [em28xx_rc]) from [<c0096710>] (SyS_delete_module+0x11c/0x180)
[<c00965f4>] (SyS_delete_module) from [<c000ec00>] (ret_fast_syscall+0x0/0x48)
 r6:00000001 r5:beb0f813 r4:b8b17d00

Cc: <stable@vger.kernel.org>
Fixes: f52226099382 ("[media] em28xx: extend the support for device buttons")
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 drivers/media/usb/em28xx/em28xx-input.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
index d8dc03aadfbd..ef36c49ef166 100644
--- a/drivers/media/usb/em28xx/em28xx-input.c
+++ b/drivers/media/usb/em28xx/em28xx-input.c
@@ -654,8 +654,6 @@ static void em28xx_init_buttons(struct em28xx *dev)
 	if (dev->num_button_polling_addresses) {
 		memset(dev->button_polling_last_values, 0,
 		       EM28XX_NUM_BUTTON_ADDRESSES_MAX);
-		INIT_DELAYED_WORK(&dev->buttons_query_work,
-				  em28xx_query_buttons);
 		schedule_delayed_work(&dev->buttons_query_work,
 				      msecs_to_jiffies(dev->button_polling_interval));
 	}
@@ -689,6 +687,7 @@ static int em28xx_ir_init(struct em28xx *dev)
 	}
 
 	kref_get(&dev->ref);
+	INIT_DELAYED_WORK(&dev->buttons_query_work, em28xx_query_buttons);
 
 	if (dev->board.buttons)
 		em28xx_init_buttons(dev);
-- 
1.8.3.1


  reply	other threads:[~2014-12-20 12:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-20 12:44 [PATCH 0/8] Fix issues in em28xx Russell King - ARM Linux
2014-12-20 12:45 ` Russell King [this message]
     [not found]   ` <549583AA.9040204@googlemail.com>
2014-12-20 14:51     ` [PATCH 1/8] [media] em28xx: fix em28xx-input removal Russell King - ARM Linux
2014-12-21 19:18       ` Frank Schäfer
2014-12-20 12:45 ` [PATCH 2/8] [media] em28xx: ensure "closing" messages terminate with a newline Russell King
2014-12-20 12:45 ` [PATCH 3/8] [media] em28xx-input: fix missing newlines Russell King
2014-12-20 12:45 ` [PATCH 4/8] [media] em28xx-core: " Russell King
2014-12-20 12:45 ` [PATCH 5/8] [media] em28xx-audio: " Russell King
2014-12-20 12:45 ` [PATCH 6/8] " Russell King
2014-12-20 12:45 ` [PATCH 7/8] [media] em28xx-dvb: " Russell King
2014-12-20 12:45 ` [PATCH 8/8] [media] em28xx-video: " Russell King
2014-12-20 14:10 ` [PATCH 0/8] Fix issues in em28xx Frank Schäfer
2014-12-20 14:53   ` Russell King - ARM Linux
2014-12-21 19:20 ` Frank Schäfer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1Y2JPH-0006UN-SW@rmk-PC.arm.linux.org.uk \
    --to=rmk+kernel@arm.linux.org.uk \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.