From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754181AbcGKMju (ORCPT ); Mon, 11 Jul 2016 08:39:50 -0400 Received: from www.linutronix.de ([62.245.132.108]:57284 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758677AbcGKMbB (ORCPT ); Mon, 11 Jul 2016 08:31:01 -0400 Message-Id: <20160711122533.663727276@linutronix.de> User-Agent: quilt/0.63-1 Date: Mon, 11 Jul 2016 12:28:47 -0000 From: Anna-Maria Gleixner To: LKML Cc: Peter Zijlstra , Ingo Molnar , Richard Cochran , Sebastian Andrzej Siewior , "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org, Anna-Maria Gleixner Subject: [patch 36/66] ACPI/processor: avoid STARTING/DYING actions in a more logical way References: <20160711122450.923603742@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Disposition: inline; filename=0030-ACPI-processor-avoid-STARTING-DYING-actions-in-a-mor.patch X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001,URIBL_BLOCKED=0.001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Richard Cochran As part of the hotplug cleanup, the CPU_STARTING/DYING actions are going away soon. This driver needlessly uses those two macro, and so this patch replaces that code with something more sensible. Commit 8da8373447d6a57a5a9f55233d35beb15d92d0d2 ("ACPI / processor: Fix STARTING/DYING action in acpi_cpu_soft_notify()") added checks for those two actions, because the notification callback can sleep, causing a hung CPU. This patch instead checks for the ONLINE/DEAD actions, which are the ones that are handled by the driver in the first place. Signed-off-by: Richard Cochran Reviewed-by: Sebastian Andrzej Siewior Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: linux-acpi@vger.kernel.org Signed-off-by: Anna-Maria Gleixner --- drivers/acpi/processor_driver.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c @@ -118,12 +118,13 @@ static int acpi_cpu_soft_notify(struct n struct acpi_device *device; action &= ~CPU_TASKS_FROZEN; - /* - * CPU_STARTING and CPU_DYING must not sleep. Return here since - * acpi_bus_get_device() may sleep. - */ - if (action == CPU_STARTING || action == CPU_DYING) + switch (action) { + case CPU_ONLINE: + case CPU_DEAD: + break; + default: return NOTIFY_DONE; + } if (!pr || acpi_bus_get_device(pr->handle, &device)) return NOTIFY_DONE;