Patch "gpio: bcm-kona: Fix GPIO lock/unlock for banks above bank 0" 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: bcm-kona: Fix GPIO lock/unlock for banks above bank 0

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-bcm-kona-fix-gpio-lock-unlock-for-banks-above-b.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 e228ae7b3b0e2076312a7be89d00603e452f9473
Author: Artur Weber <aweber.kernel@xxxxxxxxx>
Date:   Thu Feb 6 18:46:00 2025 +0100

    gpio: bcm-kona: Fix GPIO lock/unlock for banks above bank 0
    
    [ Upstream commit de1d0d160f64ee76df1d364d521b2faf465a091c ]
    
    The GPIO lock/unlock functions clear/write a bit to the relevant
    register for each bank. However, due to an oversight the bit that
    was being written was based on the total GPIO number, not the index
    of the GPIO within the relevant bank, causing it to fail for any
    GPIO above 32 (thus any GPIO for banks above bank 0).
    
    Fix lock/unlock for these banks by using the correct bit.
    
    Fixes: bdb93c03c550 ("gpio: bcm281xx: Centralize register locking")
    Reviewed-by: Florian Fainelli <florian.fainelli@xxxxxxxxxxxx>
    Reviewed-by: Markus Mayer <mmayer@xxxxxxxxxxxx>
    Signed-off-by: Artur Weber <aweber.kernel@xxxxxxxxx>
    Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20250206-kona-gpio-fixes-v2-1-409135eab780@xxxxxxxxx
    Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c
index 100575973e1fd..840a4b7e6c4d1 100644
--- a/drivers/gpio/gpio-bcm-kona.c
+++ b/drivers/gpio/gpio-bcm-kona.c
@@ -94,11 +94,12 @@ static void bcm_kona_gpio_lock_gpio(struct bcm_kona_gpio *kona_gpio,
 	u32 val;
 	unsigned long flags;
 	int bank_id = GPIO_BANK(gpio);
+	int bit = GPIO_BIT(gpio);
 
 	raw_spin_lock_irqsave(&kona_gpio->lock, flags);
 
 	val = readl(kona_gpio->reg_base + GPIO_PWD_STATUS(bank_id));
-	val |= BIT(gpio);
+	val |= BIT(bit);
 	bcm_kona_gpio_write_lock_regs(kona_gpio->reg_base, bank_id, val);
 
 	raw_spin_unlock_irqrestore(&kona_gpio->lock, flags);
@@ -110,11 +111,12 @@ static void bcm_kona_gpio_unlock_gpio(struct bcm_kona_gpio *kona_gpio,
 	u32 val;
 	unsigned long flags;
 	int bank_id = GPIO_BANK(gpio);
+	int bit = GPIO_BIT(gpio);
 
 	raw_spin_lock_irqsave(&kona_gpio->lock, flags);
 
 	val = readl(kona_gpio->reg_base + GPIO_PWD_STATUS(bank_id));
-	val &= ~BIT(gpio);
+	val &= ~BIT(bit);
 	bcm_kona_gpio_write_lock_regs(kona_gpio->reg_base, bank_id, val);
 
 	raw_spin_unlock_irqrestore(&kona_gpio->lock, flags);




[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