1. 24 6月, 2021 4 次提交
    • D
      ACPI: PM: postpone bringing devices to D0 unless we need them · f7599be2
      Dmitry Torokhov 提交于
      Currently ACPI power domain brings devices into D0 state in the "resume
      early" phase. Normally this does not cause any issues, as powering up
      happens quickly. However there are peripherals that have certain timing
      requirements for powering on, for example some models of Elan
      touchscreens need 300msec after powering up/releasing reset line before
      they can accept commands from the host. Such devices will dominate
      the time spent in early resume phase and cause increase in overall
      resume time as we wait for early resume to complete before we can
      proceed to the normal resume stage.
      
      There are ways for a driver to indicate that it can tolerate device
      being in the low power mode and that it knows how to power the device
      back up when resuming, bit that requires changes to individual drivers
      that may not really care about details of ACPI controlled power
      management.
      
      This change attempts to solve this issue at ACPI power domain level, by
      postponing powering up device until we get to the normal resume stage,
      unless there is early resume handler defined for the device, or device
      does not declare any resume handlers, in which case we continue powering
      up such devices early. This allows us to shave off several hundred
      milliseconds of resume time on affected systems.
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f7599be2
    • R
      ACPI: tables: Add custom DSDT file as makefile prerequisite · d1059c1b
      Richard Fitzgerald 提交于
      A custom DSDT file is mostly used during development or debugging,
      and in that case it is quite likely to want to rebuild the kernel
      after changing ONLY the content of the DSDT.
      
      This patch adds the custom DSDT as a prerequisite to tables.o
      to ensure a rebuild if the DSDT file is updated. Make will merge
      the prerequisites from multiple rules for the same target.
      Signed-off-by: NRichard Fitzgerald <rf@opensource.cirrus.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d1059c1b
    • N
      ACPI: bgrt: Use sysfs_emit · 6554ca9c
      Nathan Chancellor 提交于
      sysfs_emit is preferred to snprintf for emitting values after
      commit 2efc459d ("sysfs: Add sysfs_emit and sysfs_emit_at to format
      sysfs output").
      Signed-off-by: NNathan Chancellor <nathan@kernel.org>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      6554ca9c
    • N
      ACPI: bgrt: Fix CFI violation · f37ccf8f
      Nathan Chancellor 提交于
      clang's Control Flow Integrity requires that every indirect call has a
      valid target, which is based on the type of the function pointer. The
      *_show() functions in this file are written as if they will be called
      from dev_attr_show(); however, they will be called from
      sysfs_kf_seq_show() because the files were created by
      sysfs_create_group() and the sysfs ops are based on kobj_sysfs_ops
      because of kobject_add_and_create(). Because the *_show() functions do
      not match the type of the show() member in struct kobj_attribute, there
      is a CFI violation.
      
      $ cat /sys/firmware/acpi/bgrt/{status,type,version,{x,y}offset}}
      1
      0
      1
      522
      307
      
      $ dmesg | grep "CFI failure"
      [  267.761825] CFI failure (target: type_show.d5e1ad21498a5fd14edbc5c320906598.cfi_jt+0x0/0x8):
      [  267.762246] CFI failure (target: xoffset_show.d5e1ad21498a5fd14edbc5c320906598.cfi_jt+0x0/0x8):
      [  267.762584] CFI failure (target: status_show.d5e1ad21498a5fd14edbc5c320906598.cfi_jt+0x0/0x8):
      [  267.762973] CFI failure (target: yoffset_show.d5e1ad21498a5fd14edbc5c320906598.cfi_jt+0x0/0x8):
      [  267.763330] CFI failure (target: version_show.d5e1ad21498a5fd14edbc5c320906598.cfi_jt+0x0/0x8):
      
      Convert these functions to the type of the show() member in struct
      kobj_attribute so that there is no more CFI violation. Because these
      functions are all so similar, combine them into a macro.
      
      Fixes: d1ff4b1c ("ACPI: Add support for exposing BGRT data")
      Link: https://github.com/ClangBuiltLinux/linux/issues/1406Signed-off-by: NNathan Chancellor <nathan@kernel.org>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f37ccf8f
  2. 22 6月, 2021 2 次提交
  3. 19 6月, 2021 7 次提交
  4. 17 6月, 2021 16 次提交
  5. 14 6月, 2021 5 次提交
  6. 12 6月, 2021 1 次提交
  7. 11 6月, 2021 5 次提交