i2c: i2c-qcom-geni: Add shutdown callback for i2c
authorRoja Rani Yarubandi <rojay@codeaurora.org>
Fri, 8 Jan 2021 15:05:45 +0000 (20:35 +0530)
committerWolfram Sang <wsa@kernel.org>
Mon, 1 Feb 2021 22:09:34 +0000 (23:09 +0100)
commite0371298ddc51761be257698554ea507ac8bf831
tree7de39a0ee069ef70eef6a52603134435597ccc74
parente5c02cf541541605f704fbbb9a764e23f88ad0cb
i2c: i2c-qcom-geni: Add shutdown callback for i2c

If the hardware is still accessing memory after SMMU translation
is disabled (as part of smmu shutdown callback), then the
IOVAs (I/O virtual address) which it was using will go on the bus
as the physical addresses which will result in unknown crashes
like NoC/interconnect errors.

So, implement shutdown callback to i2c driver to stop on-going transfer
and unmap DMA mappings during system "reboot" or "shutdown".

Fixes: 37692de5d523 ("i2c: i2c-qcom-geni: Add bus driver for the Qualcomm GENI I2C controller")
Signed-off-by: Roja Rani Yarubandi <rojay@codeaurora.org>
Reviewed-by: Akash Asthana <akashast@codeaurora.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-qcom-geni.c