Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3457ybp; Thu, 3 Oct 2019 09:22:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqze4TeSCzQ/6HGUnzvKIaqqLUSe1RnXrrAp73sQGHbHbWVohGx41x7iSvYL+s99M79h759N X-Received: by 2002:a50:9402:: with SMTP id p2mr10435010eda.111.1570119735755; Thu, 03 Oct 2019 09:22:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570119735; cv=none; d=google.com; s=arc-20160816; b=br50Euwl4BXrk/kPKU5VQExxITKO+88ld007h9A4F913/mXUzDjhZIii0hpi6HG+Q6 BYKp4VAbdVBAF+g06Fo4YZUmm38mj2uaB9AkpBFM2H2ANjS06LHMxKoibu2mHhCa11pI 1BLQycrQWlqyckamfFZodJ2wWcn8zSTV6jxJMRAxQXXqFjD9IOb+rOXVlP6Y9vWCB2BZ rZ3GOwgPYDtRTyL0jTZoumKz+5KEIx4vepNIk28vjacw6z5sMePm5V2LaNmh8zBzKYoU MwJ24Jp0C77ScPnFLN4DEptVc4yl/mBpe/14J9k1Jsrd8N2znlYkq0e/Tx+YQZ/ub+j6 HObA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0ioxiNJPLEDPF8Mzhs+iSiVp5X+9XS4yHJqBCmZKtoQ=; b=T77MYaI+MlKuGGT+pV/pyNY+RmvSFqdAEvmyLWT84MDB5asLRsyj67Qc8p3BF78fyc 0Y0GWOkGmwXlDLu5xh61CMZRWJjCDUDFnX+nWagOpZjiHq5wcjJEeLcsovxjGcZln7Wv NWPgSg8qtIBIq01CHkmOVXg8tL/EblrY6L9Fo802By+9NAxJuMkjvbUER5dm/Z9RuMs4 xRiuF/DF3ENDu2MMsamRlBv2kczUvuUKBK0+SFPPoRIuzmHFNdAUiq5EwL5lrcZi2RWn DaxC0+XWG0M2AA5g1FadgX+qwhfmYO/P1z8JUs2QI3NHh43MEWV9sjcvzczOr//QEc9+ 3pow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t6tlhJ4b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3si1677259edy.48.2019.10.03.09.21.51; Thu, 03 Oct 2019 09:22:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t6tlhJ4b; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389473AbfJCQTO (ORCPT + 99 others); Thu, 3 Oct 2019 12:19:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:46144 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389709AbfJCQTN (ORCPT ); Thu, 3 Oct 2019 12:19:13 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C76A720865; Thu, 3 Oct 2019 16:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119553; bh=K0AEGtS3ru3m5o3GBWv+/gtrDrzTVL4cNuryvWAlht0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t6tlhJ4bzlOm1ol8NaEO7meXIscNecLOElvCyNcHEYt/AZ6YuVIFqmQ591vX6vwuj jX24s4Pg4hCMpAYu33wxHZ5gD+y+QScOH1Ra1hpikUJ6l6aljHc8QBCNbu/jUqMprj zNVdXaq+yIXOyq2uFwcm4k5/pFjVMPXuEblI4u84= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Al Stone , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 4.19 106/211] ACPI / CPPC: do not require the _PSD method Date: Thu, 3 Oct 2019 17:52:52 +0200 Message-Id: <20191003154511.236352636@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154447.010950442@linuxfoundation.org> References: <20191003154447.010950442@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Stone [ Upstream commit 4c4cdc4c63853fee48c02e25c8605fb65a6c9924 ] According to the ACPI 6.3 specification, the _PSD method is optional when using CPPC. The underlying assumption is that each CPU can change frequency independently from all other CPUs; _PSD is provided to tell the OS that some processors can NOT do that. However, the acpi_get_psd() function returns ENODEV if there is no _PSD method present, or an ACPI error status if an error occurs when evaluating _PSD, if present. This makes _PSD mandatory when using CPPC, in violation of the specification, and only on Linux. This has forced some firmware writers to provide a dummy _PSD, even though it is irrelevant, but only because Linux requires it; other OSPMs follow the spec. We really do not want to have OS specific ACPI tables, though. So, correct acpi_get_psd() so that it does not return an error if there is no _PSD method present, but does return a failure when the method can not be executed properly. This allows _PSD to be optional as it should be. Signed-off-by: Al Stone Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/cppc_acpi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index d9ce4b162e2ce..a1aa59849b964 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -369,8 +369,10 @@ static int acpi_get_psd(struct cpc_desc *cpc_ptr, acpi_handle handle) union acpi_object *psd = NULL; struct acpi_psd_package *pdomain; - status = acpi_evaluate_object_typed(handle, "_PSD", NULL, &buffer, - ACPI_TYPE_PACKAGE); + status = acpi_evaluate_object_typed(handle, "_PSD", NULL, + &buffer, ACPI_TYPE_PACKAGE); + if (status == AE_NOT_FOUND) /* _PSD is optional */ + return 0; if (ACPI_FAILURE(status)) return -ENODEV; -- 2.20.1