Re: [PATCH 2/2] xen pvfb: Para-virtual framebuffer, keyboard and pointer driver

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jeremy Fitzhardinge <jeremy@...>
Cc: <linux-kernel@...>, <xen-devel@...>, <linux-fbdev-devel@...>, <dmitry.torokhov@...>, <virtualization@...>, <linux-input@...>, <adaplas@...>, <akpm@...>, <jayakumar.lkml@...>
Date: Friday, February 22, 2008 - 2:31 am

Jeremy Fitzhardinge <jeremy@goop.org> writes:


I could do that do that, but the intermediate step (one driver, not
the other) is somewhat problematic: the backend in dom0 needs both
drivers, and will refuse to complete device initialization unless
they're both present.


Framebuffer: fbif.h xen-fbfront.c
Keyboard/mouse: kbdif.h xen-kbdfront.h

I added the config dependency because having one without the other
doesn't make sense, as explained above.

Still want it split into two separate patches?

[...]
[...]
[...]

It's designed that way.  dev->info is initialized so that
xenkbd_remove() does nothing.  Then stuff is stored into dev->info
only when it's sufficiently initialized for xenkbd_remove() to clean
it up.


Yes.  xenkbd_probe() initializes info->kbd and info->ptr to null, and
changes that to the device only after input_register_device()
succeeds.  If something goes wrong between input_allocate_device() and
input_register_device(), xenkbd_probe() frees the device with
input_free_device().  This is how input_register_device() wants to be
used according to its function comment:

    /**
     * input_register_device - register device with input core
     * @dev: device to be registered
     *
     * This function registers device with input core. The device must be
     * allocated with input_allocate_device() and all it's capabilities
     * set up before registering.
     * If function fails the device must be freed with input_free_device().
     * Once device has been successfully registered it can be unregistered
     * with input_unregister_device(); input_free_device() should not be
     * called in this case.
     */

There's another bug here: must not call input_unregister_device() when
the device is still null.  Man, I remember checking cleanup multiple
times when this stuff went into Xen (i.e. quite some time ago), and I
still missed this one.  Going to check cleanup *again*.

[...]

Thanks!
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 2/2] xen pvfb: Para-virtual framebuffer, keyboard and..., Markus Armbruster, (Thu Feb 21, 5:43 am)
Re: [PATCH 2/2] xen pvfb: Para-virtual framebuffer, keyboard..., Jeremy Fitzhardinge, (Thu Feb 21, 4:31 pm)
Re: [PATCH 2/2] xen pvfb: Para-virtual framebuffer, keyboard..., Markus Armbruster, (Fri Feb 22, 2:31 am)
Re: [PATCH 2/2] xen pvfb: Para-virtual framebuffer, keyboard..., Jeremy Fitzhardinge, (Fri Feb 22, 6:31 pm)