Am 07.10.2010 11:13, Gilles Chanteperdrix wrote:
> Jan Kiszka wrote:
>> Am 04.10.2010 22:13, Edward Hoffman wrote:
>>> I am attempting to port the Broadcom tg3 NetXtreme linux driver to
>>> rtnet.
>>
>> Your port will be welcome!
>>
>>> The Broadcom driver internally utilizes
>>> spin_lock_bh/spin_unlock_bh to disable/enable software interrupts.
>>> There is no rtdm lock equivalent.
>>> I believe that software interrupts are used by the driver for the
>>> following reasons:
>>> 1. To allow for simultaneous DMA read write operations
>>> 2. To use shared local variables in a critical section of the driver.
>>> 3. To receive changes to settings variables in realtime from the
>>> userpace Nextreme utilities. (not sure about this one).
>>>
>>> What RTDM lock functions should I use to substitute for
>>> spin_lock_bh/spin_unlock_bh? Should I substitute
>>> rtdm_lock_get_irqsave/rtdm_lock_put_irqrestore? Or does rtdm need to ne
>>> extended for softirqs used internally by the driver?
>>>
>>> I looked through the other device drivers and could not detect the
>>> correct substitute.
>>
>> As RTDM provides no abstraction of bottom-halves, there are also no
>> specific locking services to disable them. You have to use IRQ-disabling
>> services unless you are in IRQ context.
>
> Maybe if you want to only exclude the driver's irq, you may only disable
> the irq line at IC level, with rtdm_irq_disable?
Usually discouraged due to potentially slow line-disabling services and
the breakage this will cause when the line is shared.
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
|