Permalink
Browse files

i2c: s3c2410: stop all pending transfers on shutdown

If the i2c bus is busy when reboot() is called, it may never
come out of the busy state. Usually this is not an issue - since
the hardware will be reset before another kernel comes along - but
this causes the i2c bus to be unusable when using kexec.
  • Loading branch information...
fourkbomb committed Nov 27, 2017
1 parent 1227753 commit a9d7293289e647b2fdb63ee75d5d9bf5800770c5
Showing with 11 additions and 0 deletions.
  1. +11 −0 drivers/i2c/busses/i2c-s3c2410.c
@@ -1243,6 +1243,16 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev)
return 0;
}

static void s3c24xx_i2c_shutdown(struct platform_device *pdev)
{
struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);

// stop any pending i2c transfers
i2c->suspended = 1;
s3c24xx_i2c_stop(i2c, -ENXIO);
}


#ifdef CONFIG_PM_SLEEP
static int s3c24xx_i2c_suspend_noirq(struct device *dev)
{
@@ -1289,6 +1299,7 @@ static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
static struct platform_driver s3c24xx_i2c_driver = {
.probe = s3c24xx_i2c_probe,
.remove = s3c24xx_i2c_remove,
.shutdown = s3c24xx_i2c_shutdown,
.id_table = s3c24xx_driver_ids,
.driver = {
.name = "s3c-i2c",

0 comments on commit a9d7293

Please sign in to comment.