From patchwork Sun Jun 9 21:09:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 13691387 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14B4014265; Sun, 9 Jun 2024 21:09:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717967359; cv=none; b=BWvvmXztFW/t1IjjeOjJF3JWCtKqL8A+6lvy0Cf+XZtZZ02vqx1BGfgZzOeRhIn54cy/Gapq3dOA8BfZHgSUb5wv3ADSj+u7shNo6Y9cieN45FO8NsiDZ+brKIyYeYDMfDkSqudvpSohSM6diNWSnRwRiotdXrrdQnrqA/lTgMo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717967359; c=relaxed/simple; bh=/E1wD/ufLPJhzP//qxEYP8D8mnf0t+I6DWJYveHX944=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=j5QsFitCt34omxbgP/tV5hOnng6jI+FLyHt0DSJx/PeNxBZpcfAluMTyWcDI1BmU0FwxkLqwmv7q3vyQuCNvofIgLhzMRjOcaUDRGFYqteFzfWIMygKPH4gawb18zPEglUdQIL5bv2vJqPu2gHYgUIXA5DQq1zLDOZwt82vMg6I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=Liic4alC; arc=none smtp.client-ip=212.227.15.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="Liic4alC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1717967351; x=1718572151; i=w_armin@gmx.de; bh=9SIub8og3/9ldon22F2Wdln9k3m6OqGkRm+nPBuWpm8=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id: MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=Liic4alCoVq2cf/AWoqLhRhxYzSpLu1o3rNB6coKYSCSGIhXBOfHMd+bSSRpq/MS 2wJBdZx+KXFSkwUDGMCnVhnkrhrTnL6tocZoY0120E2CW8Pnx52Go8al975MKm1I2 v+sI2gJnYzdapyCGbqhvr4yuS0FaUrjna40LiGg6Fzj3uR2FjmmH+KShUyRwYz9aB 82kLDWuQiuFfcVNj975mMi+q27SqxsK1eI6rdJhmzg5NbQ2y4CPnLSenHK9kf1ZnM T+N6tnliMWsWqH6kgGGf3av2O/vOp1j0z1PCi/aZ7zfwpdqrs4VHRxeRr/nEl6XPa OgNVtQFb3IftwTmQmQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from mx-amd-b650.users.agdsn.de ([141.30.226.129]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N1wlv-1sRv3P3ONF-00wHn8; Sun, 09 Jun 2024 23:09:10 +0200 From: Armin Wolf To: rafael@kernel.org, lenb@kernel.org Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ACPI: acpi_pad: Still evaluate _OST when _PUR evaluation fails Date: Sun, 9 Jun 2024 23:09:08 +0200 Message-Id: <20240609210908.4470-1-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-ac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5ooOWOWjMaYMaCojOHB9UAn7FSMJUN 7fmUDAeWfGD2/RdIEVpESMW6fvGvS8/wS/b4tWSw+/5Zgz3G0NjAcpxScYb0OY9FASV4m972k sBUSWtUEJQlosZvrPfUIHmIXCJ/WotxJ3gXoVdJgxlpUA= The ACPI specification says that if no action was performed when processing the _PUR object, _OST should still be evaluated, albeit with a different status code. Evaluate _OST even when evaluating _PUR fails, to signal the firmware that no action was performed. Compile-tested only. Signed-off-by: Armin Wolf --- drivers/acpi/acpi_pad.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) -- 2.39.2 diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index bd1ad07f0290..350d3a892889 100644 --- a/drivers/acpi/acpi_pad.c +++ b/drivers/acpi/acpi_pad.c @@ -25,6 +25,10 @@ #define ACPI_PROCESSOR_AGGREGATOR_CLASS "acpi_pad" #define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator" #define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80 + +#define ACPI_PROCESSOR_AGGREGATOR_STATUS_SUCCESS 0 +#define ACPI_PROCESSOR_AGGREGATOR_STATUS_NO_ACTION 1 + static DEFINE_MUTEX(isolated_cpus_lock); static DEFINE_MUTEX(round_robin_lock); @@ -382,16 +386,23 @@ static void acpi_pad_handle_notify(acpi_handle handle) .length = 4, .pointer = (void *)&idle_cpus, }; + u32 status; mutex_lock(&isolated_cpus_lock); num_cpus = acpi_pad_pur(handle); if (num_cpus < 0) { - mutex_unlock(&isolated_cpus_lock); - return; + /* The ACPI specification says that if no action was performed when + * processing the _PUR object, _OST should still be evaluated, albeit + * with a different status code. + */ + status = ACPI_PROCESSOR_AGGREGATOR_STATUS_NO_ACTION; + } else { + status = ACPI_PROCESSOR_AGGREGATOR_STATUS_SUCCESS; + acpi_pad_idle_cpus(num_cpus); } - acpi_pad_idle_cpus(num_cpus); + idle_cpus = acpi_pad_idle_cpus_num(); - acpi_evaluate_ost(handle, ACPI_PROCESSOR_AGGREGATOR_NOTIFY, 0, ¶m); + acpi_evaluate_ost(handle, ACPI_PROCESSOR_AGGREGATOR_NOTIFY, status, ¶m); mutex_unlock(&isolated_cpus_lock); }