1. 07 12月, 2016 5 次提交
    • D
      tools/testing/nvdimm: unit test acpi_nfit_ctl() · a7de92da
      Dan Williams 提交于
      A recent flurry of bug discoveries in the nfit driver's DSM marshalling
      routine has highlighted the fact that we do not have unit test coverage
      for this routine. Add a self-test of acpi_nfit_ctl() routine before
      probing the "nfit_test.0" device. This mocks stimulus to acpi_nfit_ctl()
      and if any of the tests fail "nfit_test.0" will be unavailable causing
      the rest of the tests to not run / fail.
      
      This unit test will also be a place to land reproductions of quirky BIOS
      behavior discovered in the field and ensure the kernel does not regress
      against implementations it has seen in practice.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      a7de92da
    • D
      acpi, nfit: fix bus vs dimm confusion in xlat_status · d6eb270c
      Dan Williams 提交于
      Given dimms and bus commands share the same command number space we need
      to be careful that we are translating status in the correct context.
      Otherwise we can, for example, fail an ND_CMD_GET_CONFIG_SIZE command
      because max_xfer is zero. It fails because that condition erroneously
      correlates with the 'cleared == 0' failure of ND_CMD_CLEAR_ERROR.
      
      Cc: <stable@vger.kernel.org>
      Fixes: aef25338 ("libnvdimm, nfit: centralize command status translation")
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      d6eb270c
    • D
      acpi, nfit: validate ars_status output buffer size · 82aa37cf
      Dan Williams 提交于
      If an ARS Status command returns truncated output, do not process
      partial records or otherwise consume non-status fields.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 0caeef63 ("libnvdimm: Add a poison list and export badblocks")
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      82aa37cf
    • D
      acpi, nfit, libnvdimm: fix / harden ars_status output length handling · efda1b5d
      Dan Williams 提交于
      Given ambiguities in the ACPI 6.1 definition of the "Output (Size)"
      field of the ARS (Address Range Scrub) Status command, a firmware
      implementation may in practice return 0, 4, or 8 to indicate that there
      is no output payload to process.
      
      The specification states "Size of Output Buffer in bytes, including this
      field.". However, 'Output Buffer' is also the name of the entire
      payload, and earlier in the specification it states "Max Query ARS
      Status Output Buffer Size: Maximum size of buffer (including the Status
      and Extended Status fields)".
      
      Without this fix if the BIOS happens to return 0 it causes memory
      corruption as evidenced by this result from the acpi_nfit_ctl() unit
      test.
      
       ars_status00000000: 00020000 00000000                    ........
       BUG: stack guard page was hit at ffffc90001750000 (stack is ffffc9000174c000..ffffc9000174ffff)
       kernel stack overflow (page fault): 0000 [#1] SMP DEBUG_PAGEALLOC
       task: ffff8803332d2ec0 task.stack: ffffc9000174c000
       RIP: 0010:[<ffffffff814cfe72>]  [<ffffffff814cfe72>] __memcpy+0x12/0x20
       RSP: 0018:ffffc9000174f9a8  EFLAGS: 00010246
       RAX: ffffc9000174fab8 RBX: 0000000000000000 RCX: 000000001fffff56
       RDX: 0000000000000000 RSI: ffff8803231f5a08 RDI: ffffc90001750000
       RBP: ffffc9000174fa88 R08: ffffc9000174fab0 R09: ffff8803231f54b8
       R10: 0000000000000008 R11: 0000000000000001 R12: 0000000000000000
       R13: 0000000000000000 R14: 0000000000000003 R15: ffff8803231f54a0
       FS:  00007f3a611af640(0000) GS:ffff88033ed00000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: ffffc90001750000 CR3: 0000000325b20000 CR4: 00000000000406e0
       Stack:
        ffffffffa00bc60d 0000000000000008 ffffc90000000001 ffffc9000174faac
        0000000000000292 ffffffffa00c24e4 ffffffffa00c2914 0000000000000000
        0000000000000000 ffffffff00000003 ffff880331ae8ad0 0000000800000246
       Call Trace:
        [<ffffffffa00bc60d>] ? acpi_nfit_ctl+0x49d/0x750 [nfit]
        [<ffffffffa01f4fe0>] nfit_test_probe+0x670/0xb1b [nfit_test]
      
      Cc: <stable@vger.kernel.org>
      Fixes: 747ffe11 ("libnvdimm, tools/testing/nvdimm: fix 'ars_status' output buffer sizing")
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      efda1b5d
    • V
      acpi, nfit: fix extended status translations for ACPI DSMs · 9a901f54
      Vishal Verma 提交于
      ACPI DSMs can have an 'extended' status which can be non-zero to convey
      additional information about the command. In the xlat_status routine,
      where we translate the command statuses, we were returning an error for
      a non-zero extended status, even if the primary status indicated success.
      
      Return from each command's 'case' once we have verified both its status
      and extend status are good.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 11294d63 ("nfit: fail DSMs that return non-zero status by default")
      Signed-off-by: NVishal Verma <vishal.l.verma@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      9a901f54
  2. 01 10月, 2016 2 次提交
  3. 22 9月, 2016 1 次提交
  4. 02 9月, 2016 1 次提交
  5. 30 8月, 2016 1 次提交
  6. 23 8月, 2016 2 次提交
  7. 09 8月, 2016 1 次提交
  8. 24 7月, 2016 3 次提交
    • V
      nfit: do an ARS scrub on hitting a latent media error · 6839a6d9
      Vishal Verma 提交于
      When a latent (unknown to 'badblocks') error is encountered, it will
      trigger a machine check exception. On a system with machine check
      recovery, this will only SIGBUS the process(es) which had the bad page
      mapped (as opposed to a kernel panic on platforms without machine
      check recovery features). In the former case, we want to trigger a full
      rescan of that nvdimm bus. This will allow any additional, new errors
      to be captured in the block devices' badblocks lists, and offending
      operations on them can be trapped early, avoiding machine checks.
      
      This is done by registering a callback function with the
      x86_mce_decoder_chain and calling the new ars_rescan functionality with
      the address in the mce notificatiion.
      
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Signed-off-by: NVishal Verma <vishal.l.verma@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      6839a6d9
    • D
      nfit: move to nfit/ sub-directory · bdf97013
      Dan Williams 提交于
      With the arrival of x86-machine-check support the nfit driver will add a
      (conditionally-compiled) source file.  Prepare for this by moving all
      nfit source to drivers/acpi/nfit/.  This is pure code movement, no
      functional changes.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      bdf97013
    • V
      nfit, libnvdimm: allow an ARS scrub to be triggered on demand · 37b137ff
      Vishal Verma 提交于
      Normally, an ARS (Address Range Scrub) only happens at
      boot/initialization time. There can however arise situations where a
      bus-wide rescan is needed - notably, in the case of discovering a latent
      media error, we should do a full rescan to figure out what other sectors
      are bad, and thus potentially avoid triggering an mce on them in the
      future. Also provide a sysfs trigger to start a bus-wide scrub.
      
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NVishal Verma <vishal.l.verma@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      37b137ff
  9. 23 7月, 2016 1 次提交
  10. 22 7月, 2016 4 次提交
    • D
      libnvdimm: move ->module to struct nvdimm_bus_descriptor · bc9775d8
      Dan Williams 提交于
      Let the provider module be explicitly passed in rather than implicitly
      assumed by the module that calls nvdimm_bus_register().  This is in
      preparation for unifying the nfit and nfit_test driver teardown paths.
      Reviewed-by: NLee, Chun-Yi <jlee@suse.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      bc9775d8
    • D
      nfit: cleanup acpi_nfit_init calling convention · e7a11b44
      Dan Williams 提交于
      Pass the nfit buffer as a parameter rather than hanging it off of
      acpi_desc.
      Reviewed-by: N"Lee, Chun-Yi" <jlee@suse.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      e7a11b44
    • D
      nfit: fix _FIT evaluation memory leak + use after free · 31932041
      Dan Williams 提交于
      acpi_evaluate_object() allocates memory. Free the buffer allocated
      during acpi_nfit_add(). In order for this memory to be freed
      acpi_nfit_init() needs to be converted to duplicate the nfit contents in
      its internal allocation.  Use zero-length arrays to minimize the thrash
      with the rest of the nfit driver implementation.
      
      All of the add_<nfit-sub-table>() routines now validate a minimum table
      size and expect hotplugged tables to match the size of the original
      table to count as a duplicate. For variable length tables, like 'idt'
      and 'flush', we calculate the dynamic size. Note that hotplug by
      definition cannot change the interleave as it would cause data
      corruption of in-use namespaces.
      
      Cc: Vishal Verma <vishal.l.verma@intel.com>
      Reported-by: NXiao Guangrong <guangrong.xiao@intel.com>
      Reported-by: NHaozhong Zhang <haozhong.zhang@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      31932041
    • L
      acpi, nfit: treat virtual ramdisk SPA as pmem region · c2f32acd
      Lee, Chun-Yi 提交于
      This patch adds logic to treat virtual ramdisk SPA as pmem region, then
      ramdisk's /dev/pmem* device can be mounted with iso9660.
      
      It's useful to work with the httpboot in EFI firmware to pull a remote
      ISO file to the local memory region for booting and installation.
      
      Wiki page of UEFI HTTPBoot with OVMF:
      	https://en.opensuse.org/UEFI_HTTPBoot_with_OVMF
      
      The ramdisk function in EDK2/OVMF generates a ACPI0012 root device that
      it contains empty _STA but without _DSM:
      
      DefinitionBlock ("ssdt2.aml", "SSDT", 2, "INTEL ", "RamDisk ", 0x00001000)
      {
          Scope (\_SB)
          {
              Device (NVDR)
              {
                  Name (_HID, "ACPI0012")  // _HID: Hardware ID
                  Name (_STR, Unicode ("NVDIMM Root Device"))  // _STR: Description String
                  Method (_STA, 0, NotSerialized)  // _STA: Status
                  {
                      Return (0x0F)
                  }
              }
          }
      }
      
      In section 5.2.25.2 of ACPI 6.1 spec, it mentions that the "SPA Range
      Structure Index" of virtual SPA shall be set to zero. That means virtual SPA
      will not be associated by any NVDIMM region mapping.
      
      The VCD's SPA Range Structure in NFIT is similar to virtual disk region
      as following:
      
      [028h 0040   2]                Subtable Type : 0000 [System Physical Address Range]
      [02Ah 0042   2]                       Length : 0038
      
      [02Ch 0044   2]                  Range Index : 0000
      [02Eh 0046   2]        Flags (decoded below) : 0000
                         Add/Online Operation Only : 0
                            Proximity Domain Valid : 0
      [030h 0048   4]                     Reserved : 00000000
      [034h 0052   4]             Proximity Domain : 00000000
      [038h 0056  16]           Address Range GUID : 77AB535A-45FC-624B-5560-F7B281D1F96E
      [048h 0072   8]           Address Range Base : 00000000B6ABD018
      [050h 0080   8]         Address Range Length : 0000000005500000
      [058h 0088   8]         Memory Map Attribute : 0000000000000000
      
      The way to not associate a SPA range is to never reference it from a "flush hint",
      "interleave", or "control region" table.
      
      After testing on OVMF, pmem driver can support the region that it doesn't
      assoicate to any NVDIMM mapping. So, treat VCD like pmem is a idea to get
      a pmem block device that it contains iso.
      
      v4:
      Instoduce nfit_spa_is_virtual() to check virtual ramdisk SPA and create
      pmem region.
      
      v3:
      To simplify patch, removed useless VCD region in libnvdimm.
      
      v2:
      Removed the code for setting VCD to a read-only region.
      
      Cc: Gary Lin <GLin@suse.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Linda Knippers <linda.knippers@hpe.com>
      Signed-off-by: NLee, Chun-Yi <jlee@suse.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      c2f32acd
  11. 20 7月, 2016 1 次提交
    • D
      nfit: make DIMM DSMs optional · a7225598
      Dan Williams 提交于
      Commit 4995734e "acpi, nfit: fix acpi_check_dsm() vs zero functions
      implemented" attempted to fix a QEMU regression by supporting its usage
      of a zero-mask as a valid response to a DSM-family probe request.
      However, this behavior breaks HP platforms that return a zero-mask by
      default causing the probe to misidentify the DSM-family.
      
      Instead, the QEMU regression can be fixed by simply not requiring the DSM
      family to be identified.
      
      This effectively reverts commit 4995734e, and removes the DSM
      requirement from the init path.
      
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Cc: Xiao Guangrong <guangrong.xiao@linux.intel.com>
      Cc: Linda Knippers <linda.knippers@hpe.com>
      Fixes: 4995734e ("acpi, nfit: fix acpi_check_dsm() vs zero functions implemented")
      Reported-by: NJerry Hoemann <jerry.hoemann@hpe.com>
      Tested-by: NJerry Hoemann <jerry.hoemann@hpe.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      a7225598
  12. 12 7月, 2016 3 次提交
    • D
      libnvdimm: introduce nvdimm_flush() and nvdimm_has_flush() · f284a4f2
      Dan Williams 提交于
      nvdimm_flush() is a replacement for the x86 'pcommit' instruction.  It is
      an optional write flushing mechanism that an nvdimm bus can provide for
      the pmem driver to consume.  In the case of the NFIT nvdimm-bus-provider
      nvdimm_flush() is implemented as a series of flush-hint-address [1]
      writes to each dimm in the interleave set (region) that backs the
      namespace.
      
      The nvdimm_has_flush() routine relies on platform firmware to describe
      the flushing capabilities of a platform.  It uses the heuristic of
      whether an nvdimm bus provider provides flush address data to return a
      ternary result:
      
            1: flush addresses defined
            0: dimm topology described without flush addresses (assume ADR)
       -errno: no topology information, unable to determine flush mechanism
      
      The pmem driver is expected to take the following actions on this ternary
      result:
      
            1: nvdimm_flush() in response to REQ_FUA / REQ_FLUSH and shutdown
            0: do not set, WC or FUA on the queue, take no further action
       -errno: warn and then operate as if nvdimm_has_flush() returned '0'
      
      The caveat of this heuristic is that it can not distinguish the "dimm
      does not have flush address" case from the "platform firmware is broken
      and failed to describe a flush address".  Given we are already
      explicitly trusting the NFIT there's not much more we can do beyond
      blacklisting broken firmwares if they are ever encountered.
      
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      f284a4f2
    • D
      libnvdimm, nfit: move flush hint mapping to region-device driver-data · e5ae3b25
      Dan Williams 提交于
      In preparation for triggering flushes of a DIMM's writes-posted-queue
      (WPQ) via the pmem driver move mapping of flush hint addresses to the
      region driver.  Since this uses devm_nvdimm_memremap() the flush
      addresses will remain mapped while any region to which the dimm belongs
      is active.
      
      We need to communicate more information to the nvdimm core to facilitate
      this mapping, namely each dimm object now carries an array of flush hint
      address resources.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      e5ae3b25
    • D
      libnvdimm, nfit: remove nfit_spa_map() infrastructure · a8a6d2e0
      Dan Williams 提交于
      Now that all shared mappings are handled by devm_nvdimm_memremap() we no
      longer need nfit_spa_map() nor do we need to trigger a callback to the
      bus provider at region disable time.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      a8a6d2e0
  13. 08 7月, 2016 3 次提交
    • D
      libnvdimm: introduce devm_nvdimm_memremap(), convert nfit_spa_map() users · 29b9aa0a
      Dan Williams 提交于
      In preparation for generically mapping flush hint addresses for both the
      BLK and PMEM use case, provide a generic / reference counted mapping
      api.  Given the fact that a dimm may belong to multiple regions (PMEM
      and BLK), the flush hint addresses need to be held valid as long as any
      region associated with the dimm is active.  This is similar to the
      existing BLK-region case where multiple BLK-regions may share an
      aperture mapping.  Up-level this shared / reference-counted mapping
      capability from the nfit driver to a core nvdimm capability.
      
      This eliminates the need for the nd_blk_region.disable() callback.  Note
      that the removal of nfit_spa_map() and related infrastructure is
      deferred to a later patch.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      29b9aa0a
    • D
      nfit: don't override return value of nfit_mem_init · 81ed4e36
      Dan Williams 提交于
      We were needlessly converting nfit_mem_init() errors to -ENOMEM.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      81ed4e36
    • D
      nfit: always associate flush hints · ad9ac5e1
      Dan Williams 提交于
      Before enabling use of flush hints for pmem regions, we need to make
      sure they are always associated.  Move the initialization of nfit_flush
      out of the block-window specific init path to the general init path.
      
      Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      ad9ac5e1
  14. 07 7月, 2016 1 次提交
  15. 30 6月, 2016 1 次提交
    • D
      nfit: fix format interface code byte order · 1bcbf42d
      Dan Williams 提交于
      Per JEDEC Annex L Release 3 the SPD data is:
      
      Bits 9~5 00 000 = Function Undefined
               00 001 = Byte addressable energy backed
               00 010 = Block addressed
               00 011 = Byte addressable, no energy backed
               All other codes reserved
      Bits 4~0 0 0000 = Proprietary interface
               0 0001 = Standard interface 1
               All other codes reserved; see Definitions of Functions
      
      ...and per the ACPI 6.1 spec:
      
          byte0: Bits 4~0 (0 or 1)
          byte1: Bits 9~5 (1, 2, or 3)
      
      ...so a format interface code displayed as 0x301 should be stored in the
      nfit as (0x1, 0x3), little-endian.
      
      Cc: Toshi Kani <toshi.kani@hpe.com>
      Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
      Cc: Robert Moore <robert.moore@intel.com>
      Cc: Robert Elliott <elliott@hpe.com>
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=121161
      Fixes: 30ec5fd4 ("nfit: fix format interface code byte order per ACPI6.1")
      Fixes: 5ad9a7fd ("acpi/nfit: Update nfit driver to comply with ACPI 6.1")
      Reported-by: NKristin Jacque <kristin.jacque@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      1bcbf42d
  16. 25 6月, 2016 1 次提交
    • D
      acpi, nfit: fix acpi_check_dsm() vs zero functions implemented · 4995734e
      Dan Williams 提交于
      QEMU 2.6 implements nascent support for nvdimm DSMs. Depending on
      configuration it may only implement the function0 dsm to indicate that
      no other DSMs are available. Commit 31eca76b "nfit, libnvdimm:
      limited/whitelisted dimm command marshaling mechanism" breaks QEMU, but
      QEMU is spec compliant.  Per the spec the way to indicate that no
      functions are supported is:
      
          If Function Index is zero, the return is a buffer containing one bit
          for each function index, starting with zero. Bit 0 indicates whether
          there is support for any functions other than function 0 for the
          specified UUID and Revision ID. If set to zero, no functions are
          supported (other than function zero) for the specified UUID and
          Revision ID.
      
      Update the nfit driver to determine the family (interface UUID) without
      requiring the implementation to define any other functions, i.e.
      short-circuit acpi_check_dsm() to succeed per the spec.  The nfit driver
      appears to be the only user passing funcs==0 to acpi_check_dsm(), so
      this behavior change of the common routine should be limited to the
      probing done by the nfit driver.
      
      Cc: Len Brown <lenb@kernel.org>
      Cc: Jerry Hoemann <jerry.hoemann@hpe.com>
      Acked-by: N"Rafael J. Wysocki" <rafael@kernel.org>
      Fixes: 31eca76b ("nfit, libnvdimm: limited/whitelisted dimm command marshaling mechanism")
      Reported-by: NXiao Guangrong <guangrong.xiao@linux.intel.com>
      Tested-by: NXiao Guangrong <guangrong.xiao@linux.intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      4995734e
  17. 21 6月, 2016 1 次提交
  18. 06 5月, 2016 2 次提交
  19. 03 5月, 2016 1 次提交
  20. 30 4月, 2016 1 次提交
  21. 29 4月, 2016 2 次提交
    • D
      nfit, libnvdimm: limited/whitelisted dimm command marshaling mechanism · 31eca76b
      Dan Williams 提交于
      There are currently 4 known similar but incompatible definitions of the
      command sets that can be sent to an NVDIMM through ACPI.  It is also
      clear that future platform generations (ACPI or not) will continue to
      revise and extend the DIMM command set as new devices and use cases
      arrive.
      
      It is obviously untenable to continue to proliferate divergence
      of these command definitions, and to that end a standardization process
      has begun to provide for a unified specification.  However, that leaves a
      problem about what to do with this first generation where vendors are
      already shipping divergence.
      
      The Linux kernel can support these initial diverged platforms without
      giving platform-firmware free reign to continue to diverge and compound
      kernel maintenance overhead.  The kernel implementation can encourage
      standardization in two ways:
      
      1/ Require that any function code that userspace wants to send be
         explicitly white-listed in the implementation.  For ACPI this means
         function codes marked as supported by acpi_check_dsm() may
         only be invoked if they appear in the white-list.  A function must be
         publicly documented before it is added to the white-list.
      
      2/ The above restrictions can be trivially bypassed by using the
         "vendor-specific" payload command.  However, since vendor-specific
         commands are by definition not publicly documented and have the
         potential to corrupt the kernel's view of the dimm state, we provide a
         toggle to disable vendor-specific operations.  Enabling undefined
         behavior is a policy decision that can be made by the platform owner
         and encourages firmware implementations to choose public over
         private command implementations.
      
      Based on an initial patch from Jerry Hoemann
      Cc: Jerry Hoemann <jerry.hoemann@hpe.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      31eca76b
    • D
      nfit, libnvdimm: clarify "commands" vs "_DSMs" · e3654eca
      Dan Williams 提交于
      Clarify the distinction between "commands", the ioctls userspace calls
      to request the kernel take some action on a given dimm device, and
      "_DSMs", the actual function numbers used in the firmware interface to
      the DIMM.  _DSMs are ACPI specific whereas commands are Linux kernel
      generic.
      
      This is in preparation for breaking the 1:1 implicit relationship
      between the kernel ioctl number space and the firmware specific function
      numbers.
      
      Cc: Jerry Hoemann <jerry.hoemann@hpe.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      e3654eca
  22. 27 4月, 2016 2 次提交
    • T
      acpi/nfit: Add sysfs "id" for NVDIMM ID · 38a879ba
      Toshi Kani 提交于
      ACPI 6.1, section 5.2.25.9, defines an identifier for an NVDIMM.
      
      Change the NFIT driver to add a new sysfs file "id" under nfit
      directory.
      Signed-off-by: NToshi Kani <toshi.kani@hpe.com>
      Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Robert Moore <robert.moore@intel.com>
      Cc: Robert Elliott <elliott@hpe.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      38a879ba
    • T
      acpi/nfit: Update nfit driver to comply with ACPI 6.1 · 5ad9a7fd
      Toshi Kani 提交于
      ACPI 6.1, Table 5-133, updates NVDIMM Control Region Structure
      as follows.
       - Valid Fields, Manufacturing Location, and Manufacturing Date
         are added from reserved range.  No change in the structure size.
       - IDs (SPD values) are stored as arrays of bytes (i.e. big-endian
         format).  The spec clarifies that they need to be represented
         as arrays of bytes as well.
      
      This patch makes the following changes to support this update.
       - Change the NFIT driver to show SPD ID values in big-endian
         format.
       - Change sprintf format to use "0x" instead of "#" since "%#02x"
         does not prepend '0'.
      
      link: http://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdfSigned-off-by: NToshi Kani <toshi.kani@hpe.com>
      Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Robert Moore <robert.moore@intel.com>
      Cc: Robert Elliott <elliott@hpe.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      5ad9a7fd