Patch "gpio: mpc8xxx: Don't overwrite default irq_set_type callback" has been added to the 5.4-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    gpio: mpc8xxx: Don't overwrite default irq_set_type callback

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     gpio-mpc8xxx-don-t-overwrite-default-irq_set_type-ca.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit a8f999eebe81051a62bc2c70ed6290e91c7d5062
Author: Vladimir Oltean <vladimir.oltean@xxxxxxx>
Date:   Fri Nov 15 14:55:51 2019 +0200

    gpio: mpc8xxx: Don't overwrite default irq_set_type callback
    
    [ Upstream commit 4e50573f39229d5e9c985fa3b4923a8b29619ade ]
    
    The per-SoC devtype structures can contain their own callbacks that
    overwrite mpc8xxx_gpio_devtype_default.
    
    The clear intention is that mpc8xxx_irq_set_type is used in case the SoC
    does not specify a more specific callback. But what happens is that if
    the SoC doesn't specify one, its .irq_set_type is de-facto NULL, and
    this overwrites mpc8xxx_irq_set_type to a no-op. This means that the
    following SoCs are affected:
    
    - fsl,mpc8572-gpio
    - fsl,ls1028a-gpio
    - fsl,ls1088a-gpio
    
    On these boards, the irq_set_type does exactly nothing, and the GPIO
    controller keeps its GPICR register in the hardware-default state. On
    the LS1028A, that is ACTIVE_BOTH, which means 2 interrupts are raised
    even if the IRQ client requests LEVEL_HIGH. Another implication is that
    the IRQs are not checked (e.g. level-triggered interrupts are not
    rejected, although they are not supported).
    
    Fixes: 82e39b0d8566 ("gpio: mpc8xxx: handle differences between incarnations at a single place")
    Signed-off-by: Vladimir Oltean <vladimir.oltean@xxxxxxx>
    Link: https://lore.kernel.org/r/20191115125551.31061-1-olteanv@xxxxxxxxx
    Tested-by: Michael Walle <michael@xxxxxxxx>
    Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c
index b863421ae730..a031cbcdf6ef 100644
--- a/drivers/gpio/gpio-mpc8xxx.c
+++ b/drivers/gpio/gpio-mpc8xxx.c
@@ -377,7 +377,8 @@ static int mpc8xxx_probe(struct platform_device *pdev)
 	 * It's assumed that only a single type of gpio controller is available
 	 * on the current machine, so overwriting global data is fine.
 	 */
-	mpc8xxx_irq_chip.irq_set_type = devtype->irq_set_type;
+	if (devtype->irq_set_type)
+		mpc8xxx_irq_chip.irq_set_type = devtype->irq_set_type;
 
 	if (devtype->gpio_dir_out)
 		gc->direction_output = devtype->gpio_dir_out;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux