Skip to content

Commit 9d004b2

Browse files
committed
Merge tag 'cxl-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl
Pull cxl updates from Dan Williams: "Compute Express Link (CXL) updates for this cycle. The highlight is new driver-core infrastructure and CXL subsystem changes for allowing lockdep to validate device_lock() usage. Thanks to PeterZ for setting me straight on the current capabilities of the lockdep API, and Greg acked it as well. On the CXL ACPI side this update adds support for CXL _OSC so that platform firmware knows that it is safe to still grant Linux native control of PCIe hotplug and error handling in the presence of CXL devices. A circular dependency problem was discovered between suspend and CXL memory for cases where the suspend image might be stored in CXL memory where that image also contains the PCI register state to restore to re-enable the device. Disable suspend for now until an architecture is defined to clarify that conflict. Lastly a collection of reworks, fixes, and cleanups to the CXL subsystem where support for snooping mailbox commands and properly handling the "mem_enable" flow are the highlights. Summary: - Add driver-core infrastructure for lockdep validation of device_lock(), and fixup a deadlock report that was previously hidden behind the 'lockdep no validate' policy. - Add CXL _OSC support for claiming native control of CXL hotplug and error handling. - Disable suspend in the presence of CXL memory unless and until a protocol is identified for restoring PCI device context from memory hosted on CXL PCI devices. - Add support for snooping CXL mailbox commands to protect against inopportune changes, like set-partition with the 'immediate' flag set. - Rework how the driver detects legacy CXL 1.1 configurations (CXL DVSEC / 'mem_enable') before enabling new CXL 2.0 decode configurations (CXL HDM Capability). - Miscellaneous cleanups and fixes from -next exposure" * tag 'cxl-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl: (47 commits) cxl/port: Enable HDM Capability after validating DVSEC Ranges cxl/port: Reuse 'struct cxl_hdm' context for hdm init cxl/port: Move endpoint HDM Decoder Capability init to port driver cxl/pci: Drop @info argument to cxl_hdm_decode_init() cxl/mem: Merge cxl_dvsec_ranges() and cxl_hdm_decode_init() cxl/mem: Skip range enumeration if mem_enable clear cxl/mem: Consolidate CXL DVSEC Range enumeration in the core cxl/pci: Move cxl_await_media_ready() to the core cxl/mem: Validate port connectivity before dvsec ranges cxl/mem: Fix cxl_mem_probe() error exit cxl/pci: Drop wait_for_valid() from cxl_await_media_ready() cxl/pci: Consolidate wait_for_media() and wait_for_media_ready() cxl/mem: Drop mem_enabled check from wait_for_media() nvdimm: Fix firmware activation deadlock scenarios device-core: Kill the lockdep_mutex nvdimm: Drop nd_device_lock() ACPI: NFIT: Drop nfit_device_lock() nvdimm: Replace lockdep_mutex with local lock classes cxl: Drop cxl_device_lock() cxl/acpi: Add root device lockdep validation ...
2 parents a9f9482 + 34e37b4 commit 9d004b2

48 files changed

Lines changed: 1266 additions & 863 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

drivers/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ obj-$(CONFIG_PARPORT) += parport/
7272
obj-y += base/ block/ misc/ mfd/ nfc/
7373
obj-$(CONFIG_LIBNVDIMM) += nvdimm/
7474
obj-$(CONFIG_DAX) += dax/
75-
obj-$(CONFIG_CXL_BUS) += cxl/
7675
obj-$(CONFIG_DMA_SHARED_BUFFER) += dma-buf/
7776
obj-$(CONFIG_NUBUS) += nubus/
77+
obj-y += cxl/
7878
obj-y += macintosh/
7979
obj-y += scsi/
8080
obj-y += nvme/

drivers/acpi/bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ static void acpi_bus_osc_negotiate_usb_control(void)
443443
}
444444

445445
osc_sb_native_usb4_control =
446-
control & ((u32 *)context.ret.pointer)[OSC_CONTROL_DWORD];
446+
control & acpi_osc_ctx_get_pci_control(&context);
447447

448448
acpi_bus_decode_usb_osc("USB4 _OSC: OS supports", control);
449449
acpi_bus_decode_usb_osc("USB4 _OSC: OS controls",

drivers/acpi/nfit/core.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ static ssize_t hw_error_scrub_store(struct device *dev,
12301230
if (rc)
12311231
return rc;
12321232

1233-
nfit_device_lock(dev);
1233+
device_lock(dev);
12341234
nd_desc = dev_get_drvdata(dev);
12351235
if (nd_desc) {
12361236
struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc);
@@ -1247,7 +1247,7 @@ static ssize_t hw_error_scrub_store(struct device *dev,
12471247
break;
12481248
}
12491249
}
1250-
nfit_device_unlock(dev);
1250+
device_unlock(dev);
12511251
if (rc)
12521252
return rc;
12531253
return size;
@@ -1267,10 +1267,10 @@ static ssize_t scrub_show(struct device *dev,
12671267
ssize_t rc = -ENXIO;
12681268
bool busy;
12691269

1270-
nfit_device_lock(dev);
1270+
device_lock(dev);
12711271
nd_desc = dev_get_drvdata(dev);
12721272
if (!nd_desc) {
1273-
nfit_device_unlock(dev);
1273+
device_unlock(dev);
12741274
return rc;
12751275
}
12761276
acpi_desc = to_acpi_desc(nd_desc);
@@ -1287,7 +1287,7 @@ static ssize_t scrub_show(struct device *dev,
12871287
}
12881288

12891289
mutex_unlock(&acpi_desc->init_mutex);
1290-
nfit_device_unlock(dev);
1290+
device_unlock(dev);
12911291
return rc;
12921292
}
12931293

@@ -1304,14 +1304,14 @@ static ssize_t scrub_store(struct device *dev,
13041304
if (val != 1)
13051305
return -EINVAL;
13061306

1307-
nfit_device_lock(dev);
1307+
device_lock(dev);
13081308
nd_desc = dev_get_drvdata(dev);
13091309
if (nd_desc) {
13101310
struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc);
13111311

13121312
rc = acpi_nfit_ars_rescan(acpi_desc, ARS_REQ_LONG);
13131313
}
1314-
nfit_device_unlock(dev);
1314+
device_unlock(dev);
13151315
if (rc)
13161316
return rc;
13171317
return size;
@@ -1697,9 +1697,9 @@ static void acpi_nvdimm_notify(acpi_handle handle, u32 event, void *data)
16971697
struct acpi_device *adev = data;
16981698
struct device *dev = &adev->dev;
16991699

1700-
nfit_device_lock(dev->parent);
1700+
device_lock(dev->parent);
17011701
__acpi_nvdimm_notify(dev, event);
1702-
nfit_device_unlock(dev->parent);
1702+
device_unlock(dev->parent);
17031703
}
17041704

17051705
static bool acpi_nvdimm_has_method(struct acpi_device *adev, char *method)
@@ -3152,8 +3152,8 @@ static int acpi_nfit_flush_probe(struct nvdimm_bus_descriptor *nd_desc)
31523152
struct device *dev = acpi_desc->dev;
31533153

31543154
/* Bounce the device lock to flush acpi_nfit_add / acpi_nfit_notify */
3155-
nfit_device_lock(dev);
3156-
nfit_device_unlock(dev);
3155+
device_lock(dev);
3156+
device_unlock(dev);
31573157

31583158
/* Bounce the init_mutex to complete initial registration */
31593159
mutex_lock(&acpi_desc->init_mutex);
@@ -3305,8 +3305,8 @@ void acpi_nfit_shutdown(void *data)
33053305
* acpi_nfit_ars_rescan() submissions have had a chance to
33063306
* either submit or see ->cancel set.
33073307
*/
3308-
nfit_device_lock(bus_dev);
3309-
nfit_device_unlock(bus_dev);
3308+
device_lock(bus_dev);
3309+
device_unlock(bus_dev);
33103310

33113311
flush_workqueue(nfit_wq);
33123312
}
@@ -3449,9 +3449,9 @@ EXPORT_SYMBOL_GPL(__acpi_nfit_notify);
34493449

34503450
static void acpi_nfit_notify(struct acpi_device *adev, u32 event)
34513451
{
3452-
nfit_device_lock(&adev->dev);
3452+
device_lock(&adev->dev);
34533453
__acpi_nfit_notify(&adev->dev, adev->handle, event);
3454-
nfit_device_unlock(&adev->dev);
3454+
device_unlock(&adev->dev);
34553455
}
34563456

34573457
static const struct acpi_device_id acpi_nfit_ids[] = {

drivers/acpi/nfit/nfit.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -337,30 +337,6 @@ static inline struct acpi_nfit_desc *to_acpi_desc(
337337
return container_of(nd_desc, struct acpi_nfit_desc, nd_desc);
338338
}
339339

340-
#ifdef CONFIG_PROVE_LOCKING
341-
static inline void nfit_device_lock(struct device *dev)
342-
{
343-
device_lock(dev);
344-
mutex_lock(&dev->lockdep_mutex);
345-
}
346-
347-
static inline void nfit_device_unlock(struct device *dev)
348-
{
349-
mutex_unlock(&dev->lockdep_mutex);
350-
device_unlock(dev);
351-
}
352-
#else
353-
static inline void nfit_device_lock(struct device *dev)
354-
{
355-
device_lock(dev);
356-
}
357-
358-
static inline void nfit_device_unlock(struct device *dev)
359-
{
360-
device_unlock(dev);
361-
}
362-
#endif
363-
364340
const guid_t *to_nfit_uuid(enum nfit_uuids id);
365341
int acpi_nfit_init(struct acpi_nfit_desc *acpi_desc, void *nfit, acpi_size sz);
366342
void acpi_nfit_shutdown(void *data);

0 commit comments

Comments
 (0)