[PATCH] nvme-host: fix the updating of the firmware version
Keith Busch
kbusch at kernel.org
Thu Feb 1 17:48:35 PST 2024
On Thu, Jan 18, 2024 at 12:48:54PM +0100, Maurizio Lombardi wrote:
> The original code didn't update the firmware version if the
> "next slot" of the AFI register isn't zero or if the
> "current slot" field is zero; in those cases it assumed
> that a reset was needed.
>
> However, the NVMe specification doesn't exclude the possibility that
> the "next slot" value is equal to the "current slot" value,
> meaning that the same firmware slot will be activated after performing
> a controller level reset; in this case a reset is clearly not
> necessary and we can safely update the firmware version.
>
> Modify the code so the kernel will report that a Controller Level Reset
> is needed only in the following cases:
>
> 1) If the "current slot" field is zero. This is invalid and means that
> something is wrong, a reset is needed.
>
> or
>
> 2) if the "next slot" field isn't zero AND it's not equal to the
> "current slot" value. This means that at the next reset a different
> firmware slot will be activated.
>
> Fixes: 983a338b96c8 ("nvme: update firmware version after commit")
> Signed-off-by: Maurizio Lombardi <mlombard at redhat.com>
Sorry I missed this one for this weeks pull request. It's now applied
for nvme-6.8 as the first commit for the next round.
More information about the Linux-nvme
mailing list