Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2578525rdb; Wed, 21 Feb 2024 12:04:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWdyERVJge2BwIILX8Bir8hmEh61+VAEtGuRT+0KgQzEbA/BZqb2fqgzSKaTlGHBWwrC724yR6rtgFIi6kVodk/1mBZPRRBjJ9okvc95w== X-Google-Smtp-Source: AGHT+IE3bvwUxb2W8a3kfEu/PnmHWnQ7w0qC/Rk7SgEYDMr07Qy3TTXPDBR74y3OsjpTSOtR9hxR X-Received: by 2002:a17:902:dacd:b0:1db:e792:bb25 with SMTP id q13-20020a170902dacd00b001dbe792bb25mr14443961plx.25.1708545893149; Wed, 21 Feb 2024 12:04:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708545893; cv=pass; d=google.com; s=arc-20160816; b=daMtmQujMWjZPP238O/VDZq9TyeUh7wfqf/O1y0mjjOwWtg7yW3y8JuKzeBnWVpvas /I19LriWabhxkXWPvXRUXxpJbFb9k9K8eRaA7nA8osqwOVnG0ChjBQp7JdrkSIlU3ESH 3PEVFaSaEZ6elVND3zsf70FFtirveSFMVCAqrUDFpdgFg7zNqLn9XLiop0clHaupz82r BktMLq+cvoKVYRTPSaIV/fDbwaDnPGCrHyDLwgRLPtKQ3HrhG7iWdb3zH0CNgtXD+B8Z 6fev27ZEHTDq6/ZAuJvFYNjdl//3yWBpDLBfpUIA/B+X/VLGY4KM/liYpCpYymPDSPpq iNqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=VbHKg7NT8SmXHUT2pr1u9bWcSAoQ8UPuQKdsuU3YKg8=; fh=s5Fc0MEg8Xcp85xwyejK4S4zs7msQB7g1OY0X3YpOJg=; b=S3s+S0nLgKQxEAGbUky3M6vFSqcyT1h57AvhYk0nYGtid+/oEnsD9ayqsXdXIDFR/a vq5IsEepJd0uqEljUYK6N4rcMeFcUCXnjrB4v2OMFwSLmOEWwSmwOxvpLUQLAnp06BcJ tLXTc3M52Ac8Y9Dv57t07lERIzsLkh257ZM7iuLF3c74axvVH7/4Qbega5mWRCW/amHc nAg6c+3MEA+2kkHO/coXnOMP6bKMbC6xdFQRkVx97Q2+GkIvpnOXQM8Bt8tW0CVCcotY noYOxXhO68Y6xG/0XzWwlqGkobtgUinPXp62tTQMXNWB1BDdOHHxWZHiBLAXHPeVbKbQ gWMg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-75443-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75443-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id lm8-20020a170903298800b001dc03d4e2a9si5271597plb.173.2024.02.21.12.04.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 12:04:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75443-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-75443-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75443-linux.lists.archive=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 80F0528400B for ; Wed, 21 Feb 2024 20:04:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FB0385C68; Wed, 21 Feb 2024 20:04:47 +0000 (UTC) Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) (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 1A54B42A8E; Wed, 21 Feb 2024 20:04:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.96.170.134 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708545886; cv=none; b=qgVcRa2w010hYfhV5UBjLq7TrzelbvHqCZKXl78Kw+wnmYX0s3Mu386qAJTSTVVEDV7RFhJ/5KNRisU2CCwWNK9oyq0H80R9qTOlsyFXqm9tpo7rl4kCDJoIBC9rTlMkHXmOctIvhVS/Q9reW+hndfI3JB1xzwW96IhgrfqLPfc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708545886; c=relaxed/simple; bh=HyUVCsjQzKDy4y3IbS6W3hreF7bH4BoXJ2aTGIKqH1Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=C20tbOh3VqSDNCPPQ1TcQPJshIzZgqd3nZGf74o9SsEFqW8snINRYAyYAFpobIMHAmwW4WDNQ4V5YoSomNw0xw07WddLVqQmovj5ttmsDSLZWbtGS0QhDHWxYUx9ajRK6FmG3LzD/FWoouKUb7OJ66LdetCh7m6udcl6eHPFk+k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net; spf=pass smtp.mailfrom=rjwysocki.net; arc=none smtp.client-ip=79.96.170.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rjwysocki.net Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.4.0) id a3ca0b28fd2e1865; Wed, 21 Feb 2024 21:04:35 +0100 Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cloudserver094114.home.pl (Postfix) with ESMTPSA id 5C1A066A243; Wed, 21 Feb 2024 21:04:35 +0100 (CET) From: "Rafael J. Wysocki" To: Linux ACPI , Jonathan Cameron Cc: LKML , Mika Westerberg , "Rafael J. Wysocki" , "Russell King (Oracle)" Subject: [PATCH v1 4/4] ACPI: scan: Make acpi_processor_add() check the device enabled bit Date: Wed, 21 Feb 2024 21:03:17 +0100 Message-ID: <3298279.44csPzL39Z@kreacher> In-Reply-To: <4562925.LvFx2qVVIh@kreacher> References: <4562925.LvFx2qVVIh@kreacher> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrfedvgddufedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepkedtvdevieejkeevkedvffeiffehiedtheekkeefieehffekgfeltdehleehvddunecuffhomhgrihhnpehuvghfihdrohhrghenucfkphepudelhedrudefiedrudelrdelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleehrddufeeirdduledrleegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeeipdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhonhgrthhhrghnrdgtrghmvghrohhnsehhuhgrfigvihdrtghomhdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehmihhkrgdrfigvshht vghrsggvrhhgsehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtoheprhgrfhgrvghlsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigsegrrhhmlhhinhhugidrohhrghdruhhk X-DCC--Metrics: v370.home.net.pl 1024; Body=6 Fuz1=6 Fuz2=6 From: Rafael J. Wysocki Modify acpi_processor_add() return an error if _STA returns the enabled bit clear for the given processor device, so as to avoid using processors that don't decode their resources, as per the ACPI specification. [1] Link: https://uefi.org/specs/ACPI/6.5/06_Device_Configuration.html#sta-device-status # [1] Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpi_processor.c | 3 +++ 1 file changed, 3 insertions(+) Index: linux-pm/drivers/acpi/acpi_processor.c =================================================================== --- linux-pm.orig/drivers/acpi/acpi_processor.c +++ linux-pm/drivers/acpi/acpi_processor.c @@ -381,6 +381,9 @@ static int acpi_processor_add(struct acp struct device *dev; int result = 0; + if (!acpi_device_is_enabled(device)) + return -ENODEV; + pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL); if (!pr) return -ENOMEM;