1. 28 3月, 2019 1 次提交
    • F
      ACPICA: Clear status of GPEs before enabling them · c8b1917c
      Furquan Shaikh 提交于
      Commit 18996f2d ("ACPICA: Events: Stop unconditionally clearing
      ACPI IRQs during suspend/resume") was added to stop clearing event
      status bits unconditionally in the system-wide suspend and resume
      paths. This was done because of an issue with a laptop lid appaering
      to be closed even when it was used to wake up the system from suspend
      (see https://bugzilla.kernel.org/show_bug.cgi?id=196249), which
      happened because event status bits were cleared unconditionally on
      system resume. Though this change fixed the issue in the resume path,
      it introduced regressions in a few suspend paths.
      
      First regression was reported and fixed in the S5 entry path by commit
      fa85015c ("ACPICA: Clear status of all events when entering S5").
      Next regression was reported and fixed for all legacy sleep paths by
      commit f317c7dc ("ACPICA: Clear status of all events when entering
      sleep states").  However, there still is a suspend-to-idle regression,
      since suspend-to-idle does not follow the legacy sleep paths.
      
      In the suspend-to-idle case, wakeup is enabled as part of device
      suspend.  If the status bits of wakeup GPEs are set when they are
      enabled, it causes a premature system wakeup to occur.
      
      To address that problem, partially revert commit 18996f2d to
      restore GPE status bits clearing before the GPE is enabled in
      acpi_ev_enable_gpe().
      
      Fixes: 18996f2d ("ACPICA: Events: Stop unconditionally clearing ACPI IRQs during suspend/resume")
      Signed-off-by: NFurquan Shaikh <furquan@google.com>
      Cc: 4.17+ <stable@vger.kernel.org> # 4.17+
      [ rjw: Subject & changelog ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c8b1917c
  2. 20 3月, 2019 1 次提交
  3. 12 3月, 2019 4 次提交
    • R
      ACPI: sysfs: Prevent get_status() from returning acpi_status · 3fd16d70
      Rafael J. Wysocki 提交于
      The return value of get_status() is passed to user space on errors,
      so it should not return acpi_status values then.  Make it return
      error values that are meaningful for user space instead.
      
      This also makes a Clang warning regarding the initialization of a
      local variable in get_status() go away.
      Reported-by: NNathan Chancellor <natechancellor@gmail.com>
      Reviewed-by: NNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      3fd16d70
    • A
      ACPI / device_sysfs: Avoid OF modalias creation for removed device · f16eb8a4
      Andy Shevchenko 提交于
      If SSDT overlay is loaded via ConfigFS and then unloaded the device,
      we would like to have OF modalias for, already gone. Thus, acpi_get_name()
      returns no allocated buffer for such case and kernel crashes afterwards:
      
       ACPI: Host-directed Dynamic ACPI Table Unload
       ads7950 spi-PRP0001:00: Dropping the link to regulator.0
       BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
       #PF error: [normal kernel read fault]
       PGD 80000000070d6067 P4D 80000000070d6067 PUD 70d0067 PMD 0
       Oops: 0000 [#1] SMP PTI
       CPU: 0 PID: 40 Comm: kworker/u4:2 Not tainted 5.0.0+ #96
       Hardware name: Intel Corporation Merrifield/BODEGA BAY, BIOS 542 2015.01.21:18.19.48
       Workqueue: kacpi_hotplug acpi_device_del_work_fn
       RIP: 0010:create_of_modalias.isra.1+0x4c/0x150
       Code: 00 00 48 89 44 24 18 31 c0 48 8d 54 24 08 48 c7 44 24 10 00 00 00 00 48 c7 44 24 08 ff ff ff ff e8 7a b0 03 00 48 8b 4c 24 10 <0f> b6 01 84 c0 74 27 48 c7 c7 00 09 f4 a5 0f b6 f0 8d 50 20 f6 04
       RSP: 0000:ffffa51040297c10 EFLAGS: 00010246
       RAX: 0000000000001001 RBX: 0000000000000785 RCX: 0000000000000000
       RDX: 0000000000001001 RSI: 0000000000000286 RDI: ffffa2163dc042e0
       RBP: ffffa216062b1196 R08: 0000000000001001 R09: ffffa21639873000
       R10: ffffffffa606761d R11: 0000000000000001 R12: ffffa21639873218
       R13: ffffa2163deb5060 R14: ffffa216063d1010 R15: 0000000000000000
       FS:  0000000000000000(0000) GS:ffffa2163e000000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 0000000000000000 CR3: 0000000007114000 CR4: 00000000001006f0
       Call Trace:
        __acpi_device_uevent_modalias+0xb0/0x100
        spi_uevent+0xd/0x40
      
       ...
      
      In order to fix above let create_of_modalias() check the status returned
      by acpi_get_name() and bail out in case of failure.
      
      Fixes: 8765c5ba ("ACPI / scan: Rework modalias creation when "compatible" is present")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=201381Reported-by: NFerry Toth <fntoth@gmail.com>
      Tested-by: Ferry Toth<fntoth@gmail.com>
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Cc: 4.1+ <stable@vger.kernel.org> # 4.1+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f16eb8a4
    • A
      ACPI / configfs: Mark local data structures static · bf567dd3
      Andy Shevchenko 提交于
      There is no need to have non-static local data structures. otherwise
      sparse is not happy:
      
        CHECK   drivers/acpi/acpi_configfs.c
      drivers/acpi/acpi_configfs.c:100:31: warning: symbol 'acpi_table_bin_attrs' was not declared. Should it be static?
      drivers/acpi/acpi_configfs.c:196:27: warning: symbol 'acpi_table_attrs' was not declared. Should it be static?
      drivers/acpi/acpi_configfs.c:236:34: warning: symbol 'acpi_table_group_ops' was not declared. Should it be static?
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      bf567dd3
    • A
      ACPI / configfs: Mark local functions static · c62c15a9
      Andy Shevchenko 提交于
      There is no need to have non-static local functions. otherwise
      compiler is not happy:
      
        CC [M]  drivers/acpi/acpi_configfs.o
      drivers/acpi/acpi_configfs.c:105:9: warning: no previous prototype for ‘acpi_table_signature_show’ [-Wmissing-prototypes]
       ssize_t acpi_table_signature_show(struct config_item *cfg, char *str)
               ^~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/acpi/acpi_configfs.c:115:9: warning: no previous prototype for ‘acpi_table_length_show’ [-Wmissing-prototypes]
       ssize_t acpi_table_length_show(struct config_item *cfg, char *str)
               ^~~~~~~~~~~~~~~~~~~~~~
      ...
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c62c15a9
  4. 11 3月, 2019 1 次提交
  5. 02 3月, 2019 1 次提交
  6. 27 2月, 2019 1 次提交
  7. 25 2月, 2019 3 次提交
  8. 22 2月, 2019 1 次提交
  9. 21 2月, 2019 5 次提交
  10. 20 2月, 2019 1 次提交
  11. 18 2月, 2019 7 次提交
  12. 15 2月, 2019 1 次提交
  13. 14 2月, 2019 3 次提交
    • H
      ACPI / video: Extend chassis-type detection with a "Lunch Box" check · d693c008
      Hans de Goede 提交于
      Commit 53fa1f6e ("ACPI / video: Only default only_lcd to true on
      Win8-ready _desktops_") introduced chassis type detection, limiting the
      lcd_only check for the backlight to devices where the chassis-type
      indicates their is no builtin LCD panel.
      
      The purpose of the lcd_only check is to avoid advertising a backlight
      interface on desktops, since skylake and newer machines seem to always
      have a backlight interface even if there is no LCD panel. The limiting
      of this check to desktops only was done to avoid breaking backlight
      support on some laptops which do not have the lcd flag set.
      
      The Fujitsu ESPRIMO Q910 which is a compact (NUC like) desktop machine
      has a chassis type of 0x10 aka "Lunch Box". Without the lcd_only check
      we end up falsely advertising backlight/brightness control on this
      device. This commit extend the dmi_is_desktop check to return true
      for type 0x10 to fix this.
      
      Fixes: 53fa1f6e ("ACPI / video: Only default only_lcd to true ...")
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d693c008
    • H
      ACPI / video: Refactor and fix dmi_is_desktop() · cecf3e3e
      Hans de Goede 提交于
      This commit refactors the chassis-type detection introduced by
      commit 53fa1f6e ("ACPI / video: Only default only_lcd to true on
      Win8-ready _desktops_") (where desktop means anything without a builtin
      screen).
      
      The DMI chassis_type is an unsigned integer, so rather then doing a
      whole bunch of string-compares on it, convert it to an int and feed
      the result to a switch case.
      
      Note the switch case uses hex values, this is done because the spec
      uses hex values too. This changes the check for "Main Server Chassis"
      from checking for 11 decimal to 11 hexadecimal, this is a bug fix,
      the original check for 11 decimal was wrong.
      
      Fixes: 53fa1f6e ("ACPI / video: Only default only_lcd to true ...")
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      [ rjw: Drop redundant return statements ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      cecf3e3e
    • D
      nfit/ars: Attempt a short-ARS whenever the ARS state is idle at boot · c6c5df29
      Dan Williams 提交于
      If query-ARS reports that ARS has stopped and requires continuation
      attempt to retrieve short-ARS results before continuing the long
      operation.
      
      Fixes: bc6ba808 ("nfit, address-range-scrub: rework and simplify ARS...")
      Cc: <stable@vger.kernel.org>
      Reported-by: NKrzysztof Rusocki <krzysztof.rusocki@intel.com>
      Reviewed-by: NToshi Kani <toshi.kani@hpe.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      c6c5df29
  14. 13 2月, 2019 1 次提交
    • D
      acpi/nfit: Require opt-in for read-only label configurations · 0171b6b7
      Dan Williams 提交于
      Recent fixes to command handling enabled Linux to read label
      configurations that it could not before. Unfortunately that means that
      configurations that were operating in label-less mode will be broken as
      the kernel ignores the existing namespace configuration and tries to
      honor the new found labels.
      
      Fortunately this seems limited to a case where Linux can quirk the
      behavior and maintain the existing label-less semantics by default.
      When the platform does not emit an _LSW method, disable all label access
      methods. Provide a 'force_labels' module parameter to allow read-only
      label operation.
      
      Fixes: 11189c10 ("acpi/nfit: Fix command-supported detection")
      Reported-by: NDexuan Cui <decui@microsoft.com>
      Reviewed-by: NDexuan Cui <decui@microsoft.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      0171b6b7
  15. 11 2月, 2019 1 次提交
  16. 08 2月, 2019 8 次提交