Re: [PATCH] SPI LPC information kernel module

From: Greg Kroah-Hartman
Date: Tue Jun 30 2020 - 04:59:37 EST


On Mon, Jun 29, 2020 at 07:59:32PM -0300, Daniel Gutson wrote:
> This kernel module exports configuration attributes for the
> system SPI chip.
> This initial version exports the BIOS Write Enable (bioswe),
> BIOS Lock Enable (ble), and the SMM Bios Write Protect (SMM_BWP)
> fields of the Bios Control register. The idea is to keep adding more
> flags, not only from the BC but also from other registers in following
> versions.
>
> The goal is that the attributes are avilable to fwupd when SecureBoot
> is turned on.
>
> A technical note: I check if *ppos == BUFFER_SIZE in the reading function
> to exit early and avoid an extra access to the HW, for example when using
> the 'cat' command, which causes two read operations.
>
> Signed-off-by: Daniel Gutson <daniel.gutson@xxxxxxxxxxxxx>
> ---
> Documentation/ABI/stable/securityfs-spi-lpc | 23 +
> MAINTAINERS | 6 +
> drivers/misc/Kconfig | 1 +
> drivers/misc/Makefile | 1 +
> drivers/misc/spi_lpc/Kconfig | 20 +
> drivers/misc/spi_lpc/Makefile | 8 +
> drivers/misc/spi_lpc/bios_data_access.c | 559 +++++++++++++++++++
> drivers/misc/spi_lpc/bios_data_access.h | 181 +++++++
> drivers/misc/spi_lpc/low_level_access.c | 59 ++
> drivers/misc/spi_lpc/low_level_access.h | 21 +
> drivers/misc/spi_lpc/spi_lpc_main.c | 176 ++++++
> drivers/misc/spi_lpc/viddid_arch_map.c | 566 ++++++++++++++++++++
> drivers/misc/spi_lpc/viddid_arch_map.h | 17 +
> 13 files changed, 1638 insertions(+)

A single driver that is 1500 lines long is fine, why split this up into
tiny pieces?

thanks,

greg k-h