i2c: i801: Restore INTREN on unload
authorJean Delvare <jdelvare@suse.de>
Tue, 9 Nov 2021 15:02:57 +0000 (16:02 +0100)
committerWolfram Sang <wsa@kernel.org>
Tue, 23 Nov 2021 09:43:50 +0000 (10:43 +0100)
commit9b5bf5878138293fb5b14a48a7a17b6ede6bea25
tree31aca0273b5c2d8e0dd3cfa6904fda50d3844ae8
parentaa6fed90fea20bf52215952b276169efab8ae5ad
i2c: i801: Restore INTREN on unload

If driver interrupts are enabled, SMBHSTCNT_INTREN will be 1 after
the first transaction, and will stay to that value forever. This
means that interrupts will be generated for both host-initiated
transactions and also SMBus Alert events even after the driver is
unloaded. To be on the safe side, we should restore the initial state
of this bit at suspend and reboot time, as we do for several other
configuration bits already and for the same reason: the BIOS should
be handed the device in the same configuration state in which we
received it. Otherwise interrupts may be generated which nobody
will process.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-i801.c