Re: [PATCH v5 char-misc-next] misc: microchip: pci1xxxx: Add OTP/EEPROM driver for the pci1xxxx switch

From: Greg KH
Date: Mon Feb 20 2023 - 04:45:19 EST


On Mon, Feb 20, 2023 at 09:31:45AM +0000, Kumaravel.Thiagarajan@xxxxxxxxxxxxx wrote:
> > I do not recommend using a block interface for this at all.  Why not
> > the
> > "normal" EEPROM interface that the kernel has today (i.e. a binary
> > sysfs
> > file)?  That way you can mmap it and edit locations how ever you
> > want.
> Greg, I have one question about the sysfs interface. If OTP and EEPROM
> are enumerated as two sysfs files of 8KB each, will that start
> occupying the RAM permamently or is the swapping in and out of the RAM
> handled automatically by the kernel based on the user trying to access
> it.

It depends on exactly what you are doing here with the binary sysfs
file. Try it yourself and see how it works.

thanks,

greg k-h