1. 14 Feb, 2017 4 commits
    • Dan Williams's avatar
      libnvdimm, pfn: fix memmap reservation size versus 4K alignment · cd755677
      Dan Williams authored
      commit bfb34527 upstream.
      
      When vmemmap_populate() allocates space for the memmap it does so in 2MB
      sized chunks. The libnvdimm-pfn driver incorrectly accounts for this
      when the alignment of the device is set to 4K. When this happens we
      trigger memory allocation failures in altmap_alloc_block_buf() and
      trigger warnings of the form:
      
       WARNING: CPU: 0 PID: 3376 at arch/x86/mm/init_64.c:656 arch_add_memory+0xe4/0xf0
       [..]
       Call Trace:
        dump_stack+0x86/0xc3
        __warn+0xcb/0xf0
        warn_slowpath_null+0x1d/0x20
        arch_add_memory+0xe4/0xf0
        devm_memremap_pages+0x29b/0x4e0
      
      Fixes: 315c5625 ("libnvdimm, pfn: add 'align' attribute, default to HPAGE_SIZE")
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cd755677
    • Dan Williams's avatar
      libnvdimm, namespace: do not delete namespace-id 0 · ebffa7bc
      Dan Williams authored
      commit 9d032f42 upstream.
      
      Given that the naming of pmem devices changes from the pmemX form to the
      pmemX.Y form when namespace id is greater than 0, arrange for namespaces
      with id-0 to be exempt from deletion. Otherwise a simple reconfiguration
      of an existing namespace to a new mode results in a name change of the
      resulting block device:
      
          # ndctl list --namespace=namespace1.0
          {
            "dev":"namespace1.0",
            "mode":"raw",
            "size":2147483648,
            "uuid":"3dadf3dc-89b9-4b24-b20e-abc8a4707ce3",
            "blockdev":"pmem1"
          }
      
          # ndctl create-namespace --reconfig=namespace1.0 --mode=memory --force
          {
            "dev":"namespace1.1",
            "mode":"memory",
            "size":2111832064,
            "uuid":"7b4a6341-7318-4219-a02c-fb57c0bbf613",
            "blockdev":"pmem1.1"
          }
      
      This change does require tooling changes to explicitly look for
      namespaceX.0 if the seed has already advanced to another namespace.
      
      Fixes: 98a29c39 ("libnvdimm, namespace: allow creation of multiple pmem-namespaces per region")
      Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ebffa7bc
    • Dan Williams's avatar
      acpi, nfit: fix acpi_nfit_flush_probe() crash · 46cf1520
      Dan Williams authored
      commit e471486c upstream.
      
      We queue an on-stack work item to 'nfit_wq' and wait for it to complete
      as part of a 'flush_probe' request. However, if the user cancels the
      wait we need to make sure the item is flushed from the queue otherwise
      we are leaving an out-of-scope stack address on the work list.
      
       BUG: unable to handle kernel paging request at ffffbcb3c72f7cd0
       IP: [<ffffffffa9413a7b>] __list_add+0x1b/0xb0
       [..]
       RIP: 0010:[<ffffffffa9413a7b>]  [<ffffffffa9413a7b>] __list_add+0x1b/0xb0
       RSP: 0018:ffffbcb3c7ba7c00  EFLAGS: 00010046
       [..]
       Call Trace:
        [<ffffffffa90bb11a>] insert_work+0x3a/0xc0
        [<ffffffffa927fdda>] ? seq_open+0x5a/0xa0
        [<ffffffffa90bb30a>] __queue_work+0x16a/0x460
        [<ffffffffa90bbb08>] queue_work_on+0x38/0x40
        [<ffffffffc0cf2685>] acpi_nfit_flush_probe+0x95/0xc0 [nfit]
        [<ffffffffc0cf25d0>] ? nfit_visible+0x40/0x40 [nfit]
        [<ffffffffa9571495>] wait_probe_show+0x25/0x60
        [<ffffffffa9546b30>] dev_attr_show+0x20/0x50
      
      Fixes: 7ae0fa43 ("nfit, libnvdimm: async region scrub workqueue")
      Reviewed-by: default avatarVishal Verma <vishal.l.verma@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      46cf1520
    • Srinivas Pandruvada's avatar
      cpufreq: intel_pstate: Disable energy efficiency optimization · a6b1dc61
      Srinivas Pandruvada authored
      commit 6e978b22 upstream.
      
      Some Kabylake desktop processors may not reach max turbo when running in
      HWP mode, even if running under sustained 100% utilization.
      
      This occurs when the HWP.EPP (Energy Performance Preference) is set to
      "balance_power" (0x80) -- the default on most systems.
      
      It occurs because the platform BIOS may erroneously enable an
      energy-efficiency setting -- MSR_IA32_POWER_CTL BIT-EE, which is not
      recommended to be enabled on this SKU.
      
      On the failing systems, this BIOS issue was not discovered when the
      desktop motherboard was tested with Windows, because the BIOS also
      neglects to provide the ACPI/CPPC table, that Windows requires to enable
      HWP, and so Windows runs in legacy P-state mode, where this setting has
      no effect.
      
      Linux' intel_pstate driver does not require ACPI/CPPC to enable HWP, and
      so it runs in HWP mode, exposing this incorrect BIOS configuration.
      
      There are several ways to address this problem.
      
      First, Linux can also run in legacy P-state mode on this system.
      As intel_pstate is how Linux enables HWP, booting with
      "intel_pstate=disable"
      will run in acpi-cpufreq/ondemand legacy p-state mode.
      
      Or second, the "performance" governor can be used with intel_pstate,
      which will modify HWP.EPP to 0.
      
      Or third, starting in 4.10, the
      /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
      attribute in can be updated from "balance_power" to "performance".
      
      Or fourth, apply this patch, which fixes the erroneous setting of
      MSR_IA32_POWER_CTL BIT_EE on this model, allowing the default
      configuration to function as designed.
      Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Reviewed-by: default avatarLen Brown <len.brown@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a6b1dc61
  2. 09 Feb, 2017 36 commits