All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wireless: p54pci: add handling of signal case
@ 2015-01-20  5:26 Nicholas Mc Guire
  2015-01-22 18:13 ` Christian Lamparter
  2015-01-23 19:37 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Nicholas Mc Guire @ 2015-01-20  5:26 UTC (permalink / raw)
  To: Christian Lamparter
  Cc: Kalle Valo, linux-wireless, netdev, linux-kernel, Nicholas Mc Guire

if(!wait_for_completion_interruptible_timeout(...))
only handles the timeout case - this patch adds handling the
signal case the same as timeout.

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
---

Only the timeout case was being handled, the signal case 
(-ERESTARTSYS) was treated just like the case of successful 
completion, which is most likely not reasonable.

The callsite for p54p_open() in p54p_firmware_step2() expect !=0 to 
indicate error so both -ERESTARTSYS and -ETIMEDOUT should be fine 
for the current handling.

Patch was only compild tested with x86_64_defcofnig +
CONFIG_P54_COMMON=m, CONFIG_P54_PCI=m

Patch is against 3.19.0-rc5 -next-20150119

 drivers/net/wireless/p54/p54pci.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c
index d4aee64..27a4906 100644
--- a/drivers/net/wireless/p54/p54pci.c
+++ b/drivers/net/wireless/p54/p54pci.c
@@ -431,6 +431,7 @@ static int p54p_open(struct ieee80211_hw *dev)
 {
 	struct p54p_priv *priv = dev->priv;
 	int err;
+	long timeout;
 
 	init_completion(&priv->boot_comp);
 	err = request_irq(priv->pdev->irq, p54p_interrupt,
@@ -468,10 +469,12 @@ static int p54p_open(struct ieee80211_hw *dev)
 	P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_RESET));
 	P54P_READ(dev_int);
 
-	if (!wait_for_completion_interruptible_timeout(&priv->boot_comp, HZ)) {
+	timeout = wait_for_completion_interruptible_timeout(
+			&priv->boot_comp, HZ);
+	if (timeout <= 0) {
 		wiphy_err(dev->wiphy, "Cannot boot firmware!\n");
 		p54p_stop(dev);
-		return -ETIMEDOUT;
+		return timeout ? -ERESTARTSYS : -ETIMEDOUT;
 	}
 
 	P54P_WRITE(int_enable, cpu_to_le32(ISL38XX_INT_IDENT_UPDATE));
-- 
1.7.10.4


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

* Re: [PATCH] wireless: p54pci: add handling of signal case
  2015-01-20  5:26 [PATCH] wireless: p54pci: add handling of signal case Nicholas Mc Guire
@ 2015-01-22 18:13 ` Christian Lamparter
  2015-01-23 19:37 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Lamparter @ 2015-01-22 18:13 UTC (permalink / raw)
  To: Nicholas Mc Guire; +Cc: Kalle Valo, linux-wireless

On Tuesday, January 20, 2015 06:26:17 AM Nicholas Mc Guire wrote:
> if(!wait_for_completion_interruptible_timeout(...))
> only handles the timeout case - this patch adds handling the
> signal case the same as timeout.
> 
> Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>


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

* Re: p54pci: add handling of signal case
  2015-01-20  5:26 [PATCH] wireless: p54pci: add handling of signal case Nicholas Mc Guire
  2015-01-22 18:13 ` Christian Lamparter
@ 2015-01-23 19:37 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2015-01-23 19:37 UTC (permalink / raw)
  To: Nicholas Mc Guire
  Cc: Christian Lamparter, linux-wireless, netdev, linux-kernel,
	Nicholas Mc Guire


> if(!wait_for_completion_interruptible_timeout(...))
> only handles the timeout case - this patch adds handling the
> signal case the same as timeout.
> 
> Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
> Acked-by: Christian Lamparter <chunkeey@googlemail.com>

Thanks, applied to wireless-drivers-next.git. I remove the useless "wireless: "
from the title.

Kalle Valo

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

end of thread, other threads:[~2015-01-23 19:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-20  5:26 [PATCH] wireless: p54pci: add handling of signal case Nicholas Mc Guire
2015-01-22 18:13 ` Christian Lamparter
2015-01-23 19:37 ` Kalle Valo

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.