Re: [Linuxwacom-devel] [PATCH] HID: wacom: Exclude battery reporting for Intuos4 WL

2012-02-05 Thread Chris Bagwell
On Sun, Feb 5, 2012 at 1:15 PM, Przemo Firszt  wrote:
> Dnia 2012-02-04, sob o godzinie 10:52 -0600, Chris Bagwell pisze:
>> I've been monitoring battery topics lately (no pun intended :-) )
>> because I'm adding adding similar logic to wacom_wac for wireless.  I
>> know that the function power_supply_powers() that is in stack trace is
>> brand new (not in official kernel) and associates a power supply to a
>> specific device (nice so GUI's don't think our wacom's are powering
>> our machines).
>>
>> So I would suspect that feature first.  Can you try deleting the two
>> calls to that function and see if crash goes away?
> Hi Chris,
> Yes, it does :-)
>>
>> I peeked in jikos's hid tree and the function looks like it registers
>> a sysfs directory called "powers".  I suspect its meant to be under
>> the "wacom_battery" directory and thus the call needs to be moved
>> *after* registering the battery device.
>>
>> This looks needed even for graphire's to work.
>
> Works!
> Looks like there were 2 issues: a wrong (battery->ac) call & calls in
> wrong place.
>
> Patch is on the way. Let me know if I can I add your signed-by to the
> patch.
>
> Thanks!

Glad to hear its working.  Yes, you can add my sign off if you like.

Chris

--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] HID: wacom: Exclude battery reporting for Intuos4 WL

2012-02-05 Thread Przemo Firszt
Dnia 2012-02-04, sob o godzinie 10:52 -0600, Chris Bagwell pisze:
> I've been monitoring battery topics lately (no pun intended :-) )
> because I'm adding adding similar logic to wacom_wac for wireless.  I
> know that the function power_supply_powers() that is in stack trace is
> brand new (not in official kernel) and associates a power supply to a
> specific device (nice so GUI's don't think our wacom's are powering
> our machines).
> 
> So I would suspect that feature first.  Can you try deleting the two
> calls to that function and see if crash goes away?
Hi Chris,
Yes, it does :-) 
> 
> I peeked in jikos's hid tree and the function looks like it registers
> a sysfs directory called "powers".  I suspect its meant to be under
> the "wacom_battery" directory and thus the call needs to be moved
> *after* registering the battery device.
> 
> This looks needed even for graphire's to work.

Works!
Looks like there were 2 issues: a wrong (battery->ac) call & calls in
wrong place.

Patch is on the way. Let me know if I can I add your signed-by to the
patch.

Thanks!
-- 
Regards,
Przemo Firszt


--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] HID: wacom: Exclude battery reporting for Intuos4 WL

2012-02-05 Thread Chris Bagwell
On Sun, Feb 5, 2012 at 8:08 AM, Przemo Firszt  wrote:
> Dnia 2012-02-04, sob o godzinie 10:52 -0600, Chris Bagwell pisze:
> Chris,
> irst of all - thanks for your comments!
>> I've been monitoring battery topics lately (no pun intended :-) )
>> because I'm adding adding similar logic to wacom_wac for wireless.  I
>> know that the function power_supply_powers() that is in stack trace is
>> brand new (not in official kernel) and associates a power supply to a
>> specific device (nice so GUI's don't think our wacom's are powering
>> our machines).
>
> It is in the mainline now [1]
>
>> So I would suspect that feature first.  Can you try deleting the two
>> calls to that function and see if crash goes away?
>
> I'm trying to figure out if theat's correct that Jeremy added twice the
> same call: power_supply_powers(&wdata->battery, &hdev->dev); instead of:
>        power_supply_powers(&wdata->battery, &hdev->dev);
>  and
>        power_supply_powers(&wdata->ac, &hdev->dev);
> It might be the reason - compiling now...

Yeah, that could be issue as well.  If I recall correctly, registering
the same sysfs file name or directory twice will cause crashes like
this.

Since that topic came up, I thought I'd bring up a related item.  I
notice that hid-wacom is installing "wacom_battery" and "wacom_ac".
hid-wiimote is only other example input I could find with battery and
its registering "wiimote_battery".

Since bluetooth is designs to support concurrent devices, I would
think this could lead to crashes in the off case that user has
multiple tablets.  Although 2 Wacom's may not be typical, I would
think 2 wiimotes would be.

We might should be putting a # on ends of those names like most other areas do.

Chris

>
>> I peeked in jikos's hid tree and the function looks like it registers
>> a sysfs directory called "powers".  I suspect its meant to be under
>> the "wacom_battery" directory and thus the call needs to be moved
>> *after* registering the battery device.
>
> I'll test that as well.
>
>> This looks needed even for graphire's to work.
>
> Anyone with Graphire to test it?
>
> [1] http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%
> 2Flinux.git&a=search&h=HEAD&st=grep&s=power_supply_powers
>

--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] HID: wacom: Exclude battery reporting for Intuos4 WL

2012-02-05 Thread Przemo Firszt
Dnia 2012-02-04, sob o godzinie 10:52 -0600, Chris Bagwell pisze:
Chris, 
irst of all - thanks for your comments!
> I've been monitoring battery topics lately (no pun intended :-) )
> because I'm adding adding similar logic to wacom_wac for wireless.  I
> know that the function power_supply_powers() that is in stack trace is
> brand new (not in official kernel) and associates a power supply to a
> specific device (nice so GUI's don't think our wacom's are powering
> our machines).

It is in the mainline now [1]

> So I would suspect that feature first.  Can you try deleting the two
> calls to that function and see if crash goes away?

I'm trying to figure out if theat's correct that Jeremy added twice the
same call: power_supply_powers(&wdata->battery, &hdev->dev); instead of:
power_supply_powers(&wdata->battery, &hdev->dev);
 and
power_supply_powers(&wdata->ac, &hdev->dev);
It might be the reason - compiling now...

> I peeked in jikos's hid tree and the function looks like it registers
> a sysfs directory called "powers".  I suspect its meant to be under
> the "wacom_battery" directory and thus the call needs to be moved
> *after* registering the battery device.

I'll test that as well.

> This looks needed even for graphire's to work.

Anyone with Graphire to test it?

[1] http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%
2Flinux.git&a=search&h=HEAD&st=grep&s=power_supply_powers

-- 
Przemo Firszt 


--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] HID: wacom: Exclude battery reporting for Intuos4 WL

2012-02-04 Thread Chris Bagwell
I've been monitoring battery topics lately (no pun intended :-) )
because I'm adding adding similar logic to wacom_wac for wireless.  I
know that the function power_supply_powers() that is in stack trace is
brand new (not in official kernel) and associates a power supply to a
specific device (nice so GUI's don't think our wacom's are powering
our machines).

So I would suspect that feature first.  Can you try deleting the two
calls to that function and see if crash goes away?

I peeked in jikos's hid tree and the function looks like it registers
a sysfs directory called "powers".  I suspect its meant to be under
the "wacom_battery" directory and thus the call needs to be moved
*after* registering the battery device.

This looks needed even for graphire's to work.

Chris

On Sat, Feb 4, 2012 at 6:33 AM, Przemo Firszt  wrote:
> Some words of explanation: when I was submitting the original patch for
> Intuos4 WL (78761ff9bc4e944e0b4e5df1e7eedcfdbb1a9a1a) there were no
> problems with connection, battery values were incorrect, but it was a
> minor issue. When the patch reached the mainline kernel it became
> unusable (crash report below). I tried to bisect the problem, but I
> failed.  The problem might be related to the attempt
> to send a packet to the tablet while the link is not yet established.
> I don't feel confident enough with kernel locks to suggest a solution
> yet, but I'm working on it.
> Currently I just switched off the sysfs code for I4WL in the driver. My
> only concern is that I don't have access to Graphire Bluetooth and there
> is a chance that the tablet might be affected as well..
>
> regards,
> Przemo
>
> Crash report (also here: http://pastebin.com/ZVNZWaPs) :
>
>> Feb  1 21:47:58 pldmachine kernel: [   89.535952] Bluetooth: HIDP (Human 
>> Interface Emulation) ver 1.2
>> Feb  1 21:49:51 pldmachine kernel: [  202.347235] wacom 0005:056A:00BD.0001: 
>> unknown main item tag 0x0
>> Feb  1 21:49:51 pldmachine kernel: [  202.347999] input: PTK-540WL as 
>> /devices/pci:00/:00:1d.0/usb2/2-2/2-2:1.0/blue
>> tooth/hci0/hci0:1/input8
>> Feb  1 21:49:51 pldmachine kernel: [  202.348201] wacom 0005:056A:00BD.0001: 
>> input,hidraw0: BLUETOOTH HID v1.06 Mouse [PTK-5
>> 40WL] on 00:11:67:D6:1D:BF
>> Feb  1 21:49:51 pldmachine kernel: [  202.416811] BUG: unable to handle 
>> kernel NULL pointer dereference at 0020
>> Feb  1 21:49:51 pldmachine kernel: [  202.416888] IP: [] 
>> sysfs_do_create_link+0x24/0x1c0
>> Feb  1 21:49:51 pldmachine kernel: [  202.416945] *pde = 
>> Feb  1 21:49:51 pldmachine kernel: [  202.416973] Oops:  [#1]
>> Feb  1 21:49:51 pldmachine kernel: [  202.417002] Modules linked in: 
>> hid_wacom(+) hidp binfmt_misc rfcomm bnep cn i915 drm_k
>> ms_helper drm i2c_algo_bit cfbfillrect cfbcopyarea cfbimgblt rtl8192cu 
>> rtl8192c_common rtlwifi mac80211 ipw2200 libipw cfg80
>> 211 snd_intel8x0 snd_ac97_codec ac97_bus btusb bluetooth pcmcia snd_pcm 
>> snd_timer snd rfkill intel_agp sdhci_pci intel_gtt v
>> ideo yenta_socket tpm_infineon sdhci lib80211 soundcore evdev pcspkr 
>> snd_page_alloc psmouse pcmcia_rsrc pcmcia_core backligh
>> t mmc_core agpgart tg3 sg ohci_hcd uhci_hcd ehci_hcd usbhid usbcore 
>> usb_common hid ata_piix libata sd_mod crc_t10dif scsi_mod ext4 crc16 mbcache 
>> jbd2 jbd [last unloaded: scsi_wait_scan]
>> Feb  1 21:49:51 pldmachine kernel: [  202.417660]
>> Feb  1 21:49:51 pldmachine kernel: [  202.417676] Pid: 3759, comm: modprobe 
>> Not tainted 3.3.0-rc1-2-1-g326ff11 #18 Hewlett-Packard HP Compaq nc4200 
>> (PV983AW#ABU)  /0938
>> Feb  1 21:49:51 pldmachine kernel: [  202.417781] EIP: 0060:[] 
>> EFLAGS: 00010202 CPU: 0
>> Feb  1 21:49:51 pldmachine kernel: [  202.417826] EIP is at 
>> sysfs_do_create_link+0x24/0x1c0
>> Feb  1 21:49:51 pldmachine kernel: [  202.417866] EAX: 0008 EBX: 
>> 0246 ECX: c1484021 EDX: e7624c68
>> Feb  1 21:49:51 pldmachine kernel: [  202.417914] ESI: c1484021 EDI: 
>> ef36bf00 EBP: ef307db8 ESP: ef307d80
>> Feb  1 21:49:51 pldmachine kernel: [  202.417962]  DS: 007b ES: 007b FS: 
>>  GS: 00e0 SS: 0068
>> Feb  1 21:49:51 pldmachine kernel: [  202.418005] Process modprobe (pid: 
>> 3759, ti=ef306000 task=e7560380 task.ti=ef306000)
>> Feb  1 21:49:51 pldmachine kernel: [  202.418066] Stack:
>> Feb  1 21:49:51 pldmachine kernel: [  202.418084]  0002 0001 
>> ef307d90 c1383f88 ef307dcc f81037fa  e7624c68
>> Feb  1 21:49:51 pldmachine kernel: [  202.418170]  e7693aa0 e7560380 
>> e7693abc 0246 e7624000 ef36bf00 ef307dc4 c1142d62
>> Feb  1 21:49:51 pldmachine kernel: [  202.418255]  0001 ef307dcc 
>> c1289ed6 ef307df8 f812f5c0 0002 ef307df8 f8130028
>> Feb  1 21:49:51 pldmachine kernel: [  202.418341] Call Trace:
>> Feb  1 21:49:51 pldmachine kernel: [  202.418366]  [] ? 
>> mutex_unlock+0x8/0x10
>> Feb  1 21:49:51 pldmachine kernel: [  202.418406]  [] ? 
>> hidp_output_raw_report+0x15a/0x1c0 [hidp]
>> Feb  1 21:49:51 pldmachine kernel: [  202.418457]  [] 
>> sysfs_crea

Re: [Linuxwacom-devel] [PATCH] HID: wacom: Exclude battery reporting for Intuos4 WL

2012-02-04 Thread Przemo Firszt
Some words of explanation: when I was submitting the original patch for
Intuos4 WL (78761ff9bc4e944e0b4e5df1e7eedcfdbb1a9a1a) there were no
problems with connection, battery values were incorrect, but it was a
minor issue. When the patch reached the mainline kernel it became
unusable (crash report below). I tried to bisect the problem, but I
failed.  The problem might be related to the attempt
to send a packet to the tablet while the link is not yet established. 
I don't feel confident enough with kernel locks to suggest a solution
yet, but I'm working on it.
Currently I just switched off the sysfs code for I4WL in the driver. My
only concern is that I don't have access to Graphire Bluetooth and there
is a chance that the tablet might be affected as well..

regards,
Przemo 

Crash report (also here: http://pastebin.com/ZVNZWaPs) :

> Feb  1 21:47:58 pldmachine kernel: [   89.535952] Bluetooth: HIDP (Human 
> Interface Emulation) ver 1.2
> Feb  1 21:49:51 pldmachine kernel: [  202.347235] wacom 0005:056A:00BD.0001: 
> unknown main item tag 0x0
> Feb  1 21:49:51 pldmachine kernel: [  202.347999] input: PTK-540WL as 
> /devices/pci:00/:00:1d.0/usb2/2-2/2-2:1.0/blue
> tooth/hci0/hci0:1/input8
> Feb  1 21:49:51 pldmachine kernel: [  202.348201] wacom 0005:056A:00BD.0001: 
> input,hidraw0: BLUETOOTH HID v1.06 Mouse [PTK-5
> 40WL] on 00:11:67:D6:1D:BF
> Feb  1 21:49:51 pldmachine kernel: [  202.416811] BUG: unable to handle 
> kernel NULL pointer dereference at 0020
> Feb  1 21:49:51 pldmachine kernel: [  202.416888] IP: [] 
> sysfs_do_create_link+0x24/0x1c0
> Feb  1 21:49:51 pldmachine kernel: [  202.416945] *pde =  
> Feb  1 21:49:51 pldmachine kernel: [  202.416973] Oops:  [#1] 
> Feb  1 21:49:51 pldmachine kernel: [  202.417002] Modules linked in: 
> hid_wacom(+) hidp binfmt_misc rfcomm bnep cn i915 drm_k
> ms_helper drm i2c_algo_bit cfbfillrect cfbcopyarea cfbimgblt rtl8192cu 
> rtl8192c_common rtlwifi mac80211 ipw2200 libipw cfg80
> 211 snd_intel8x0 snd_ac97_codec ac97_bus btusb bluetooth pcmcia snd_pcm 
> snd_timer snd rfkill intel_agp sdhci_pci intel_gtt v
> ideo yenta_socket tpm_infineon sdhci lib80211 soundcore evdev pcspkr 
> snd_page_alloc psmouse pcmcia_rsrc pcmcia_core backligh
> t mmc_core agpgart tg3 sg ohci_hcd uhci_hcd ehci_hcd usbhid usbcore 
> usb_common hid ata_piix libata sd_mod crc_t10dif scsi_mod ext4 crc16 mbcache 
> jbd2 jbd [last unloaded: scsi_wait_scan]
> Feb  1 21:49:51 pldmachine kernel: [  202.417660] 
> Feb  1 21:49:51 pldmachine kernel: [  202.417676] Pid: 3759, comm: modprobe 
> Not tainted 3.3.0-rc1-2-1-g326ff11 #18 Hewlett-Packard HP Compaq nc4200 
> (PV983AW#ABU)  /0938
> Feb  1 21:49:51 pldmachine kernel: [  202.417781] EIP: 0060:[] 
> EFLAGS: 00010202 CPU: 0
> Feb  1 21:49:51 pldmachine kernel: [  202.417826] EIP is at 
> sysfs_do_create_link+0x24/0x1c0
> Feb  1 21:49:51 pldmachine kernel: [  202.417866] EAX: 0008 EBX: 0246 
> ECX: c1484021 EDX: e7624c68
> Feb  1 21:49:51 pldmachine kernel: [  202.417914] ESI: c1484021 EDI: ef36bf00 
> EBP: ef307db8 ESP: ef307d80
> Feb  1 21:49:51 pldmachine kernel: [  202.417962]  DS: 007b ES: 007b FS:  
> GS: 00e0 SS: 0068
> Feb  1 21:49:51 pldmachine kernel: [  202.418005] Process modprobe (pid: 
> 3759, ti=ef306000 task=e7560380 task.ti=ef306000)
> Feb  1 21:49:51 pldmachine kernel: [  202.418066] Stack:
> Feb  1 21:49:51 pldmachine kernel: [  202.418084]  0002 0001 ef307d90 
> c1383f88 ef307dcc f81037fa  e7624c68
> Feb  1 21:49:51 pldmachine kernel: [  202.418170]  e7693aa0 e7560380 e7693abc 
> 0246 e7624000 ef36bf00 ef307dc4 c1142d62
> Feb  1 21:49:51 pldmachine kernel: [  202.418255]  0001 ef307dcc c1289ed6 
> ef307df8 f812f5c0 0002 ef307df8 f8130028
> Feb  1 21:49:51 pldmachine kernel: [  202.418341] Call Trace:
> Feb  1 21:49:51 pldmachine kernel: [  202.418366]  [] ? 
> mutex_unlock+0x8/0x10
> Feb  1 21:49:51 pldmachine kernel: [  202.418406]  [] ? 
> hidp_output_raw_report+0x15a/0x1c0 [hidp]
> Feb  1 21:49:51 pldmachine kernel: [  202.418457]  [] 
> sysfs_create_link+0x12/0x20
> Feb  1 21:49:51 pldmachine kernel: [  202.418498]  [] 
> power_supply_powers+0x16/0x20
> Feb  1 21:49:51 pldmachine kernel: [  202.418541]  [] 
> wacom_probe+0x180/0x2c0 [hid_wacom]
> Feb  1 21:49:51 pldmachine kernel: [  202.418592]  [] 
> hid_device_probe+0x8e/0x110 [hid]
> Feb  1 21:49:51 pldmachine kernel: [  202.418639]  [] 
> driver_probe_device+0x61/0x170
> Feb  1 21:49:51 pldmachine kernel: [  202.418683]  [] 
> __driver_attach+0x89/0x90
> 
> Feb  1 21:49:51 pldmachine kernel: [  202.418722]  [] ? 
> driver_probe_device+0x170/0x170
> Feb  1 21:49:51 pldmachine kernel: [  202.418766]  [] 
> bus_for_each_dev+0x38/0x60
> Feb  1 21:49:51 pldmachine kernel: [  202.418809]  [] 
> driver_attach+0x1c/0x20
> Feb  1 21:49:51 pldmachine kernel: [  202.418847]  [] ? 
> driver_probe_device+0x170/0x170
> Feb  1 21:49:51 pldmachine kernel: [  202.418891]  [] 
> bus_add_driver+0x187/0x260
> Feb