1. 09 11月, 2018 1 次提交
    • A
      ACPI / PMIC: xpower: fix IOSF_MBI dependency · 017ce359
      Arnd Bergmann 提交于
      We still get a link failure with IOSF_MBI=m when the xpower driver
      is built-in:
      
      drivers/acpi/pmic/intel_pmic_xpower.o: In function `intel_xpower_pmic_update_power':
      intel_pmic_xpower.c:(.text+0x4f2): undefined reference to `iosf_mbi_block_punit_i2c_access'
      intel_pmic_xpower.c:(.text+0x5e2): undefined reference to `iosf_mbi_unblock_punit_i2c_access'
      
      This makes the dependency stronger, so we can only build when IOSF_MBI
      is built-in.
      
      Fixes: 6a9b593d (ACPI / PMIC: xpower: Add depends on IOSF_MBI to Kconfig entry)
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      017ce359
  2. 07 11月, 2018 2 次提交
    • V
      acpi/nfit, x86/mce: Validate a MCE's address before using it · e8a308e5
      Vishal Verma 提交于
      The NFIT machine check handler uses the physical address from the mce
      structure, and compares it against information in the ACPI NFIT table
      to determine whether that location lies on an NVDIMM. The mce->addr
      field however may not always be valid, and this is indicated by the
      MCI_STATUS_ADDRV bit in the status field.
      
      Export mce_usable_address() which already performs validation for the
      address, and use it in the NFIT handler.
      
      Fixes: 6839a6d9 ("nfit: do an ARS scrub on hitting a latent media error")
      Reported-by: NRobert Elliott <elliott@hpe.com>
      Signed-off-by: NVishal Verma <vishal.l.verma@intel.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      CC: Arnd Bergmann <arnd@arndb.de>
      Cc: Dan Williams <dan.j.williams@intel.com>
      CC: Dave Jiang <dave.jiang@intel.com>
      CC: elliott@hpe.com
      CC: "H. Peter Anvin" <hpa@zytor.com>
      CC: Ingo Molnar <mingo@redhat.com>
      CC: Len Brown <lenb@kernel.org>
      CC: linux-acpi@vger.kernel.org
      CC: linux-edac <linux-edac@vger.kernel.org>
      CC: linux-nvdimm@lists.01.org
      CC: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
      CC: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      CC: Ross Zwisler <zwisler@kernel.org>
      CC: stable <stable@vger.kernel.org>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Tony Luck <tony.luck@intel.com>
      CC: x86-ml <x86@kernel.org>
      CC: Yazen Ghannam <yazen.ghannam@amd.com>
      Link: http://lkml.kernel.org/r/20181026003729.8420-2-vishal.l.verma@intel.com
      e8a308e5
    • V
      acpi/nfit, x86/mce: Handle only uncorrectable machine checks · 5d96c934
      Vishal Verma 提交于
      The MCE handler for nfit devices is called for memory errors on a
      Non-Volatile DIMM and adds the error location to a 'badblocks' list.
      This list is used by the various NVDIMM drivers to avoid consuming known
      poison locations during IO.
      
      The MCE handler gets called for both corrected and uncorrectable errors.
      Until now, both kinds of errors have been added to the badblocks list.
      However, corrected memory errors indicate that the problem has already
      been fixed by hardware, and the resulting interrupt is merely a
      notification to Linux.
      
      As far as future accesses to that location are concerned, it is
      perfectly fine to use, and thus doesn't need to be included in the above
      badblocks list.
      
      Add a check in the nfit MCE handler to filter out corrected mce events,
      and only process uncorrectable errors.
      
      Fixes: 6839a6d9 ("nfit: do an ARS scrub on hitting a latent media error")
      Reported-by: NOmar Avelar <omar.avelar@intel.com>
      Signed-off-by: NVishal Verma <vishal.l.verma@intel.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      CC: Arnd Bergmann <arnd@arndb.de>
      CC: Dan Williams <dan.j.williams@intel.com>
      CC: Dave Jiang <dave.jiang@intel.com>
      CC: elliott@hpe.com
      CC: "H. Peter Anvin" <hpa@zytor.com>
      CC: Ingo Molnar <mingo@redhat.com>
      CC: Len Brown <lenb@kernel.org>
      CC: linux-acpi@vger.kernel.org
      CC: linux-edac <linux-edac@vger.kernel.org>
      CC: linux-nvdimm@lists.01.org
      CC: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
      CC: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      CC: Ross Zwisler <zwisler@kernel.org>
      CC: stable <stable@vger.kernel.org>
      CC: Thomas Gleixner <tglx@linutronix.de>
      CC: Tony Luck <tony.luck@intel.com>
      CC: x86-ml <x86@kernel.org>
      CC: Yazen Ghannam <yazen.ghannam@amd.com>
      Link: http://lkml.kernel.org/r/20181026003729.8420-1-vishal.l.verma@intel.com
      5d96c934
  3. 31 10月, 2018 3 次提交
    • D
      mm/memory_hotplug: make add_memory() take the device_hotplug_lock · 8df1d0e4
      David Hildenbrand 提交于
      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>
      8df1d0e4
    • D
      mm/memory_hotplug: make remove_memory() take the device_hotplug_lock · d15e5926
      David Hildenbrand 提交于
      Patch series "mm: online/offline_pages called w.o. mem_hotplug_lock", v3.
      
      Reading through the code and studying how mem_hotplug_lock is to be used,
      I noticed that there are two places where we can end up calling
      device_online()/device_offline() - online_pages()/offline_pages() without
      the mem_hotplug_lock.  And there are other places where we call
      device_online()/device_offline() without the device_hotplug_lock.
      
      While e.g.
      	echo "online" > /sys/devices/system/memory/memory9/state
      is fine, e.g.
      	echo 1 > /sys/devices/system/memory/memory9/online
      Will not take the mem_hotplug_lock. However the device_lock() and
      device_hotplug_lock.
      
      E.g.  via memory_probe_store(), we can end up calling
      add_memory()->online_pages() without the device_hotplug_lock.  So we can
      have concurrent callers in online_pages().  We e.g.  touch in
      online_pages() basically unprotected zone->present_pages then.
      
      Looks like there is a longer history to that (see Patch #2 for details),
      and fixing it to work the way it was intended is not really possible.  We
      would e.g.  have to take the mem_hotplug_lock in device/base/core.c, which
      sounds wrong.
      
      Summary: We had a lock inversion on mem_hotplug_lock and device_lock().
      More details can be found in patch 3 and patch 6.
      
      I propose the general rules (documentation added in patch 6):
      
      1. add_memory/add_memory_resource() must only be called with
         device_hotplug_lock.
      2. remove_memory() must only be called with device_hotplug_lock. This is
         already documented and holds for all callers.
      3. device_online()/device_offline() must only be called with
         device_hotplug_lock. This is already documented and true for now in core
         code. Other callers (related to memory hotplug) have to be fixed up.
      4. mem_hotplug_lock is taken inside of add_memory/remove_memory/
         online_pages/offline_pages.
      
      To me, this looks way cleaner than what we have right now (and easier to
      verify).  And looking at the documentation of remove_memory, using
      lock_device_hotplug also for add_memory() feels natural.
      
      This patch (of 6):
      
      remove_memory() is exported right now but requires the
      device_hotplug_lock, which is not exported.  So let's provide a variant
      that takes the lock and only export that one.
      
      The lock is already held in
      	arch/powerpc/platforms/pseries/hotplug-memory.c
      	drivers/acpi/acpi_memhotplug.c
      	arch/powerpc/platforms/powernv/memtrace.c
      
      Apart from that, there are not other users in the tree.
      
      Link: http://lkml.kernel.org/r/20180925091457.28651-2-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: Rashmica Gupta <rashmica.g@gmail.com>
      Cc: Michael Neuling <mikey@neuling.org>
      Cc: Balbir Singh <bsingharora@gmail.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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: YASUAKI ISHIMATSU <yasu.isimatu@gmail.com>
      Cc: Mathieu Malaterre <malat@debian.org>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      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>
      d15e5926
    • M
      mm: remove include/linux/bootmem.h · 57c8a661
      Mike Rapoport 提交于
      Move remaining definitions and declarations from include/linux/bootmem.h
      into include/linux/memblock.h and remove the redundant header.
      
      The includes were replaced with the semantic patch below and then
      semi-automated removal of duplicated '#include <linux/memblock.h>
      
      @@
      @@
      - #include <linux/bootmem.h>
      + #include <linux/memblock.h>
      
      [sfr@canb.auug.org.au: dma-direct: fix up for the removal of linux/bootmem.h]
        Link: http://lkml.kernel.org/r/20181002185342.133d1680@canb.auug.org.au
      [sfr@canb.auug.org.au: powerpc: fix up for removal of linux/bootmem.h]
        Link: http://lkml.kernel.org/r/20181005161406.73ef8727@canb.auug.org.au
      [sfr@canb.auug.org.au: x86/kaslr, ACPI/NUMA: fix for linux/bootmem.h removal]
        Link: http://lkml.kernel.org/r/20181008190341.5e396491@canb.auug.org.au
      Link: http://lkml.kernel.org/r/1536927045-23536-30-git-send-email-rppt@linux.vnet.ibm.comSigned-off-by: NMike Rapoport <rppt@linux.vnet.ibm.com>
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Palmer Dabbelt <palmer@sifive.com>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Richard Kuo <rkuo@codeaurora.org>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Serge Semin <fancer.lancer@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      57c8a661
  4. 25 10月, 2018 2 次提交
  5. 18 10月, 2018 11 次提交
    • H
      ACPI / scan: Create platform device for INT33FE ACPI nodes · 589edb56
      Hans de Goede 提交于
      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>
      589edb56
    • B
      ACPI / OSL: Use 'jiffies' as the time bassis for acpi_os_get_timer() · 83b2348e
      Bart Van Assche 提交于
      Since acpi_os_get_timer() may be called after the timer subsystem has
      been suspended, use the jiffies counter instead of ktime_get(). This
      patch avoids that the following warning is reported during hibernation:
      
      WARNING: CPU: 0 PID: 612 at kernel/time/timekeeping.c:751 ktime_get+0x116/0x120
      RIP: 0010:ktime_get+0x116/0x120
      Call Trace:
       acpi_os_get_timer+0xe/0x30
       acpi_ds_exec_begin_control_op+0x175/0x1de
       acpi_ds_exec_begin_op+0x2c7/0x39a
       acpi_ps_create_op+0x573/0x5e4
       acpi_ps_parse_loop+0x349/0x1220
       acpi_ps_parse_aml+0x25b/0x6da
       acpi_ps_execute_method+0x327/0x41b
       acpi_ns_evaluate+0x4e9/0x6f5
       acpi_ut_evaluate_object+0xd9/0x2f2
       acpi_rs_get_method_data+0x8f/0x114
       acpi_walk_resources+0x122/0x1b6
       acpi_pci_link_get_current.isra.2+0x157/0x280
       acpi_pci_link_set+0x32f/0x4a0
       irqrouter_resume+0x58/0x80
       syscore_resume+0x84/0x380
       hibernation_snapshot+0x20c/0x4f0
       hibernate+0x22d/0x3a6
       state_store+0x99/0xa0
       kobj_attr_store+0x37/0x50
       sysfs_kf_write+0x87/0xa0
       kernfs_fop_write+0x1a5/0x240
       __vfs_write+0xd2/0x410
       vfs_write+0x101/0x250
       ksys_write+0xab/0x120
       __x64_sys_write+0x43/0x50
       do_syscall_64+0x71/0x220
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Fixes: 164a08ce (ACPICA: Dispatcher: Introduce timeout mechanism for infinite loop detection)
      Reported-by: NFengguang Wu <fengguang.wu@intel.com>
      References: https://lists.01.org/pipermail/lkp/2018-April/008406.htmlSigned-off-by: NBart Van Assche <bvanassche@acm.org>
      Cc: 4.16+ <stable@vger.kernel.org> # 4.16+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      83b2348e
    • E
      ACPI: probe ECDT before loading AML tables regardless of module-level code flag · d737f333
      Erik Schmauss 提交于
      It was discovered that AML tables were loaded before or after the
      ECDT depending on acpi_gbl_execute_tables_as_methods. According to
      the ACPI spec, the ECDT should be loaded before the namespace is
      populated by loading AML tables (DSDT and SSDT). Since the ECDT
      should be loaded early in the boot process, this change moves the
      ECDT probing to acpi_early_init.
      Signed-off-by: NErik Schmauss <erik.schmauss@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d737f333
    • E
      ACPICA: Remove acpi_gbl_group_module_level_code and only use... · 08930d56
      Erik Schmauss 提交于
      ACPICA: Remove acpi_gbl_group_module_level_code and only use acpi_gbl_execute_tables_as_methods instead
      
      acpi_gbl_group_module_level_code and acpi_gbl_execute_tables_as_methods were
      used to enable different table load behavior. The different table
      load behaviors are as follows:
      
      A.) acpi_gbl_group_module_level_code enabled the legacy approach where
          ASL if statements are executed after the namespace object has
          been loaded.
      B.) acpi_gbl_execute_tables_as_methods is currently used to enable the
          table load to be a method invocation. This meaning that ASL If
          statements are executed in-line rather than deferred until after
          the ACPI namespace has been populated. This is the correct
          behavior and option A will be removed in the future.
      
      We do not support a table load behavior where these variables are
      assigned the same value. In otherwords, we only support option A or B
      and do not need acpi_gbl_group_module_level_code to enable A. From now on,
      acpi_gbl_execute_tables_as_methods == 0 enables option A and
      acpi_gbl_execute_tables_as_methods == 1 enables option B.
      
      Note: option A is expected to be removed in the future and option B
      will become the only supported table load behavior.
      Signed-off-by: NErik Schmauss <erik.schmauss@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      08930d56
    • E
      ACPICA: AML Parser: fix parse loop to correctly skip erroneous extended opcodes · c64baa3a
      Erik Schmauss 提交于
      AML opcodes come in two lengths: 1-byte opcodes and 2-byte, extended opcodes.
      If an error occurs due to illegal opcodes during table load, the AML parser
      needs to continue loading the table. In order to do this, it needs to skip
      parsing of the offending opcode and operands associated with that opcode.
      
      This change fixes the AML parse loop to correctly skip parsing of incorrect
      extended opcodes. Previously, only the short opcodes were skipped correctly.
      Signed-off-by: NErik Schmauss <erik.schmauss@intel.com>
      Cc: All applicable <stable@vger.kernel.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c64baa3a
    • E
      ACPICA: AML interpreter: add region addresses in global list during initialization · 4abb951b
      Erik Schmauss 提交于
      The table load process omitted adding the operation region address
      range to the global list. This omission is problematic because the OS
      queries the global list to check for address range conflicts before
      deciding which drivers to load. This commit may result in warning
      messages that look like the following:
      
      [    7.871761] ACPI Warning: system_IO range 0x00000428-0x0000042F conflicts with op_region 0x00000400-0x0000047F (\PMIO) (20180531/utaddress-213)
      [    7.871769] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
      
      However, these messages do not signify regressions. It is a result of
      properly adding address ranges within the global address list.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=200011Tested-by: NJean-Marc Lenoir <archlinux@jihemel.com>
      Signed-off-by: NErik Schmauss <erik.schmauss@intel.com>
      Cc: All applicable <stable@vger.kernel.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      4abb951b
    • R
      ACPI: TAD: Add low-level support for real time capability · 3230b2b3
      Rafael J. Wysocki 提交于
      Add low-level support for the (optional) real time capability of the
      ACPI Time and Alarm Device (TAD) to the ACPI TAD driver.
      
      This allows the real time to be acquired or set via sysfs with the
      help of the _GRT and _SRT methods of the TAD, respectively.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      3230b2b3
    • D
      acpi, nfit: Further restrict userspace ARS start requests · 59486121
      Dan Williams 提交于
      In addition to not allowing ARS start while the background thread is
      actively running, prevent ARS start while any scrub request is pending.
      
      This aligns the window for ARS start submission with the status of ARS
      reported via sysfs. Previously userspace could sneak its own ARS start
      requests in while sysfs reported -EBUSY.
      Reviewed-by: NDave Jiang <dave.jiang@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      59486121
    • D
      acpi, nfit: Fix Address Range Scrub completion tracking · d3abaf43
      Dan Williams 提交于
      The Address Range Scrub implementation tried to skip running scrubs
      against ranges that were already scrubbed by the BIOS. Unfortunately
      that support also resulted in early scrub completions as evidenced by
      this debug output from nfit_test:
      
          nd_region region9: ARS: range 1 short complete
          nd_region region3: ARS: range 1 short complete
          nd_region region4: ARS: range 2 ARS start (0)
          nd_region region4: ARS: range 2 short complete
      
      ...i.e. completions without any indications that the scrub was started.
      
      This state of affairs was hard to see in the code due to the
      proliferation of state bits and mistakenly trying to track done state
      per-range when the completion is a global property of the bus.
      
      So, kill the four ARS state bits (ARS_REQ, ARS_REQ_REDO, ARS_DONE, and
      ARS_SHORT), and replace them with just 2 request flags ARS_REQ_SHORT and
      ARS_REQ_LONG. The implementation will still complete and reap the
      results of BIOS initiated ARS, but it will not attempt to use that
      information to affect the completion status of scrubbing the ranges from
      a Linux perspective.
      
      Instead, try to synchronously run a short ARS per range at init time and
      schedule a long scrub in the background. If ARS is busy with an ARS
      request, schedule both a short and a long scrub for when ARS returns to
      idle. This logic also satisfies the intent of what ARS_REQ_REDO was
      trying to achieve. The new rule is that the REQ flag stays set until the
      next successful ars_start() for that range.
      
      With the new policy that the REQ flags are not cleared until the next
      start, the implementation no longer loses requests as can be seen from
      the following log:
      
          nd_region region3: ARS: range 1 ARS start short (0)
          nd_region region9: ARS: range 1 ARS start short (0)
          nd_region region3: ARS: range 1 complete
          nd_region region4: ARS: range 2 ARS start short (0)
          nd_region region9: ARS: range 1 complete
          nd_region region9: ARS: range 1 ARS start long (0)
          nd_region region4: ARS: range 2 complete
          nd_region region3: ARS: range 1 ARS start long (0)
          nd_region region9: ARS: range 1 complete
          nd_region region3: ARS: range 1 complete
          nd_region region4: ARS: range 2 ARS start long (0)
          nd_region region4: ARS: range 2 complete
      
      ...note that the nfit_test emulated driver provides 2 buses, that is why
      some of the range indices are duplicated. Notice that each range
      now successfully completes a short and long scrub.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 14c73f99 ("nfit, address-range-scrub: introduce nfit_spa->ars_state")
      Fixes: cc3d3458 ("acpi/nfit: queue issuing of ars when an uc error...")
      Reported-by: NJacek Zloch <jacek.zloch@intel.com>
      Reported-by: NKrzysztof Rusocki <krzysztof.rusocki@intel.com>
      Reviewed-by: NDave Jiang <dave.jiang@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      d3abaf43
    • D
      tools/testing/nvdimm: Populate dirty shutdown data · f1101766
      Dan Williams 提交于
      Allow the unit tests to verify the retrieval of the dirty shutdown
      count via smart commands, and allow the driver-load-time retrieval of
      the smart health payload to be simulated by nfit_test.
      Reviewed-by: NKeith Busch <keith.busch@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      f1101766
    • D
      acpi, nfit: Collect shutdown status · 0ead1118
      Dan Williams 提交于
      Some NVDIMMs, in addition to providing an indication of whether the
      previous shutdown was clean, also provide a running count of lifetime
      dirty-shutdown events for the device. In anticipation of this
      functionality appearing on more devices arrange for the nfit driver to
      retrieve / cache this data at DIMM discovery time, and export it via
      sysfs.
      Reviewed-by: NKeith Busch <keith.busch@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      0ead1118
  6. 17 10月, 2018 1 次提交
  7. 16 10月, 2018 2 次提交
  8. 12 10月, 2018 2 次提交
  9. 08 10月, 2018 2 次提交
    • R
      ACPI / SBS: Fix rare oops when removing modules · 757c968c
      Ronald Tschalär 提交于
      There was a small race when removing the sbshc module where
      smbus_alarm() had queued acpi_smbus_callback() for deferred execution
      but it hadn't been run yet, so that when it did run hc had been freed
      and the module unloaded, resulting in an invalid paging request.
      
      A similar race existed when removing the sbs module with regards to
      acpi_sbs_callback() (which is called from acpi_smbus_callback()).
      
      We therefore need to ensure no callbacks are pending or executing before
      the cleanups are done and the modules are removed.
      Signed-off-by: NRonald Tschalär <ronald@innovation.ch>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      757c968c
    • R
      ACPI / SBS: Fix GPE storm on recent MacBookPro's · ca1721c5
      Ronald Tschalär 提交于
      On Apple machines, plugging-in or unplugging the power triggers a GPE
      for the EC. Since these machines expose an SBS device, this GPE ends
      up triggering the acpi_sbs_callback(). This in turn tries to get the
      status of the SBS charger. However, on MBP13,* and MBP14,* machines,
      performing the smbus-read operation to get the charger's status triggers
      the EC's GPE again. The result is an endless re-triggering and handling
      of that GPE, consuming significant CPU resources (> 50% in irq).
      
      In the end this is quite similar to commit 3031cdde (ACPI / SBS:
      Don't assume the existence of an SBS charger), except that on the above
      machines a status of all 1's is returned. And like there, we just want
      ignore the charger here.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=198169Signed-off-by: NRonald Tschalär <ronald@innovation.ch>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ca1721c5
  10. 05 10月, 2018 1 次提交
  11. 04 10月, 2018 7 次提交
  12. 03 10月, 2018 2 次提交
  13. 02 10月, 2018 1 次提交
    • P
      x86/cpu: Sanitize FAM6_ATOM naming · f2c4db1b
      Peter Zijlstra 提交于
      Going primarily by:
      
        https://en.wikipedia.org/wiki/List_of_Intel_Atom_microprocessors
      
      with additional information gleaned from other related pages; notably:
      
       - Bonnell shrink was called Saltwell
       - Moorefield is the Merriefield refresh which makes it Airmont
      
      The general naming scheme is: FAM6_ATOM_UARCH_SOCTYPE
      
        for i in `git grep -l FAM6_ATOM` ; do
      	sed -i  -e 's/ATOM_PINEVIEW/ATOM_BONNELL/g'		\
      		-e 's/ATOM_LINCROFT/ATOM_BONNELL_MID/'		\
      		-e 's/ATOM_PENWELL/ATOM_SALTWELL_MID/g'		\
      		-e 's/ATOM_CLOVERVIEW/ATOM_SALTWELL_TABLET/g'	\
      		-e 's/ATOM_CEDARVIEW/ATOM_SALTWELL/g'		\
      		-e 's/ATOM_SILVERMONT1/ATOM_SILVERMONT/g'	\
      		-e 's/ATOM_SILVERMONT2/ATOM_SILVERMONT_X/g'	\
      		-e 's/ATOM_MERRIFIELD/ATOM_SILVERMONT_MID/g'	\
      		-e 's/ATOM_MOOREFIELD/ATOM_AIRMONT_MID/g'	\
      		-e 's/ATOM_DENVERTON/ATOM_GOLDMONT_X/g'		\
      		-e 's/ATOM_GEMINI_LAKE/ATOM_GOLDMONT_PLUS/g' ${i}
        done
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: dave.hansen@linux.intel.com
      Cc: len.brown@intel.com
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      f2c4db1b
  14. 01 10月, 2018 3 次提交
    • H
      ACPI / LPSS: Resume BYT/CHT I2C controllers from resume_noirq · 48402cee
      Hans de Goede 提交于
      On some Cherry Trail systems the GPU ACPI fwnode has power-resources which
      point to the PMIC, which is connected over a LPSS I2C controller.
      
      We add a device-link to make sure that the I2C controller is resumed before
      the GPU is. But the pci-core changes the power-state of PCI devices from
      D3 to D0 at noirq time (to restore the PCI config registers) and before
      this commit we were bringing up the I2C controllers from a resume_early
      handler which runs later. More specifically the pm-core will first run
      all resume_noirq handlers in order and then all resume_early handlers.
      
      So we must not only make sure that the handlers are run in the right order,
      but also that the resume of the I2C controller is done at noirq time.
      
      The behavior before this commit, resuming the I2C controller from a
      resume_early handler leads to the following errors:
      
       i2c_designware 808622C1:06: controller timed out
       ACPI Error: AE_ERROR, Returned by Handler for [UserDefinedRegion]
       ACPI Error: Method parse/execution failed \_SB.P18W._ON, AE_ERROR
       video LNXVIDEO:00: Failed to change power state to D0
      
      This commit changes the acpi_lpss.c code to resume the BYT/CHT I2C
      controllers at resume_noirq time fixing this.
      Tested-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      48402cee
    • H
      ACPI / LPSS: Add a device link from the GPU to the BYT I2C5 controller · 2d71ee0c
      Hans de Goede 提交于
      On some Bay Trail systems the GPU ACPI fwnode has power-resources which
      point to the PMIC, which is connected over the LPSS I2C5 controller.
      
      This one was quite nasty to debug, unlike on CHT where the same problem
      leads to errors like these:
      
           i2c_designware 808622C1:06: controller timed out
           ACPI Error: AE_ERROR, Returned by Handler for [UserDefinedRegion]
           ACPI Error: Method parse/execution failed \_SB.P18W._ON, AE_ERROR
           video LNXVIDEO:00: Failed to change power state to D0
      
      On BYT the read-modify-write done by drivers/acpi/pmic/intel_pmic_xpower.c
      on the AXP288 PMIC register to change the power-resource state *seems* to
      succeed.
      
      But in reality, because the I2C controller has not been resumed yet, the
      read silently fails and returns the wrong value, where as the write does
      succeed, writing back the wrong value for all the other power-resources
      in the same register, turning off a bunch of them. Which of course does
      not end well.
      
      This commit adds a RPM consumer link from the GPU (which has a LNXVIDEO
      HID) to the BYT LPSS I2C5 controller, so that the I2C controller gets
      resumed before the GPU is resumed and thus before we try to change the
      power-resource.
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Tested-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      2d71ee0c
    • H
      ACPI / LPSS: Add a device link from the GPU to the CHT I2C7 controller · bd0f4e34
      Hans de Goede 提交于
      On some Cherry Trail systems the GPU ACPI fwnode has power-resources which
      point to the PMIC, which is connected over the LPSS I2C7 controller.
      
      Due to probe ordering currently we resume the GPU and thus try to access
      the ACPI power-resources before the I2C controller has been resumed. This
      leads to the following errors:
      
       i2c_designware 808622C1:06: controller timed out
       ACPI Error: AE_ERROR, Returned by Handler for [UserDefinedRegion]
       ACPI Error: Method parse/execution failed \_SB.P18W._ON, AE_ERROR
       video LNXVIDEO:00: Failed to change power state to D0
      
      This commit adds a RPM consumer link from the GPU (which has a LNXVIDEO
      HID) to the CHT LPSS I2C7 controller, so that the I2C controller gets
      resumed before the GPU is resumed.
      Tested-by: NJarkko Nikula <jarkko.nikula@linux.intel.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      bd0f4e34