linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: pci: Fix hotplug event timeout with shpchp
@ 2019-07-02 13:35 Miaohe Lin
  2019-07-02 17:50 ` Bjorn Helgaas
  0 siblings, 1 reply; 3+ messages in thread
From: Miaohe Lin @ 2019-07-02 13:35 UTC (permalink / raw)
  To: bhelgaas, andy.shevchenko, sebott, lukas, gustavo, linux-pci,
	linux-kernel
  Cc: linmiaohe, mingfangsen

Hotplug a network card would take more than 5 seconds
in qemu + shpchp scene. It’s because 5 seconds
delayed_work in func handle_button_press_event with
case STATIC_STATE. And this will break some
protocols with timeout within 5 seconds.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 drivers/pci/hotplug/shpchp_ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c
index 078003dcde5b..cbb00acaba0d 100644
--- a/drivers/pci/hotplug/shpchp_ctrl.c
+++ b/drivers/pci/hotplug/shpchp_ctrl.c
@@ -478,7 +478,7 @@ static void handle_button_press_event(struct slot *p_slot)
 		p_slot->hpc_ops->green_led_blink(p_slot);
 		p_slot->hpc_ops->set_attention_status(p_slot, 0);
 
-		queue_delayed_work(p_slot->wq, &p_slot->work, 5*HZ);
+		queue_delayed_work(p_slot->wq, &p_slot->work, 0);
 		break;
 	case BLINKINGOFF_STATE:
 	case BLINKINGON_STATE:
-- 
2.21.GIT


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

* Re: [PATCH] net: pci: Fix hotplug event timeout with shpchp
  2019-07-02 13:35 [PATCH] net: pci: Fix hotplug event timeout with shpchp Miaohe Lin
@ 2019-07-02 17:50 ` Bjorn Helgaas
  0 siblings, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2019-07-02 17:50 UTC (permalink / raw)
  To: Miaohe Lin
  Cc: andy.shevchenko, sebott, lukas, gustavo, linux-pci, linux-kernel,
	mingfangsen

On Tue, Jul 02, 2019 at 01:35:19PM +0000, Miaohe Lin wrote:
> Hotplug a network card would take more than 5 seconds
> in qemu + shpchp scene. It’s because 5 seconds
> delayed_work in func handle_button_press_event with
> case STATIC_STATE. And this will break some
> protocols with timeout within 5 seconds.

I'm dropping this because of the required delay pointed out by Lukas.

If you think we still need to do something here, please clarify the
situation.  Are you hot-adding?  Hot-swapping?  Since you mention a
protocol timeout, I suspect the latter, e.g., maybe you had an
existing device with connections already open, and you want to replace
it with a new device while preserving those open connections?

We do have to preserve the existing user experience, e.g., delays to
allow operators to recover from mistaken latch opens or button
presses.  But if we knew more about what you're trying to do, maybe we
could figure out another approach.

> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  drivers/pci/hotplug/shpchp_ctrl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c
> index 078003dcde5b..cbb00acaba0d 100644
> --- a/drivers/pci/hotplug/shpchp_ctrl.c
> +++ b/drivers/pci/hotplug/shpchp_ctrl.c
> @@ -478,7 +478,7 @@ static void handle_button_press_event(struct slot *p_slot)
>  		p_slot->hpc_ops->green_led_blink(p_slot);
>  		p_slot->hpc_ops->set_attention_status(p_slot, 0);
>  
> -		queue_delayed_work(p_slot->wq, &p_slot->work, 5*HZ);
> +		queue_delayed_work(p_slot->wq, &p_slot->work, 0);
>  		break;
>  	case BLINKINGOFF_STATE:
>  	case BLINKINGON_STATE:
> -- 
> 2.21.GIT
> 

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

* Re: [PATCH] net: pci: Fix hotplug event timeout with shpchp
@ 2019-07-03  2:07 linmiaohe
  0 siblings, 0 replies; 3+ messages in thread
From: linmiaohe @ 2019-07-03  2:07 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: andy.shevchenko, sebott, lukas, gustavo, linux-pci, linux-kernel,
	Mingfangsen


On Tue, Jul 02, 2019 at 01:35:19PM +0000, Miaohe Lin wrote:
> > Hotplug a network card would take more than 5 seconds in qemu + shpchp 
> > scene. It’s because 5 seconds delayed_work in func 
>
> I'm dropping this because of the required delay pointed out by Lukas.
>
> If you think we still need to do something here, please clarify the situation.  Are you hot-adding?  Hot-swapping?  Since you mention a protocol timeout, I suspect the latter, e.g., maybe you had an existing device with connections already open, and you want to replace it with a new device
> We do have to preserve the existing user experience, e.g., delays to allow operators to recover from mistaken latch opens or button presses.  But if we knew more about what you're trying to do, maybe we could figure out another approach.

Thanks for your reply. As is spec required, we would try to work around it.
Many thanks.

Have a good day.
Best wishes.

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

end of thread, other threads:[~2019-07-03  2:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-02 13:35 [PATCH] net: pci: Fix hotplug event timeout with shpchp Miaohe Lin
2019-07-02 17:50 ` Bjorn Helgaas
2019-07-03  2:07 linmiaohe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).