In TegraSerialPortLib, silently ignore any pre-init calls, such as SerialPortWrite(). Otherwise, these calls could result in a crash. Better to ignore them, especially since we cannot report the failure yet (because serial hasn't been initialized).
When INFO logs were enabled, we hit an exception early in DxeCore. This was caused by a call into SerialPortWrite() before SerialPortInitialize() had been called. SerialPortWrite() attempted to dereference gSerialCompatibilityMap, which was still NULL.
Arguably, a library should never be logging during init. But that's going to be hard to prevent. Therefore, we're adding this guard instead.
In TegraSerialPortLib, silently ignore any pre-init calls, such as SerialPortWrite(). Otherwise, these calls could result in a crash. Better to ignore them, especially since we cannot report the failure yet (because serial hasn't been initialized).
When INFO logs were enabled, we hit an exception early in DxeCore. This was caused by a call into SerialPortWrite() before SerialPortInitialize() had been called. SerialPortWrite() attempted to dereference gSerialCompatibilityMap, which was still NULL.
Arguably, a library should never be logging during init. But that's going to be hard to prevent. Therefore, we're adding this guard instead.
Reviewed-by: Jeshua Smith jeshuas@nvidia.com Reviewed-by: Jeff Brasen jbrasen@nvidia.com Reviewed-by: Ashish Singhal ashishsingha@nvidia.com