[lkml]   [2002]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: spinlocks and polling
On Thu, 2002-09-12 at 08:54, Soos Peter wrote:
> It is working but through spinlocks the interrupt sensible drives doesn't
> works (e.g. ppp interface have 5-80% of packet loss) when the OMNIBOOK_POLL
> value is in the usable range. This is too high price for the volume
> control buttons.
> Does anybody idea to solve this problem?

If its very slow hardware then that might explain your problem. You
would be sitting with interrupts off for a very long time. What really
makes the difference to how you handle it is - if the irq is shared, and
how easy it is to block.

If it is not shared, or can be blocked fast then you end up with code
that basically says

block irq
set work_to_do
kick off a tasklet

and take care in the tasklet to avoid blocking IRQ's during the actual
reads from the chip. You might do something like

if(!test_and_set_bit(0, &chip_do_read))
set_bit(1, &chip_do_read);

and elsewhere where you touch that data or might lock against it do

set_bit(0, &chip_do_read);
/* Above maybe code that waits politely for that.. */
/* Now clean up */
if(test_bit(1, &chip_do_read)) /* Poll deferred */
clear_bit(1, &chip_do_read);
clear_bit(0, &chip_do_read);
clear_bit(0, &chip_do_read);

or use xchg, or atomic_t counters

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:28    [W:0.025 / U:1.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site