Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 917667 - sys-kernel/gentoo-kernel{,-bin}: enable CONFIG_SPI_INTEL
Summary: sys-kernel/gentoo-kernel{,-bin}: enable CONFIG_SPI_INTEL
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Low enhancement (vote)
Assignee: Distribution Kernel Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-21 10:02 UTC by Agostino Sarubbo
Modified: 2023-12-01 22:01 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2023-11-21 10:02:27 UTC
I'm running sys-kernel/gentoo-kernel-6.1.60 and I noticed that it misses spi config for intel that is needed on the hardware I'm running.

I can do my own savedconfig but I guess that other would benefit from this change.

After have enabled it, this is the diff from the current config:

--- .config.old 2023-11-21 10:46:38.663386360 +0100
+++ .config     2023-11-21 10:57:13.657411390 +0100
@@ -4419,7 +4419,7 @@
 # CONFIG_I3C is not set
 CONFIG_SPI=y
 CONFIG_SPI_MASTER=y
-# CONFIG_SPI_MEM is not set
+CONFIG_SPI_MEM=y
 
 #
 # SPI Master Controller Drivers
@@ -4435,6 +4435,9 @@
 CONFIG_SPI_DLN2=m
 # CONFIG_SPI_NXP_FLEXSPI is not set
 # CONFIG_SPI_GPIO is not set
+CONFIG_SPI_INTEL=m
+CONFIG_SPI_INTEL_PCI=m
+CONFIG_SPI_INTEL_PLATFORM=m
 # CONFIG_SPI_LM70_LLP is not set
 CONFIG_SPI_MICROCHIP_CORE=m
 CONFIG_SPI_MICROCHIP_CORE_QSPI=m


Thanks.
Comment 1 Andrew Nowa Ammerlaan gentoo-dev 2023-11-21 10:40:32 UTC
To be honest, I'm not sure we should enable this by default since the kernel config explicitly lists these options as dangerous and advices to leave them disabled:

"""
Say N here unless you know what you are doing. Overwriting the
SPI flash may render the system unbootable. 
"""
Comment 2 Agostino Sarubbo gentoo-dev 2023-11-21 10:51:38 UTC
(In reply to Andrew Ammerlaan from comment #1)
> To be honest, I'm not sure we should enable this by default since the kernel
> config explicitly lists these options as dangerous and advices to leave them
> disabled:
> 
> """
> Say N here unless you know what you are doing. Overwriting the
> SPI flash may render the system unbootable. 
> """

The SPI modules allow to, e.g. update bios from cli. But these operations need to be performed manually. An example is here:
https://www.kernel.org/doc/html/v5.3/driver-api/mtd/intel-spi.html

For what you said, I have the impression that it sounds like: "load this module may render the system unbootable"

This looks like to say, do not install dd because it can erase your disk.
Comment 3 Andrew Nowa Ammerlaan gentoo-dev 2023-11-21 11:11:49 UTC
Right, that does sound like the warning in the config option might be a bit overcautious. I do wonder why this is not enabled in the upstream Fedora kernel config though. A quick google search reveals this serious issue[1], it is old, though it is unclear to me if this was actually fixed in the kernel or if Ubuntu's solution was (and is) to simply not enable this config option.

[1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1734147?comments=all
Comment 4 Agostino Sarubbo gentoo-dev 2023-11-21 11:29:42 UTC
(In reply to Andrew Ammerlaan from comment #3)
> or if Ubuntu's solution was (and is) to simply not enable this config
> option.
> [1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1734147?comments=all

I don't know, but I can say it is enabled on ubuntu, because basically it was the place where I saw that it exists.
Comment 5 Andrew Nowa Ammerlaan gentoo-dev 2023-11-21 11:34:48 UTC
(In reply to Agostino Sarubbo from comment #4)
> (In reply to Andrew Ammerlaan from comment #3)
> > or if Ubuntu's solution was (and is) to simply not enable this config
> > option.
> > [1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1734147?comments=all
> 
> I don't know, but I can say it is enabled on ubuntu, because basically it
> was the place where I saw that it exists.

Great! Then we should be fine to enable this as well.
Comment 6 Andrew Nowa Ammerlaan gentoo-dev 2023-12-01 22:01:37 UTC
Fixed in 6.6.3-r1