arm: mach-k3: common: reorder removal of firewalls
authorManorit Chawdhry <m-chawdhry@ti.com>
Fri, 5 May 2023 10:24:00 +0000 (15:54 +0530)
committerTom Rini <trini@konsulko.com>
Thu, 1 Jun 2023 16:32:03 +0000 (12:32 -0400)
commit8bfce2f9989fe15ca5f50ad74c6f315e14ad843f
tree05eef7b65fb7c269754c8039f7ff525f7fcfb73f
parent2a7ab9982cb648dba8305ad4ec02e721426e69f6
arm: mach-k3: common: reorder removal of firewalls

K3 devices have some firewalls set up by ROM that we usually remove so
that the development is easy in HS devices.

While removing the firewalls disabling a background region before
disabling the foreground regions keeps the firewall in a state where all
the transactions will be blacklisted until all the regions are disabled.
This causes a race for some other entity trying to access that memory
region before all the firewalls are disabled and causes an exception.

Since there is no guarantee on where the background regions lie based on
ROM configurations or no guarantee if the background regions will allow
all transactions across the memory spaces, iterate the loop twice removing
the foregrounds first and then backgrounds.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
arch/arm/mach-k3/common.c
arch/arm/mach-k3/common.h