1. 14 Feb, 2023 5 commits
    • Dan Williams's avatar
      Merge branch 'for-6.3/cxl-ram-region' into cxl/next · ee817aca
      Dan Williams authored
      Pick up some fixes from exposure of for-6.3/cxl-ram-region in
      linux-next.
      ee817aca
    • Arnd Bergmann's avatar
      dax/hmem: build hmem device support as module if possible · 8a3d95ea
      Arnd Bergmann authored
      When device_hmem.o is enabled but dax itself is a loadable module, the
      dax_hmem support fails to link because Kbuild never compiles built-in
      code under drivers/dax:
      
      ERROR: modpost: "walk_hmem_resources" [drivers/dax/hmem/dax_hmem.ko] undefined!
      
      Make sure that drivers/dax is entered for compiling built-in code
      even with CONFIG_DAX=m.
      
      Fixes: 7dab174e ("dax/hmem: Move hmem device registration to dax_hmem.ko")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Link: https://lore.kernel.org/r/20230214131913.1431969-1-arnd@kernel.orgSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      8a3d95ea
    • Arnd Bergmann's avatar
      dax: cxl: add CXL_REGION dependency · 0c16c83e
      Arnd Bergmann authored
      There is already a dependency on CXL_REGION, which depends on CXL_BUS,
      but since CXL_REGION is a 'bool' symbol, it's possible to configure
      DAX as built-in even though CXL itself is a loadable module:
      
      x86_64-linux-ld: drivers/dax/cxl.o: in function `cxl_dax_region_probe':
      cxl.c:(.text+0xb): undefined reference to `to_cxl_dax_region'
      x86_64-linux-ld: drivers/dax/cxl.o: in function `cxl_dax_region_driver_init':
      cxl.c:(.init.text+0x10): undefined reference to `__cxl_driver_register'
      x86_64-linux-ld: drivers/dax/cxl.o: in function `cxl_dax_region_driver_exit':
      cxl.c:(.exit.text+0x9): undefined reference to `cxl_driver_unregister'
      
      Prevent this with another depndency on the tristate symbol.
      
      Fixes: 09d09e04 ("cxl/dax: Create dax devices for CXL RAM regions")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Link: https://lore.kernel.org/r/20230214103054.1082908-1-arnd@kernel.orgSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      0c16c83e
    • Arnd Bergmann's avatar
      cxl: avoid returning uninitialized error code · 7abcb0b1
      Arnd Bergmann authored
      The new cxl_add_to_region() function returns an uninitialized
      value on success:
      
      drivers/cxl/core/region.c:2628:6: error: variable 'rc' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
              if (IS_ERR(cxlr)) {
                  ^~~~~~~~~~~~
      drivers/cxl/core/region.c:2654:9: note: uninitialized use occurs here
              return rc;
      
      Simplify the logic to have the rc variable always initialized in the
      same place.
      
      Fixes: a32320b7 ("cxl/region: Add region autodiscovery")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Link: https://lore.kernel.org/r/20230213101220.3821689-1-arnd@kernel.orgSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      7abcb0b1
    • Dan Williams's avatar
      cxl/pmem: Fix nvdimm registration races · f57aec44
      Dan Williams authored
      A loop of the form:
      
          while true; do modprobe cxl_pci; modprobe -r cxl_pci; done
      
      ...fails with the following crash signature:
      
          BUG: kernel NULL pointer dereference, address: 0000000000000040
          [..]
          RIP: 0010:cxl_internal_send_cmd+0x5/0xb0 [cxl_core]
          [..]
          Call Trace:
           <TASK>
           cxl_pmem_ctl+0x121/0x240 [cxl_pmem]
           nvdimm_get_config_data+0xd6/0x1a0 [libnvdimm]
           nd_label_data_init+0x135/0x7e0 [libnvdimm]
           nvdimm_probe+0xd6/0x1c0 [libnvdimm]
           nvdimm_bus_probe+0x7a/0x1e0 [libnvdimm]
           really_probe+0xde/0x380
           __driver_probe_device+0x78/0x170
           driver_probe_device+0x1f/0x90
           __device_attach_driver+0x85/0x110
           bus_for_each_drv+0x7d/0xc0
           __device_attach+0xb4/0x1e0
           bus_probe_device+0x9f/0xc0
           device_add+0x445/0x9c0
           nd_async_device_register+0xe/0x40 [libnvdimm]
           async_run_entry_fn+0x30/0x130
      
      ...namely that the bottom half of async nvdimm device registration runs
      after the CXL has already torn down the context that cxl_pmem_ctl()
      needs. Unlike the ACPI NFIT case that benefits from launching multiple
      nvdimm device registrations in parallel from those listed in the table,
      CXL is already marked PROBE_PREFER_ASYNCHRONOUS. So provide for a
      synchronous registration path to preclude this scenario.
      
      Fixes: 21083f51 ("cxl/pmem: Register 'pmem' / cxl_nvdimm devices")
      Cc: <stable@vger.kernel.org>
      Reported-by: default avatarDave Jiang <dave.jiang@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      f57aec44
  2. 11 Feb, 2023 26 commits
  3. 09 Feb, 2023 1 commit
  4. 07 Feb, 2023 4 commits
  5. 30 Jan, 2023 3 commits
  6. 29 Jan, 2023 1 commit