The GERROR register's state might be lost when the SMMU is powered down
during runtime suspend. Handle any pending errors before suspending.
Refactor the gerror handling logic into a helper function and invoke it
from the runtime suspend callback after disabling the SMMU. This ensures
that any late-breaking gerrors are logged and ack'ed before the hardware
state is lost.
The commit message isn't clear, this is just a refactoring patch it
does not "Handle gerror during suspend"
But the refactoring is fine
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Though sashiko seems right about the pre-existing bug.
--
Jason