]> 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)
commitd9a0127b06aa6f48ebece550667bbc2c97faa22f
tree6ece54340135cfd49a96c407218a19f561a3da77
parente027cd529711c9a4f8ddd17cc355e9c0c623fc27
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