diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2020-01-14 10:12:01 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-01-14 10:20:31 +0100 |
commit | 76551856b28d227cb0386a1ab0e774329b941f7d (patch) | |
tree | 0de1ac5029fad0155df6b8d8ac6d5a6e25fe43f9 | |
parent | d6bdb85eb0d73353e6df1caf586a1de523d309e2 (diff) | |
download | seabios-76551856b28d227cb0386a1ab0e774329b941f7d.tar.gz |
nvme: skip initializing non-bootable devices
Check NVMe devices whenever they are bootable,
skip initialization in case they are not.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | src/hw/nvme.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/hw/nvme.c b/src/hw/nvme.c index 2e3aa386..41f3b768 100644 --- a/src/hw/nvme.c +++ b/src/hw/nvme.c @@ -586,8 +586,15 @@ nvme_controller_enable(struct nvme_ctrl *ctrl) static void nvme_controller_setup(void *opaque) { + u8 skip_nonbootable = is_bootprio_strict(); struct pci_device *pci = opaque; + if (skip_nonbootable && bootprio_find_pci_device(pci) < 0) { + dprintf(1, "skipping init of a non-bootable NVMe at %pP\n", + pci); + goto err; + } + struct nvme_reg volatile *reg = pci_enable_membar(pci, PCI_BASE_ADDRESS_0); if (!reg) return; |