diff mbox

hp-wmi: fix wifi cannot be hard-unblock

Message ID 1465818240-11994-1-git-send-email-alex.hung@canonical.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Alex Hung June 13, 2016, 11:44 a.m. UTC
Several users reported wifi cannot be unblocked as discussed in [1].
This patch removes the useof 2009 flag by BIOS but uses the actual WMI
function calls - it will be skipped if WMI reports unsupported

[1] https://bugzilla.kernel.org/show_bug.cgi?id=69131

Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 drivers/platform/x86/hp-wmi.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Evgenii Shatokhin June 28, 2016, 11:32 a.m. UTC | #1
On 13.06.2016 14:44, Alex Hung wrote:
> Several users reported wifi cannot be unblocked as discussed in [1].
> This patch removes the useof 2009 flag by BIOS but uses the actual WMI
> function calls - it will be skipped if WMI reports unsupported
>
> [1] https://bugzilla.kernel.org/show_bug.cgi?id=69131
>
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>   drivers/platform/x86/hp-wmi.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
> index 6f145f2..96ffda4 100644
> --- a/drivers/platform/x86/hp-wmi.c
> +++ b/drivers/platform/x86/hp-wmi.c
> @@ -718,6 +718,11 @@ static int __init hp_wmi_rfkill_setup(struct platform_device *device)
>   	if (err)
>   		return err;
>
> +	err = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, &wireless,
> +				   sizeof(wireless), 0);
> +	if (err)
> +		return err;
> +
>   	if (wireless & 0x1) {
>   		wifi_rfkill = rfkill_alloc("hp-wifi", &device->dev,
>   					   RFKILL_TYPE_WLAN,
> @@ -882,7 +887,7 @@ static int __init hp_wmi_bios_setup(struct platform_device *device)
>   	wwan_rfkill = NULL;
>   	rfkill2_count = 0;
>
> -	if (hp_wmi_bios_2009_later() || hp_wmi_rfkill_setup(device))
> +	if (hp_wmi_rfkill_setup(device))
>   		hp_wmi_rfkill2_setup(device);
>
>   	err = device_create_file(&device->dev, &dev_attr_display);
>

I checked this patch with kernels 4.1.19 - 4.1.25 on HP EliteBook 6930p 
where the problem was spotted earlier. The patch does fix the problem 
for me.

Tested-by: Evgenii Shatokhin <eugene.shatokhin@yandex.ru>

Regards,
Evgenii

--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Darren Hart June 28, 2016, 4:04 p.m. UTC | #2
On Tue, Jun 28, 2016 at 02:32:23PM +0300, Evgenii Shatokhin wrote:
> On 13.06.2016 14:44, Alex Hung wrote:
> > Several users reported wifi cannot be unblocked as discussed in [1].
> > This patch removes the useof 2009 flag by BIOS but uses the actual WMI
> > function calls - it will be skipped if WMI reports unsupported
> > 
> > [1] https://bugzilla.kernel.org/show_bug.cgi?id=69131
> > 
> > Signed-off-by: Alex Hung <alex.hung@canonical.com>

Thank you Alex, and thanks Evgenii for the testing. Queued to testing for 4.8,
tagged for stable.
diff mbox

Patch

diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index 6f145f2..96ffda4 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -718,6 +718,11 @@  static int __init hp_wmi_rfkill_setup(struct platform_device *device)
 	if (err)
 		return err;
 
+	err = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, &wireless,
+				   sizeof(wireless), 0);
+	if (err)
+		return err;
+
 	if (wireless & 0x1) {
 		wifi_rfkill = rfkill_alloc("hp-wifi", &device->dev,
 					   RFKILL_TYPE_WLAN,
@@ -882,7 +887,7 @@  static int __init hp_wmi_bios_setup(struct platform_device *device)
 	wwan_rfkill = NULL;
 	rfkill2_count = 0;
 
-	if (hp_wmi_bios_2009_later() || hp_wmi_rfkill_setup(device))
+	if (hp_wmi_rfkill_setup(device))
 		hp_wmi_rfkill2_setup(device);
 
 	err = device_create_file(&device->dev, &dev_attr_display);