From: Benjamin Tissoires <benjamin.tissoires@gmail.com>
To: Dylan Alex Simon <dylan-kernel@dylex.net>,
linux-input@vger.kernel.org, Jiri Kosina <jkosina@suse.cz>
Subject: Re: hid-thingm: kernel panic on remove
Date: Tue, 02 Sep 2014 15:58:08 -0400 [thread overview]
Message-ID: <54062150.2010800@gmail.com> (raw)
In-Reply-To: <20140902174659.GA1811@datura.dylex.net>
Hi,
On 09/02/2014 01:46 PM, Dylan Alex Simon wrote:
> Whenever either disconnecting the USB device or simply rmmod'ing the module
> (even when not in use), I get a kernel panic. I haven't managed to capture a
> backtrace, but at least the first two lines were saved after an rmmod:
>
> 18:53:17 kernel: thingm 0003:27B8:01ED.0004: hidraw3: USB HID v1.01 Device [ThingM blink(1) mk2] on usb-0000:00:12.2-3.1.4/input0
> <snip, rmmod hid-thingm:>
> 08:38:42 kernel: BUG: unable to handle kernel paging request at fffffffb8a80aaf8
> 08:38:42 kernel: IP: [<ffffffff8106e30c>] osq_lock+0x3c/0x110
>
> Let me know if you'd like me to try to capture more info, but this problem
> seems very reproducible (at least with a mk2 device; I never had the problem on
> older kernels with a mk1). I do direct write()s to the hidraw device, but
> don't otherwise use the driver while it's loaded.
>
> Also at https://bugzilla.kernel.org/show_bug.cgi?id=83751
Do you happen to see a "unsupported firmware " error when plugging your device?
If so, then the following patch should help with the panic (but you will an other one to be able to use again your device).
---
>From 791297375227b91990b37f94fc9de93156a3c21a Mon Sep 17 00:00:00 2001
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Date: Tue, 2 Sep 2014 15:50:43 -0400
Subject: [PATCH] HID: thingm: set the proper error code before leaving
In case of an unsupported firmware, the driver bails out without setting
the LEDs interfaces, but forget to set the proper error code.
err is then still equal to 0 and the hid subsytem consider the device
to be in perfect shape.
When removing it, thingm_remove() tries to unbind the rgb LEDs which
has not been created, leading to a segfault.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---
drivers/hid/hid-thingm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/hid/hid-thingm.c b/drivers/hid/hid-thingm.c
index 134be89..f91f971 100644
--- a/drivers/hid/hid-thingm.c
+++ b/drivers/hid/hid-thingm.c
@@ -250,6 +250,7 @@ static int thingm_probe(struct hid_device *hdev, const struct hid_device_id *id)
if (!tdev->fwinfo) {
hid_err(hdev, "unsupported firmware %c\n", tdev->version.major);
+ err = -ENODEV;
goto stop;
}
--
2.1.0
next prev parent reply other threads:[~2014-09-02 19:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-02 17:46 hid-thingm: kernel panic on remove Dylan Alex Simon
2014-09-02 19:58 ` Benjamin Tissoires [this message]
2014-09-02 20:12 ` Dylan Alex Simon
2014-09-02 21:32 ` Jiri Kosina
2014-09-03 2:35 ` Dylan Alex Simon
2014-09-03 7:29 ` Jiri Kosina
2014-09-03 8:17 ` Dylan Alex Simon
2014-09-03 8:21 ` Jiri Kosina
2014-09-03 13:03 ` Dylan Alex Simon
2014-09-03 13:10 ` Jiri Kosina
2014-09-03 14:16 ` Dylan Alex Simon
2014-09-03 14:37 ` Jiri Kosina
2014-09-04 1:05 ` Dylan Alex Simon
2014-09-04 7:02 ` [PATCH] HID: thingm: fix workqueue race " Jiri Kosina
2014-09-03 19:48 ` hid-thingm: kernel panic " Benjamin Tissoires
2014-09-03 21:47 ` Jiri Kosina
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=54062150.2010800@gmail.com \
--to=benjamin.tissoires@gmail.com \
--cc=dylan-kernel@dylex.net \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
/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.