• Lv Zheng's avatar
    ACPI / button: Change default behavior to lid_init_state=open · 8d5dd97f
    Lv Zheng authored
    [ Upstream commit 77e9a4aa ]
    
    More and more platforms need the button.lid_init_state=open quirk. This
    patch sets it the default behavior.
    
    If a platform doesn't send lid open event or lid open event is lost due to
    the underlying system problems, then we can compare various combinations:
    1. systemd/acpid is used to suspend system or not, systemd has a special
       logic forcing open event after resuming;
    2. _LID returns a cached value or not.
    
    The result is as follows:
    
     1. lid_init_state=method
       1. cached
          1. resumed by lid:
             (x) event=close
             (x) systemd=suspends again
             (x) acpid=suspends again
             (x) state=close
          2. resumed by other:
             (o) event=close
             (x) systemd=suspends again
             (x) acpid=suspends again
             (o) state=close
       2. non-cached
          1. resumed by lid:
             (o) event=open
             (o) systemd=resumes
             (o) acpid=resumes
             (o) state=open
          2. resumed by other:
             (o) event=close
             (x) systemd=suspends again
             (x) acpid=suspends again
             (o) state=close
     2. lid_init_state=open
       1. cached
          1. resumed by lid:
             (o) event=open
             (o) systemd=resumes
             (o) acpid=resumes
             (x) state=close
          2. resumed by other:
             (x) event=open
             (o) systemd=resumes
             (o) acpid=resumes
             (o) state=close
       2. non-cached
          1. resumed by lid:
             (o) event=open
             (o) systemd=resumes
             (o) acpid=resumes
             (o) state=open
          2. resumed by other:
             (x) event=open
             (o) systemd=resumes
             (o) acpid=resumes
             (o) state=close
     3. lid_init_state=ignore
       1. cached
          1. resumed by lid:
             (o) event=none
             (x) systemd=suspends again
             (o) acpid=resumes
             (x) state=close
          2. resumed by other:
             (o) event=none
             (x) systemd=suspends again
             (o) acpid=resumes
             (o) state=close
       2. non-cached
          1. resumed by lid:
             (o) event=none
             (x) systemd=suspends again
             (o) acpid=resumes
             (o) state=open
          2. resumed by other:
             (o) event=none
             (x) systemd=suspends again
             (o) acpid=resumes
             (o) state=close
    
    As a conclusion:
     1. With systemd changed, lid_init_state=ignore has only one problem and the
        problem comes from an underlying issue, not userspace and kernel lid
        handling.
     2. Without systemd changed, lid_init_state=open can be the default
        behavior as the pass ratio is not much worse than lid_init_state=ignore.
     3. lid_init_state=method is buggy, we can have a separate patch to make it
        deprectated.
    
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=187271Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    8d5dd97f
button.c 16.3 KB