Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is not USB interrupt-driven?

Tags:

usb

hardware

What's the rationale behind making USB a polling mechanism rather than interrupt-driven? The answers I can come up with some reasoning are:

  • Leave control of processing efficiency and granularity to OS, rather than the device itself.
  • Prevent "interrupt storms" by faulty devices.

Some explanations on the net that I found say that it's mostly because of the nature of USB devices. They are mostly microcontroller-based systems which cannot queue larger transfers therefore require short interrupt intervals and such short interrupt intervals may not be the most efficient. Is that true?

Could there be other reasons?

like image 828
Sedat Kapanoglu Avatar asked Aug 16 '11 10:08

Sedat Kapanoglu


People also ask

What is USB interrupt?

A USB device can support interrupt endpoints so that it can send or receive data at regular intervals. To accomplish that, the host polls the device at regular intervals and data is transmitted each time the host polls the device. Interrupt transfers are mostly used for getting interrupt data from the device.

Why does USB use polling?

Polling of devices on the USB bus is required in order to guarantee consistent and timely servicing of all connected devices. Event-driven schemes (e.g. using interrupts) require more-complex adaptive work-arounds to avoid starvation of low-priority or low-activity devices.

Do keyboards use polling or interrupts?

The bus uses USB Periodic Transactions called "Interrupt Pipe" to get keyboard data, which is formally a form of polling. Show activity on this post. Built-in keyboards use the method corresponding to the interface they use and that interface is usually either PS/2 or USB.


1 Answers

The overarching premise of the development of USB was, "cheap chips". This was done, through the use of polling, which reduces the need for a higher arbitration protocol.

Firewire, which did allow for interrupts from the devices and even DMA, was much more expensive. So USB won in the low-cost field, and firewire in low-latency/low-overhead/... field. Due to history USB more or less won.

like image 72
Christopher Avatar answered Oct 21 '22 17:10

Christopher