From patchwork Sun Jan 13 23:27:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 1970811 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 9046D3FE1B for ; Sun, 13 Jan 2013 23:28:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756351Ab3AMX1v (ORCPT ); Sun, 13 Jan 2013 18:27:51 -0500 Received: from mail-qc0-f202.google.com ([209.85.216.202]:41847 "EHLO mail-qc0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756349Ab3AMX1t (ORCPT ); Sun, 13 Jan 2013 18:27:49 -0500 Received: by mail-qc0-f202.google.com with SMTP id s25so431664qcq.5 for ; Sun, 13 Jan 2013 15:27:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=0RRDEgDjFxYwUhCdx5bCrgsVDhSKBOpHYCdOqpCzJ7c=; b=UNSqpw3gQxPaKdsiOhtTZTk6LdlTxU5r6S9p9kaq2LP5CKT0p4pqAEKAzaFXaVHRRG if+aNTw7Zzfa9nVrz4R/RW9nHpRqZWGNQWcAgygrT9cMo5clNbRN1mtldCx67qsWCV0D P0lpvJ8fNoC0riwu7TXqcfluYqUX5Lyq2J4O0XvxwUuis1SFX9M3chNTNOpGBu5WCNeW JrofBXRfcBPACnrBjFsn64z+MeQFctNZ3E6MML8mBglNSJtVlZslxSM6FvG0fxSVb224 9fm7Js+G4YzE6LG2pwKMdTFXmdWdGowQ/4ZtpbF3T7MZiCErsL10dABMBbxEA6UOyALK 8YAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=0RRDEgDjFxYwUhCdx5bCrgsVDhSKBOpHYCdOqpCzJ7c=; b=RpCNx/pf3NF05cyEnL57hmvalyZREMnF5UIICOdUz7F2RuOzvra4hdxrMAP/qb8acv qN2gEgyKsgIEn9yLcFS4xriXbjIUOtBaE6xYHvhQavZlQbo2HldnG1srz9e+Lf0TEnfx cyiytpCw8AII81fDzjvXm10eO2Z4k8Xyz/bA+viJVXzFZgBeuZFc9Ci1J8I/19n6+3Mn PJE5Qy3cLiLM0Vbhrtvw/gJKHyyO7a/43jcvaggRuqI/wcY82BWMwlanSm5I4C6aJFy6 T8WjWUeeawdfouCBE5Rtfc2ztCuxiI2i4M9t0mDD3zCEIMyVcBU7Ov5GG8YRtxvmUOll wnAQ== X-Received: by 10.236.119.39 with SMTP id m27mr21034704yhh.1.1358119668768; Sun, 13 Jan 2013 15:27:48 -0800 (PST) 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 u20si343526anj.3.2013.01.13.15.27.48 (version=TLSv1 cipher=AES128-SHA bits=128/128); Sun, 13 Jan 2013 15:27:48 -0800 (PST) Received: from bhelgaas.mtv.corp.google.com (bhelgaas.mtv.corp.google.com [172.17.131.112]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 78507100047; Sun, 13 Jan 2013 15:27:48 -0800 (PST) Received: from bhelgaas.mtv.corp.google.com (unknown [IPv6:::1]) by bhelgaas.mtv.corp.google.com (Postfix) with ESMTP id 3737818024D; Sun, 13 Jan 2013 15:27:48 -0800 (PST) Subject: [PATCH v7 3/4] PCI: shpchp: Handle push button event asynchronously To: Yijing Wang , linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: linux-kernel@vger.kernel.org, Daniel J Blueman , Kenji Kaneshige , Tejun Heo , Yinghai Lu , Jiang Liu Date: Sun, 13 Jan 2013 16:27:48 -0700 Message-ID: <20130113232748.7225.66704.stgit@bhelgaas.mtv.corp.google.com> In-Reply-To: <20130113232606.7225.94802.stgit@bhelgaas.mtv.corp.google.com> References: <20130113232606.7225.94802.stgit@bhelgaas.mtv.corp.google.com> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQm3GYCYwu1oJUSyVFprfPE4MTVeuU+n/BFPysgJDd+9EwNNQ5Yus6zheLu0inh5CluX3Aex4Fr9hQveZZyuLgOfOTRRqNU5Jt2QYvYyl8ajT0s0jy1PwOpFkQWZo0SbS6hqWNIfDxcYhGUk3vGt/vj1YtvVtpuad8zj2pM5OSB9SQa0GIarK8EAraYvM7ICQCgbAPbJgc9eIsMjWLMftGiDplWoFg== Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Use non-ordered workqueue for attention button events. Attention button events on each slot can be handled asynchronously. So we should use non-ordered workqueue. This patch also removes ordered workqueue in shpchp as a result. 486b10b9f4 ("PCI: pciehp: Handle push button event asynchronously") made the same change to pciehp. I split this out from a patch by Yijing Wang so we fix one thing at a time and to make the shpchp history correspond more closely with the pciehp history. Signed-off-by: Bjorn Helgaas CC: Kenji Kaneshige --- drivers/pci/hotplug/shpchp.h | 1 - drivers/pci/hotplug/shpchp_core.c | 10 ---------- drivers/pci/hotplug/shpchp_ctrl.c | 2 +- 3 files changed, 1 insertions(+), 12 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" 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/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h index ca64932..1b69d95 100644 --- a/drivers/pci/hotplug/shpchp.h +++ b/drivers/pci/hotplug/shpchp.h @@ -47,7 +47,6 @@ extern bool shpchp_poll_mode; extern int shpchp_poll_time; extern bool shpchp_debug; extern struct workqueue_struct *shpchp_wq; -extern struct workqueue_struct *shpchp_ordered_wq; #define dbg(format, arg...) \ do { \ diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index 59ca86c..3774e0d 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c @@ -40,7 +40,6 @@ bool shpchp_debug; bool shpchp_poll_mode; int shpchp_poll_time; struct workqueue_struct *shpchp_wq; -struct workqueue_struct *shpchp_ordered_wq; #define DRIVER_VERSION "0.4" #define DRIVER_AUTHOR "Dan Zink , Greg Kroah-Hartman , Dely Sy " @@ -181,7 +180,6 @@ void cleanup_slots(struct controller *ctrl) list_del(&slot->slot_list); cancel_delayed_work(&slot->work); flush_workqueue(shpchp_wq); - flush_workqueue(shpchp_ordered_wq); pci_hp_deregister(slot->hotplug_slot); } } @@ -370,17 +368,10 @@ static int __init shpcd_init(void) if (!shpchp_wq) return -ENOMEM; - shpchp_ordered_wq = alloc_ordered_workqueue("shpchp_ordered", 0); - if (!shpchp_ordered_wq) { - destroy_workqueue(shpchp_wq); - return -ENOMEM; - } - retval = pci_register_driver(&shpc_driver); dbg("%s: pci_register_driver = %d\n", __func__, retval); info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); if (retval) { - destroy_workqueue(shpchp_ordered_wq); destroy_workqueue(shpchp_wq); } return retval; @@ -390,7 +381,6 @@ static void __exit shpcd_cleanup(void) { dbg("unload_shpchpd()\n"); pci_unregister_driver(&shpc_driver); - destroy_workqueue(shpchp_ordered_wq); destroy_workqueue(shpchp_wq); info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n"); } diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c index f9b5a52..fd2cae9 100644 --- a/drivers/pci/hotplug/shpchp_ctrl.c +++ b/drivers/pci/hotplug/shpchp_ctrl.c @@ -453,7 +453,7 @@ void shpchp_queue_pushbutton_work(struct work_struct *work) kfree(info); goto out; } - queue_work(shpchp_ordered_wq, &info->work); + queue_work(shpchp_wq, &info->work); out: mutex_unlock(&p_slot->lock); }