From patchwork Thu May 8 13:58:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Toshi Kani X-Patchwork-Id: 4136661 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 23F1ABFF02 for ; Thu, 8 May 2014 14:08:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 66B7A2025B for ; Thu, 8 May 2014 14:08:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4DEAA20127 for ; Thu, 8 May 2014 14:08:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753446AbaEHOIM (ORCPT ); Thu, 8 May 2014 10:08:12 -0400 Received: from g2t1383g.austin.hp.com ([15.217.136.92]:43477 "EHLO g2t1383g.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753238AbaEHOIL (ORCPT ); Thu, 8 May 2014 10:08:11 -0400 Received: from g5t1627.atlanta.hp.com (g5t1627.atlanta.hp.com [15.192.137.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by g2t1383g.austin.hp.com (Postfix) with ESMTPS id 85FE0367F; Thu, 8 May 2014 13:48:57 +0000 (UTC) Received: from g5t1633.atlanta.hp.com (g5t1633.atlanta.hp.com [16.201.144.132]) by g5t1627.atlanta.hp.com (Postfix) with ESMTP id 83DEA1D8; Thu, 8 May 2014 14:07:53 +0000 (UTC) Received: from misato.fc.hp.com (misato.fc.hp.com [16.79.34.41]) by g5t1633.atlanta.hp.com (Postfix) with ESMTP id 13D7D64; Thu, 8 May 2014 14:07:52 +0000 (UTC) From: Toshi Kani To: rjw@rjwysocki.net Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Toshi Kani Subject: [PATCH] ACPI/hotplug: Fix STARTING/DYING action in acpi_cpu_soft_notify() Date: Thu, 8 May 2014 07:58:59 -0600 Message-Id: <1399557539-7282-1-git-send-email-toshi.kani@hp.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP During CPU online/offline testing on a large system, one of the processors got stuck after the message "bad: scheduling from the idle thread!". The problem is that acpi_cpu_soft_notify() calls acpi_bus_get_device() for all action types. CPU_STARTING and CPU_DYING do not allow the notify handlers to sleep. However, acpi_bus_get_device() can sleep in acpi_ut_acquire_mutex(). Change acpi_cpu_soft_notify() to return immediately for CPU_STARTING and CPU_DYING as they have no action in this handler. Signed-off-by: Toshi Kani --- drivers/acpi/processor_driver.c | 7 +++++++ 1 file changed, 7 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index 7f70f31..4fcbd67 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c @@ -121,6 +121,13 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb, struct acpi_processor *pr = per_cpu(processors, cpu); struct acpi_device *device; + /* + * CPU_STARTING and CPU_DYING must not sleep. Return here since + * acpi_bus_get_device() may sleep. + */ + if (action == CPU_STARTING || action == CPU_DYING) + return NOTIFY_DONE; + if (!pr || acpi_bus_get_device(pr->handle, &device)) return NOTIFY_DONE;