[PATCH iwl-net] ice: allow reading the last byte of the NVM and Shadow RAM regions

Nowlin, Alexander alexander.nowlin at intel.com
Wed Sep 30 01:21:05 UTC 2026


> -----Original Message-----
> From: Petr Oros <poros at redhat.com> 
> Sent: Wednesday, August 19, 2026 1:25 AM
> To: netdev at vger.kernel.org
> Cc: Oros, Petr <poros at redhat.com>; Nguyen, Anthony L <anthony.l.nguyen at intel.com>; Kitszel, Przemyslaw <przemyslaw.kitszel at intel.com>; Andrew Lunn <andrew+netdev at lunn.ch>; David S. Miller <davem at davemloft.net>; Eric Dumazet <edumazet at google.com>; Jakub Kicinski <kuba at kernel.org>; Paolo Abeni <pabeni at redhat.com>; Loktionov, Aleksandr <aleksandr.loktionov at intel.com>; Paul Menzel <pmenzel at molgen.mpg.de>; Keller, Jacob E <jacob.e.keller at intel.com>; Kees Cook <kees at kernel.org>; Robert Malz <robert.malz at canonical.com>; Ratheesh Kannoth <rkannoth at marvell.com>; Daniel Zahka <daniel.zahka at gmail.com>; intel-wired-lan at lists.osuosl.org; linux-kernel at vger.kernel.org
> Subject: [PATCH iwl-net] ice: allow reading the last byte of the NVM and Shadow RAM regions
> 
> ice_devlink_nvm_read() rejects a read whose end lands exactly on the region size, so feeding back the size devlink itself reports fails:
> 
>   devlink region show pci/0000:04:00.0/nvm-flash
>   pci/0000:04:00.0/nvm-flash: size 10485760 snapshot [] max 1
> 
>   devlink region read pci/0000:04:00.0/nvm-flash address 0 length 10485760
>   Error: ice: Cannot read beyond the region size.
> 
> shadow-ram behaves the same. The regions are created with those sizes, so a read ending on the size is the whole region and has to be allowed.
> ice_read_flat_nvm() uses > for its own Shadow RAM check, and so does ixgbe, which grew its region support from this code.
> 
> Fixes: 3af4b40b0f2f ("ice: implement direct read for NVM and Shadow RAM regions")
> Signed-off-by: Petr Oros <poros at redhat.com>
> ---
>  drivers/net/ethernet/intel/ice/devlink/devlink.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Tested-by: Alexander Nowlin <alexander.nowlin at intel.com>


More information about the Intel-wired-lan mailing list