1. 25 6月, 2015 4 次提交
    • D
      libnvdimm: control (ioctl) messages for nvdimm_bus and nvdimm devices · 62232e45
      Dan Williams 提交于
      Most discovery/configuration of the nvdimm-subsystem is done via sysfs
      attributes.  However, some nvdimm_bus instances, particularly the
      ACPI.NFIT bus, define a small set of messages that can be passed to the
      platform.  For convenience we derive the initial libnvdimm-ioctl command
      formats directly from the NFIT DSM Interface Example formats.
      
          ND_CMD_SMART: media health and diagnostics
          ND_CMD_GET_CONFIG_SIZE: size of the label space
          ND_CMD_GET_CONFIG_DATA: read label space
          ND_CMD_SET_CONFIG_DATA: write label space
          ND_CMD_VENDOR: vendor-specific command passthrough
          ND_CMD_ARS_CAP: report address-range-scrubbing capabilities
          ND_CMD_ARS_START: initiate scrubbing
          ND_CMD_ARS_STATUS: report on scrubbing state
          ND_CMD_SMART_THRESHOLD: configure alarm thresholds for smart events
      
      If a platform later defines different commands than this set it is
      straightforward to extend support to those formats.
      
      Most of the commands target a specific dimm.  However, the
      address-range-scrubbing commands target the bus.  The 'commands'
      attribute in sysfs of an nvdimm_bus, or nvdimm, enumerate the supported
      commands for that object.
      
      Cc: <linux-acpi@vger.kernel.org>
      Cc: Robert Moore <robert.moore@intel.com>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reported-by: NNicholas Moulin <nicholas.w.moulin@linux.intel.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      62232e45
    • D
      libnvdimm, nfit: dimm/memory-devices · e6dfb2de
      Dan Williams 提交于
      Enable nvdimm devices to be registered on a nvdimm_bus.  The kernel
      assigned device id for nvdimm devicesis dynamic.  If userspace needs a
      more static identifier it should consult a provider-specific attribute.
      In the case where NFIT is the provider, the 'nmemX/nfit/handle' or
      'nmemX/nfit/serial' attributes may be used for this purpose.
      
      Cc: Neil Brown <neilb@suse.de>
      Cc: <linux-acpi@vger.kernel.org>
      Cc: Greg KH <gregkh@linuxfoundation.org>
      Cc: Robert Moore <robert.moore@intel.com>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NToshi Kani <toshi.kani@hp.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      e6dfb2de
    • D
      libnvdimm: control character device and nvdimm_bus sysfs attributes · 45def22c
      Dan Williams 提交于
      The control device for a nvdimm_bus is registered as an "nd" class
      device.  The expectation is that there will usually only be one "nd" bus
      registered under /sys/class/nd.  However, we allow for the possibility
      of multiple buses and they will listed in discovery order as
      ndctl0...ndctlN.  This character device hosts the ioctl for passing
      control messages.  The initial command set has a 1:1 correlation with
      the commands listed in the by the "NFIT DSM Example" document [1], but
      this scheme is extensible to future command sets.
      
      Note, nd_ioctl() and the backing ->ndctl() implementation are defined in
      a subsequent patch.  This is simply the initial registrations and sysfs
      attributes.
      
      [1]: http://pmem.io/documents/NVDIMM_DSM_Interface_Example.pdf
      
      Cc: Neil Brown <neilb@suse.de>
      Cc: Greg KH <gregkh@linuxfoundation.org>
      Cc: <linux-acpi@vger.kernel.org>
      Cc: Robert Moore <robert.moore@intel.com>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NToshi Kani <toshi.kani@hp.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      45def22c
    • D
      libnvdimm, nfit: initial libnvdimm infrastructure and NFIT support · b94d5230
      Dan Williams 提交于
      A struct nvdimm_bus is the anchor device for registering nvdimm
      resources and interfaces, for example, a character control device,
      nvdimm devices, and I/O region devices.  The ACPI NFIT (NVDIMM Firmware
      Interface Table) is one possible platform description for such
      non-volatile memory resources in a system.  The nfit.ko driver attaches
      to the "ACPI0012" device that indicates the presence of the NFIT and
      parses the table to register a struct nvdimm_bus instance.
      
      Cc: <linux-acpi@vger.kernel.org>
      Cc: Lv Zheng <lv.zheng@intel.com>
      Cc: Robert Moore <robert.moore@intel.com>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NJeff Moyer <jmoyer@redhat.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NToshi Kani <toshi.kani@hp.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      b94d5230
  2. 22 5月, 2015 8 次提交
  3. 13 5月, 2015 1 次提交
  4. 04 5月, 2015 1 次提交
    • W
      ACPI / PNP: add two IDs to list for PNPACPI device enumeration · 622532bb
      Witold Szczeponik 提交于
      Commit eec15edb (ACPI / PNP: use device ID list for PNPACPI device
      enumeration) changed the way how ACPI devices are enumerated and when
      they are added to the PNP bus.
      
      However, it broke the sound card support on (at least) a vintage
      IBM ThinkPad 600E: with said commit applied, two of the necessary
      "CSC01xx" devices are not added to the PNP bus and hence can not be
      found during the initialization of the "snd-cs4236" module.  As a
      consequence, loading "snd-cs4236" causes null pointer exceptions.
      The attached patch fixes the problem end re-enables sound on the
      IBM ThinkPad 600E.
      
      Fixes: eec15edb (ACPI / PNP: use device ID list for PNPACPI device enumeration)
      Signed-off-by: NWitold Szczeponik <Witold.Szczeponik@gmx.net>
      Cc: 3.16+ <stable@vger.kernel.org> # 3.16+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      622532bb
  5. 01 5月, 2015 2 次提交
  6. 29 4月, 2015 1 次提交
  7. 24 4月, 2015 2 次提交
    • R
      ACPI / scan: Add a scan handler for PRP0001 · 7d284352
      Rafael J. Wysocki 提交于
      If the special PRP0001 device ID is present in the given device's list
      of ACPI/PNP IDs and the device has a valid "compatible" property in
      the _DSD, it should be enumerated using the default mechanism,
      unless some scan handlers match the IDs preceding PRP0001 in the
      device's list of ACPI/PNP IDs.  In addition to that, no scan handlers
      matching the IDs following PRP0001 in that list should be attached
      to the device.
      
      To make that happen, define a scan handler that will match PRP0001
      and trigger the default enumeration for the matching devices if the
      "compatible" property is present for them.
      
      Since that requires the check for platform_id and device->handler
      to be removed from acpi_default_enumeration(), move the fallback
      invocation of acpi_default_enumeration() to acpi_bus_attach()
      (after it's checked if there's a matching ACPI driver for the
      device), which is a better place to call it, and do the platform_id
      check in there too (device->handler is guaranteed to be unset at
      the point where the function is looking for a matching ACPI driver).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NDarren Hart <dvhart@linux.intel.com>
      7d284352
    • R
      ACPI / scan: Annotate physical_node_lock in acpi_scan_is_offline() · 4c533c80
      Rafael J. Wysocki 提交于
      acpi_scan_is_offline() may be called under the physical_node_lock
      lock of the given device object's parent, so prevent lockdep from
      complaining about that by annotating that instance with
      SINGLE_DEPTH_NESTING.
      
      Fixes: caa73ea1 (ACPI / hotplug / driver core: Handle containers in a special way)
      Reported-and-tested-by: NXie XiuQi <xiexiuqi@huawei.com>
      Reviewed-by: NToshi Kani <toshi.kani@hp.com>
      Cc: 3.14+ <stable@vger.kernel.org> # 3.14+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      4c533c80
  8. 22 4月, 2015 1 次提交
  9. 15 4月, 2015 2 次提交
    • R
      ACPICA: Store GPE register enable masks upfront · 0ee0d349
      Rafael J. Wysocki 提交于
      It is reported that ACPI interrupts do not work any more on
      Dell Latitude D600 after commit c50f13c6 (ACPICA: Save
      current masks of enabled GPEs after enable register writes).
      The problem turns out to be related to the fact that the
      enable_mask and enable_for_run GPE bit masks are not in
      sync (in the absence of any system suspend/resume events)
      for at least one GPE register on that machine.
      
      Address this problem by writing the enable_for_run mask into
      enable_mask as soon as enable_for_run is updated instead of
      doing that only after the subsequent register write has
      succeeded.  For consistency, update acpi_hw_gpe_enable_write()
      to store the bit mask to be written into the GPE register
      in enable_mask unconditionally before the write.
      
      Since the ACPI_GPE_SAVE_MASK flag is not necessary any more after
      that, drop it along with the symbols depending on it.
      Reported-and-tested-by: NJim Bos <jim876@xs4all.nl>
      Fixes: c50f13c6 (ACPICA: Save current masks of enabled GPEs after enable register writes)
      Cc: 3.19+ <stable@vger.kernel.org> # 3.19+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0ee0d349
    • K
      ACPI / battery: Fix doubly added battery on system suspend · 31f7dc79
      Krzysztof Kozlowski 提交于
      Commit 297d716f ("power_supply: Change ownership from driver to
      core") inverted the logic in battery_notify().  As an effect already
      present battery was re-added on each system suspend or hibernation.
      
          WARNING: CPU: 0 PID: 303 at ../fs/sysfs/dir.c:31 sysfs_warn_dup+0x68/0x80()
          sysfs: cannot create duplicate filename '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/PNP0C0A:00/power_supply/BAT0'
          CPU: 0 PID: 303 Comm: rtcwake Not tainted 4.0.0-ARCH-02621-g07e6253af953 #48
          Call Trace:
            sysfs_create_dir_ns+0x8d/0xa0
            kobject_add_internal+0xb6/0x370
            kobject_add+0x6f/0xd0
            device_add+0x120/0x6c0
            __power_supply_register+0x145/0x290
            power_supply_register_no_ws+0x10/0x20
            sysfs_add_battery+0x84/0xc5 [battery]
            battery_notify+0x45/0x6b [battery]
            notifier_call_chain+0x4f/0x80
            __blocking_notifier_call_chain+0x4b/0x70
            blocking_notifier_call_chain+0x16/0x20
            pm_notifier_call_chain+0x1a/0x40
            pm_suspend+0x3ed/0x4e0
      Signed-off-by: NKrzysztof Kozlowski <k.kozlowski.k@gmail.com>
      Reported-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-By: NSebastian Reichel <sre@kernel.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      31f7dc79
  10. 14 4月, 2015 18 次提交