lkml.org 
[lkml]   [2010]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    Subject[PATCH RFC 0/3] Implement refcounting for OF GPIO chips
    Hi all,

    OF GPIO infrastructure is using dynamic GPIO bases, so it is possible
    that of_get_gpio()'s returned GPIO number will be no longer valid, or
    worse, it may point to an unexpected GPIO controller.

    This scenario is possible:

    driver A: driver B: driver C:
    --------- --------- ---------
    gpiochip_add()
    gpio = of_get_gpio()
    gpiochip_remove()
    gpiochip_add()
    gpio_request(gpio);
    gpio_set_value(gpio);

    That is, driver A assumes that it is working with GPIO from driver B,
    but in practice it may disappear and driver C will take its GPIO base
    number, so it will provide the same GPIO numbers.

    The above situation is hard to trigger, but the issue is there
    nonetheless, and so needs fixing.

    Thanks,

    p.s. The patches are based on top of
    '[PATCH v2 0/4] OF GPIO integration for I2C/SPI GPIO chips'
    http://lkml.org/lkml/2010/2/5/243

    --
    Anton Vorontsov
    email: cbouatmailru@gmail.com
    irc://irc.freenode.net/bd2


    \
     
     \ /
      Last update: 2010-02-05 21:53    [W:0.039 / U:61.160 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site