User avatar
clickykbd
Posts: 117
Joined: Wed Jun 06, 2012 2:21 am
Location: Austin, Texas
Contact: Website

Re: 8000 interrupts per second when idle!

Mon Jul 09, 2012 10:18 am

mpthompson wrote:To others having USB keyboard issues, check to see if it has a built-in low-speed USB hub. If so, look to replace the keyboard with one that doesn't have a USB hub or use a USB/PS2 adapter if you keyboard also has a PS2 plug.
This is probably pretty good advice, as one of my problem keyboards was a variety with a low-speed hub as well. However the other one was not. I also ran into the same problems with the one USB2PS2 adapter I had available to test with, so that workaround did not do me any good.

Which brand of PS2 adapter do you have that seems happy?

User avatar
55020
Posts: 16
Joined: Sun Jun 03, 2012 4:12 pm
Contact: Website

Re: 8000 interrupts per second when idle!

Mon Jul 09, 2012 6:27 pm

I've given SOF reduction a quick whirl. FYI, the bad news is that, at the very moment it's enabled via /proc, the keyboard gets terrible sticky-key disease. And as soon as it's turned off again via /proc, the sticky-key problem goes away. dmesg shows: "usb 1-1.2.6: reset low speed USB device number 6 using dwc_otg" at intervals of from 1 sec to 5 sec for the intervening period. For avoidance of doubt, there is no built-in low speed hub, though as you can see the keyboard is itself a low speed device.

(ObThreadDrift: Also FYI, I've successfully added a patch from mainline -stable that avoids the extended pause when adding swap in 3.1.9. Works like a charm. Commit 07fb30fa5b31)
Slackware ARM on the Raspberry Pi -> http://www.daves-collective.co.uk/raspi/

User avatar
mpthompson
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
Contact: Website

Re: 8000 interrupts per second when idle!

Mon Jul 09, 2012 10:30 pm

clickykbd wrote:
mpthompson wrote:Which brand of PS2 adapter do you have that seems happy?
It's a generic looking no-brand-name unit I picked up a few years ago. Does have a label saying "USB to PS/2 Cable - Model No. UPS-102".

User avatar
clickykbd
Posts: 117
Joined: Wed Jun 06, 2012 2:21 am
Location: Austin, Texas
Contact: Website

Re: 8000 interrupts per second when idle!

Wed Jul 11, 2012 8:36 pm

mpthompson wrote:
clickykbd wrote:
mpthompson wrote:Which brand of PS2 adapter do you have that seems happy?
It's a generic looking no-brand-name unit I picked up a few years ago. Does have a label saying "USB to PS/2 Cable - Model No. UPS-102".
Thanks. These unbranded generics are prolific... maybe a photo? Mine says "MiMicro Innovations" AND DOES NOT WORK RELIABLY, sticky keys and resets.
IMG_3225_small.jpg
MiMicro Innovations USB-to-PS2 (not working well)
IMG_3225_small.jpg (22 KiB) Viewed 5070 times

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12414
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: 8000 interrupts per second when idle!

Wed Jul 11, 2012 10:39 pm

The adapter might be fine, but PS/2 keyboards were never designed to work with 4.4 Volt, as real USB keyboards do, and 4,4 Volt is all the voltage that USB devices on R-Pi USB ports get, due to those infernal polyfuses, wich have internal resistances from 5 to 8 Ohm!
For example at the 100 mA of a typical USB device each ohm resistance of the polyfuse causes a 0.1 Volt power drop, so if your fuse happens to be 6 Ohm, and the current draw through it is 100mA the drop will be 0.6 Volt, leaving only 4.4 Volt change from 5.0 Volt on the input.

PS/2 Keyboards are designed to work with a minimum of 5V + or - 5%, that is a minimum of 4.75V.

chris_c
Posts: 156
Joined: Sun May 06, 2012 10:23 am

Re: 8000 interrupts per second when idle!

Sat Jul 14, 2012 5:17 pm

I did the old tp1 tp2 test and found a disappointing 4.75v which lets face it borderline to say the least!

In hopes that this wasn't helping with the usb resets and causing SOF_reduction not to be usable, I temporary wired my lab supply to p1 pins 2 & 6.

Decent power readings on tp1 & tp2 but alas with sof reduction switched on I was still getting lots of resets on my keyboard.

Pity but there ya go, so while power *might* be a contributing problem its not the whole picture.

now "ALL" I have to do if find a USB power supply that can actually do what it purports to be able to do... *sigh*

Then "ALL" I need to do is find a keyboard that the PI likes better than my little zippy....

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12414
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: 8000 interrupts per second when idle!

Sat Jul 14, 2012 6:31 pm

even with exactly 5V on the PI, the polyfuses on the PI would still extract half a volt from that, which is the reason you shouldn't expect a non for USB designed keyboard to work, which is exactly what you are trying to do.
Simply use a $10 USB keyboard, and all will be fine.

chris_c
Posts: 156
Joined: Sun May 06, 2012 10:23 am

Re: 8000 interrupts per second when idle!

Sun Jul 15, 2012 12:20 am

erm no I'm using a usb keyboard

are you sure the poly fuses are still involved when "injecting" 5v via pin 2 of the gpio (p1) connector?

are they not the other side of the micro usb regulation circuit?

pholy
Posts: 46
Joined: Sun Jun 24, 2012 11:29 pm

Re: 8000 interrupts per second when idle!

Sun Jul 15, 2012 1:55 am

Nope, there are three poly-fuses, the main one between the micro-USB power input and 'everything else', and one each between 'everything else' and each USB port. Pin 1 connects to 'everything else'. So using pins 1 & 2 only bypasses the skinny wires in the USB cord and the poly-fuse - but every little bit helps.

chris_c
Posts: 156
Joined: Sun May 06, 2012 10:23 am

Re: 8000 interrupts per second when idle!

Sun Jul 15, 2012 6:10 am

i'm confused pin 1 is 3v3 and pin 2 is 5v

putting a 5v supply on pin 1 & 2 will probably cause the magic blue smoke, maybe you might like to verify this for me?

I was supplying power via pin 2 and pin 6

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1445
Joined: Sat Sep 10, 2011 11:43 am

Re: 8000 interrupts per second when idle!

Sun Jul 15, 2012 9:06 am

I've been working on a fix for the 8000 interrupts per second for a while now, I've already created one fix which worked fairly well for simple bulk and low requirement interrupt / isochronous devices but it turns out it also breaks multicast and therefore isn't quite good enough...

So I've been working on implementing a FIQ interrupt solution that does some quick checks before subsequently triggering the actual IRQ. Of course there's no way it'll make its way upstream since FIQ's are frowned upon!

Should be done in a couple more days if I've got the time

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

User avatar
Burngate
Posts: 6100
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: 8000 interrupts per second when idle!

Sun Jul 15, 2012 9:46 am

gsh wrote: ... since FIQ's are frowned upon! ...
Really? Since when? and why?
OK I'm an ignoramous, it just seems if we've got 'em we can use 'em.

jerry.tk
Posts: 63
Joined: Sat Apr 07, 2012 6:26 am
Location: CZ
Contact: Website

Re: 8000 interrupts per second when idle!

Sun Jul 15, 2012 11:45 am

gsh wrote:I've been working on a fix for the 8000 interrupts per second for a while now, I've already created one fix which worked fairly well for simple bulk and low requirement interrupt / isochronous devices but it turns out it also breaks multicast and therefore isn't quite good enough...

So I've been working on implementing a FIQ interrupt solution that does some quick checks before subsequently triggering the actual IRQ. Of course there's no way it'll make its way upstream since FIQ's are frowned upon!

Should be done in a couple more days if I've got the time

Gordon
Great news! Thank for all the effort!
It just doesn't feel right to give up 20% CPU for almost nothing.

asb
Forum Moderator
Forum Moderator
Posts: 853
Joined: Fri Sep 16, 2011 7:16 pm
Contact: Website

Re: 8000 interrupts per second when idle!

Sun Jul 15, 2012 12:16 pm

gsh wrote: So I've been working on implementing a FIQ interrupt solution that does some quick checks before subsequently triggering the actual IRQ. Of course there's no way it'll make its way upstream since FIQ's are frowned upon!
Could be OK, Stephen Warren had a look and reckoned a number of other drivers use FIQs. He did recommend we might want to ask on the kernel mailing list. Anyway, if it does give an improvement here it's a well justified use. On top of that the current USB driver isn't likely to make it upstream any time soon anyway :)

pholy
Posts: 46
Joined: Sun Jun 24, 2012 11:29 pm

Re: 8000 interrupts per second when idle!

Sun Jul 15, 2012 12:28 pm

chris_c wrote:i'm confused pin 1 is 3v3 and pin 2 is 5v

putting a 5v supply on pin 1 & 2 will probably cause the magic blue smoke, maybe you might like to verify this for me?

I was supplying power via pin 2 and pin 6
@Chris - You are right. The pins along the edge are 2,4,6,... So I should have said 2 & 6. Ten o'clock isn't usually too late for me - maybe I am getting old.

Phil

User avatar
cheery
Posts: 219
Joined: Wed Jan 25, 2012 9:39 pm

Re: 8000 interrupts per second when idle!

Sun Jul 15, 2012 4:12 pm

USB seems to be just a pain. Funnily enough, I were wondering about this a while before I saw this post, when cyclone explained me how usb works at #raspberrypi-osdev

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12414
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: 8000 interrupts per second when idle!

Mon Jul 16, 2012 2:09 am

chris_c wrote:erm no I'm using a usb keyboard
Okay, I was confusing you with another user that said he was using a PS/2 keyboard.
chris_c wrote:are you sure the poly fuses are still involved when "injecting" 5v via pin 2 of the gpio (p1) connector?
are they not the other side of the micro usb regulation circuit?
Yes they are still involved.
5Volt distribution chain is:

PSU=>micro USB cable => micro USB port => 1.1 A main polyfuse (F3) => main 5V on board, which is to be found between testpins TP1 and TP2 and also beween both pin 2 and 4 (5V) and pins 6, 9, 14, 20 and 25 (GND) of the GPIO header.
From there it goes to the the two 140mA USB polyfuses F1 and F2, and from there to the two USB ports. If you do not draw any current from these ports you will still find the same voltage there as on TP1-TP2, but if you draw any current, the voltage will drop, in many cases with 5.0 Volt input you will find something like 4.6 to 4.4 Volt after the polyfuses, which won't do for USB devices requiring 4.75V, but is enough for some who work with 4.4 Volt.

Note that nowhere it this voltage distribution chain there is any regulation happening but from the main 5V voltage a number of regulators are fed, mainly the 3V3 regulator (RG2) and from that 2V5 and 1V8 regulators (RG1 and RG3), but also the SoC is itself a (switching) regulator that dynamically regulates its core voltage (that is the reason you can "overvolt" the SoC, in software, for over-clocking purposes).
but even the humble (3.3V fed) Ethernet&USB chip (IC2 the LAN9512 chip) has its own built in 1V8 regulator. so there is really a whole bunch of voltage regulation going on, just not for the USB ports.

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1445
Joined: Sat Sep 10, 2011 11:43 am

Re: 8000 interrupts per second when idle!

Sat Jul 21, 2012 9:44 am

So I've finally been able to implement the FIQ -> IRQ processing reducing the interrupts from 8000 to 800 (which is the minimum you need ...)

Will upload a patch soon... (Still needs a little cleaning, got a few global variables to get rid of first!)

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

redelm
Posts: 2
Joined: Tue Jul 24, 2012 3:03 pm

Re: 8000 interrupts per second when idle!

Tue Jul 24, 2012 3:13 pm

I see the same ~8000 ints/sec and believe it is a serious drag on the little Raz (not just eating clocks, but adding interrupt latency and skew). My Sheevaplug is much more responsive -- more than the clock diff.

Looking thru Goggle, I see a 2009 post where someone on PPC tracked the source of these interrupts to not enabling DMA through a #define . I don't have a kernel sourcetree lined up to rebuild one.

bloodline
Posts: 76
Joined: Sun Jun 10, 2012 8:44 pm
Location: London - England

Re: 8000 interrupts per second when idle!

Fri Jul 27, 2012 9:12 am

Great work by gordon here! When are we likely to see this patch in the main kernel image?

reggie
Posts: 151
Joined: Fri Aug 26, 2011 11:51 am

Re: 8000 interrupts per second when idle!

Fri Aug 03, 2012 2:10 am

Just a bump message to see whether gordons patches have made it into the repo/firmware yet?

User avatar
oztrailrider
Posts: 55
Joined: Sat Jan 14, 2012 3:21 am

Re: 8000 interrupts per second when idle!

Fri Aug 03, 2012 3:56 am

reggie wrote:Just a bump message to see whether gordons patches have made it into the repo/firmware yet?
There was this firmware commit back on July 6th which is related: https://github.com/raspberrypi/firmware ... efb5653b09

reggie
Posts: 151
Joined: Fri Aug 26, 2011 11:51 am

Re: 8000 interrupts per second when idle!

Fri Aug 03, 2012 12:02 pm

Not sure if that's the same patch? As it's from 6th July and gordons post on here mentions his fixes on 21st that haven't been pushed yet.

User avatar
oztrailrider
Posts: 55
Joined: Sat Jan 14, 2012 3:21 am

Re: 8000 interrupts per second when idle!

Thu Aug 23, 2012 4:22 am

Any news on how the USB driver is progressing?. I see the latest firmware commit has just updated to the dwc_otg driver to version 3.00 in kernel 3.2.27.

User avatar
Paul Webster
Posts: 812
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
Contact: Twitter

Re: 8000 interrupts per second when idle!

Thu Aug 23, 2012 6:32 am

See the "elephant" thread for more recent discussions on progress.

Return to “Troubleshooting”