Re: 8k interrupts/sec with USB hub

2017-11-15 Thread Billy Araujo
Hi Johan,


Thanks for your answer. That seems a lot like what I am seeing because
I had a USB tracer and it showed many NAKed transactions.


Regards,

Billy.










On Wed, Nov 15, 2017 at 2:45 PM, Johan Hovold <jo...@kernel.org> wrote:
> On Wed, Nov 15, 2017 at 12:12:16PM +0000, Billy Araujo wrote:
>> Hi all,
>>
>> I built a kernel/rootfs for altera SoCkit amd uses the default SoCkit
>> device tree and I plug when in plug in a USB stick it uses the dwc2
>> driver.
>> When doing cat /proc/interrupts I get normal amount of interrupts -
>> everything seems ok.
>>
>> However, when I connect the USB stick to a USB hub and then to the
>> same USB port I get a great amount of interrupts approx. 8000 per
>> second. Anyone know why this different behaviour?
>
>> I have seen several threads with stating this issue but haven't found
>> a clear answer.
>
> This sounds familiar, take a look at:
>
> https://lkml.kernel.org/r/20171030170802.14489-1-diand...@chromium.org
>
> Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: 8k interrupts/sec with USB hub

2017-11-15 Thread Billy Araujo
Hi Greg,

1. What kernel version are you using here?

Sorry about the lack of info. The kernel is: SOCKit: Angstrom v2016.12
- Kernel 4.1.22-ltsi-altera

2. Why is this an "issue"?  Is the device not working properly?

It is an issue because it makes the CPU busier and when I have another
application which needs to run with low latency, these interrupts get
in the way because I think they have higher priority.

I don't know whose fault it is, hardware, driver or kernel, I just was
wondering why it behaves different with the USB hub connected.

Regards,

Billy.





On Wed, Nov 15, 2017 at 1:58 PM, Greg KH <gre...@linuxfoundation.org> wrote:
> On Wed, Nov 15, 2017 at 12:12:16PM +, Billy Araujo wrote:
>> Hi all,
>>
>> I built a kernel/rootfs for altera SoCkit amd uses the default SoCkit
>> device tree and I plug when in plug in a USB stick it uses the dwc2
>> driver.
>
> What kernel version are you using here?
>
>> When doing cat /proc/interrupts I get normal amount of interrupts -
>> everything seems ok.
>>
>> However, when I connect the USB stick to a USB hub and then to the
>> same USB port I get a great amount of interrupts approx. 8000 per
>> second. Anyone know why this different behaviour?
>>
>> root@cyclone5:~# cat /proc/interrupts
>>
>>CPU0
>>
>> 16:  53922   GIC  29 Edge  twd
>>
>> 17:  0   GIC 199 Level timer0
>>
>> 18:  0   GIC 136 Level ffe01000.pdma
>>
>> 26:  0   GIC 190 Level ffc04000.i2c
>>
>> 27:  0   GIC 191 Level ffc05000.i2c
>>
>> 29:  24718   GIC 171 Level dw-mci
>>
>> 40:   1138   GIC 194 Level serial
>>
>> 41:3946968   GIC 160 Level ffb4.usb, ffb4.usb,
>> dwc2_hsotg:usb1
>>
>>
>>
>> root@cyclone5:~# [  651.854021] usb 1-1: new high-speed USB device
>> number 7 using dwc2
>>
>> [  652.065190] usb 1-1: New USB device found, idVendor=05e3, idProduct=0608
>>
>> [  652.071869] usb 1-1: New USB device strings: Mfr=0, Product=1, 
>> SerialNumber=0
>>
>> [  652.079007] usb 1-1: Product: USB2.0 Hub
>>
>> [  652.088468] hub 1-1:1.0: USB hub found
>>
>> [  652.092830] hub 1-1:1.0: 4 ports detected
>>
>> [  652.374026] usb 1-1.1: new high-speed USB device number 8 using dwc2
>>
>> [  652.475473] usb 1-1.1: New USB device found, idVendor=05e3, idProduct=0608
>>
>> [  652.482331] usb 1-1.1: New USB device strings: Mfr=0, Product=1,
>> SerialNumber=0
>>
>> [  652.489639] usb 1-1.1: Product: USB2.0 Hub
>>
>> [  652.499214] hub 1-1.1:1.0: USB hub found
>>
>> [  652.503762] hub 1-1.1:1.0: 4 ports detected
>>
>>
>> I have seen several threads with stating this issue but haven't found
>> a clear answer.
>
> Why is this an "issue"?  Is the device not working properly?  Is the
> device not seen correctly?  USB is a "constantly asking the device for
> data" type of protocol, lots of interrupts is a normal thing.
>
> Heck, we know of some machines where you plug a USB keyboard into them
> and it starts to take 30% of the CPU time up just to handle the
> interrupts.  That's not USB's fault, or the kernels, it's the horrible
> hardware implementation that the board has on it, where it is up to the
> CPU to do most of the work.  Odds are that is what is happening here
> with your platform.
>
> thanks,
>
> greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


8k interrupts/sec with USB hub

2017-11-15 Thread Billy Araujo
Hi all,

I built a kernel/rootfs for altera SoCkit amd uses the default SoCkit
device tree and I plug when in plug in a USB stick it uses the dwc2
driver.
When doing cat /proc/interrupts I get normal amount of interrupts -
everything seems ok.

However, when I connect the USB stick to a USB hub and then to the
same USB port I get a great amount of interrupts approx. 8000 per
second. Anyone know why this different behaviour?

root@cyclone5:~# cat /proc/interrupts

   CPU0

16:  53922   GIC  29 Edge  twd

17:  0   GIC 199 Level timer0

18:  0   GIC 136 Level ffe01000.pdma

26:  0   GIC 190 Level ffc04000.i2c

27:  0   GIC 191 Level ffc05000.i2c

29:  24718   GIC 171 Level dw-mci

40:   1138   GIC 194 Level serial

41:3946968   GIC 160 Level ffb4.usb, ffb4.usb,
dwc2_hsotg:usb1



root@cyclone5:~# [  651.854021] usb 1-1: new high-speed USB device
number 7 using dwc2

[  652.065190] usb 1-1: New USB device found, idVendor=05e3, idProduct=0608

[  652.071869] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0

[  652.079007] usb 1-1: Product: USB2.0 Hub

[  652.088468] hub 1-1:1.0: USB hub found

[  652.092830] hub 1-1:1.0: 4 ports detected

[  652.374026] usb 1-1.1: new high-speed USB device number 8 using dwc2

[  652.475473] usb 1-1.1: New USB device found, idVendor=05e3, idProduct=0608

[  652.482331] usb 1-1.1: New USB device strings: Mfr=0, Product=1,
SerialNumber=0

[  652.489639] usb 1-1.1: Product: USB2.0 Hub

[  652.499214] hub 1-1.1:1.0: USB hub found

[  652.503762] hub 1-1.1:1.0: 4 ports detected


I have seen several threads with stating this issue but haven't found
a clear answer.


Regards,

Billy.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html