Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp638864lqb; Wed, 29 May 2024 06:37:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWkZnTETfvly9ykJXCKyO0xEfdIJRR1ZQ/ZMFx4PrUdqfrsw+lNN7itOlmaJ0r/UBwG1JuYyIhkijADAA/tSxp03yRwp9z0St315Iz3zA== X-Google-Smtp-Source: AGHT+IFKyzzkXcnaSwujxhcYD0tK+PpZSJkZYFW6pxudR6Bh2JdF1+tR5g2/Cslok6x96roluZD3 X-Received: by 2002:a05:6e02:138b:b0:36d:b63a:8241 with SMTP id e9e14a558f8ab-3737b257743mr181296985ab.8.1716989850100; Wed, 29 May 2024 06:37:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716989850; cv=pass; d=google.com; s=arc-20160816; b=C6nG4naN+Scq/PQqrbN4XxbDSaQeRI0zWzWVJhKkMBK8MLd3er/56edI85UFMldIK3 vidP3Sc+5bDs0wEv42p35nl0o/tuoEif0n9W5suuZUkyc8d9W4/rSNEJBdptyQbarGEl YnJwphGCm5o6CPuP8PvyGbEXZmv8zYkzCzUU9HyU7lia9I754xm9/QD9HSNGWJIPx7Ed vIoBvTMquGlyVUbXefSPnQjHXI83vb59qcRhNBmOm9BvH1lfAPbWlisOagI9YAwL1Y8h jsJtgg+Gatv1x6lA/Hrg25ugAIwWzW8QCDtdOKCVEqbbx0QoX5abFpl34/xCT/FnvCKU 2gWQ== 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=+J0M3w5Y0VFO6nsisHSgKtN5qB/B3eaiB5dOxqTi5ZM=; fh=NxmCHexitX7P6x/7ARv3vZBmyAUGQGWkF2RSnxwWsIo=; b=ZLu/RaefyiXP0NgDkFd/DyDfwfJRD9pnN8GLyO4KKnOAobvjLg7Qn+egWSAmUDuaTa RAD51aF57X3U9piHt15Mhc/YlmNEapllgsAKPawKIni+D6ln4V1hEl1qTTG0vbfC/edK S2qxqFs+4Ngy15eS4B8x3lVCBmkmNPdA4QfkVPdJ7wX5iSqRgBUsYVM1ib6WtKundhYV uHDdq7gwASowqo8ff3Tyjb7e3mW2pVQ+lxjI7lma2rFNlIeQRUD+bfvXrpLkGgcuhRPt AWi4NFFvpB795+m5W1hk2CZIJTKfFC9a+kaqXO8MyaI66tT5QzhqSztrCRumDZEZvtB1 6XQg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-194169-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194169-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6bdefb93838si380469a12.463.2024.05.29.06.37.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 06:37:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194169-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=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-194169-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194169-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com 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 94A5A2838C5 for ; Wed, 29 May 2024 13:37:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5879D1AAC4; Wed, 29 May 2024 13:36:54 +0000 (UTC) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (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 6C0871C6A0; Wed, 29 May 2024 13:36:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716989813; cv=none; b=BJh/3eqrT2IF7ZYcKal/LBC9wOOb3OypO2/DtnmslxvowxB+CVPSVgvsCHW8qOFPZvlzLzOnih0U1PBJ8lnDCyakX6/C90yNR9IEiJk2K9YT+/0eUYt6XA73skYhAscFfYgoxa4s0rxKySieehmJXjK80qe6kM2Y4Bxkldtq5UA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716989813; c=relaxed/simple; bh=FHe3puVLC/fR3A3r9/VgzXc62fLK6dSusZxGJJJmiHA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jUrAF6wHA4mlD5J4AM4YZeUTGrsV8jvj1cL4bWxJ3MWbhlx56dFBMKqZEBKV8aM3USGopORlJbUKtVLws9enOyFRyuDx/BOhK1AGTVYi6LpVlmTGGQ2CSciaaQe03D14vFDR8KJAeku6EjT/qoRNTX/s3pvEGT7pm1kxH1qMYPA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Vq9Pd4VGXz6K8qR; Wed, 29 May 2024 21:35:49 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id C3534140D26; Wed, 29 May 2024 21:36:50 +0800 (CST) Received: from SecurePC-101-06.china.huawei.com (10.122.247.231) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 29 May 2024 14:36:50 +0100 From: Jonathan Cameron To: Marc Zyngier , Will Deacon , Catalin Marinas , , , , , CC: Mark Rutland , Thomas Gleixner , Peter Zijlstra , , , Russell King , "Rafael J . Wysocki" , Miguel Luis , James Morse , Salil Mehta , Jean-Philippe Brucker , Hanjun Guo , Gavin Shan , Ingo Molnar , Borislav Petkov , Dave Hansen , , , Subject: [PATCH v10 04/19] ACPI: processor: Return an error if acpi_processor_get_info() fails in processor_add() Date: Wed, 29 May 2024 14:34:31 +0100 Message-ID: <20240529133446.28446-5-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240529133446.28446-1-Jonathan.Cameron@huawei.com> References: <20240529133446.28446-1-Jonathan.Cameron@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: lhrpeml100001.china.huawei.com (7.191.160.183) To lhrpeml500005.china.huawei.com (7.191.163.240) Rafael observed [1] that returning 0 from processor_add() will result in acpi_default_enumeration() being called which will attempt to create a platform device, but that makes little sense when the processor is known to be not available. So just return the error code from acpi_processor_get_info() instead. Link: https://lore.kernel.org/all/CAJZ5v0iKU8ra9jR+EmgxbuNm=Uwx2m1-8vn_RAZ+aCiUVLe3Pw@mail.gmail.com/ [1] Suggested-by: Rafael J. Wysocki Acked-by: Rafael J. Wysocki Reviewed-by: Gavin Shan Signed-off-by: Jonathan Cameron --- drivers/acpi/acpi_processor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 161c95c9d60a..5f062806ca40 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -393,7 +393,7 @@ static int acpi_processor_add(struct acpi_device *device, result = acpi_processor_get_info(device); if (result) /* Processor is not physically present or unavailable */ - return 0; + return result; BUG_ON(pr->id >= nr_cpu_ids); -- 2.39.2