diff options
author | Maciej Andrzejewski <maciej.andrzejewski@m-works.net> | 2024-12-02 13:51:07 +0100 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2024-12-05 11:13:41 +0100 |
commit | b086a46dae48829e11c0c02580e30d920b76743c (patch) | |
tree | 921d7433ce749ba65f4fafa57f342cb62d9ba7e2 /fs/xfs/xfs_exchrange.c | |
parent | 9b458e8be0d13e81ed03fffa23f8f9b528bbd786 (diff) | |
download | linux-b086a46dae48829e11c0c02580e30d920b76743c.tar.gz linux-b086a46dae48829e11c0c02580e30d920b76743c.tar.bz2 linux-b086a46dae48829e11c0c02580e30d920b76743c.zip |
mtd: rawnand: arasan: Fix double assertion of chip-select
When two chip-selects are configured in the device tree, and the second is
a non-native GPIO, both the GPIO-based chip-select and the first native
chip-select may be asserted simultaneously. This double assertion causes
incorrect read and write operations.
The issue occurs because when nfc->ncs <= 2, nfc->spare_cs is always
initialized to 0 due to static initialization. Consequently, when the
second chip-select (GPIO-based) is selected in anfc_assert_cs(), it is
detected by anfc_is_gpio_cs(), and nfc->native_cs is assigned the value 0.
This results in both the GPIO-based chip-select being asserted and the
NAND controller register receiving 0, erroneously selecting the native
chip-select.
This patch resolves the issue, as confirmed by oscilloscope testing with
configurations involving two or more chip-selects in the device tree.
Fixes: acbd3d0945f9 ("mtd: rawnand: arasan: Leverage additional GPIO CS")
Cc: stable@vger.kernel.org
Signed-off-by: Maciej Andrzejewski <maciej.andrzejewski@m-works.net>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'fs/xfs/xfs_exchrange.c')
0 files changed, 0 insertions, 0 deletions