From 93096fecb66a1dcc37c255b0625e9bd94d9c5c03 Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Sat, 20 Apr 2019 02:44:38 +0000 Subject: [PATCH] powerpc64/powernv: Relax flash block write requirements Since writes don't necessarily need to be on erase-block boundaries, we can relax the block size and alignments down to sector size. If it needs to be erased, opalflash_erase() will check proper alignment and size. --- sys/powerpc/powernv/opal_flash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/powerpc/powernv/opal_flash.c b/sys/powerpc/powernv/opal_flash.c index fd08be0d6ca8..3e45603ce882 100644 --- a/sys/powerpc/powernv/opal_flash.c +++ b/sys/powerpc/powernv/opal_flash.c @@ -239,8 +239,8 @@ opalflash_write(struct opalflash_softc *sc, off_t off, int rv, size, token; /* Ensure we write aligned to a full block size. */ - if (off % sc->sc_disk->d_stripesize != 0 || - count % sc->sc_disk->d_stripesize != 0) + if (off % sc->sc_disk->d_sectorsize != 0 || + count % sc->sc_disk->d_sectorsize != 0) return (EIO); if (sc->sc_erase) {