05 Feb, 2013

1 commit

  • Exporting gpios over sysfs GPIO interface throws genirq
    error messages, i.e. on an mpc5121 based board exporting
    GPIO 5 triggers it:

    # echo 229 > /sys/class/gpio/export
    genirq: Setting trigger mode 0 for irq 44 failed
    (mpc512x_irq_set_type+0x0/0x18c)

    Similar error messages appear in the kernel boot log since the
    board specifies GPIOs for matrix keypad and also SD Card write
    protect and card detect GPIOs in its device tree. For all these
    GPIOs there is an error message in the log.

    The issue is triggered by setting the irq type to IRQ_TYPE_NONE
    in the driver's irq_domain map function mpc8xxx_gpio_irq_map().

    ...
    mpc8xxx_gpio_irq_map
    irq_set_irq_type
    __irq_set_trigger

    __irq_set_trigger() calls irq_set_type() callback of the mpc8xxx gpio
    irq chip with the IRQ_TYPE_NONE in its 'flags' argument. This callback
    is either mpc8xxx_irq_set_type() or mpc512x_irq_set_type(). Both these
    functions return -EINVAL in the case if IRQ_TYPE_NONE is passed in the
    flow_type argument. This return value triggers the observed error
    message in __irq_set_trigger(). Modifying these callbacks to not
    return an error in IRQ_TYPE_NONE case doesn't make any sense to me.
    The line setting IRQ_TYPE_NONE type has been originally added by
    commit 345e5c8a "powerpc: Add interrupt support to mpc8xxx_gpio".
    At this time set_irq_type() checked its type argument and returned 0
    if the type argument didn't specify any meaningful type in its type
    sense bits (and thus was equal to IRQ_TYPE_NONE). Effectively this
    line was a nop and I wonder what was the point of adding it.

    Remove IRQ_TYPE_NONE setting in the irq_domain mapping function.

    Signed-off-by: Anatolij Gustschin
    Acked-by: Peter Korsgaard
    Signed-off-by: Linus Walleij

    Anatolij Gustschin
     

11 Sep, 2012

1 commit

  • This prepares *of_device_id.data becoming const. Without this change
    the following warning would occur:

    drivers/gpio/gpio-mpc8xxx.c: In function 'mpc8xxx_add_controller':
    drivers/gpio/gpio-mpc8xxx.c:360:30: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

    Acked-by: Linus Walleij
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Uwe Kleine-König

    Uwe Kleine-König
     

19 May, 2012

1 commit

  • commit cfadd838(powerpc/8xxx: Fix interrupt handling in MPC8xxx GPIO
    driver) added an unconditional call of chip->irq_eoi() to the demux
    handler.

    This leads to a NULL pointer derefernce on MPC512x platforms which use
    this driver as well.

    Make it conditional.

    Reported-by: Thomas Wucher
    Signed-off-by: Thomas Gleixner
    Cc: Felix Radensky
    Cc: Kumar Gala
    Cc: Grant Likely
    Cc: stable@vger.kernel.org
    Signed-off-by: Grant Likely

    Thomas Gleixner
     

16 Feb, 2012

2 commits

  • This patch converts a number of the powerpc drivers to use the common library
    of irq_domain xlate functions, dropping a bunch of lines in the process.

    v5: - Remove tsi108 changes from patch

    Signed-off-by: Grant Likely
    Cc: Rob Herring
    Cc: Benjamin Herrenschmidt
    Cc: Thomas Gleixner
    Cc: Milton Miller
    Tested-by: Olof Johansson

    Grant Likely
     
  • Each revmap type has different arguments for setting up the revmap.
    This patch splits up the generator functions so that each revmap type
    can do its own setup and the user doesn't need to keep track of how
    each revmap type handles the arguments.

    This patch also adds a host_data argument to the generators. There are
    cases where the host_data pointer will be needed before the function returns.
    ie. the legacy map calls the .map callback for each irq before returning.

    v2: - Add void *host_data argument to irq_domain_add_*() functions
    - fixed failure to compile
    - Moved IRQ_DOMAIN_MAP_* defines into irqdomain.c

    Signed-off-by: Grant Likely
    Cc: Rob Herring
    Cc: Benjamin Herrenschmidt
    Cc: Thomas Gleixner
    Cc: Milton Miller
    Tested-by: Olof Johansson

    Grant Likely
     

15 Feb, 2012

1 commit

  • This patch drops the powerpc-specific irq_host structures and uses the common
    irq_domain strucutres defined in linux/irqdomain.h. It also fixes all
    the users to use the new structure names.

    Renaming irq_host to irq_domain has been discussed for a long time, and this
    patch is a step in the process of generalizing the powerpc virq code to be
    usable by all architecture.

    An astute reader will notice that this patch actually removes the irq_host
    structure instead of renaming it. This is because the irq_domain structure
    already exists in include/linux/irqdomain.h and has the needed data members.

    Signed-off-by: Grant Likely
    Cc: Benjamin Herrenschmidt
    Cc: Thomas Gleixner
    Cc: Milton Miller
    Tested-by: Olof Johansson

    Grant Likely
     

14 Dec, 2011

1 commit


04 Nov, 2011

2 commits


23 Sep, 2011

1 commit

  • Move the driver to the place where it is expected to be nowadays. Also
    rename its CONFIG-name to match the rest and adapt the defconfigs.
    Finally, move selection of REQUIRE_GPIOLIB or WANTS_OPTIONAL_GPIOLIB to
    the platforms, because this option is per-platform and not per-driver.

    Signed-off-by: Wolfram Sang
    Cc: Anatolij Gustschin
    Cc: Grant Likely
    Cc: Benjamin Herrenschmidt
    Acked-by: Grant Likely
    Signed-off-by: Anatolij Gustschin

    Wolfram Sang