Message ID | 3298279.44csPzL39Z@kreacher |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-75443-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1268241dyc; Wed, 21 Feb 2024 12:05:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVxRtIlpETZr8mn6Cm4o0T8Tpzu2qopoAI80bd8DI+7gyK1KmoEBQrdov7OjK/Q2KubtBbpDKZANC08Zm0UXLQGVovXOA== X-Google-Smtp-Source: AGHT+IHYVSMS3yFhY9+SqlK68HyYMZtPBiAUzb6IagjKlevPBrcw82IFcsOTRTqdCHPEIX7GE1RM X-Received: by 2002:a17:906:abd0:b0:a3f:686c:1d88 with SMTP id kq16-20020a170906abd000b00a3f686c1d88mr568188ejb.11.1708545902916; Wed, 21 Feb 2024 12:05:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708545902; cv=pass; d=google.com; s=arc-20160816; b=QI6bcuzcV42tY+YYUmQ5FZroEauelgToXmnqXP5Bd4cm1kHnJjOy7yvDXOqig2/Y1u 0JGbNQ44weKqDjRHNK9XKsPIFnOkFvIIrEFOZzTHHPSjgLpywbCw0NM33z59coV7Z5zD K4W6ia/Qo88l0oqqb/IN7nGiHQVT/R2o9k8aKD1dSjZIybO78qhfwBSz4t/gD63lsOWH msWem15OZV3KBwC6Kc7bU9X2HaoD1vcEqb+f6FibBwFsSLl+qKmyMKP80HuSPtEzRPof vBkvJ0UYxy7vrsGPRlWK9wLe0uW6ZyB1MVuXlViC5j5zaL+Qy3N6KB4ZHmmJl+dm3XF7 2i4w== 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75443-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id dv19-20020a170906b81300b00a3ef7c0e120si1903842ejb.958.2024.02.21.12.05.02 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 12:05:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75443-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-75443-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75443-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8719B1F2995D for <ouuuleilei@gmail.com>; Wed, 21 Feb 2024 20:05:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B93586AE9; Wed, 21 Feb 2024 20:04:48 +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" <rjw@rjwysocki.net> To: Linux ACPI <linux-acpi@vger.kernel.org>, Jonathan Cameron <jonathan.cameron@huawei.com> Cc: LKML <linux-kernel@vger.kernel.org>, Mika Westerberg <mika.westerberg@linux.intel.com>, "Rafael J. Wysocki" <rafael@kernel.org>, "Russell King (Oracle)" <linux@armlinux.org.uk> 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: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791540228392548488 X-GMAIL-MSGID: 1791540228392548488 |
Series |
ACPI: scan: Check enabled _STA bit on Bus/Device Checks
|
|
Commit Message
Rafael J. Wysocki
Feb. 21, 2024, 8:03 p.m. UTC
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> 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 <rafael.j.wysocki@intel.com> --- drivers/acpi/acpi_processor.c | 3 +++ 1 file changed, 3 insertions(+)
Comments
On Wed, 21 Feb 2024 21:03:17 +0100 "Rafael J. Wysocki" <rjw@rjwysocki.net> wrote: > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > 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 <rafael.j.wysocki@intel.com> This does the job for us so if you are happier with this approach that works for me. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> > --- > 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; > > >
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;