Skip to content

Commit 9f78c60

Browse files
Roja Rani Yarubandiwsakernel
authored andcommitted
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: 37692de ("i2c: i2c-qcom-geni: Add bus driver for the Qualcomm GENI I2C controller") Signed-off-by: Roja Rani Yarubandi <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent de2646f commit 9f78c60

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/i2c/busses/i2c-qcom-geni.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,14 @@ static int geni_i2c_remove(struct platform_device *pdev)
650650
return 0;
651651
}
652652

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+
653661
static int __maybe_unused geni_i2c_runtime_suspend(struct device *dev)
654662
{
655663
int ret;
@@ -714,6 +722,7 @@ MODULE_DEVICE_TABLE(of, geni_i2c_dt_match);
714722
static struct platform_driver geni_i2c_driver = {
715723
.probe = geni_i2c_probe,
716724
.remove = geni_i2c_remove,
725+
.shutdown = geni_i2c_shutdown,
717726
.driver = {
718727
.name = "geni_i2c",
719728
.pm = &geni_i2c_pm_ops,

0 commit comments

Comments
 (0)