Re: WMI driver no longer load after switching to generic UUID library

2016-05-30 Thread Kui Zhang
Thanks guys.

keyboard functions are working now.


kui.z

On Mon, May 30, 2016 at 7:40 AM, Andy Shevchenko
 wrote:
> On Mon, 2016-05-30 at 12:52 +0200, Bjørn Mork wrote:
>> How about the untested attached patch?
>>
>
> Facepalm.jpg!
>
> Good catch!
>
> The question is how it passed in our internal tree without being
> notified (it even included a lot of ACPI code updated)!?
>
> My explanation since I have no access to archive of internal mailing
> list is that I submitted 'cleaned up' version which brought that and
> wasn't tested.
>
> Anyway I just wrote a test module and is about to submit it with your
> fix in a series.
>
> Thanks!
>
>>
>> Bjørn
>>
>
> --
> Andy Shevchenko 
> Intel Finland Oy


Re: WMI driver no longer load after switching to generic UUID library

2016-05-30 Thread Kui Zhang
Thanks guys.

keyboard functions are working now.


kui.z

On Mon, May 30, 2016 at 7:40 AM, Andy Shevchenko
 wrote:
> On Mon, 2016-05-30 at 12:52 +0200, Bjørn Mork wrote:
>> How about the untested attached patch?
>>
>
> Facepalm.jpg!
>
> Good catch!
>
> The question is how it passed in our internal tree without being
> notified (it even included a lot of ACPI code updated)!?
>
> My explanation since I have no access to archive of internal mailing
> list is that I submitted 'cleaned up' version which brought that and
> wasn't tested.
>
> Anyway I just wrote a test module and is about to submit it with your
> fix in a series.
>
> Thanks!
>
>>
>> Bjørn
>>
>
> --
> Andy Shevchenko 
> Intel Finland Oy


Re: WMI driver no longer load after switching to generic UUID library

2016-05-30 Thread Andy Shevchenko
On Mon, 2016-05-30 at 12:52 +0200, Bjørn Mork wrote:
> How about the untested attached patch?
> 

Facepalm.jpg!

Good catch!

The question is how it passed in our internal tree without being
notified (it even included a lot of ACPI code updated)!?

My explanation since I have no access to archive of internal mailing
list is that I submitted 'cleaned up' version which brought that and
wasn't tested. 

Anyway I just wrote a test module and is about to submit it with your
fix in a series.

Thanks!

> 
> Bjørn
> 

-- 
Andy Shevchenko 
Intel Finland Oy


Re: WMI driver no longer load after switching to generic UUID library

2016-05-30 Thread Andy Shevchenko
On Mon, 2016-05-30 at 12:52 +0200, Bjørn Mork wrote:
> How about the untested attached patch?
> 

Facepalm.jpg!

Good catch!

The question is how it passed in our internal tree without being
notified (it even included a lot of ACPI code updated)!?

My explanation since I have no access to archive of internal mailing
list is that I submitted 'cleaned up' version which brought that and
wasn't tested. 

Anyway I just wrote a test module and is about to submit it with your
fix in a series.

Thanks!

> 
> Bjørn
> 

-- 
Andy Shevchenko 
Intel Finland Oy


Re: WMI driver no longer load after switching to generic UUID library

2016-05-30 Thread Bjørn Mork
How about the untested attached patch?


Bjørn

>From d1682d6c0a558cf8ffb82af959156f99f0f1f61a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= 
Date: Mon, 30 May 2016 12:44:05 +0200
Subject: [PATCH] lib/uuid.c: use correct offset in uuid parser
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Use '+ 0' and '+ 1' as offsets, like they were intended, instead
of adding to the result.

Fixes: 2b1b0d66704a ("lib/uuid.c: introduce a few more generic helpers")
Signed-off-by: Bjørn Mork 
---
 lib/uuid.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/uuid.c b/lib/uuid.c
index e116ae5fa00f..37687af77ff8 100644
--- a/lib/uuid.c
+++ b/lib/uuid.c
@@ -106,8 +106,8 @@ static int __uuid_to_bin(const char *uuid, __u8 b[16], const u8 ei[16])
 		return -EINVAL;
 
 	for (i = 0; i < 16; i++) {
-		int hi = hex_to_bin(uuid[si[i]] + 0);
-		int lo = hex_to_bin(uuid[si[i]] + 1);
+		int hi = hex_to_bin(uuid[si[i] + 0]);
+		int lo = hex_to_bin(uuid[si[i] + 1]);
 
 		b[ei[i]] = (hi << 4) | lo;
 	}
-- 
2.1.4



Re: WMI driver no longer load after switching to generic UUID library

2016-05-30 Thread Bjørn Mork
How about the untested attached patch?


Bjørn

>From d1682d6c0a558cf8ffb82af959156f99f0f1f61a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= 
Date: Mon, 30 May 2016 12:44:05 +0200
Subject: [PATCH] lib/uuid.c: use correct offset in uuid parser
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Use '+ 0' and '+ 1' as offsets, like they were intended, instead
of adding to the result.

Fixes: 2b1b0d66704a ("lib/uuid.c: introduce a few more generic helpers")
Signed-off-by: Bjørn Mork 
---
 lib/uuid.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/uuid.c b/lib/uuid.c
index e116ae5fa00f..37687af77ff8 100644
--- a/lib/uuid.c
+++ b/lib/uuid.c
@@ -106,8 +106,8 @@ static int __uuid_to_bin(const char *uuid, __u8 b[16], const u8 ei[16])
 		return -EINVAL;
 
 	for (i = 0; i < 16; i++) {
-		int hi = hex_to_bin(uuid[si[i]] + 0);
-		int lo = hex_to_bin(uuid[si[i]] + 1);
+		int hi = hex_to_bin(uuid[si[i] + 0]);
+		int lo = hex_to_bin(uuid[si[i] + 1]);
 
 		b[ei[i]] = (hi << 4) | lo;
 	}
-- 
2.1.4



Re: WMI driver no longer load after switching to generic UUID library

2016-05-30 Thread Andy Shevchenko
On Sun, 2016-05-29 at 13:22 -0700, Linus Torvalds wrote:
> Andy?
> 
> Looking at that commit, it does look like what wmi_parse_guid +
> wmi_swap_bytes did was to implement a LE uuid. So the conversion looks
> correct, but the fact that it breaks something obviously means that
> there's something missing. What's going on?

I proposed to add print to the loops to see what's going on there.

> 
> And dammit, how I hate uuid's and the idiotic byte ordering issue.
> It's possibly the only idiotic standard that is even worse than xml.

T'so seems has the same opinion http://www.spinics.net/lists/kernel/msg2
26.html

> 
> Linus
> 
> On Sun, May 29, 2016 at 11:35 AM, Kui Zhang 
> wrote:
> > Hello,
> > 
> > After commit 538d7eb86d58 ("drivers/platform/x86/wmi.c: use generic
> > UUID library")
> > 
> > some keyboard functions stopped working:
> > 
> > clevo-wmi - git://git.code.sf.net/p/clevo-wmi/code
> > [   83.877887] Clevo Get GUID not found
> > 
> > /*
> > #define CLWMI_GET_GUID "ABBC0F6D-8EA1-11d1-00A0-C9062910"
> > 
> > ...
> > if(!wmi_has_guid(CLWMI_GET_GUID)) {
> > pr_err("Clevo Get GUID not found\n");
> > return -ENODEV;
> > }
> > 
> > 
> > */
> > 
> > clevo-xsm-wmi - https://bitbucket.org/lynthium/clevo-xsm-wmi.git
> > insmod: ERROR: could not insert module clevo-xsm-wmi.ko: No such
> > device
> > 
> > /*
> > 
> > #define CLEVO_GET_GUID"ABBC0F6D-8EA1-11D1-00A0-C9062910"
> > 
> > ...
> > 
> > if (!wmi_has_guid(CLEVO_GET_GUID)) {
> > CLEVO_XSM_INFO("No known WMI control method GUID found\n");
> > return -ENODEV;
> > }
> > 
> > */
> > 
> > 
> > thanks
> > Kui.Z

-- 
Andy Shevchenko 
Intel Finland Oy


Re: WMI driver no longer load after switching to generic UUID library

2016-05-30 Thread Andy Shevchenko
On Sun, 2016-05-29 at 13:22 -0700, Linus Torvalds wrote:
> Andy?
> 
> Looking at that commit, it does look like what wmi_parse_guid +
> wmi_swap_bytes did was to implement a LE uuid. So the conversion looks
> correct, but the fact that it breaks something obviously means that
> there's something missing. What's going on?

I proposed to add print to the loops to see what's going on there.

> 
> And dammit, how I hate uuid's and the idiotic byte ordering issue.
> It's possibly the only idiotic standard that is even worse than xml.

T'so seems has the same opinion http://www.spinics.net/lists/kernel/msg2
26.html

> 
> Linus
> 
> On Sun, May 29, 2016 at 11:35 AM, Kui Zhang 
> wrote:
> > Hello,
> > 
> > After commit 538d7eb86d58 ("drivers/platform/x86/wmi.c: use generic
> > UUID library")
> > 
> > some keyboard functions stopped working:
> > 
> > clevo-wmi - git://git.code.sf.net/p/clevo-wmi/code
> > [   83.877887] Clevo Get GUID not found
> > 
> > /*
> > #define CLWMI_GET_GUID "ABBC0F6D-8EA1-11d1-00A0-C9062910"
> > 
> > ...
> > if(!wmi_has_guid(CLWMI_GET_GUID)) {
> > pr_err("Clevo Get GUID not found\n");
> > return -ENODEV;
> > }
> > 
> > 
> > */
> > 
> > clevo-xsm-wmi - https://bitbucket.org/lynthium/clevo-xsm-wmi.git
> > insmod: ERROR: could not insert module clevo-xsm-wmi.ko: No such
> > device
> > 
> > /*
> > 
> > #define CLEVO_GET_GUID"ABBC0F6D-8EA1-11D1-00A0-C9062910"
> > 
> > ...
> > 
> > if (!wmi_has_guid(CLEVO_GET_GUID)) {
> > CLEVO_XSM_INFO("No known WMI control method GUID found\n");
> > return -ENODEV;
> > }
> > 
> > */
> > 
> > 
> > thanks
> > Kui.Z

-- 
Andy Shevchenko 
Intel Finland Oy


Re: WMI driver no longer load after switching to generic UUID library

2016-05-29 Thread Linus Torvalds
Andy?

Looking at that commit, it does look like what wmi_parse_guid +
wmi_swap_bytes did was to implement a LE uuid. So the conversion looks
correct, but the fact that it breaks something obviously means that
there's something missing. What's going on?

And dammit, how I hate uuid's and the idiotic byte ordering issue.
It's possibly the only idiotic standard that is even worse than xml.

Linus

On Sun, May 29, 2016 at 11:35 AM, Kui Zhang  wrote:
> Hello,
>
> After commit 538d7eb86d58 ("drivers/platform/x86/wmi.c: use generic UUID 
> library")
>
> some keyboard functions stopped working:
>
> clevo-wmi - git://git.code.sf.net/p/clevo-wmi/code
> [   83.877887] Clevo Get GUID not found
>
> /*
> #define CLWMI_GET_GUID "ABBC0F6D-8EA1-11d1-00A0-C9062910"
>
> ...
> if(!wmi_has_guid(CLWMI_GET_GUID)) {
> pr_err("Clevo Get GUID not found\n");
> return -ENODEV;
> }
>
>
> */
>
> clevo-xsm-wmi - https://bitbucket.org/lynthium/clevo-xsm-wmi.git
> insmod: ERROR: could not insert module clevo-xsm-wmi.ko: No such device
>
> /*
>
> #define CLEVO_GET_GUID"ABBC0F6D-8EA1-11D1-00A0-C9062910"
>
> ...
>
> if (!wmi_has_guid(CLEVO_GET_GUID)) {
> CLEVO_XSM_INFO("No known WMI control method GUID found\n");
> return -ENODEV;
> }
>
> */
>
>
> thanks
> Kui.Z


Re: WMI driver no longer load after switching to generic UUID library

2016-05-29 Thread Linus Torvalds
Andy?

Looking at that commit, it does look like what wmi_parse_guid +
wmi_swap_bytes did was to implement a LE uuid. So the conversion looks
correct, but the fact that it breaks something obviously means that
there's something missing. What's going on?

And dammit, how I hate uuid's and the idiotic byte ordering issue.
It's possibly the only idiotic standard that is even worse than xml.

Linus

On Sun, May 29, 2016 at 11:35 AM, Kui Zhang  wrote:
> Hello,
>
> After commit 538d7eb86d58 ("drivers/platform/x86/wmi.c: use generic UUID 
> library")
>
> some keyboard functions stopped working:
>
> clevo-wmi - git://git.code.sf.net/p/clevo-wmi/code
> [   83.877887] Clevo Get GUID not found
>
> /*
> #define CLWMI_GET_GUID "ABBC0F6D-8EA1-11d1-00A0-C9062910"
>
> ...
> if(!wmi_has_guid(CLWMI_GET_GUID)) {
> pr_err("Clevo Get GUID not found\n");
> return -ENODEV;
> }
>
>
> */
>
> clevo-xsm-wmi - https://bitbucket.org/lynthium/clevo-xsm-wmi.git
> insmod: ERROR: could not insert module clevo-xsm-wmi.ko: No such device
>
> /*
>
> #define CLEVO_GET_GUID"ABBC0F6D-8EA1-11D1-00A0-C9062910"
>
> ...
>
> if (!wmi_has_guid(CLEVO_GET_GUID)) {
> CLEVO_XSM_INFO("No known WMI control method GUID found\n");
> return -ENODEV;
> }
>
> */
>
>
> thanks
> Kui.Z


Fwd: WMI driver no longer load after switching to generic UUID library

2016-05-29 Thread Kui Zhang
oops, forgot the list.


-- Forwarded message --
From: Kui Zhang <kuizh...@gmail.com>
Date: Sun, May 29, 2016 at 11:35 AM
Subject: WMI driver no longer load after switching to generic UUID library
To: andriy.shevche...@linux.intel.com, dvh...@linux.intel.com,
a...@linux-foundation.org, torva...@linux-foundation.org


Hello,

After this:

commit 538d7eb86d58b3d7d73f3bb3ff960c4bdf411c1a
drivers/platform/x86/wmi.c: use generic UUID library


some keyboard functions stopped working:

clevo-wmi - git://git.code.sf.net/p/clevo-wmi/code
[   83.877887] Clevo Get GUID not found


/*
#define CLWMI_GET_GUID "ABBC0F6D-8EA1-11d1-00A0-C9062910"

...

if(!wmi_has_guid(CLWMI_GET_GUID)) {
pr_err("Clevo Get GUID not found\n");
return -ENODEV;
}


*/



clevo-xsm-wmi - https://bitbucket.org/lynthium/clevo-xsm-wmi.git
insmod: ERROR: could not insert module clevo-xsm-wmi.ko: No such device

/*

#define CLEVO_GET_GUID"ABBC0F6D-8EA1-11D1-00A0-C9062910"

...

if (!wmi_has_guid(CLEVO_GET_GUID)) {
CLEVO_XSM_INFO("No known WMI control method GUID found\n");
return -ENODEV;
}

*/


thanks
Kui.Z


Fwd: WMI driver no longer load after switching to generic UUID library

2016-05-29 Thread Kui Zhang
oops, forgot the list.


-- Forwarded message --
From: Kui Zhang 
Date: Sun, May 29, 2016 at 11:35 AM
Subject: WMI driver no longer load after switching to generic UUID library
To: andriy.shevche...@linux.intel.com, dvh...@linux.intel.com,
a...@linux-foundation.org, torva...@linux-foundation.org


Hello,

After this:

commit 538d7eb86d58b3d7d73f3bb3ff960c4bdf411c1a
drivers/platform/x86/wmi.c: use generic UUID library


some keyboard functions stopped working:

clevo-wmi - git://git.code.sf.net/p/clevo-wmi/code
[   83.877887] Clevo Get GUID not found


/*
#define CLWMI_GET_GUID "ABBC0F6D-8EA1-11d1-00A0-C9062910"

...

if(!wmi_has_guid(CLWMI_GET_GUID)) {
pr_err("Clevo Get GUID not found\n");
return -ENODEV;
}


*/



clevo-xsm-wmi - https://bitbucket.org/lynthium/clevo-xsm-wmi.git
insmod: ERROR: could not insert module clevo-xsm-wmi.ko: No such device

/*

#define CLEVO_GET_GUID"ABBC0F6D-8EA1-11D1-00A0-C9062910"

...

if (!wmi_has_guid(CLEVO_GET_GUID)) {
CLEVO_XSM_INFO("No known WMI control method GUID found\n");
return -ENODEV;
}

*/


thanks
Kui.Z