lkml.org 
[lkml]   [2012]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC][PATCH 2/2] ACPI video: Don't start video device until its associated input device has been reigstered
    On Tue, Feb 28, 2012 at 04:39:15PM -0800, Dmitry Torokhov wrote:
    > On Wed, Feb 29, 2012 at 03:55:18AM +0400, Igor Murzov wrote:
    > > From 202f25d44b1cf871697c88a6a3a8d854674db4d8 Mon Sep 17 00:00:00 2001
    > > From: Igor Murzov <e-mail@date.by>
    > > Date: Mon, 27 Feb 2012 21:57:59 +0400
    > > Subject: [PATCH 2/2] ACPI video: Don't start video device until its
    > > associated input device has been reigstered
    >
    > >
    > > ---
    > > drivers/acpi/video.c | 10 ++++++----
    > > 1 files changed, 6 insertions(+), 4 deletions(-)
    > >
    > > diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
    > > index 1bc6370..b9e114c 100644
    > > --- a/drivers/acpi/video.c
    > > +++ b/drivers/acpi/video.c
    > > @@ -1659,9 +1659,6 @@ static int acpi_video_bus_add(struct acpi_device *device)
    > > error = acpi_video_bus_get_devices(video, device);
    > > if (error)
    > > goto err_free_video;
    > > - error = acpi_video_bus_start_devices(video);
    > > - if (error)
    > > - goto err_put_video;
    > >
    > > video->input = input = input_allocate_device();
    > > if (!input) {
    > > @@ -1703,13 +1700,18 @@ static int acpi_video_bus_add(struct acpi_device *device)
    > > if (error)
    > > goto err_free_input_dev;
    > >
    > > + error = acpi_video_bus_start_devices(video);
    > > + if (error)
    > > + goto err_unregister_pm_notifier;
    > > +
    >
    > Registered input device should be unregistered with
    > input_unregister_device(), not input_free_device(). Your change breaks
    > this.
    >
    > Also, notify() will not be called until acpi_video_bus_add() completes
    > so current code should be perfectly fine.

    Hm, I take the last paragraph back - in addition to bus notifier we do
    install device notifier explicitly so it might fire up early. The
    easiest fox would be to move acpi_video_bus_start_devices after
    input_allocate_device() but before input_refister_device() -
    unregistered input devoces can handle input_event() calls just fine.

    --
    Dmitry


    \
     
     \ /
      Last update: 2012-02-29 02:19    [W:4.981 / U:0.140 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site