From a casual read, the "Disable #SMI generation" code (once using the hardware sequencer, and once using the software sequencer) stands out, because there is no reverse action and is one-way.
This code is within the 'intel_spi_init()' routine, and if it is the cause, might explain which the problem shows up merely by loading the module, when _init() is called.
FWIW, the Intel-SPI Readme contains:
https:/ /github. com/torvalds/ linux/blob/ master/ Documentation/ mtd/intel- spi.txt
"makes it possible to read and write the SPI serial flash, if certain protection bits are not set and locked."
"… If it finds any of them set, the whole MTD device is made read-only to prevent partial overwrites."
Corresponding code is in:
https:/ /github. com/torvalds/ linux/blob/ 8afda8b26d01ee2 6a60ef2f0284a7f 01a5ed96f8/ drivers/ mtd/spi- nor/intel- spi.c
From a casual read, the "Disable #SMI generation" code (once using the hardware sequencer, and once using the software sequencer) stands out, because there is no reverse action and is one-way.
This code is within the 'intel_spi_init()' routine, and if it is the cause, might explain which the problem shows up merely by loading the module, when _init() is called.