Discussion:
Enabling a ACPI eMMC device is causing kernel reboots with FreeBSD 11.2
Rajesh Kumar
2018-11-08 10:44:57 UTC
Permalink
Hi,

I have amd64 board, which has a eMMC device on the ACPI bus. When I try
booting FreeBSD 11.2 on this board, with eMMC device disabled in BIOS, it
boots without any issues. But, when eMMC device is enabled in BIOS,
FreeBSD 11.2 continuously reboots.

When I have the following tunable set, FreeBSD 11.2 boots without any
issues with eMMC enabled.
hw.pci.mcfg=0

Observations :
a) We have verified the ACPI device addresses (from DSDT table) doesn't
conflict with the PCI address base (configured in MCFG table).
b) The PCI address base from MCFG table is read correctly by kernel
(Verbose boot prints that address). So, I don't think MCFG table pointer is
corrupted and getting read properly.

Questions :
a) What does hw.pci.mcfg=0 actually do to get the reboot issue resolved?
b) Why enabling a device on ACPI bus needs hw.pci.mcfg (PCI specific) to
boot?

Looks like the system reboots when the ACPI and PCI devices enumeration
starts during the boot. So, seems ACPI (or) PCI devices aren't getting
enough resources and so reboots.

Thanks,
Rajesh.
Rajesh Kumar
2018-11-16 05:15:39 UTC
Permalink
Hi,

I did some study on this. During acpi_attach, if MCFG table is present,
FreeBSD tries to use it (That is to map the PCI Base address to virtual
address space). Setting hw.pci.mcfg=0, disables that mapping and lets the
system use the type 1 config access (which is IO port based access). So,
this is what hw.pci.mcfg does.

In our case, we are enabling a device on the ACPI bus and made sure no
other ACPI device collides with the address range for PCI (which mcfg
says). So, why enabling a device on ACPI, is causing the memory mapped PCI
access go bad to panic/reboot the kernel? I tried to collect more info
enabling INVARIANTS, but in that case kernel panics much before in the boot
process. So, how could I proceed in debugging this issue? Any suggestions?
Post by Rajesh Kumar
Hi,
I have amd64 board, which has a eMMC device on the ACPI bus. When I try
booting FreeBSD 11.2 on this board, with eMMC device disabled in BIOS, it
boots without any issues. But, when eMMC device is enabled in BIOS,
FreeBSD 11.2 continuously reboots.
When I have the following tunable set, FreeBSD 11.2 boots without any
issues with eMMC enabled.
hw.pci.mcfg=0
a) We have verified the ACPI device addresses (from DSDT table) doesn't
conflict with the PCI address base (configured in MCFG table).
b) The PCI address base from MCFG table is read correctly by kernel
(Verbose boot prints that address). So, I don't think MCFG table pointer is
corrupted and getting read properly.
a) What does hw.pci.mcfg=0 actually do to get the reboot issue resolved?
b) Why enabling a device on ACPI bus needs hw.pci.mcfg (PCI specific) to
boot?
Looks like the system reboots when the ACPI and PCI devices enumeration
starts during the boot. So, seems ACPI (or) PCI devices aren't getting
enough resources and so reboots.
Thanks,
Rajesh.
Konstantin Belousov
2018-11-16 06:35:29 UTC
Permalink
Post by Rajesh Kumar
Hi,
I did some study on this. During acpi_attach, if MCFG table is present,
FreeBSD tries to use it (That is to map the PCI Base address to virtual
address space). Setting hw.pci.mcfg=0, disables that mapping and lets the
system use the type 1 config access (which is IO port based access). So,
this is what hw.pci.mcfg does.
In our case, we are enabling a device on the ACPI bus and made sure no
other ACPI device collides with the address range for PCI (which mcfg
says). So, why enabling a device on ACPI, is causing the memory mapped PCI
access go bad to panic/reboot the kernel? I tried to collect more info
enabling INVARIANTS, but in that case kernel panics much before in the boot
process. So, how could I proceed in debugging this issue? Any suggestions?
There is no ACPI bus, at best the device is enumerated using ACPI.
Post by Rajesh Kumar
Post by Rajesh Kumar
Hi,
I have amd64 board, which has a eMMC device on the ACPI bus. When I try
booting FreeBSD 11.2 on this board, with eMMC device disabled in BIOS, it
boots without any issues. But, when eMMC device is enabled in BIOS,
FreeBSD 11.2 continuously reboots.
What is the CPU in your motherboard ?
If it is AMD, try HEAD or latest 12.0 BETA.
Post by Rajesh Kumar
Post by Rajesh Kumar
When I have the following tunable set, FreeBSD 11.2 boots without any
issues with eMMC enabled.
hw.pci.mcfg=0
a) We have verified the ACPI device addresses (from DSDT table) doesn't
conflict with the PCI address base (configured in MCFG table).
b) The PCI address base from MCFG table is read correctly by kernel
(Verbose boot prints that address). So, I don't think MCFG table pointer is
corrupted and getting read properly.
a) What does hw.pci.mcfg=0 actually do to get the reboot issue resolved?
b) Why enabling a device on ACPI bus needs hw.pci.mcfg (PCI specific) to
boot?
Looks like the system reboots when the ACPI and PCI devices enumeration
starts during the boot. So, seems ACPI (or) PCI devices aren't getting
enough resources and so reboots.
Thanks,
Rajesh.
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-amd64
Loading...