Re: Help with a driver im writing.



On Mon, 09 Jan 2006 00:38:42 +0100, Kasper Dupont
<27396270153341488322@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

>Ace wrote:
>>
>> BTW, can I use udelay in a tasklet? My understanding is they must be
>> atomic and cant call anything that sleeps. I need udelay in places as
>> to allow time for the latched data on the hardware to settle.
>
>udelay does busywaiting, so using it for that purpose is going
>to work. It is going to waste CPU cycles, but with some hardware
>that may be unavoidable.
>
>How long delays do you need? There exist some slow I/O macros
>that will do an extra outb to an unused port to get a small
>delay large enough for much hardware to settle.



I got bold and removed the delays and it seem to work so just to be
sure ill use the outb_p version and get rid of udelay


im gunna look at asm/io.h for curiosity

Ace

.



Relevant Pages

  • Re: [PATCH] ia64: disable preemption in udelay()
    ... > The udelay() inline for ia64 uses the ITC. ... > The most simple fix is to disable preemption around the udelay looping. ... > preemption only for "short" delays, and uses the global RTC as the time ... This does make the function a bit big for an "inline" though. ...
    (Linux-Kernel)
  • Re: 2.6.24-rc4-git5: Reported regressions from 2.6.23
    ... since udelay depends on loops_per_jiffy, ... (and it caused driver failures for him.) ... In theory sched-clock ... causes delays between 2 and 2.9 seconds) but it's not depending on frequency ...
    (Linux-Kernel)
  • Re: [PATCH 9/11] Panic delay fix
    ... needed on virtualized hardware with something else. ... Just magically defining udelay into nop is broken. ... for hardware and not needed for virtualization. ... You did not time to do the full audit, ...
    (Linux-Kernel)
  • Re: [PATCH 9/11] Panic delay fix
    ... needed on virtualized hardware with something else. ... Just magically defining udelay into nop is broken. ... We'd have to audit and figure out what udelays are for hardware and ...
    (Linux-Kernel)
  • Re: [PATCH 9/11] Panic delay fix
    ... possessed in the event of a kernel crash, ... But paravirtualized kernels with fake devices have no need to udelay to accommodate slow hardware - the hardware is just virtual. ... There are only a couple cases where it matters - one is booting APs on SMP systems (there is a real delay before they come up), and one is any hardware that drives world interacting devices - such as keyboard LEDs in a panic loop. ...
    (Linux-Kernel)