From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: Valdis.Kletnieks@vt.edu, Alan Cox <alan@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: hidraw_exit in discarded section (was: Re: [PATCH 1/1] HID: fix tty<->hid deadlock)
Date: Thu, 16 Oct 2008 12:32:11 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.64.0810161229300.25933@anakin> (raw)
In-Reply-To: <1220541367-10984-1-git-send-email-jirislaby@gmail.com>
On Thu, 4 Sep 2008, Jiri Slaby wrote:
> hid_compat_load() runs on the default workqueue, it request_module(), it
> execs modprobe, it exits, tty flushes default workqueue, it hangs, because
> we are still in it.
>
> I haven't run into it since there always was at least one opener of the tty,
> I guess. Could you try the patch below?
>
> --
>
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
> ---
> drivers/hid/hid-core.c | 11 ++++++++++-
> 1 files changed, 10 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index 92c16e1..18d952a 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -1663,6 +1663,7 @@ static void hid_compat_load(struct work_struct *ws)
> request_module("hid-dummy");
> }
> static DECLARE_WORK(hid_compat_work, hid_compat_load);
> +static struct workqueue_struct *hid_compat_wq;
> #endif
>
> static int __init hid_init(void)
> @@ -1680,7 +1681,12 @@ static int __init hid_init(void)
> goto err_bus;
>
> #ifdef CONFIG_HID_COMPAT
> - schedule_work(&hid_compat_work);
> + hid_compat_wq = create_workqueue("hid_compat");
> + if (!hid_compat_wq) {
> + hidraw_exit();
> + goto err;
> + }
> + queue_work(hid_compat_wq, &hid_compat_work);
> #endif
>
> return 0;
> @@ -1692,6 +1698,9 @@ err:
>
> static void __exit hid_exit(void)
> {
> +#ifdef CONFIG_HID_COMPAT
> + destroy_workqueue(hid_compat_wq);
> +#endif
> hidraw_exit();
> bus_unregister(&hid_bus_type);
> }
hid_init() is marked __init.
hidraw_exit() is marked __exit.
Hence I get:
`hidraw_exit' referenced in section `.init.text' of drivers/built-in.o: defined in discarded section `.exit.text' of drivers/built-in.o
and my `enable everything' m68k kernel fails to link.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
prev parent reply other threads:[~2008-10-16 10:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <48BFFAE0.5010001@gmail.com>
2008-09-04 15:16 ` [PATCH 1/1] HID: fix tty<->hid deadlock Jiri Slaby
2008-09-05 0:03 ` Valdis.Kletnieks
2008-09-26 11:03 ` Jiri Slaby
2008-10-16 10:32 ` Geert Uytterhoeven [this message]
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=Pine.LNX.4.64.0810161229300.25933@anakin \
--to=geert@linux-m68k.org \
--cc=Valdis.Kletnieks@vt.edu \
--cc=akpm@linux-foundation.org \
--cc=alan@redhat.com \
--cc=jirislaby@gmail.com \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®