Unverified Commit 42d61847 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12770 v2 hisilicon/hisi_hbmcache: Use mutex_trylock to prevent hung task

parents c67d418d effe6fe8
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -24,7 +24,9 @@ static ssize_t state_store(struct device *d, struct device_attribute *attr,
	acpi_handle handle = adev->handle;
	acpi_status status = AE_OK;

	mutex_lock(&cache_lock);
	if (!mutex_trylock(&cache_lock))
		return -EBUSY;

	switch (type) {
	case STATE_ONLINE:
		status = acpi_evaluate_object(handle, "_ON", NULL, NULL);