* [PATCH] mwifiex: propagate error if IRQ request fails in mwifiex_sdio_of()
@ 2016-08-18 14:17 Javier Martinez Canillas
2016-08-18 19:14 ` Arend van Spriel
2016-09-03 10:35 ` Kalle Valo
0 siblings, 2 replies; 9+ messages in thread
From: Javier Martinez Canillas @ 2016-08-18 14:17 UTC (permalink / raw)
To: linux-kernel
Cc: Javier Martinez Canillas, Amitkumar Karwar, Kalle Valo, netdev,
linux-wireless, Nishant Sarmukadam
If request_irq() fails in mwifiex_sdio_probe_of(), only an error message
is printed but the actual error is not propagated to the caller function.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---
drivers/net/wireless/marvell/mwifiex/sdio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
index d3e1561ca075..00727936ad6e 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -125,6 +125,7 @@ static int mwifiex_sdio_probe_of(struct device *dev, struct sdio_mmc_card *card)
dev_err(dev,
"Failed to request irq_wifi %d (%d)\n",
cfg->irq_wifi, ret);
+ return ret;
}
disable_irq(cfg->irq_wifi);
}
--
2.5.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] mwifiex: propagate error if IRQ request fails in mwifiex_sdio_of()
2016-08-18 14:17 [PATCH] mwifiex: propagate error if IRQ request fails in mwifiex_sdio_of() Javier Martinez Canillas
@ 2016-08-18 19:14 ` Arend van Spriel
2016-08-18 19:29 ` Javier Martinez Canillas
2016-09-03 10:35 ` Kalle Valo
1 sibling, 1 reply; 9+ messages in thread
From: Arend van Spriel @ 2016-08-18 19:14 UTC (permalink / raw)
To: Javier Martinez Canillas, linux-kernel
Cc: Amitkumar Karwar, Kalle Valo, netdev, linux-wireless,
Nishant Sarmukadam
On 18-08-16 16:17, Javier Martinez Canillas wrote:
> If request_irq() fails in mwifiex_sdio_probe_of(), only an error message
> is printed but the actual error is not propagated to the caller function.
Hmm. The caller function, ie. mwifiex_sdio_probe(), does not seem to care.
The device may still function without this wake interrupt.
Regards,
Arend
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
> ---
>
> drivers/net/wireless/marvell/mwifiex/sdio.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
> index d3e1561ca075..00727936ad6e 100644
> --- a/drivers/net/wireless/marvell/mwifiex/sdio.c
> +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
> @@ -125,6 +125,7 @@ static int mwifiex_sdio_probe_of(struct device *dev, struct sdio_mmc_card *card)
> dev_err(dev,
> "Failed to request irq_wifi %d (%d)\n",
> cfg->irq_wifi, ret);
> + return ret;
> }
> disable_irq(cfg->irq_wifi);
> }
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] mwifiex: propagate error if IRQ request fails in mwifiex_sdio_of()
2016-08-18 19:14 ` Arend van Spriel
@ 2016-08-18 19:29 ` Javier Martinez Canillas
2016-08-18 19:49 ` Arend van Spriel
0 siblings, 1 reply; 9+ messages in thread
From: Javier Martinez Canillas @ 2016-08-18 19:29 UTC (permalink / raw)
To: Arend van Spriel, linux-kernel
Cc: Amitkumar Karwar, Kalle Valo, netdev, linux-wireless,
Nishant Sarmukadam
Hello Arend,
Thanks a lot for your feedback.
On 08/18/2016 03:14 PM, Arend van Spriel wrote:
> On 18-08-16 16:17, Javier Martinez Canillas wrote:
>> If request_irq() fails in mwifiex_sdio_probe_of(), only an error message
>> is printed but the actual error is not propagated to the caller function.
>
> Hmm. The caller function, ie. mwifiex_sdio_probe(), does not seem to care.
>
Hmm, I'm not so sure about that. It's checking the wifiex_sdio_probe_of()
return value.
If the IRQ request failing is not an error, then at the very least the call
to disable_irq() should be avoided if request_irq() fails, and the message
should be changed from dev_err() to dev_dgb() or dev_info().
> The device may still function without this wake interrupt.
>
That's correct, the binding says that the "interrupts" property in the child
node is optional since is just a wakeup IRQ. Now the question is if should
be an error if the IRQ is defined but fails to be requested.
> Regards,
> Arend
>
Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] mwifiex: propagate error if IRQ request fails in mwifiex_sdio_of()
2016-08-18 19:29 ` Javier Martinez Canillas
@ 2016-08-18 19:49 ` Arend van Spriel
2016-08-18 20:23 ` Javier Martinez Canillas
0 siblings, 1 reply; 9+ messages in thread
From: Arend van Spriel @ 2016-08-18 19:49 UTC (permalink / raw)
To: Javier Martinez Canillas, linux-kernel
Cc: Amitkumar Karwar, Kalle Valo, netdev, linux-wireless,
Nishant Sarmukadam
On 18-08-16 21:29, Javier Martinez Canillas wrote:
> Hello Arend,
>
> Thanks a lot for your feedback.
>
> On 08/18/2016 03:14 PM, Arend van Spriel wrote:
>> On 18-08-16 16:17, Javier Martinez Canillas wrote:
>>> If request_irq() fails in mwifiex_sdio_probe_of(), only an error message
>>> is printed but the actual error is not propagated to the caller function.
>>
>> Hmm. The caller function, ie. mwifiex_sdio_probe(), does not seem to care.
>>
>
> Hmm, I'm not so sure about that. It's checking the wifiex_sdio_probe_of()
> return value.
Ok. I looked at 4.7 sources on lxr [1].
> If the IRQ request failing is not an error, then at the very least the call
> to disable_irq() should be avoided if request_irq() fails, and the message
> should be changed from dev_err() to dev_dgb() or dev_info().
agree.
>> The device may still function without this wake interrupt.
>>
>
> That's correct, the binding says that the "interrupts" property in the child
> node is optional since is just a wakeup IRQ. Now the question is if should
> be an error if the IRQ is defined but fails to be requested.
Clearly it indicates an error in the DT specification so behavior is not
as expected. Personally I would indeed consider it an error, but I was
just indicating that it might have done like this intentionally.
Regards,
Arend
[1]
http://lxr.free-electrons.com/source/drivers/net/wireless/marvell/mwifiex/sdio.c#L192
>> Regards,
>> Arend
>>
>
> Best regards,
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] mwifiex: propagate error if IRQ request fails in mwifiex_sdio_of()
2016-08-18 19:49 ` Arend van Spriel
@ 2016-08-18 20:23 ` Javier Martinez Canillas
0 siblings, 0 replies; 9+ messages in thread
From: Javier Martinez Canillas @ 2016-08-18 20:23 UTC (permalink / raw)
To: Arend van Spriel, linux-kernel
Cc: Amitkumar Karwar, Kalle Valo, netdev, linux-wireless,
Nishant Sarmukadam
Hello Arend,
On 08/18/2016 03:49 PM, Arend van Spriel wrote:
>
>
> On 18-08-16 21:29, Javier Martinez Canillas wrote:
>> Hello Arend,
>>
>> Thanks a lot for your feedback.
>>
>> On 08/18/2016 03:14 PM, Arend van Spriel wrote:
>>> On 18-08-16 16:17, Javier Martinez Canillas wrote:
>>>> If request_irq() fails in mwifiex_sdio_probe_of(), only an error message
>>>> is printed but the actual error is not propagated to the caller function.
>>>
>>> Hmm. The caller function, ie. mwifiex_sdio_probe(), does not seem to care.
>>>
>>
>> Hmm, I'm not so sure about that. It's checking the wifiex_sdio_probe_of()
>> return value.
>
> Ok. I looked at 4.7 sources on lxr [1].
>
Oh, right. That was fixed quite recently indeed.
>> If the IRQ request failing is not an error, then at the very least the call
>> to disable_irq() should be avoided if request_irq() fails, and the message
>> should be changed from dev_err() to dev_dgb() or dev_info().
>
> agree.
>
>>> The device may still function without this wake interrupt.
>>>
>>
>> That's correct, the binding says that the "interrupts" property in the child
>> node is optional since is just a wakeup IRQ. Now the question is if should
>> be an error if the IRQ is defined but fails to be requested.
>
> Clearly it indicates an error in the DT specification so behavior is not
> as expected. Personally I would indeed consider it an error, but I was
> just indicating that it might have done like this intentionally.
>
Yes, might had been done intentionally indeed but I don't think that is
the case since the driver lacked error checking and propagation in many
places. But if someone thinks that's better to not honor the DT and at
least have the driver working without the wake up capability, then I'm
happy to respin the patch and change the print log level to info/debug.
> Regards,
> Arend
>
Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: mwifiex: propagate error if IRQ request fails in mwifiex_sdio_of()
2016-08-18 14:17 [PATCH] mwifiex: propagate error if IRQ request fails in mwifiex_sdio_of() Javier Martinez Canillas
2016-08-18 19:14 ` Arend van Spriel
@ 2016-09-03 10:35 ` Kalle Valo
1 sibling, 0 replies; 9+ messages in thread
From: Kalle Valo @ 2016-09-03 10:35 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: linux-kernel, Javier Martinez Canillas, Amitkumar Karwar, netdev,
linux-wireless, Nishant Sarmukadam
Javier Martinez Canillas <javier@osg.samsung.com> wrote:
> If request_irq() fails in mwifiex_sdio_probe_of(), only an error message
> is printed but the actual error is not propagated to the caller function.
>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
What's the conclusion with this patch? Should I drop it or take it?
(The discussion is available from the patchwork link in the signature.)
--
Sent by pwcli
https://patchwork.kernel.org/patch/9288169/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: mwifiex: propagate error if IRQ request fails in mwifiex_sdio_of()
[not found] <20160903103520.8C69C6201B@smtp.codeaurora.org>
@ 2016-09-06 12:12 ` Javier Martinez Canillas
2016-09-08 15:55 ` Amitkumar Karwar
0 siblings, 1 reply; 9+ messages in thread
From: Javier Martinez Canillas @ 2016-09-06 12:12 UTC (permalink / raw)
To: Kalle Valo
Cc: linux-kernel, Amitkumar Karwar, netdev, linux-wireless,
Nishant Sarmukadam, Arend van Spriel
Hello Kalle,
On 09/03/2016 12:35 PM, Kalle Valo wrote:
> Javier Martinez Canillas <javier@osg.samsung.com> wrote:
>> If request_irq() fails in mwifiex_sdio_probe_of(), only an error message
>> is printed but the actual error is not propagated to the caller function.
>>
>> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
>
> What's the conclusion with this patch? Should I drop it or take it?
>
> (The discussion is available from the patchwork link in the signature.)
>
My understanding is that Arend agrees with the patch and that the question
raised was caused by looking at an older kernel version. IOW, the patch is
OK and should be picked.
I'm adding Arend to cc, so can comment in case I misunderstood him though.
Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: mwifiex: propagate error if IRQ request fails in mwifiex_sdio_of()
2016-09-06 12:12 ` Javier Martinez Canillas
@ 2016-09-08 15:55 ` Amitkumar Karwar
2016-09-08 15:57 ` Javier Martinez Canillas
0 siblings, 1 reply; 9+ messages in thread
From: Amitkumar Karwar @ 2016-09-08 15:55 UTC (permalink / raw)
To: Javier Martinez Canillas, Kalle Valo
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-wireless@vger.kernel.org, Nishant Sarmukadam,
Arend van Spriel
SGkgSmF2aWVyLA0KDQo+IEZyb206IEphdmllciBNYXJ0aW5leiBDYW5pbGxhcyBbbWFpbHRvOmph
dmllckBvc2cuc2Ftc3VuZy5jb21dDQo+IFNlbnQ6IFR1ZXNkYXksIFNlcHRlbWJlciAwNiwgMjAx
NiA1OjQzIFBNDQo+IFRvOiBLYWxsZSBWYWxvDQo+IENjOiBsaW51eC1rZXJuZWxAdmdlci5rZXJu
ZWwub3JnOyBBbWl0a3VtYXIgS2Fyd2FyOw0KPiBuZXRkZXZAdmdlci5rZXJuZWwub3JnOyBsaW51
eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmc7IE5pc2hhbnQNCj4gU2FybXVrYWRhbTsgQXJlbmQg
dmFuIFNwcmllbA0KPiBTdWJqZWN0OiBSZTogbXdpZmlleDogcHJvcGFnYXRlIGVycm9yIGlmIElS
USByZXF1ZXN0IGZhaWxzIGluDQo+IG13aWZpZXhfc2Rpb19vZigpDQo+IA0KPiBIZWxsbyBLYWxs
ZSwNCj4gDQo+IE9uIDA5LzAzLzIwMTYgMTI6MzUgUE0sIEthbGxlIFZhbG8gd3JvdGU6DQo+ID4g
SmF2aWVyIE1hcnRpbmV6IENhbmlsbGFzIDxqYXZpZXJAb3NnLnNhbXN1bmcuY29tPiB3cm90ZToN
Cj4gPj4gSWYgcmVxdWVzdF9pcnEoKSBmYWlscy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kZWQgc3RhdGUgd29uJ3Qgd29yay4NCkkgdGhpbmssIHdlIGNhbiBtYWtlIGJlbG93IGNoYW5n
ZS4gDQoNCi0tLS0tLS0tLS0tLS0tLS0tLQ0KQEAgLTEyMiw5ICsxMjIsMTEgQEAgc3RhdGljIGlu
dCBtd2lmaWV4X3NkaW9fcHJvYmVfb2Yoc3RydWN0IGRldmljZSAqZGV2LCBzdHJ1Y3Qgc2Rpb19t
bWNfY2FyZCAqY2FyZCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgSVJRRl9UUklHR0VSX0xPVywNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIndpZmlfd2FrZSIsIGNmZyk7DQogICAgICAgICAgIGlmIChyZXQpIHsN
Ci0gICAgICAgICAgICAgICAgICAgIGRldl9lcnIoZGV2LA0KKyAgICAgICAgICAgICAgICAgICAg
ZGV2X2RiZyhkZXYsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICJGYWlsZWQgdG8gcmVx
dWVzdCBpcnFfd2lmaSAlZCAoJWQpXG4iLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBj
ZmctPmlycV93aWZpLCByZXQpOw0KKyAgICAgICAgICAgICAgICAgICAgY2FyZC0+cGx0X3dha2Vf
Y2ZnID0gTlVMTDsNCisgICAgICAgICAgICAgICAgICAgIHJldHVybiAwOw0KICAgICAgICAgICAg
IH0NCiAgICAgICAgICAgICAgICBkaXNhYmxlX2lycShjZmctPmlycV93aWZpKTsNCiAgICAgICAg
ICAgIH0NCi0tLS0tLS0tLS0tLS0tLS0tDQoNClJlZ2FyZHMsDQpBbWl0a3VtYXINCg==
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: mwifiex: propagate error if IRQ request fails in mwifiex_sdio_of()
2016-09-08 15:55 ` Amitkumar Karwar
@ 2016-09-08 15:57 ` Javier Martinez Canillas
0 siblings, 0 replies; 9+ messages in thread
From: Javier Martinez Canillas @ 2016-09-08 15:57 UTC (permalink / raw)
To: Amitkumar Karwar, Kalle Valo
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-wireless@vger.kernel.org, Nishant Sarmukadam,
Arend van Spriel
Hello Amitkumar,
On 09/08/2016 11:55 AM, Amitkumar Karwar wrote:
> Hi Javier,
>
>> From: Javier Martinez Canillas [mailto:javier@osg.samsung.com]
>> Sent: Tuesday, September 06, 2016 5:43 PM
>> To: Kalle Valo
>> Cc: linux-kernel@vger.kernel.org; Amitkumar Karwar;
>> netdev@vger.kernel.org; linux-wireless@vger.kernel.org; Nishant
>> Sarmukadam; Arend van Spriel
>> Subject: Re: mwifiex: propagate error if IRQ request fails in
>> mwifiex_sdio_of()
>>
>> Hello Kalle,
>>
>> On 09/03/2016 12:35 PM, Kalle Valo wrote:
>>> Javier Martinez Canillas <javier@osg.samsung.com> wrote:
>>>> If request_irq() fails in mwifiex_sdio_probe_of(), only an error
>>>> message is printed but the actual error is not propagated to the
>> caller function.
>>>>
>>>> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
>>>
>>> What's the conclusion with this patch? Should I drop it or take it?
>>>
>>> (The discussion is available from the patchwork link in the
>>> signature.)
>>>
>>
>> My understanding is that Arend agrees with the patch and that the
>> question raised was caused by looking at an older kernel version. IOW,
>> the patch is OK and should be picked.
>>
>> I'm adding Arend to cc, so can comment in case I misunderstood him
>> though.
>>
>
> This error doesn't affect actual wifi functionality. Only thing is wakeup on interrupt when system is in suspended state won't work.
> I think, we can make below change.
>
> ------------------
> @@ -122,9 +122,11 @@ static int mwifiex_sdio_probe_of(struct device *dev, struct sdio_mmc_card *card)
> IRQF_TRIGGER_LOW,
> "wifi_wake", cfg);
> if (ret) {
> - dev_err(dev,
> + dev_dbg(dev,
> "Failed to request irq_wifi %d (%d)\n",
> cfg->irq_wifi, ret);
> + card->plt_wake_cfg = NULL;
> + return 0;
> }
I'm OK with that change. Feel free too add my Reviewed-by if you post it.
> disable_irq(cfg->irq_wifi);
> }
> -----------------
>
> Regards,
> Amitkumar
>
Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-09-08 15:57 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-18 14:17 [PATCH] mwifiex: propagate error if IRQ request fails in mwifiex_sdio_of() Javier Martinez Canillas
2016-08-18 19:14 ` Arend van Spriel
2016-08-18 19:29 ` Javier Martinez Canillas
2016-08-18 19:49 ` Arend van Spriel
2016-08-18 20:23 ` Javier Martinez Canillas
2016-09-03 10:35 ` Kalle Valo
[not found] <20160903103520.8C69C6201B@smtp.codeaurora.org>
2016-09-06 12:12 ` Javier Martinez Canillas
2016-09-08 15:55 ` Amitkumar Karwar
2016-09-08 15:57 ` Javier Martinez Canillas
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).