• Johannes Berg's avatar
    um: irq/sigio: Support suspend/resume handling of workaround IRQs · cae20ba0
    Johannes Berg authored
    If the sigio workaround needed to be applied to a file descriptor,
    set_irq_wake() wouldn't work for it since it would get polled by
    the thread instead of causing SIGIO, and thus could never really
    cause a wakeup, since the thread notification FD wasn't marked as
    being able to wake up the system.
    
    Fix this by marking the thread's notification FD explicitly as a
    wake source FD, i.e. not suppressing SIGIO for it in suspend. In
    order to not cause spurious wakeups, we then need to remove all
    FDs that shouldn't wake up the system from the polling thread. In
    order to do this, add unlocked versions of ignore_sigio_fd() and
    add_sigio_fd() (nothing else is happening in suspend, so this is
    fine), and also modify ignore_sigio_fd() to return -ENOENT if the
    FD wasn't originally in there. This doesn't matter because nothing
    else currently checks the return value, but the irq code needs to
    know which ones to restore the workaround for.
    
    All told, this lets us use a timerfd for the RTC clock in the next
    patch, which doesn't send SIGIO.
    Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
    Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
    cae20ba0
sigio.c 11.2 KB