From patchwork Mon Mar 31 23:51:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 3918151 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@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 891CFBF540 for ; Mon, 31 Mar 2014 23:51:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B47B0203B4 for ; Mon, 31 Mar 2014 23:51:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E3018201C8 for ; Mon, 31 Mar 2014 23:51:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751318AbaCaXv0 (ORCPT ); Mon, 31 Mar 2014 19:51:26 -0400 Received: from mail-pd0-f182.google.com ([209.85.192.182]:35520 "EHLO mail-pd0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750966AbaCaXvZ (ORCPT ); Mon, 31 Mar 2014 19:51:25 -0400 Received: by mail-pd0-f182.google.com with SMTP id y10so8752675pdj.27 for ; Mon, 31 Mar 2014 16:51:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=IM8HIbaPEyWISgCmck7PyDoXdbGJ7tIGQ+W/bD5bF4I=; b=XhRW//twD70ZgkVgFmzWb83pzDU+ZyPVGDS+u8frA4jr5MvTpjAzJ47lYD+UWF6jfZ 2zstZEpm+4PKbKXonYy2OR0aYdvl9M7+Lsuvk4QseyD8S5A3xM0OO+0GaldbrQ3Jdpq1 CgxF9OpN5z4ueG0PH3QwkjX/GHTs4Zbcw7FPabhRMw85PDoaYutg9CTGjWBauX4sp8yN QHUcL/ntZt67F2iqyag3Qe8B0Wy3up577C2k7grrcsnOOGSPolZDVPd82099O/heVfIt ayW7pExJpxmMfemvb3TlqgLk59YOoTrkCCMgxH1F700g45m/rOQ0F20Sb/Q89xm90z3s /jLQ== X-Received: by 10.66.27.67 with SMTP id r3mr27691631pag.62.1396309885371; Mon, 31 Mar 2014 16:51:25 -0700 (PDT) Received: from [192.168.95.129] ([66.129.239.13]) by mx.google.com with ESMTPSA id xn10sm46959165pab.0.2014.03.31.16.51.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 31 Mar 2014 16:51:24 -0700 (PDT) Message-ID: <5339FF7B.4020904@gmail.com> Date: Mon, 31 Mar 2014 16:51:23 -0700 From: Rajat Jain User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org CC: Rajat Jain , Guenter Roeck Subject: [PATCH v2] pci: Allow hotplug service drivers to operate in polling mode Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Today the PCIe port bus driver disables the Hot-plug service if the port device does not have the capability to generate interrupts. However, a user must be able to use the "pciehp_poll_mode" parameter to use the pciehp in polling method in such a case. Today it is not possible. This patch allows a hotplug service driver to decide whether or not it would like to continue in absense of interrupts. Signed-off-by: Rajat Jain Signed-off-by: Rajat Jain Signed-off-by: Guenter Roeck --- v2: Drop the extra debug msg in pciehp (and just retain the changes in portdrv_core.c) drivers/pci/pcie/portdrv_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 0b6e766..ba31deb 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -377,10 +377,13 @@ int pcie_port_device_register(struct pci_dev *dev) /* * Initialize service irqs. Don't use service devices that * require interrupts if there is no way to generate them. + * However, some drivers may have a polling mode (e.g pciehp_poll_mode) + * that can be used in absense of irqs. Allow them to determine + * if that is to be used. */ status = init_service_irqs(dev, irqs, capabilities); if (status) { - capabilities &= PCIE_PORT_SERVICE_VC; + capabilities &= PCIE_PORT_SERVICE_VC | PCIE_PORT_SERVICE_HP; if (!capabilities) goto error_disable; }