Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp112914imm; Wed, 22 Aug 2018 00:46:51 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyEeYwJ4/5ii8E80+51x6lGJp39gjlQjwzUkwXcfwrOJXfM16T7+wEGyLbPpp6iTzCyO/cX X-Received: by 2002:a63:c608:: with SMTP id w8-v6mr50512287pgg.16.1534924011527; Wed, 22 Aug 2018 00:46:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534924011; cv=none; d=google.com; s=arc-20160816; b=e+hOKVWD3VLoTrA2m/2U9GuiM84QfnzpP7nm8QsCJeTHXQFL0WPrM6oMTxuRv40v5o x6aeF+dQZUnd3+TmEFcb5n7Um8TjR5n08sTIaX74Kz2IlIhxrvrUSQi6yZcQ2LSvu1vv Fni7jxkbW8ilsgboKaWxmu8X96Vkz/zAZDp0JalIYrtkZzELX4LuF/zm0GEIWGT3nat/ /iGpND8GszV5KMXRywHdzN2yTPbuKFxt8rOLkVyVo+SbxDMESSbRp173GBN45zW+YmOj dNb7tl2F4e+VYqVLOt/K0vQYoU6uEue/aM7WCy53a7wHy2ljX2RMaQnrPaw7i2FAEwUL IvzQ== 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 :message-id:date:subject:cc:to:from:arc-authentication-results; bh=OHNxlJ35ls9BJWpIiPkJVHWGHjXFPu27mZeGusA2v54=; b=koXlKFfGxISLoxUJ1LDW8bMAqNDeazHNliAgUg9keeNJS/sSAYSDpvwA9zYrIuRlpI KPju0AFvwSiAy3e9MSAdYpx15Qp66Lyh0BqgLmTFAMEs6ioNljEyIFUvVLhn/cWqCG9Y Hr3sA8XdA4BFoduTekym5QtpxHD79LQ6mqz93MuofmSEroeHgtThXaZRo8yLdnvrAbQ/ rWTuQhW6R8+UrQq7j8YYQayuSMtKnT9fF3tegvw5QkG7TEQsKo6L6AqRbuBolXCelGxL 2vAxtZSqAk4iTVuMYDHZ2NY+X7cvZYFGkBXtaE8dQJClOzPAyb4DjwbCasqCnuqsCDla LfSQ== ARC-Authentication-Results: i=1; mx.google.com; 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 d6-v6si1038474pgi.506.2018.08.22.00.46.36; Wed, 22 Aug 2018 00:46:51 -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; 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 S1728286AbeHVLI6 (ORCPT + 99 others); Wed, 22 Aug 2018 07:08:58 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:54613 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726838AbeHVLI5 (ORCPT ); Wed, 22 Aug 2018 07:08:57 -0400 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="43780055" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 22 Aug 2018 15:45:08 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id 071EB4B6AE0E; Wed, 22 Aug 2018 15:45:08 +0800 (CST) Received: from localhost.localdomain (10.167.226.106) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 22 Aug 2018 15:45:05 +0800 From: Dou Liyang To: , , CC: , , , , , Dou Liyang Subject: [RESEND PATCH v2] acpi/processor: Fix the return value of acpi_processor_ids_walk() Date: Wed, 22 Aug 2018 15:44:53 +0800 Message-ID: <20180822074453.26959-1-douly.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.14.3 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: 071EB4B6AE0E.A0406 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ACPI driver should make sure all the processor IDs in their ACPI Namespace are unique. the driver performs a depth-first walk of the namespace tree and calls the acpi_processor_ids_walk() to check the duplicate IDs. But, the acpi_processor_ids_walk() mistakes the return value. If a processor is checked, it returns true which causes the walk break immediately, and other processors will never be checked. Repace the value with AE_OK which is the standard acpi_status value. And don't abort the namespace walk even on error. Fixes 8c8cb30f49b8 ("acpi/processor: Implement DEVICE operator for processor enumeration") Signed-off-by: Dou Liyang --- Changelog: v1 --> v2: - Fix the check against duplicate IDs suggested by Rafael. Now,the duplicate IDs only be found in Ivb42 machine, and we have added this check at linux-4.9. But, we introduced a bug in linux-4.12 by commit 8c8cb30f49b8. For resolving the bug, firstly, I removed the check[1]. because Linux will compare the coming ID with present processors when it hot-added a physical CPU and will avoid using duplicate IDs. But, seems we should consider all the possible processors. So, with this patch, All the processors with the same IDs will never be hot-plugged. [1] https://lkml.org/lkml/2018/5/28/213 --- drivers/acpi/acpi_processor.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 449d86d39965..a59870ccd5ca 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -643,7 +643,7 @@ static acpi_status __init acpi_processor_ids_walk(acpi_handle handle, status = acpi_get_type(handle, &acpi_type); if (ACPI_FAILURE(status)) - return false; + return_ACPI_STATUS(status); switch (acpi_type) { case ACPI_TYPE_PROCESSOR: @@ -663,11 +663,12 @@ static acpi_status __init acpi_processor_ids_walk(acpi_handle handle, } processor_validated_ids_update(uid); - return true; + return AE_OK; err: + /* Exit on error, but don't abort the namespace walk */ acpi_handle_info(handle, "Invalid processor object\n"); - return false; + return AE_OK; } -- 2.14.3