* [PATCH] mtd: rawnand: arasan: Fix missing de-registration of NAND chip-selects
@ 2024-12-02 13:25 Maciej Andrzejewski
2024-12-02 13:46 ` Miquel Raynal
0 siblings, 1 reply; 2+ messages in thread
From: Maciej Andrzejewski @ 2024-12-02 13:25 UTC (permalink / raw)
To: Miquel Raynal, Michal Simek, Jinjie Ruan,
Punnaiah Choudary Kalluri, linux-mtd
The NAND chip-selects are registered for the Arasan driver during
initialization but are not de-registered when the driver is unloaded. As a
result, if the driver is loaded again, the chip-selects remain registered
and busy, making them unavailable for use.
Fixes: 197b88fecc50ee3c7a22415db81eae0b9126f20e ("mtd: rawnand: arasan: Add new Arasan NAND controller")
Cc: stable@vger.kernel.org
Signed-off-by: Maciej Andrzejewski ICEYE <maciej.andrzejewski@m-works.net>
---
drivers/mtd/nand/raw/arasan-nand-controller.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/mtd/nand/raw/arasan-nand-controller.c b/drivers/mtd/nand/raw/arasan-nand-controller.c
index 5436ec4a8fde..36c23fa186f2 100644
--- a/drivers/mtd/nand/raw/arasan-nand-controller.c
+++ b/drivers/mtd/nand/raw/arasan-nand-controller.c
@@ -1478,8 +1478,15 @@ static int anfc_probe(struct platform_device *pdev)
static void anfc_remove(struct platform_device *pdev)
{
+ int i;
struct arasan_nfc *nfc = platform_get_drvdata(pdev);
+ for (i = 0; i < nfc->ncs; i++) {
+ if (nfc->cs_array[i]) {
+ gpiod_put(nfc->cs_array[i]);
+ }
+ }
+
anfc_chips_cleanup(nfc);
}
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] mtd: rawnand: arasan: Fix missing de-registration of NAND chip-selects
2024-12-02 13:25 [PATCH] mtd: rawnand: arasan: Fix missing de-registration of NAND chip-selects Maciej Andrzejewski
@ 2024-12-02 13:46 ` Miquel Raynal
0 siblings, 0 replies; 2+ messages in thread
From: Miquel Raynal @ 2024-12-02 13:46 UTC (permalink / raw)
To: Maciej Andrzejewski
Cc: Michal Simek, Jinjie Ruan, Punnaiah Choudary Kalluri, linux-mtd
Hi Maciej,
On 02/12/2024 at 14:25:59 +01, Maciej Andrzejewski <maciej.andrzejewski@m-works.net> wrote:
> The NAND chip-selects are registered for the Arasan driver during
> initialization but are not de-registered when the driver is unloaded. As a
> result, if the driver is loaded again, the chip-selects remain registered
> and busy, making them unavailable for use.
Good point!
> Fixes: 197b88fecc50ee3c7a22415db81eae0b9126f20e ("mtd: rawnand: arasan: Add new Arasan NAND controller")
This should be a 12-digit sha only. FYI in my .gitconfig I have the
following alias:
fixes = show -s --format='Fixes: %h (\"%s\")'
It was correct in your previous patch :)
> Cc: stable@vger.kernel.org
> Signed-off-by: Maciej Andrzejewski ICEYE <maciej.andrzejewski@m-works.net>
Otherwise looks good to me!
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-12-02 13:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-02 13:25 [PATCH] mtd: rawnand: arasan: Fix missing de-registration of NAND chip-selects Maciej Andrzejewski
2024-12-02 13:46 ` Miquel Raynal
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.