[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c384c5ea0911180828x7c857189w3316c93bb78100ab@mail.gmail.com>
Date: Wed, 18 Nov 2009 17:28:53 +0100
From: Leon Woestenberg <leon.woestenberg@...il.com>
To: Alan Cox <alan@...rguk.ukuu.org.uk>
Cc: Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Thomas Gleixner <tglx@...utronix.de>,
Jean Delvare <khali@...ux-fr.org>,
Sven-Thorsten Dietrich <sven@...bigcorporation.com>,
linux-i2c@...r.kernel.org,
rt-users <linux-rt-users@...r.kernel.org>,
"Ben Dooks (embedded platforms)" <ben-linux@...ff.org>,
Peter Zijlstra <peterz@...radead.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: yield() in i2c non-happy paths hits BUG under -rt patch
Hello,
On Wed, Nov 18, 2009 at 2:05 AM, Alan Cox <alan@...rguk.ukuu.org.uk> wrote:
>> I think the yield()s in the device driver code means "I need a small
>> delay before the hardware is ready" which might translate to some
>> arbitrary "let me msleep()" or "do not select this task in the next
>> scheduler run, EVEN IF this task is highest priority".
>
> Yield() in a driver is almost always a bug.
>
I know and that's exactly why I started this thread (and of course,
because I ran into the bug on my system).
> Our timers are very efficient and some day we will need to make jiffies a
> function and stop the timer ticking for best performance. At that point
> timers are probably the most efficient way to do much of this.
>
The problem with I2C bitbanged is the stringent timing, we need a way
to have fine-grained sleeping
mixed with real-time tasks in order to make this work.
As Thomas already said, the hardware is broken (in the sense that I2C
should really rely on hardware timers, i.e. an I2C host controller).
However, much of the cheaper/older/... embedded hardware is broken.
Given that I2C devices are relatively easy on the timing, we need
the least-dirty way that is not buggy in the kernel.
> Be that as it may, yield() in a driver is almost always the wrong thing
> to do.
>
Yes. What is your idea on removing those without breaking
functionality? Fine-graining sleep()ing?
Regards,
--
Leon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists