Re: [PATCH] mtd: spinand: Enable QE on all dies
From: Miquel Raynal
Date: Thu Aug 13 2026 - 02:49:08 EST
>> > + /*
>> > + * QE is a per-die setting on some devices. Program each target
>> > + * individually when enabling or disabling quad I/O mode.
>> > + */
>> > + for (target = 0; target < nand->memorg.ntargets; target++) {
>> > + ret = spinand_select_target(spinand, target);
>> > + if (ret)
>> > + return ret;
>> > +
>> > + ret = spinand_upd_cfg(spinand, CFG_QUAD_ENABLE,
>> > + enable ? CFG_QUAD_ENABLE : 0);
>> > + if (ret)
>> > + return ret;
>>
>> If there is an issue in the middle of the loop, the chip will become
>> unusable. Perhaps we should reset the dies to the !QE state and return
>> an error to continue in degraded (single) mode if that happens?
>
>
> Single-lane is the most basic op - if the QE set_feature write fails, the link
> is broken and single-lane won't work anyway. And falling back needs the vendor's
> own 1S op stored somewhere, but those variant tables are discarded after probe.
> So it likely requires refactoring struct spinand_device to cache them. Given that,
> maybe just keep the current return-error implementation.
Ack.