All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] pci: Allow hotplug service drivers to operate in polling mode
@ 2014-03-31 23:51 Rajat Jain
  2014-04-14 19:35 ` Rajat Jain
  2014-04-24 21:26 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Rajat Jain @ 2014-03-31 23:51 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci, linux-kernel; +Cc: Rajat Jain, Guenter Roeck

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 <rajatxjain@gmail.com>
Signed-off-by: Rajat Jain <rajatjain@juniper.net>
Signed-off-by: Guenter Roeck <groeck@juniper.net>
---
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;
 	}
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH v2] pci: Allow hotplug service drivers to operate in polling mode
  2014-03-31 23:51 [PATCH v2] pci: Allow hotplug service drivers to operate in polling mode Rajat Jain
@ 2014-04-14 19:35 ` Rajat Jain
  2014-04-24 21:26 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Rajat Jain @ 2014-04-14 19:35 UTC (permalink / raw)
  To: Rajat Jain, Bjorn Helgaas, linux-pci, linux-kernel; +Cc: Guenter Roeck

Hello Bjorn,

Just wondering if you got a chance to look at this one. This independent of my other patch (that makes polling, a per-port thing). 

Without this patch - today the hot-plug service cannot be used at all in polling mode IF the interrupts are broken (which I'd assume is the case when one would want to resort to use polling).

Thanks,

Rajat

> -----Original Message-----
> From: linux-pci-owner@vger.kernel.org [mailto:linux-pci-
> owner@vger.kernel.org] On Behalf Of Rajat Jain
> Sent: Monday, March 31, 2014 4:51 PM
> 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
> 
> 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 <rajatxjain@gmail.com>
> Signed-off-by: Rajat Jain <rajatjain@juniper.net>
> Signed-off-by: Guenter Roeck <groeck@juniper.net>
> ---
> 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;
>  	}
> --
> 1.7.9.5
> 
> --
> 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
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] pci: Allow hotplug service drivers to operate in polling mode
  2014-03-31 23:51 [PATCH v2] pci: Allow hotplug service drivers to operate in polling mode Rajat Jain
  2014-04-14 19:35 ` Rajat Jain
@ 2014-04-24 21:26 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2014-04-24 21:26 UTC (permalink / raw)
  To: Rajat Jain; +Cc: linux-pci, linux-kernel, Rajat Jain, Guenter Roeck

On Mon, Mar 31, 2014 at 04:51:23PM -0700, Rajat Jain wrote:
> 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 <rajatxjain@gmail.com>
> Signed-off-by: Rajat Jain <rajatjain@juniper.net>
> Signed-off-by: Guenter Roeck <groeck@juniper.net>

Applied to pci/hotplug for v3.16, thanks!

> ---
> 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;
>  	}
> -- 
> 1.7.9.5
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-24 21:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-31 23:51 [PATCH v2] pci: Allow hotplug service drivers to operate in polling mode Rajat Jain
2014-04-14 19:35 ` Rajat Jain
2014-04-24 21:26 ` Bjorn Helgaas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.