From 340332a38a2ac0d439118688e2aaf6809b019e46 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 8 Dec 2024 21:31:06 +0000 Subject: [PATCH 1/1] 20241206rev3: 3050micro nvme fix. misc lbmk fixes. This combines the following lbmk patches, which were made on top of 20241206 rev2: commit 3b6b283eabe7a655c861d1543aeae49d27566f53 Author: Leah Rowe Date: Wed Dec 11 01:11:08 2024 +0000 disable 3050micro nvme hotplug commit c2023921893f8ee11a9a611469bb8350ef1692be Author: Leah Rowe Date: Tue Dec 10 23:45:59 2024 +0000 fix t480 spd size (512, not 256) commit da527459b68f2e7a1e6a902fdb5b7d89e8b69dd6 Author: Leah Rowe Date: Sun Dec 8 21:31:06 2024 +0000 add tarballs and signatures to gitignore The tarballs/gitignore patch isn't very interesting. The SPD config fix does not necessitate a new revision for T480/T480s, because the change was created by running make oldconfig on the coreboot configs manually, which lbmk does automatically at build time anyway, so the resulting SPD size in the final ROM images was 512 anyway, which is correct. The 3050micro fix is most relevant: in my testing, the nvme got replugged and therefore renamed every few days. My 3050micro has a RAID1 array (SATA+NVMe) and kept getting unsynced because e.g. nvme0n1 would become nvme0n2 and Linux would think it's a new drive; this caused the mdraid driver to remove it from the array, which then meant I had to keep re-building my RAID1 array. In other cases, this could be a problem. If the user was running only from the nvme ssd, and this happened, their Linux system would simply crash. If they were using RAID0, the array would possibly become corrupted. With this nvme fix, the issue shouldn't occur anymore. This is because PCI-E Re-plug (hotplug feature) has been disabled. This same fix was made to the ThinkPad T480/T480s ports, which manifested on suspend from resume, leading to a crash if running Linux from the NVMe (this was fixed there by disabling hotplug in the same way). There might be one or two more minor revisions after this, but hopefully this will be the last revision I made to the Libreboot 20241206 release. Signed-off-by: Leah Rowe --- .gitignore | 1 + ...-dell-3050micro-disable-nvme-hotplug.patch | 57 +++++++++++++++++++ .../config/libgfxinit_corebootfb | 2 +- .../t480_fsp_16mb/config/libgfxinit_txtmode | 2 +- .../config/libgfxinit_corebootfb | 2 +- .../t480s_fsp_16mb/config/libgfxinit_txtmode | 2 +- 6 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 config/coreboot/next/patches/0010-dell-3050micro-disable-nvme-hotplug.patch diff --git a/.gitignore b/.gitignore index 84724cfb0f8..b6aca3b20d3 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ /hash/ /dump/ /qrun*.sh +*.tar.* diff --git a/config/coreboot/next/patches/0010-dell-3050micro-disable-nvme-hotplug.patch b/config/coreboot/next/patches/0010-dell-3050micro-disable-nvme-hotplug.patch new file mode 100644 index 00000000000..0408d114fb4 --- /dev/null +++ b/config/coreboot/next/patches/0010-dell-3050micro-disable-nvme-hotplug.patch @@ -0,0 +1,57 @@ +From adfeaeabcf98878814b463f14aba7871721d7606 Mon Sep 17 00:00:00 2001 +From: Leah Rowe +Date: Wed, 11 Dec 2024 01:06:01 +0000 +Subject: [PATCH 1/1] dell/3050micro: disable nvme hotplug + +in my testing, when running my 3050micro for a few days, +the nvme would sometimes randomly rename. + +e.g. nvme0n1 renamed to nvme0n2 + +this might cause crashes in linux, if booting only from the +nvme. in my case, i was booting from mdraid (sata+nvme) and +every few days, the nvme would rename at least once, causing +my RAID to become unsynced. since i'm using RAID1, this was +OK and I could simply re-sync the array, but this is quite +precarious indeed. if you're using raid0, that will potentially +corrupt your RAID array indefinitely. + +this same issue manifested on the T480/T480 thinkpads, and +S3 resume would break because of that, when booting from nvme, +because the nvme would be "unplugged" and appear to linux as a +new device (the one that you booted from). + +the fix there was to disable hotplugging on that pci-e slot +for the nvme, so apply the same fix here for 3050 micro + +Signed-off-by: Leah Rowe +--- + 3rdparty/vboot | 2 +- + src/mainboard/dell/optiplex_3050/devicetree.cb | 4 +++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/3rdparty/vboot b/3rdparty/vboot +index f1f70f46dc..902fe8af96 160000 +--- a/3rdparty/vboot ++++ b/3rdparty/vboot +@@ -1 +1 @@ +-Subproject commit f1f70f46dc5482bb7c654e53ed58d4001e386df2 ++Subproject commit 902fe8af96ad662fac127cb8f51596491cf8272f +diff --git a/src/mainboard/dell/optiplex_3050/devicetree.cb b/src/mainboard/dell/optiplex_3050/devicetree.cb +index 039709aa4a..0678ed1765 100644 +--- a/src/mainboard/dell/optiplex_3050/devicetree.cb ++++ b/src/mainboard/dell/optiplex_3050/devicetree.cb +@@ -45,7 +45,9 @@ chip soc/intel/skylake + register "PcieRpAdvancedErrorReporting[20]" = "1" + register "PcieRpLtrEnable[20]" = "1" + register "PcieRpClkSrcNumber[20]" = "3" +- register "PcieRpHotPlug[20]" = "1" ++# disable hotplug on nvme to prevent renaming e.g. nvme0n1 rename to nvme0n2, ++# which could cause crashes in linux if booting from nvme ++ register "PcieRpHotPlug[20]" = "0" + end + + # Realtek LAN +-- +2.39.5 + diff --git a/config/coreboot/t480_fsp_16mb/config/libgfxinit_corebootfb b/config/coreboot/t480_fsp_16mb/config/libgfxinit_corebootfb index 2be0ecec715..769d53eb747 100644 --- a/config/coreboot/t480_fsp_16mb/config/libgfxinit_corebootfb +++ b/config/coreboot/t480_fsp_16mb/config/libgfxinit_corebootfb @@ -115,7 +115,7 @@ CONFIG_MAINBOARD_VERSION="1.0" CONFIG_MAINBOARD_DIR="lenovo/sklkbl_thinkpad" CONFIG_VGA_BIOS_ID="8086,0406" CONFIG_DIMM_MAX=2 -CONFIG_DIMM_SPD_SIZE=256 +CONFIG_DIMM_SPD_SIZE=512 CONFIG_FMDFILE="" # CONFIG_NO_POST is not set CONFIG_MAINBOARD_VENDOR="LENOVO" diff --git a/config/coreboot/t480_fsp_16mb/config/libgfxinit_txtmode b/config/coreboot/t480_fsp_16mb/config/libgfxinit_txtmode index 95989094637..e21749fe31a 100644 --- a/config/coreboot/t480_fsp_16mb/config/libgfxinit_txtmode +++ b/config/coreboot/t480_fsp_16mb/config/libgfxinit_txtmode @@ -115,7 +115,7 @@ CONFIG_MAINBOARD_VERSION="1.0" CONFIG_MAINBOARD_DIR="lenovo/sklkbl_thinkpad" CONFIG_VGA_BIOS_ID="8086,0406" CONFIG_DIMM_MAX=2 -CONFIG_DIMM_SPD_SIZE=256 +CONFIG_DIMM_SPD_SIZE=512 CONFIG_FMDFILE="" # CONFIG_NO_POST is not set CONFIG_MAINBOARD_VENDOR="LENOVO" diff --git a/config/coreboot/t480s_fsp_16mb/config/libgfxinit_corebootfb b/config/coreboot/t480s_fsp_16mb/config/libgfxinit_corebootfb index 8d33544d9ac..9eb3bf31502 100644 --- a/config/coreboot/t480s_fsp_16mb/config/libgfxinit_corebootfb +++ b/config/coreboot/t480s_fsp_16mb/config/libgfxinit_corebootfb @@ -115,7 +115,7 @@ CONFIG_MAINBOARD_VERSION="1.0" CONFIG_MAINBOARD_DIR="lenovo/sklkbl_thinkpad" CONFIG_VGA_BIOS_ID="8086,0406" CONFIG_DIMM_MAX=2 -CONFIG_DIMM_SPD_SIZE=256 +CONFIG_DIMM_SPD_SIZE=512 CONFIG_FMDFILE="" # CONFIG_NO_POST is not set CONFIG_MAINBOARD_VENDOR="LENOVO" diff --git a/config/coreboot/t480s_fsp_16mb/config/libgfxinit_txtmode b/config/coreboot/t480s_fsp_16mb/config/libgfxinit_txtmode index 8714de3e927..9bd3bcdd0d5 100644 --- a/config/coreboot/t480s_fsp_16mb/config/libgfxinit_txtmode +++ b/config/coreboot/t480s_fsp_16mb/config/libgfxinit_txtmode @@ -115,7 +115,7 @@ CONFIG_MAINBOARD_VERSION="1.0" CONFIG_MAINBOARD_DIR="lenovo/sklkbl_thinkpad" CONFIG_VGA_BIOS_ID="8086,0406" CONFIG_DIMM_MAX=2 -CONFIG_DIMM_SPD_SIZE=256 +CONFIG_DIMM_SPD_SIZE=512 CONFIG_FMDFILE="" # CONFIG_NO_POST is not set CONFIG_MAINBOARD_VENDOR="LENOVO" -- 2.39.5