Re: [PATCH] vt: Drop K_OFF for VC_MUTE

From: Josh Boyer
Date: Tue Nov 20 2012 - 09:39:57 EST


On Fri, Nov 16, 2012 at 1:32 PM, Adam Jackson <ajax@xxxxxxxxxx> wrote:
> The "don't enqueue stuff" semantics of K_OFF shouldn't be a function of
> the keyboard map state; we should be able to switch among cooked/raw/
> unicode without changing whether events are delivered. Otherwise - if
> changing to K_UNICODE undoes K_OFF - then suddenly Alt-F2 under
> Gnome will switch VT instead of summoning the "run command" dialog.
>
> Drop the K_OFF handling and replace it with a new "mute" ioctl pair.
> Anybody using K_OFF would already need to be prepared to handle it
> throwing -EINVAL for old kernel compatibility, so userspace will degrade
> gracefully.
>
> Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=859485
> Cc: Arthur Taylor <art@xxxxxxxx>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Tested-by: Josh Boyer <jwboyer@xxxxxxxxxx>
> Signed-off-by: Adam Jackson <ajax@xxxxxxxxxx>

Well, I tested a build with this patch so the tested-by is accurate.
It fixes the problem when it builds. But...

> diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
> index 681765b..08d1d57 100644
> --- a/drivers/tty/vt/keyboard.c
> +++ b/drivers/tty/vt/keyboard.c

<snip>

> +int vt_do_kgdbmute(int console)
> +{
> + struct kbd_struct * kbd = kbd_table + console;
> + /* This is a spot read so needs no locking */
> + return vc_kbd_mode(kbd, VC_MUTE);
> +}
> +

That should be vt_do_kdgkbmute. I know kgdb is probably easier to type
because 'gdb' is ingrained into every developer's finger memory, but the
kernel gets really grumpy when function definitions don't match what
callers actually call:

drivers/built-in.o: In function `vt_ioctl':
/home/jwboyer/kernel/drivers/tty/vt/vt_ioctl.c:489: undefined
reference to `vt_do_kdgkbmute'


After that small fixup, the patch does build and does still fix the
problem with a properly fixed up Xorg.

josh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/