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

!5645 [sync] PR-5493: arm64/mpam: Fix repeated enabling in mpam_enable()

parents 4a49bfa2 e4e46c59
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -543,6 +543,7 @@ static void mpam_enable(struct work_struct *work)
	unsigned long flags;
	struct mpam_device *dev;
	bool all_devices_probed = true;
	static atomic_t once;

	/* Have we probed all the devices? */
	mutex_lock(&mpam_devices_lock);
@@ -557,7 +558,7 @@ static void mpam_enable(struct work_struct *work)
	}
	mutex_unlock(&mpam_devices_lock);

	if (!all_devices_probed)
	if (!(all_devices_probed && !atomic_fetch_inc(&once)))
		return;

	mutex_lock(&mpam_devices_lock);