mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: "Greg Kroah-Hartman" <gregkh@suse.de>, linux-kernel@vger.kernel.org
Subject: Re: compat_ioctl: unknown cmd on serial /dev/console
Date: Fri, 8 Jan 2010 17:18:23 +0100	[thread overview]
Message-ID: <201001081718.23840.arnd@arndb.de> (raw)
In-Reply-To: <20100109.000510.193873785.anemo@mba.ocn.ne.jp>

On Friday 08 January 2010, Atsushi Nemoto wrote:
> After the commit fb07a5f8 ("compat_ioctl: remove all VT ioctl
> handling"), I got this error message on 64-bit mips kernel with 32-bit
> busybox userland:
> 
> ioctl32(init:1): Unknown cmd fd(0) cmd(00005600){t:'V';sz:0} arg(7fd76480) on /dev/console

Just to confirm: The behaviour of the kernel is still correct, it's only
the message you are worried about, right?

Sorry for this, it will be trivial to fix.

> The cmd 5600 is VT_OPENQRY.  The busybox's init issues this ioctl to
> know vt-console or serial-console.  If the console was serial console,
> VT ioctls are not handled by the serial driver.
> 
> How this error should be fixed?  Is this patch OK?
> 
> diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
> index 332dd00..731478f 100644
> --- a/fs/compat_ioctl.c
> +++ b/fs/compat_ioctl.c
> @@ -1005,6 +1005,8 @@ COMPATIBLE_IOCTL(SCSI_IOCTL_SEND_COMMAND)
>  COMPATIBLE_IOCTL(SCSI_IOCTL_PROBE_HOST)
>  COMPATIBLE_IOCTL(SCSI_IOCTL_GET_PCI)
>  #endif
> +/* Big V (for serial console case) */
> +COMPATIBLE_IOCTL(VT_OPENQRY)
>  /* Little p (/dev/rtc, /dev/envctrl, etc.) */
>  COMPATIBLE_IOCTL(RTC_AIE_ON)
>  COMPATIBLE_IOCTL(RTC_AIE_OFF)

I would probably write this as IGNORE_IOCTL() instead of COMPATIBLE_IOCTL
in order to document the intent, but it's functionally the same.

> And by quick search, I found some programs using VT_GETMODE to check
> vt-console is available or not.  So VT_GETMODE might be an another
> candidate, but not sure.

Yes, that sounds reasonable, too.

	Arnd

  reply	other threads:[~2010-01-08 16:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-08 15:05 Atsushi Nemoto
2010-01-08 16:18 ` Arnd Bergmann [this message]
2010-01-10 14:09   ` Atsushi Nemoto

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=201001081718.23840.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=gregkh@suse.de \
    --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

Powered by JetHome