All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: Crash in usb_keyboard
Date: Sun, 03 May 2009 00:25:31 -0400	[thread overview]
Message-ID: <1241324731.8745.36.camel@ct> (raw)
In-Reply-To: <20090502113928.GC28362@thorin>

On Sat, 2009-05-02 at 13:39 +0200, Robert Millan wrote:
> On Mon, Apr 27, 2009 at 11:55:10PM -0400, Pavel Roskin wrote:
> > Hello!
> > 
> > Running "terminal_input.usb_keyboard" crashed GRUB (or qemu it's running
> > in).  It turns out we never check if usbdev in term/usb_keyboard.c is
> > not NULL.  It is NULL if no USB host controllers have been detected.
> > 
> > I'm not sure if we even want to call grub_term_register_input() if no
> > USB keyboard is present.
> 
> What if a keyboard is not present, but plugged in later?

If we add support for USB hotplug, then we'll take care of it.  I don't
think GRUB will support interrupts, but it may get support for timers
that would rescan the USB tree periodically.

When USB hotplug is not supported, it doesn't really matter if
terminal_input.usb_keyboard succeeds of fails in absence of a USB
keyboard.

By the way, we need to handle the case of multiple keyboards.  That
would automatically take care of the zero keyboards.

It looks like the current code can match non-keyboards.

For my keyboard, "lsusb -v" gives:

  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
...
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None

The existing code doesn't check interfaces.

-- 
Regards,
Pavel Roskin



  reply	other threads:[~2009-05-03  4:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-28  3:55 Crash in usb_keyboard Pavel Roskin
2009-05-02 11:39 ` Robert Millan
2009-05-03  4:25   ` Pavel Roskin [this message]
2009-05-03 15:56     ` Robert Millan
2009-05-03 17:13       ` Pavel Roskin

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=1241324731.8745.36.camel@ct \
    --to=proski@gnu.org \
    --cc=grub-devel@gnu.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.