* [PATCH] ath3k: add warning when switch pid is not working
@ 2018-09-07 23:35 Luiz Carlos Ramos
2018-09-27 10:48 ` Marcel Holtmann
0 siblings, 1 reply; 3+ messages in thread
From: Luiz Carlos Ramos @ 2018-09-07 23:35 UTC (permalink / raw)
To: Marcel Holtmann, Johan Hedberg; +Cc: linux-bluetooth
This patch adds a warning message in the ath3k driver when
ath3k_switch_pid() returns error.
This event happens in a specific laptop, with an adapter which
identifies itself as 0cf3:0036. Surprisingly, the adapter works even
after this event - hence a warning is chosen instead of an error.
The current version of ath3k doesn't check the return value of
ath3k_switch_pid() and so this event may remain undetected in the
original version.
Signed-off-by: Luiz Carlos Ramos <lramos.prof@yahoo.com.br>
---
drivers/bluetooth/ath3k.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index 3d7a5c149af3..3a8c47efea55 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -546,7 +546,10 @@ static int ath3k_probe(struct usb_interface *intf,
BT_ERR("Set normal mode failed");
return ret;
}
- ath3k_switch_pid(udev);
+ ret = ath3k_switch_pid(udev);
+ if (ret < 0)
+ BT_WARN("Warning: switch pid failed (ret=%d)", ret);
+
return 0;
}
--
2.14.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ath3k: add warning when switch pid is not working
2018-09-07 23:35 [PATCH] ath3k: add warning when switch pid is not working Luiz Carlos Ramos
@ 2018-09-27 10:48 ` Marcel Holtmann
2018-09-27 16:15 ` Luiz Carlos Ramos
0 siblings, 1 reply; 3+ messages in thread
From: Marcel Holtmann @ 2018-09-27 10:48 UTC (permalink / raw)
To: Luiz Carlos Ramos; +Cc: Johan Hedberg, linux-bluetooth
Hi Luiz,
> This patch adds a warning message in the ath3k driver when
> ath3k_switch_pid() returns error.
>
> This event happens in a specific laptop, with an adapter which
> identifies itself as 0cf3:0036. Surprisingly, the adapter works even
> after this event - hence a warning is chosen instead of an error.
>
> The current version of ath3k doesn't check the return value of
> ath3k_switch_pid() and so this event may remain undetected in the
> original version.
if works anyway, why bother with a warning? I have no idea what benefit this has.
Regards
Marcel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ath3k: add warning when switch pid is not working
2018-09-27 10:48 ` Marcel Holtmann
@ 2018-09-27 16:15 ` Luiz Carlos Ramos
0 siblings, 0 replies; 3+ messages in thread
From: Luiz Carlos Ramos @ 2018-09-27 16:15 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: Johan Hedberg, linux-bluetooth
Hi, Marcel,
On Thu, Sep 27, 2018 at 12:48:17PM +0200, Marcel Holtmann wrote:
> Hi Luiz,
>
> > This patch adds a warning message in the ath3k driver when
> > ath3k_switch_pid() returns error.
> >
> > This event happens in a specific laptop, with an adapter which
> > identifies itself as 0cf3:0036. Surprisingly, the adapter works even
> > after this event - hence a warning is chosen instead of an error.
> >
> > The current version of ath3k doesn't check the return value of
> > ath3k_switch_pid() and so this event may remain undetected in the
> > original version.
>
> if works anyway, why bother with a warning? I have no idea what benefit this has.
>
I analyze this issue as having three possible cases:
(1) the function works, and so, no problems, no warnings;
(2) (my case) the function fails but the system works as it should do;
in this case I would agree with you, but
(3) the function fails and this affects the whole system (let's say, the
VID:PID doesn't change as intended); in this case there's a problem and
the admin should be in a better position if one can be watched by this
warning.
Based on the code, there's no way to diferentiate (2) and (3), so IMHO a
warning would be justified.
Best regards,
Luiz
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-09-27 16:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-07 23:35 [PATCH] ath3k: add warning when switch pid is not working Luiz Carlos Ramos
2018-09-27 10:48 ` Marcel Holtmann
2018-09-27 16:15 ` Luiz Carlos Ramos
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).