From: Al Viro <viro@ftp.linux.org.uk>
To: David Howells <dhowells@redhat.com>
Cc: torvalds@osdl.org, akpm@osdl.org, schwidefsky@de.ibm.com,
linux390@de.ibm.com, linux-kernel@vger.kernel.org,
linux-arch@vger.kernel.org
Subject: Re: [PATCH] WorkStruct: Fix S390 driver workstruct usage
Date: Fri, 8 Dec 2006 17:33:43 +0000 [thread overview]
Message-ID: <20061208173342.GT4587@ftp.linux.org.uk> (raw)
In-Reply-To: <20061208145940.21411.77769.stgit@warthog.cambridge.redhat.com>
On Fri, Dec 08, 2006 at 02:59:40PM +0000, David Howells wrote:
> diff --git a/drivers/s390/char/ctrlchar.c b/drivers/s390/char/ctrlchar.c
> index 49e9628..9fcfe3a 100644
> --- a/drivers/s390/char/ctrlchar.c
> +++ b/drivers/s390/char/ctrlchar.c
> @@ -15,15 +15,16 @@ #include <linux/ctype.h>
> #include "ctrlchar.h"
>
> #ifdef CONFIG_MAGIC_SYSRQ
> +static struct tty_struct *ctrlchar_sysrq_tty;
> static int ctrlchar_sysrq_key;
>
> static void
> -ctrlchar_handle_sysrq(void *tty)
> +ctrlchar_handle_sysrq(struct work_struct *unused)
> {
> - handle_sysrq(ctrlchar_sysrq_key, (struct tty_struct *) tty);
> + handle_sysrq(ctrlchar_sysrq_key, ctrlchar_sysrq_tty);
> }
>
> -static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq, NULL);
> +static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq);
> #endif
>
>
> @@ -52,8 +53,8 @@ ctrlchar_handle(const unsigned char *buf
> #ifdef CONFIG_MAGIC_SYSRQ
> /* racy */
> if (len == 3 && buf[1] == '-') {
> + ctrlchar_sysrq_tty = tty;
> ctrlchar_sysrq_key = buf[2];
> - ctrlchar_work.data = tty;
> schedule_work(&ctrlchar_work);
> return CTRLCHAR_SYSRQ;
> }
I don't think it's a real fix.
a) what protects tty from disappearing?
b) why the hell do we need that schedule_work() at all? handle_sysrq() is
supposed to be safe to use from irq handler; when needed it does arrange for
delayed execution itself.
So how about we simply call handle_sysrq() there and be done with that?
Martin?
next prev parent reply other threads:[~2006-12-08 18:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-08 14:59 [PATCH] WorkStruct: Fix S390 driver workstruct usage David Howells
2006-12-08 15:36 ` Martin Schwidefsky
2006-12-08 17:33 ` Al Viro [this message]
2006-12-08 18:48 ` Al Viro
2006-12-09 19:51 ` Martin Schwidefsky
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=20061208173342.GT4587@ftp.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--cc=akpm@osdl.org \
--cc=dhowells@redhat.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux390@de.ibm.com \
--cc=schwidefsky@de.ibm.com \
--cc=torvalds@osdl.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.