Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 for i2c driver to suspend the bus
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: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>

authored by

Roja Rani Yarubandi and committed by
Wolfram Sang
9f78c607 de2646f3

+9
+9
drivers/i2c/busses/i2c-qcom-geni.c
··· 650 650 return 0; 651 651 } 652 652 653 + static void geni_i2c_shutdown(struct platform_device *pdev) 654 + { 655 + struct geni_i2c_dev *gi2c = platform_get_drvdata(pdev); 656 + 657 + /* Make client i2c transfers start failing */ 658 + i2c_mark_adapter_suspended(&gi2c->adap); 659 + } 660 + 653 661 static int __maybe_unused geni_i2c_runtime_suspend(struct device *dev) 654 662 { 655 663 int ret; ··· 722 714 static struct platform_driver geni_i2c_driver = { 723 715 .probe = geni_i2c_probe, 724 716 .remove = geni_i2c_remove, 717 + .shutdown = geni_i2c_shutdown, 725 718 .driver = { 726 719 .name = "geni_i2c", 727 720 .pm = &geni_i2c_pm_ops,