On 1/18/24 10:50, Dhaval wrote:
> Some platforms do not implement cache management operations. Especially
> for DMA drivers have code to manage data cache. The code seem to depend
> on the underlying CPU/cache drivers to enact functionality and simply
> return if such functionality is not implemented. However this causes
> issue with CMO implementation which has an assert causing flow to
> hang within debug environment. While it is not an issue in production
> environment there is a recommendation to conver this assert in to
> a harmless logger message. Eventually platform/drivers need to have
> better guard for such functionality.
>
> Signed-off-by: Dhaval Sharma <[email protected]>
> Cc: Liming Gao <[email protected]>
> Cc: Michael D Kinney <[email protected]>
> Cc: Zhiguang Liu <[email protected]>
> Cc: Sunil V L <[email protected]>
> Cc: Andrei Warkentin <[email protected]>
> Cc: Laszlo Ersek <[email protected]>
> Cc: Pedro Falcato <[email protected]>
> Cc: Yang Cheng <[email protected]>
> ---
> MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c
> b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c
> index 73a5a6b6b5d6..d99515bcf38b 100644
> --- a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c
> +++ b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c
> @@ -183,9 +183,8 @@ WriteBackInvalidateDataCache (
> VOID
> )
> {
> - ASSERT (FALSE);
> DEBUG ((
> - DEBUG_ERROR,
> + DEBUG_VERBOSE,
> "WriteBackInvalidateDataCache: RISC-V unsupported function.\n"
> ));
> }
> @@ -226,7 +225,9 @@ WriteBackInvalidateDataCacheRange (
> if (RiscVIsCMOEnabled ()) {
> CacheOpCacheRange (Address, Length, CacheOpFlush);
> } else {
> - ASSERT (FALSE);
> + DEBUG (
> + (DEBUG_VERBOSE, "WriteBackInvalidateDataCacheRange not supported \n")
> + );
> }
>
> return Address;
This formatting looks very strange, normally you'd write
DEBUG ((
....
));
LGTM otherwise:
Acked-by: Laszlo Ersek <[email protected]>
> @@ -248,7 +249,7 @@ WriteBackDataCache (
> VOID
> )
> {
> - ASSERT (FALSE);
> + DEBUG ((DEBUG_VERBOSE, "WriteBackDataCache not supported \n"));
> }
>
> /**
> @@ -283,7 +284,7 @@ WriteBackDataCacheRange (
> if (RiscVIsCMOEnabled ()) {
> CacheOpCacheRange (Address, Length, CacheOpClean);
> } else {
> - ASSERT (FALSE);
> + DEBUG ((DEBUG_VERBOSE, "WriteBackDataCacheRange not supported \n"));
> }
>
> return Address;
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113993): https://edk2.groups.io/g/devel/message/113993
Mute This Topic: https://groups.io/mt/103805230/21656
Group Owner: [email protected]
Unsubscribe:
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-