Skip to content

Commit

Permalink
mtd: spi-nor: Reset SPI_MASTER_U_PAGE flag after chip erase operation
Browse files Browse the repository at this point in the history
In stacked mode, by default SPI_MASTER_U_PAGE flag is reset, this ensures
that the lower flash device is selected by default. For performing any
operation on the upper flash the driver sets the SPI_MASTER_U_PAGE flag,
performs the operation and then resets SPI_MASTER_U_PAGE flag. But during
chip erase operation, after erasing the upper flash the driver doesn't
reset the SPI_MASTER_U_PAGE flag before exiting. This is not inline
with the default behaviours. This patch fixes the issue by resetting the
SPI_MASTER_U_PAGE flag before exiting spi_nor_erase_chip() api.

Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>
  • Loading branch information
Amit Kumar Mahapatra authored and Michal Simek committed Jan 25, 2022
1 parent 889bf0c commit 9270fe7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/spi-nor/core.c
Expand Up @@ -1281,8 +1281,8 @@ static int spi_nor_erase_chip(struct spi_nor *nor)
return ret;
nor->spimem->spi->master->flags |= SPI_MASTER_U_PAGE;
ret = spi_mem_exec_op(nor->spimem, &op);
nor->spimem->spi->master->flags &= ~SPI_MASTER_U_PAGE;
}
return ret;
} else {
ret = spi_nor_controller_ops_write_reg(nor,
SPINOR_OP_CHIP_ERASE,
Expand Down

0 comments on commit 9270fe7

Please sign in to comment.