Re: sysfs: wait for GPIO interrupt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 13, 2014 at 1:45 AM, Javier Martinez Canillas
<javier@xxxxxxxxxxxx> wrote:
> Hello Yegor,
> On Thu, May 8, 2014 at 10:19 AM, Yegor Yefremov
> <yegorslists@xxxxxxxxxxxxxx> wrote:
>> I've stumbled upon following issue. When waiting for interrupt with
>> poll() like described in this example [1], the program returns from
>> poll() immediately. This thread [2] describes a workaround for this
>> issue via making read() before invoking poll().
>>
>> My system is am335x, kernel 3.15-rc4
>>
>> I experience this behavior by both SoC's own GPIO and i2c expander tca6416.
>>
>
> I tested with an OMAP3 board which uses the same GPIO driver than the
> am335x and I was able to reproduce your issue.

At times like this I always want to warn you for using the GPIO sysfs
interface which is a scary piece of code.

And also to know what you are doing in userspace. Just hammering
GPIOs is already a bad idea, reading *interrupts* from GPIOs in
userspace is an even worse idea.

The basic rule is that the kernel shall handle hardware, and I just
get the feeling you are doing some userspace driver that should be
in the kernel instead.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux