1. 17 1月, 2020 1 次提交
  2. 15 1月, 2020 9 次提交
  3. 02 1月, 2020 1 次提交
  4. 27 12月, 2019 4 次提交
  5. 18 12月, 2019 3 次提交
    • R
      ACPI: PM: Avoid attaching ACPI PM domain to certain devices · 24f41534
      Rafael J. Wysocki 提交于
      commit b9ea0bae260f6aae546db224daa6ac1bd9d94b91 upstream.
      
      Certain ACPI-enumerated devices represented as platform devices in
      Linux, like fans, require special low-level power management handling
      implemented by their drivers that is not in agreement with the ACPI
      PM domain behavior.  That leads to problems with managing ACPI fans
      during system-wide suspend and resume.
      
      For this reason, make acpi_dev_pm_attach() skip the affected devices
      by adding a list of device IDs to avoid to it and putting the IDs of
      the affected devices into that list.
      
      Fixes: e5cc8ef3 (ACPI / PM: Provide ACPI PM callback routines for subsystems)
      Reported-by: NZhang Rui <rui.zhang@intel.com>
      Tested-by: NTodd Brandt <todd.e.brandt@linux.intel.com>
      Cc: 3.10+ <stable@vger.kernel.org> # 3.10+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      24f41534
    • V
      ACPI: bus: Fix NULL pointer check in acpi_bus_get_private_data() · 1309b436
      Vamshi K Sthambamkadi 提交于
      commit 627ead724eff33673597216f5020b72118827de4 upstream.
      
      kmemleak reported backtrace:
          [<bbee0454>] kmem_cache_alloc_trace+0x128/0x260
          [<6677f215>] i2c_acpi_install_space_handler+0x4b/0xe0
          [<1180f4fc>] i2c_register_adapter+0x186/0x400
          [<6083baf7>] i2c_add_adapter+0x4e/0x70
          [<a3ddf966>] intel_gmbus_setup+0x1a2/0x2c0 [i915]
          [<84cb69ae>] i915_driver_probe+0x8d8/0x13a0 [i915]
          [<81911d4b>] i915_pci_probe+0x48/0x160 [i915]
          [<4b159af1>] pci_device_probe+0xdc/0x160
          [<b3c64704>] really_probe+0x1ee/0x450
          [<bc029f5a>] driver_probe_device+0x142/0x1b0
          [<d8829d20>] device_driver_attach+0x49/0x50
          [<de71f045>] __driver_attach+0xc9/0x150
          [<df33ac83>] bus_for_each_dev+0x56/0xa0
          [<80089bba>] driver_attach+0x19/0x20
          [<cc73f583>] bus_add_driver+0x177/0x220
          [<7b29d8c7>] driver_register+0x56/0xf0
      
      In i2c_acpi_remove_space_handler(), a leak occurs whenever the
      "data" parameter is initialized to 0 before being passed to
      acpi_bus_get_private_data().
      
      This is because the NULL pointer check in acpi_bus_get_private_data()
      (condition->if(!*data)) returns EINVAL and, in consequence, memory is
      never freed in i2c_acpi_remove_space_handler().
      
      Fix the NULL pointer check in acpi_bus_get_private_data() to follow
      the analogous check in acpi_get_data_full().
      Signed-off-by: NVamshi K Sthambamkadi <vamshi.k.sthambamkadi@gmail.com>
      [ rjw: Subject & changelog ]
      Cc: All applicable <stable@vger.kernel.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1309b436
    • F
      ACPI: OSL: only free map once in osl.c · b81b6f35
      Francesco Ruggeri 提交于
      commit 833a426cc471b6088011b3d67f1dc4e147614647 upstream.
      
      acpi_os_map_cleanup checks map->refcount outside of acpi_ioremap_lock
      before freeing the map. This creates a race condition the can result
      in the map being freed more than once.
      A panic can be caused by running
      
      for ((i=0; i<10; i++))
      do
              for ((j=0; j<100000; j++))
              do
                      cat /sys/firmware/acpi/tables/data/BERT >/dev/null
              done &
      done
      
      This patch makes sure that only the process that drops the reference
      to 0 does the freeing.
      
      Fixes: b7c1fadd ("ACPI: Do not use krefs under a mutex in osl.c")
      Signed-off-by: NFrancesco Ruggeri <fruggeri@arista.com>
      Reviewed-by: NDmitry Safonov <0x7f454c46@gmail.com>
      Cc: All applicable <stable@vger.kernel.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b81b6f35
  6. 05 12月, 2019 3 次提交
    • J
      ACPI / APEI: Switch estatus pool to use vmalloc memory · 81ae6e6b
      James Morse 提交于
      [ Upstream commit 0ac234be1a9497498e57d958f4251f5257b116b4 ]
      
      The ghes code is careful to parse and round firmware's advertised
      memory requirements for CPER records, up to a maximum of 64K.
      However when ghes_estatus_pool_expand() does its work, it splits
      the requested size into PAGE_SIZE granules.
      
      This means if firmware generates 5K of CPER records, and correctly
      describes this in the table, __process_error() will silently fail as it
      is unable to allocate more than PAGE_SIZE.
      
      Switch the estatus pool to vmalloc() memory. On x86 vmalloc() memory
      may fault and be fixed up by vmalloc_fault(). To prevent this call
      vmalloc_sync_all() before an NMI handler could discover the memory.
      Signed-off-by: NJames Morse <james.morse@arm.com>
      Reviewed-by: NBorislav Petkov <bp@suse.de>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      81ae6e6b
    • J
      ACPI / APEI: Don't wait to serialise with oops messages when panic()ing · 07575de0
      James Morse 提交于
      [ Upstream commit 78b0b690f6558ed788dccafa45965325dd11ba89 ]
      
      oops_begin() exists to group printk() messages with the oops message
      printed by die(). To reach this caller we know that platform firmware
      took this error first, then notified the OS via NMI with a 'panic'
      severity.
      
      Don't wait for another CPU to release the die-lock before panic()ing,
      our only goal is to print this fatal error and panic().
      
      This code is always called in_nmi(), and since commit 42a0bb3f
      ("printk/nmi: generic solution for safe printk in NMI"), it has been
      safe to call printk() from this context. Messages are batched in a
      per-cpu buffer and printed via irq-work, or a call back from panic().
      
      Link: https://patchwork.kernel.org/patch/10313555/Acked-by: NBorislav Petkov <bp@suse.de>
      Signed-off-by: NJames Morse <james.morse@arm.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      07575de0
    • H
      ACPI / LPSS: Ignore acpi_device_fix_up_power() return value · e772949a
      Hans de Goede 提交于
      [ Upstream commit 1a2fa02f7489dc4d746f2a15fb77b3ce1affade8 ]
      
      Ignore acpi_device_fix_up_power() return value. If we return an error
      we end up with acpi_default_enumeration() still creating a platform-
      device for the device and we end up with the device still being used
      but without the special LPSS related handling which is not useful.
      
      Specicifically ignoring the error fixes the touchscreen no longer
      working after a suspend/resume on a Prowise PT301 tablet.
      
      This tablet has a broken _PS0 method on the touchscreen's I2C controller,
      causing acpi_device_fix_up_power() to fail, causing fallback to standard
      platform-dev handling and specifically causing acpi_lpss_save/restore_ctx
      to not run.
      
      The I2C controllers _PS0 method does actually turn on the device, but then
      does some more nonsense which fails when run during early boot trying to
      use I2C opregion handling on another not-yet registered I2C controller.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      e772949a
  7. 01 12月, 2019 2 次提交
    • D
      mm/memory_hotplug: make add_memory() take the device_hotplug_lock · 02735d59
      David Hildenbrand 提交于
      [ Upstream commit 8df1d0e4a265f25dc1e7e7624ccdbcb4a6630c89 ]
      
      add_memory() currently does not take the device_hotplug_lock, however
      is aleady called under the lock from
      	arch/powerpc/platforms/pseries/hotplug-memory.c
      	drivers/acpi/acpi_memhotplug.c
      to synchronize against CPU hot-remove and similar.
      
      In general, we should hold the device_hotplug_lock when adding memory to
      synchronize against online/offline request (e.g.  from user space) - which
      already resulted in lock inversions due to device_lock() and
      mem_hotplug_lock - see 30467e0b ("mm, hotplug: fix concurrent memory
      hot-add deadlock").  add_memory()/add_memory_resource() will create memory
      block devices, so this really feels like the right thing to do.
      
      Holding the device_hotplug_lock makes sure that a memory block device
      can really only be accessed (e.g. via .online/.state) from user space,
      once the memory has been fully added to the system.
      
      The lock is not held yet in
      	drivers/xen/balloon.c
      	arch/powerpc/platforms/powernv/memtrace.c
      	drivers/s390/char/sclp_cmd.c
      	drivers/hv/hv_balloon.c
      So, let's either use the locked variants or take the lock.
      
      Don't export add_memory_resource(), as it once was exported to be used by
      XEN, which is never built as a module.  If somebody requires it, we also
      have to export a locked variant (as device_hotplug_lock is never
      exported).
      
      Link: http://lkml.kernel.org/r/20180925091457.28651-3-david@redhat.comSigned-off-by: NDavid Hildenbrand <david@redhat.com>
      Reviewed-by: NPavel Tatashin <pavel.tatashin@microsoft.com>
      Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NRashmica Gupta <rashmica.g@gmail.com>
      Reviewed-by: NOscar Salvador <osalvador@suse.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Len Brown <lenb@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
      Cc: John Allen <jallen@linux.vnet.ibm.com>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Mathieu Malaterre <malat@debian.org>
      Cc: Pavel Tatashin <pavel.tatashin@microsoft.com>
      Cc: YASUAKI ISHIMATSU <yasu.isimatu@gmail.com>
      Cc: Balbir Singh <bsingharora@gmail.com>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Michael Neuling <mikey@neuling.org>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      02735d59
    • H
      ACPI / scan: Create platform device for INT33FE ACPI nodes · cf800f2b
      Hans de Goede 提交于
      [ Upstream commit 589edb56b424876cbbf61547b987a1f57d7ea99d ]
      
      Bay and Cherry Trail devices with a Dollar Cove or Whiskey Cove PMIC
      have an ACPI node with a HID of INT33FE which is a "virtual" battery
      device implementing a standard ACPI battery interface which depends upon
      a proprietary, undocument OpRegion called BMOP. Since we do have docs
      for the actual fuel-gauges used on these boards we instead use native
      fuel-gauge drivers talking directly to the fuel-gauge ICs on boards which
      rely on this INT33FE device for their battery monitoring.
      
      On boards with a Dollar Cove PMIC the INT33FE device's resources (_CRS)
      describe a non-existing I2C client at address 0x6b with a bus-speed of
      100KHz. This is a problem on some boards since there are actual devices
      on that same bus which need a speed of 400KHz to function properly.
      
      This commit adds the INT33FE HID to the list of devices with I2C resources
      which should be enumerated as a platform-device rather then letting the
      i2c-core instantiate an i2c-client matching the first I2C resource,
      so that its bus-speed will not influence the max speed of the I2C bus.
      This fixes e.g. the touchscreen not working on the Teclast X98 II Plus.
      
      The INT33FE device on boards with a Whiskey Cove PMIC is somewhat special.
      Its first I2C resource is for a secondary I2C address of the PMIC itself,
      which is already described in an ACPI device with an INT34D3 HID.
      
      But it has 3 more I2C resources describing 3 other chips for which we do
      need to instantiate I2C clients and which need device-connections added
      between them for things to work properly. This special case is handled by
      the drivers/platform/x86/intel_cht_int33fe.c code.
      
      Before this commit that code was binding to the i2c-client instantiated
      for the secondary I2C address of the PMIC, since we now instantiate a
      platform device for the INT33FE device instead, this commit also changes
      the intel_cht_int33fe driver from an i2c driver to a platform driver.
      
      This also brings the intel_cht_int33fe drv inline with how we instantiate
      multiple i2c clients from a single ACPI device in other cases, as done
      by the drivers/platform/x86/i2c-multi-instantiate.c code.
      Reported-and-tested-by: NAlexander Meiler <alex.meiler@protonmail.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Acked-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      cf800f2b
  8. 24 11月, 2019 5 次提交
  9. 21 11月, 2019 2 次提交
  10. 29 10月, 2019 1 次提交
    • J
      ACPI: CPPC: Set pcc_data[pcc_ss_id] to NULL in acpi_cppc_processor_exit() · 83dc1670
      John Garry 提交于
      commit 56a0b978d42f58c7e3ba715cf65af487d427524d upstream.
      
      When enabling KASAN and DEBUG_TEST_DRIVER_REMOVE, I find this KASAN
      warning:
      
      [   20.872057] BUG: KASAN: use-after-free in pcc_data_alloc+0x40/0xb8
      [   20.878226] Read of size 4 at addr ffff00236cdeb684 by task swapper/0/1
      [   20.884826]
      [   20.886309] CPU: 19 PID: 1 Comm: swapper/0 Not tainted 5.4.0-rc1-00009-ge7f7df3db5bf-dirty #289
      [   20.894994] Hardware name: Huawei D06 /D06, BIOS Hisilicon D06 UEFI RC0 - V1.16.01 03/15/2019
      [   20.903505] Call trace:
      [   20.905942]  dump_backtrace+0x0/0x200
      [   20.909593]  show_stack+0x14/0x20
      [   20.912899]  dump_stack+0xd4/0x130
      [   20.916291]  print_address_description.isra.9+0x6c/0x3b8
      [   20.921592]  __kasan_report+0x12c/0x23c
      [   20.925417]  kasan_report+0xc/0x18
      [   20.928808]  __asan_load4+0x94/0xb8
      [   20.932286]  pcc_data_alloc+0x40/0xb8
      [   20.935938]  acpi_cppc_processor_probe+0x4e8/0xb08
      [   20.940717]  __acpi_processor_start+0x48/0xb0
      [   20.945062]  acpi_processor_start+0x40/0x60
      [   20.949235]  really_probe+0x118/0x548
      [   20.952887]  driver_probe_device+0x7c/0x148
      [   20.957059]  device_driver_attach+0x94/0xa0
      [   20.961231]  __driver_attach+0xa4/0x110
      [   20.965055]  bus_for_each_dev+0xe8/0x158
      [   20.968966]  driver_attach+0x30/0x40
      [   20.972531]  bus_add_driver+0x234/0x2f0
      [   20.976356]  driver_register+0xbc/0x1d0
      [   20.980182]  acpi_processor_driver_init+0x40/0xe4
      [   20.984875]  do_one_initcall+0xb4/0x254
      [   20.988700]  kernel_init_freeable+0x24c/0x2f8
      [   20.993047]  kernel_init+0x10/0x118
      [   20.996524]  ret_from_fork+0x10/0x18
      [   21.000087]
      [   21.001567] Allocated by task 1:
      [   21.004785]  save_stack+0x28/0xc8
      [   21.008089]  __kasan_kmalloc.isra.9+0xbc/0xd8
      [   21.012435]  kasan_kmalloc+0xc/0x18
      [   21.015913]  pcc_data_alloc+0x94/0xb8
      [   21.019564]  acpi_cppc_processor_probe+0x4e8/0xb08
      [   21.024343]  __acpi_processor_start+0x48/0xb0
      [   21.028689]  acpi_processor_start+0x40/0x60
      [   21.032860]  really_probe+0x118/0x548
      [   21.036512]  driver_probe_device+0x7c/0x148
      [   21.040684]  device_driver_attach+0x94/0xa0
      [   21.044855]  __driver_attach+0xa4/0x110
      [   21.048680]  bus_for_each_dev+0xe8/0x158
      [   21.052591]  driver_attach+0x30/0x40
      [   21.056155]  bus_add_driver+0x234/0x2f0
      [   21.059980]  driver_register+0xbc/0x1d0
      [   21.063805]  acpi_processor_driver_init+0x40/0xe4
      [   21.068497]  do_one_initcall+0xb4/0x254
      [   21.072322]  kernel_init_freeable+0x24c/0x2f8
      [   21.076667]  kernel_init+0x10/0x118
      [   21.080144]  ret_from_fork+0x10/0x18
      [   21.083707]
      [   21.085186] Freed by task 1:
      [   21.088056]  save_stack+0x28/0xc8
      [   21.091360]  __kasan_slab_free+0x118/0x180
      [   21.095445]  kasan_slab_free+0x10/0x18
      [   21.099183]  kfree+0x80/0x268
      [   21.102139]  acpi_cppc_processor_exit+0x1a8/0x1b8
      [   21.106832]  acpi_processor_stop+0x70/0x80
      [   21.110917]  really_probe+0x174/0x548
      [   21.114568]  driver_probe_device+0x7c/0x148
      [   21.118740]  device_driver_attach+0x94/0xa0
      [   21.122912]  __driver_attach+0xa4/0x110
      [   21.126736]  bus_for_each_dev+0xe8/0x158
      [   21.130648]  driver_attach+0x30/0x40
      [   21.134212]  bus_add_driver+0x234/0x2f0
      [   21.0x10/0x18
      [   21.161764]
      [   21.163244] The buggy address belongs to the object at ffff00236cdeb600
      [   21.163244]  which belongs to the cache kmalloc-256 of size 256
      [   21.175750] The buggy address is located 132 bytes inside of
      [   21.175750]  256-byte region [ffff00236cdeb600, ffff00236cdeb700)
      [   21.187473] The buggy address belongs to the page:
      [   21.192254] page:fffffe008d937a00 refcount:1 mapcount:0 mapping:ffff002370c0fa00 index:0x0 compound_mapcount: 0
      [   21.202331] flags: 0x1ffff00000010200(slab|head)
      [   21.206940] raw: 1ffff00000010200 dead000000000100 dead000000000122 ffff002370c0fa00
      [   21.214671] raw: 0000000000000000 00000000802a002a 00000001ffffffff 0000000000000000
      [   21.222400] page dumped because: kasan: bad access detected
      [   21.227959]
      [   21.229438] Memory state around the buggy address:
      [   21.234218]  ffff00236cdeb580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      [   21.241427]  ffff00236cdeb600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [   21.248637] >ffff00236cdeb680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [   21.255845]                    ^
      [   21.259062]  ffff00236cdeb700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      [   21.266272]  ffff00236cdeb780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [   21.273480] ==================================================================
      
      It seems that global pcc_data[pcc_ss_id] can be freed in
      acpi_cppc_processor_exit(), but we may later reference this value, so
      NULLify it when freed.
      
      Also remove the useless setting of data "pcc_channel_acquired", which
      we're about to free.
      
      Fixes: 85b1407b ("ACPI / CPPC: Make CPPC ACPI driver aware of PCC subspace IDs")
      Signed-off-by: NJohn Garry <john.garry@huawei.com>
      Cc: 4.15+ <stable@vger.kernel.org> # 4.15+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      83dc1670
  11. 18 10月, 2019 1 次提交
  12. 05 10月, 2019 4 次提交
    • W
      ACPI / PCI: fix acpi_pci_irq_enable() memory leak · 9fcfdff6
      Wenwen Wang 提交于
      [ Upstream commit 29b49958cf73b439b17fa29e9a25210809a6c01c ]
      
      In acpi_pci_irq_enable(), 'entry' is allocated by kzalloc() in
      acpi_pci_irq_check_entry() (invoked from acpi_pci_irq_lookup()). However,
      it is not deallocated if acpi_pci_irq_valid() returns false, leading to a
      memory leak. To fix this issue, free 'entry' before returning 0.
      
      Fixes: e237a551 ("x86/ACPI/PCI: Recognize that Interrupt Line 255 means "not connected"")
      Signed-off-by: NWenwen Wang <wenwen@cs.uga.edu>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      9fcfdff6
    • W
      ACPI: custom_method: fix memory leaks · e4467fb6
      Wenwen Wang 提交于
      [ Upstream commit 03d1571d9513369c17e6848476763ebbd10ec2cb ]
      
      In cm_write(), 'buf' is allocated through kzalloc(). In the following
      execution, if an error occurs, 'buf' is not deallocated, leading to memory
      leaks. To fix this issue, free 'buf' before returning the error.
      
      Fixes: 526b4af4 ("ACPI: Split out custom_method functionality into an own driver")
      Signed-off-by: NWenwen Wang <wenwen@cs.uga.edu>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      e4467fb6
    • A
      ACPI / CPPC: do not require the _PSD method · 2919fa03
      Al Stone 提交于
      [ Upstream commit 4c4cdc4c63853fee48c02e25c8605fb65a6c9924 ]
      
      According to the ACPI 6.3 specification, the _PSD method is optional
      when using CPPC.  The underlying assumption is that each CPU can change
      frequency independently from all other CPUs; _PSD is provided to tell
      the OS that some processors can NOT do that.
      
      However, the acpi_get_psd() function returns ENODEV if there is no _PSD
      method present, or an ACPI error status if an error occurs when evaluating
      _PSD, if present.  This makes _PSD mandatory when using CPPC, in violation
      of the specification, and only on Linux.
      
      This has forced some firmware writers to provide a dummy _PSD, even though
      it is irrelevant, but only because Linux requires it; other OSPMs follow
      the spec.  We really do not want to have OS specific ACPI tables, though.
      
      So, correct acpi_get_psd() so that it does not return an error if there
      is no _PSD method present, but does return a failure when the method can
      not be executed properly.  This allows _PSD to be optional as it should
      be.
      Signed-off-by: NAl Stone <ahs3@redhat.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      2919fa03
    • J
      ACPI / processor: don't print errors for processorIDs == 0xff · 18e5e458
      Jiri Slaby 提交于
      [ Upstream commit 2c2b005f549544c13ef4cfb0e4842949066889bc ]
      
      Some platforms define their processors in this manner:
          Device (SCK0)
          {
      	Name (_HID, "ACPI0004" /* Module Device */)  // _HID: Hardware ID
      	Name (_UID, "CPUSCK0")  // _UID: Unique ID
      	Processor (CP00, 0x00, 0x00000410, 0x06){}
      	Processor (CP01, 0x02, 0x00000410, 0x06){}
      	Processor (CP02, 0x04, 0x00000410, 0x06){}
      	Processor (CP03, 0x06, 0x00000410, 0x06){}
      	Processor (CP04, 0x01, 0x00000410, 0x06){}
      	Processor (CP05, 0x03, 0x00000410, 0x06){}
      	Processor (CP06, 0x05, 0x00000410, 0x06){}
      	Processor (CP07, 0x07, 0x00000410, 0x06){}
      	Processor (CP08, 0xFF, 0x00000410, 0x06){}
      	Processor (CP09, 0xFF, 0x00000410, 0x06){}
      	Processor (CP0A, 0xFF, 0x00000410, 0x06){}
      	Processor (CP0B, 0xFF, 0x00000410, 0x06){}
      ...
      
      The processors marked as 0xff are invalid, there are only 8 of them in
      this case.
      
      So do not print an error on ids == 0xff, just print an info message.
      Actually, we could return ENODEV even on the first CPU with ID 0xff, but
      ACPI spec does not forbid the 0xff value to be a processor ID. Given
      0xff could be a correct one, we would break working systems if we
      returned ENODEV.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      18e5e458
  13. 01 10月, 2019 1 次提交
  14. 16 8月, 2019 1 次提交
  15. 07 8月, 2019 1 次提交
  16. 26 7月, 2019 1 次提交
    • R
      ACPICA: Clear status of GPEs on first direct enable · f6502ce4
      Rafael J. Wysocki 提交于
      [ Upstream commit 44758bafa53602f2581a6857bb20b55d4d8ad5b2 ]
      
      ACPI GPEs (other than the EC one) can be enabled in two situations.
      First, the GPEs with existing _Lxx and _Exx methods are enabled
      implicitly by ACPICA during system initialization.  Second, the
      GPEs without these methods (like GPEs listed by _PRW objects for
      wakeup devices) need to be enabled directly by the code that is
      going to use them (e.g. ACPI power management or device drivers).
      
      In the former case, if the status of a given GPE is set to start
      with, its handler method (either _Lxx or _Exx) needs to be invoked
      to take care of the events (possibly) signaled before the GPE was
      enabled.  In the latter case, however, the first caller of
      acpi_enable_gpe() for a given GPE should not be expected to care
      about any events that might be signaled through it earlier.  In
      that case, it is better to clear the status of the GPE before
      enabling it, to prevent stale events from triggering unwanted
      actions (like spurious system resume, for example).
      
      For this reason, modify acpi_ev_add_gpe_reference() to take an
      additional boolean argument indicating whether or not the GPE
      status needs to be cleared when its reference counter changes from
      zero to one and make acpi_enable_gpe() pass TRUE to it through
      that new argument.
      
      Fixes: 18996f2d ("ACPICA: Events: Stop unconditionally clearing ACPI IRQs during suspend/resume")
      Reported-by: NFurquan Shaikh <furquan@google.com>
      Tested-by: NFurquan Shaikh <furquan@google.com>
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      f6502ce4