]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipa: add driver shutdown callback
authorAlex Elder <elder@linaro.org>
Thu, 19 Nov 2020 22:49:29 +0000 (16:49 -0600)
committerJakub Kicinski <kuba@kernel.org>
Sat, 21 Nov 2020 02:45:52 +0000 (18:45 -0800)
commit4fb515d406ec1b9baf6c1fe15337bb7fb240fb6a
tree6ece54340135cfd49a96c407218a19f561a3da77
parent3844ac2e8ecc910e7c85e2e6037737e8da06eee0
net: ipa: add driver shutdown callback

A system shutdown can happen at essentially any time, and it's
possible that the IPA driver is busy when a shutdown is underway.
IPA hardware accesses IMEM and SMEM memory regions using an IOMMU,
and at some point during shutdown, needed I/O mappings could become
invalid.  This could be disastrous for any "in flight" IPA activity.

Avoid this by defining a new driver shutdown callback that stops all
IPA activity and cleanly shuts down the driver.  It merely calls the
driver's existing remove callback, reporting the error if it returns
one.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ipa/ipa_main.c