linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH - REGRESSION] mwifiex: don't enable/disable IRQ 0 during suspend/resume
@ 2017-02-10 21:55 Brian Norris
  2017-02-13 15:30 ` Kalle Valo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Brian Norris @ 2017-02-10 21:55 UTC (permalink / raw)
  To: Amitkumar Karwar, Nishant Sarmukadam, Kalle Valo
  Cc: linux-kernel, linux-wireless, Rajat Jain, Brian Norris

If we don't have an out-of-band wakeup IRQ configured through DT (as
most platforms don't), then we fall out of this function with
'irq_wakeup == 0'. Other code (e.g., mwifiex_disable_wake() and
mwifiex_enable_wake()) treats 'irq_wakeup >= 0' as a valid IRQ, and so
we end up calling {enable,disable}_irq() on IRQ 0.

That seems bad, so let's not do that.

Same problem as fixed in this patch:

https://patchwork.kernel.org/patch/9531693/
[PATCH v2 2/3] btmrvl: set irq_bt to -1 when failed to parse it

with the difference that:
(a) this one is actually a regression and
(b) this affects both device tree and non-device-tree systems

While fixing the regression, also drop the verbosity on the parse
failure, so we don't see this when a DT node is present but doesn't have
an interrupt property (this is perfectly legal):

[   21.999000] mwifiex_pcie 0000:01:00.0: fail to parse irq_wakeup from device tree

Fixes: 853402a00823 ("mwifiex: Enable WoWLAN for both sdio and pcie")
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
This is a 4.10 regression. Not sure if it's critical to push quickly, or if it
should just be tagged -stable and pushed in 4.11.

 drivers/net/wireless/marvell/mwifiex/main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index e5c3a8aa3929..c246d8efb6fc 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -1569,13 +1569,13 @@ static void mwifiex_probe_of(struct mwifiex_adapter *adapter)
 	struct device *dev = adapter->dev;
 
 	if (!dev->of_node)
-		return;
+		goto err_exit;
 
 	adapter->dt_node = dev->of_node;
 	adapter->irq_wakeup = irq_of_parse_and_map(adapter->dt_node, 0);
 	if (!adapter->irq_wakeup) {
-		dev_info(dev, "fail to parse irq_wakeup from device tree\n");
-		return;
+		dev_dbg(dev, "fail to parse irq_wakeup from device tree\n");
+		goto err_exit;
 	}
 
 	ret = devm_request_irq(dev, adapter->irq_wakeup,
@@ -1595,7 +1595,7 @@ static void mwifiex_probe_of(struct mwifiex_adapter *adapter)
 	return;
 
 err_exit:
-	adapter->irq_wakeup = 0;
+	adapter->irq_wakeup = -1;
 }
 
 /*
-- 
2.11.0.483.g087da7b7c-goog

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

* Re: [PATCH - REGRESSION] mwifiex: don't enable/disable IRQ 0 during suspend/resume
  2017-02-10 21:55 [PATCH - REGRESSION] mwifiex: don't enable/disable IRQ 0 during suspend/resume Brian Norris
@ 2017-02-13 15:30 ` Kalle Valo
  2017-02-13 19:54 ` Rajat Jain
  2017-02-15  9:14 ` [-, " Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2017-02-13 15:30 UTC (permalink / raw)
  To: Brian Norris
  Cc: Amitkumar Karwar, Nishant Sarmukadam, linux-kernel,
	linux-wireless, Rajat Jain

Brian Norris <briannorris@chromium.org> writes:

> If we don't have an out-of-band wakeup IRQ configured through DT (as
> most platforms don't), then we fall out of this function with
> 'irq_wakeup == 0'. Other code (e.g., mwifiex_disable_wake() and
> mwifiex_enable_wake()) treats 'irq_wakeup >= 0' as a valid IRQ, and so
> we end up calling {enable,disable}_irq() on IRQ 0.
>
> That seems bad, so let's not do that.
>
> Same problem as fixed in this patch:
>
> https://patchwork.kernel.org/patch/9531693/
> [PATCH v2 2/3] btmrvl: set irq_bt to -1 when failed to parse it
>
> with the difference that:
> (a) this one is actually a regression and
> (b) this affects both device tree and non-device-tree systems
>
> While fixing the regression, also drop the verbosity on the parse
> failure, so we don't see this when a DT node is present but doesn't have
> an interrupt property (this is perfectly legal):
>
> [   21.999000] mwifiex_pcie 0000:01:00.0: fail to parse irq_wakeup from device tree
>
> Fixes: 853402a00823 ("mwifiex: Enable WoWLAN for both sdio and pcie")
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> ---
> This is a 4.10 regression. Not sure if it's critical to push quickly, or if it
> should just be tagged -stable and pushed in 4.11.

It's really late for 4.10, so I would rather push it to 4.11.

-- 
Kalle Valo

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

* Re: [PATCH - REGRESSION] mwifiex: don't enable/disable IRQ 0 during suspend/resume
  2017-02-10 21:55 [PATCH - REGRESSION] mwifiex: don't enable/disable IRQ 0 during suspend/resume Brian Norris
  2017-02-13 15:30 ` Kalle Valo
@ 2017-02-13 19:54 ` Rajat Jain
  2017-02-15  9:14 ` [-, " Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Rajat Jain @ 2017-02-13 19:54 UTC (permalink / raw)
  To: Brian Norris
  Cc: Amitkumar Karwar, Nishant Sarmukadam, Kalle Valo, linux-kernel,
	linux-wireless

On Fri, Feb 10, 2017 at 1:55 PM, Brian Norris <briannorris@chromium.org> wrote:
> If we don't have an out-of-band wakeup IRQ configured through DT (as
> most platforms don't), then we fall out of this function with
> 'irq_wakeup == 0'. Other code (e.g., mwifiex_disable_wake() and
> mwifiex_enable_wake()) treats 'irq_wakeup >= 0' as a valid IRQ, and so
> we end up calling {enable,disable}_irq() on IRQ 0.
>
> That seems bad, so let's not do that.
>
> Same problem as fixed in this patch:
>
> https://patchwork.kernel.org/patch/9531693/
> [PATCH v2 2/3] btmrvl: set irq_bt to -1 when failed to parse it
>
> with the difference that:
> (a) this one is actually a regression and
> (b) this affects both device tree and non-device-tree systems
>
> While fixing the regression, also drop the verbosity on the parse
> failure, so we don't see this when a DT node is present but doesn't have
> an interrupt property (this is perfectly legal):
>
> [   21.999000] mwifiex_pcie 0000:01:00.0: fail to parse irq_wakeup from device tree
>
> Fixes: 853402a00823 ("mwifiex: Enable WoWLAN for both sdio and pcie")
> Signed-off-by: Brian Norris <briannorris@chromium.org>

Acked-by: Rajat Jain <rajatja@google.com>

> ---
> This is a 4.10 regression. Not sure if it's critical to push quickly, or if it
> should just be tagged -stable and pushed in 4.11.
>
>  drivers/net/wireless/marvell/mwifiex/main.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
> index e5c3a8aa3929..c246d8efb6fc 100644
> --- a/drivers/net/wireless/marvell/mwifiex/main.c
> +++ b/drivers/net/wireless/marvell/mwifiex/main.c
> @@ -1569,13 +1569,13 @@ static void mwifiex_probe_of(struct mwifiex_adapter *adapter)
>         struct device *dev = adapter->dev;
>
>         if (!dev->of_node)
> -               return;
> +               goto err_exit;
>
>         adapter->dt_node = dev->of_node;
>         adapter->irq_wakeup = irq_of_parse_and_map(adapter->dt_node, 0);
>         if (!adapter->irq_wakeup) {
> -               dev_info(dev, "fail to parse irq_wakeup from device tree\n");
> -               return;
> +               dev_dbg(dev, "fail to parse irq_wakeup from device tree\n");
> +               goto err_exit;
>         }
>
>         ret = devm_request_irq(dev, adapter->irq_wakeup,
> @@ -1595,7 +1595,7 @@ static void mwifiex_probe_of(struct mwifiex_adapter *adapter)
>         return;
>
>  err_exit:
> -       adapter->irq_wakeup = 0;
> +       adapter->irq_wakeup = -1;
>  }
>
>  /*
> --
> 2.11.0.483.g087da7b7c-goog
>

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

* Re: [-, REGRESSION] mwifiex: don't enable/disable IRQ 0 during suspend/resume
  2017-02-10 21:55 [PATCH - REGRESSION] mwifiex: don't enable/disable IRQ 0 during suspend/resume Brian Norris
  2017-02-13 15:30 ` Kalle Valo
  2017-02-13 19:54 ` Rajat Jain
@ 2017-02-15  9:14 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2017-02-15  9:14 UTC (permalink / raw)
  To: Brian Norris
  Cc: Amitkumar Karwar, Nishant Sarmukadam, linux-kernel,
	linux-wireless, Rajat Jain, Brian Norris

Brian Norris <briannorris@chromium.org> wrote:
> If we don't have an out-of-band wakeup IRQ configured through DT (as
> most platforms don't), then we fall out of this function with
> 'irq_wakeup == 0'. Other code (e.g., mwifiex_disable_wake() and
> mwifiex_enable_wake()) treats 'irq_wakeup >= 0' as a valid IRQ, and so
> we end up calling {enable,disable}_irq() on IRQ 0.
> 
> That seems bad, so let's not do that.
> 
> Same problem as fixed in this patch:
> 
> https://patchwork.kernel.org/patch/9531693/
> [PATCH v2 2/3] btmrvl: set irq_bt to -1 when failed to parse it
> 
> with the difference that:
> (a) this one is actually a regression and
> (b) this affects both device tree and non-device-tree systems
> 
> While fixing the regression, also drop the verbosity on the parse
> failure, so we don't see this when a DT node is present but doesn't have
> an interrupt property (this is perfectly legal):
> 
> [   21.999000] mwifiex_pcie 0000:01:00.0: fail to parse irq_wakeup from device tree
> 
> Fixes: 853402a00823 ("mwifiex: Enable WoWLAN for both sdio and pcie")
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> Acked-by: Rajat Jain <rajatja@google.com>

Patch applied to wireless-drivers-next.git, thanks.

2447e2cad752 mwifiex: don't enable/disable IRQ 0 during suspend/resume

-- 
https://patchwork.kernel.org/patch/9567543/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

end of thread, other threads:[~2017-02-15  9:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-10 21:55 [PATCH - REGRESSION] mwifiex: don't enable/disable IRQ 0 during suspend/resume Brian Norris
2017-02-13 15:30 ` Kalle Valo
2017-02-13 19:54 ` Rajat Jain
2017-02-15  9:14 ` [-, " Kalle Valo

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).