Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp17087lqp; Sun, 9 Jun 2024 14:09:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBMTA9orWC8jZM/kucnm/YHX6RQ2a++c0txHGsQ2fPU+KzaDEnKAi6tVrGlKy+83vxCAMZ9UTG7EYe5EDwKf32VgDJCp51FbLk4TAfeQ== X-Google-Smtp-Source: AGHT+IHgotWRgrAoAgqNrUHuzwif7ZswtKEHJ/y1alR6jOGH85prIEwEWFQ+bWgUJKXqzrFBQAXh X-Received: by 2002:a05:6808:1528:b0:3d2:2a9c:8b6f with SMTP id 5614622812f47-3d22a9c8f0emr968987b6e.44.1717967367022; Sun, 09 Jun 2024 14:09:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717967366; cv=pass; d=google.com; s=arc-20160816; b=UmQT48W3dSzynqJvGWWn3TUgjEHvdRx6onmrc/TU32737QKp/OJWUUN3PnbA7LxkWm jdxQlGuReXmgQyCfowNFPOlwcohXpHigvqevwnxHCqihrlVuVnL9qtja1qx4CJFvmLeK upwp+ifM9PR+T8/Bu/ku+J8pALAL3S1BbDQqeqXr8wCZMCBfNQWnRKEb7P1HcCfBD5Sj SVdV1EqbDD26GPBk5ns/FEyhOJjeMO2xaI64wtfyyPJ1qHRhHB9MfUEvJzNYmyPHc2fo xNL4ajl7qZpKhjVr4AiMa62s0An6cQWHEM41Jiq2lczwsOj2zf0ays1ncFQ+mipqLsT6 2bJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from:dkim-signature; bh=9SIub8og3/9ldon22F2Wdln9k3m6OqGkRm+nPBuWpm8=; fh=tnRAMqcWiXBrXMdf47l0fYwJmOj4zkpNbORAiH1LJoI=; b=rnpPQE39Jc4DH/dlvORI1TjCZ91t4ecca2XtEKtOTcHaOqJe1jWCsvf+ITktYHKrdI pJohwTAZFpkVuAtbVj6dxvuBn2YixQsFG47aNooItjZt5Lq04QgYSXN61iGxSyRUjvZM VijvwurBuF+PNVuFIcHqPIHTj3Npnw9g9Eji2l9/m/AXf8PMxVCaQtZhfk+K2+hLvXVi iR/lYnD76ZB3y2zQFHTcEKvV/elK0IdBEQwPamzHGdz2uQ/oltv5kNlexBk6X9m+kWOU lULLV6FMqwzim3YSgg1/iZajGklOort6qP1wEB0XM5u9SIoXqFIIHH4DAWVc3Qw+RJZ9 82kw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=Liic4alC; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-kernel+bounces-207511-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207511-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-795dca5ea23si147777885a.741.2024.06.09.14.09.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 14:09:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207511-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=Liic4alC; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-kernel+bounces-207511-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207511-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B61C91C20C28 for ; Sun, 9 Jun 2024 21:09:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43D5B4DA09; Sun, 9 Jun 2024 21:09:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="Liic4alC" 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 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:LMfD5zp++gZ8k6LdDg44V7LGkBQ5tsQKGQF2fyucr13WNqcy9Gy OC/KYQSz3VuQa8TaD7MGKjqxIgxh9Z8OB55mymOiMPutaZFNs44PlBEQghdv1LqCJ0B+5+T K/vRRIv6SyvYLZzm4vJKuRaiLPM8zWIxmIFwDP4PQU9GqrYxD+Eh378Es3vvdzJTBeqMXnI PIefLQ58DnfqeECawck6A== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:0Wr9t1P7ckI=;NM4vT9gB8wBaHD0Z2EdjLhRLG0H 84tqMLX9FAWEOtSY8WzKKfvzXh3wNfipzdsQ4bknWj+zJxLhxO7MpeK+6gKOcrz2uHWV4a0h3 RwdNEd+3n0wPL+bRHTol4JfqfGvxkL4c7kCUJA+PojOpRs3A7hjreEY9vUixU6qGn2nkZVdjU d1WydVH3jQcr9gabYMCWr4rsCCED40ruxqW8Nap7ujF+O5tjZkB2kK7MbEHBaTsl+3H0G+6Jo NFTUKBumjzQ+gZcbtZCupRmH+dFzXiCkJCDQBEfQvgXH5grF5Z9geOP+CM2qVQiwqWhBs49LR ZJnnfeUncfuwPkVxblfLZ+uJ9/EEFBAi9AlQ2GxPi68fISajJEkzdZUDNoGBwmuoHRyd9BLCL DT2PIl1QUEqnO5i2eHp14n6vs5c9s9gsOlyEt7Yh72mAWl2yrBMUCEMq2nGCdg1JOAezxG0Ug lJ+Zz8/7jhm3WouSj9njUS1Twj6gqYg7JttA/jBol14N29LVo13yTqSdv+UfU/v4Nx4bEVED8 d6TuURXpTO54PoUTHc0pCndKV4qFZ1SwLHuFhWlbVc0gc+gqb/AmBxZcSD89J7d9cA32ynMxA 8N2UUp1WLJQH2ebpmDeZPmfuoANzIs1OUGh0zmaLpFzY+FP6hOLwOTFfHOUrdW8a7w+lN10b1 1HuzlDev/XMIN+MWCUzfoUYrrgjxQ2GJS3N1GFrrmkz5ooOWOWjMaYMaCojOHB9UAn7FSMJUN 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 =2D-- drivers/acpi/acpi_pad.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index bd1ad07f0290..350d3a892889 100644 =2D-- 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 handl= e) .length =3D 4, .pointer =3D (void *)&idle_cpus, }; + u32 status; mutex_lock(&isolated_cpus_lock); num_cpus =3D 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 =3D ACPI_PROCESSOR_AGGREGATOR_STATUS_NO_ACTION; + } else { + status =3D ACPI_PROCESSOR_AGGREGATOR_STATUS_SUCCESS; + acpi_pad_idle_cpus(num_cpus); } - acpi_pad_idle_cpus(num_cpus); + idle_cpus =3D acpi_pad_idle_cpus_num(); - acpi_evaluate_ost(handle, ACPI_PROCESSOR_AGGREGATOR_NOTIFY, 0, ¶m); + acpi_evaluate_ost(handle, ACPI_PROCESSOR_AGGREGATOR_NOTIFY, status, &par= am); mutex_unlock(&isolated_cpus_lock); } =2D- 2.39.2