From patchwork Wed Mar 28 22:20:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 149317 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 34EA2B6FD3 for ; Thu, 29 Mar 2012 09:22:43 +1100 (EST) Received: by ozlabs.org (Postfix) id E7648B6EF4; Thu, 29 Mar 2012 09:21:02 +1100 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from mail-qa0-f74.google.com (mail-qa0-f74.google.com [209.85.216.74]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 564E0B6EE7 for ; Thu, 29 Mar 2012 09:21:01 +1100 (EST) Received: by qabg24 with SMTP id g24so209739qab.3 for ; Wed, 28 Mar 2012 15:20:58 -0700 (PDT) Received: by 10.236.119.242 with SMTP id n78mr40488493yhh.4.1332973258681; Wed, 28 Mar 2012 15:20:58 -0700 (PDT) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id i36si1036372anp.0.2012.03.28.15.20.58 (version=TLSv1/SSLv3 cipher=AES128-SHA); Wed, 28 Mar 2012 15:20:58 -0700 (PDT) Received: from akpm.mtv.corp.google.com (akpm.mtv.corp.google.com [172.18.96.75]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 8F70410004D; Wed, 28 Mar 2012 15:20:58 -0700 (PDT) Received: from localhost.localdomain (localhost [127.0.0.1]) by akpm.mtv.corp.google.com (Postfix) with ESMTP id 3FA2AA0624; Wed, 28 Mar 2012 15:20:58 -0700 (PDT) Subject: [patch 2/2] arch/powerpc/platforms/pseries/eeh_event.c: slightly fix set_current_state() wart To: benh@kernel.crashing.org From: akpm@linux-foundation.org Date: Wed, 28 Mar 2012 15:20:58 -0700 MIME-Version: 1.0 Message-Id: <20120328222058.3FA2AA0624@akpm.mtv.corp.google.com> Cc: linuxppc-dev@ozlabs.org, akpm@linux-foundation.org, paulus@samba.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org From: Andrew Morton Subject: arch/powerpc/platforms/pseries/eeh_event.c: slightly fix set_current_state() wart That set_current_state() won't work very well: the subsequent mutex_lock() might flip the task back into TASK_RUNNING. Attempt to put it somewhere where it might have been meant to be, and attempt to describe why it might have been added. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Grant Likely Signed-off-by: Andrew Morton --- arch/powerpc/platforms/pseries/eeh_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN arch/powerpc/platforms/pseries/eeh_event.c~arch-powerpc-platforms-pseries-eeh_eventc-slightly-fix-set_current_state-wart arch/powerpc/platforms/pseries/eeh_event.c --- a/arch/powerpc/platforms/pseries/eeh_event.c~arch-powerpc-platforms-pseries-eeh_eventc-slightly-fix-set_current_state-wart +++ a/arch/powerpc/platforms/pseries/eeh_event.c @@ -60,7 +60,6 @@ static int eeh_event_handler(void * dumm struct eeh_dev *edev; set_task_comm(current, "eehd"); - set_current_state(TASK_INTERRUPTIBLE); spin_lock_irqsave(&eeh_eventlist_lock, flags); event = NULL; @@ -83,6 +82,7 @@ static int eeh_event_handler(void * dumm printk(KERN_INFO "EEH: Detected PCI bus error on device %s\n", eeh_pci_name(edev->pdev)); + set_current_state(TASK_INTERRUPTIBLE); /* Don't add to load average */ edev = handle_eeh_events(event); eeh_clear_slot(eeh_dev_to_of_node(edev), EEH_MODE_RECOVERING);