The patch adds support to disable IMC from fetching BIOS code when we first open the SMBus device. We can perform SMBus transaction safely once IMC is disabled. Then when we close the device after the operation, we enable IMC to start fetching from BIOS ROM again. upstream status: None Signed-off-by: Arindam Nath Signed-off-by: Sanjay Mehta diff -Naur a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c --- a/drivers/i2c/i2c-dev.c 2014-03-31 09:10:15.000000000 +0530 +++ b/drivers/i2c/i2c-dev.c 2014-11-17 15:31:14.564077551 +0530 @@ -39,6 +39,7 @@ #include #include #include +#include /* * An i2c_dev represents an i2c_adapter ... an I2C or SMBus master, not a @@ -518,6 +519,8 @@ client->adapter = adap; file->private_data = client; + amd_imc_enter_scratch_ram(); + return 0; } @@ -529,6 +532,8 @@ kfree(client); file->private_data = NULL; + amd_imc_exit_scratch_ram(); + return 0; }