Re: [PATCH 4/9] Input: Block suspend while event queue is not empty.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 5, 2009 at 1:02 PM, Pavel Machek <pavel@xxxxxx> wrote:
>
>> Add an ioctl, EVIOCSSUSPENDBLOCK, to enable a suspend_blocker that will block
>> suspend while the event queue is not empty. This allows userspace code to
>> process input events while the device appears to be asleep.
>>
>> Signed-off-by: Arve Hj??nnev??g <arve@xxxxxxxxxxx>
>
> Looks ok to  me, but I guess you should cc input maintainers.

OK.

>
>> @@ -582,6 +591,19 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
>>               else
>>                       return evdev_ungrab(evdev, client);
>>
>> +     case EVIOCGSUSPENDBLOCK:
>> +             return put_user(client->use_suspend_blocker, ip);
>> +
>> +     case EVIOCSSUSPENDBLOCK:
>> +             spin_lock_irq(&client->buffer_lock);
>> +             if (!client->use_suspend_blocker && p)
>> +                     suspend_blocker_init(&client->suspend_blocker, "evdev");
>> +             else if (client->use_suspend_blocker && !p)
>> +                     suspend_blocker_destroy(&client->suspend_blocker);
>> +             client->use_suspend_blocker = !!p;
>> +             spin_unlock_irq(&client->buffer_lock);
>> +             return 0;
>
> This returns 0 even when you destroy already destroyed blocker
> (etc). Is that ok?

Yes. If events did not block suspend before the call, they still do
not block suspend after the call, so the requested state was reached.

-- 
Arve Hjønnevåg
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux