On Tue, Apr 10, 2018 at 11:57 AM, Jason Andryuk <jandryuk@xxxxxxxxx> wrote: > On Tue, Apr 10, 2018 at 4:00 AM, Benjamin Tissoires > <benjamin.tissoires@xxxxxxxxxx> wrote: >> Hi Jean, >> >> On Tue, Apr 10, 2018 at 9:44 AM, Jean Delvare <jdelvare@xxxxxxx> wrote: >>> Saving the original value of register SMBSLVCMD in >>> i801_enable_host_notify() doesn't work, because this function is >>> called not only at probe time but also at resume time. Do it in >>> i801_probe() instead, so that the saved value is not overwritten at >>> resume time. >> >> Sounds good. Thanks for spotting that! >> And thanks Jason also for the quick tests in the other thread. > > Thanks, Ben. And thank you, Jean, for your great work. > >>> >>> Signed-off-by: Jean Delvare <jdelvare@xxxxxxx> >>> Fixes: 22e94bd6779e ("i2c: i801: store and restore the SLVCMD register at load and unload") >>> Cc: Benjamin Tissoires <benjamin.tissoires@xxxxxxxxxx> >>> Cc: Wolfram Sang <wsa@xxxxxxxxxxxxx> >>> --- >>> Jason, please test this patch and let us know if it fixes your problem. > > Unfortunately, no. For a normal power off, the subsequent boot hangs > as I was seeing before. However, if I rmmod the driver first and then > power off, the subsequent boot does not hang. Maybe i801_remove is > only called on rmmod, but not shutdown? Do we need to define > shutdown() for struct pci_driver? After userspace execution terminates and the kernel is running power off code, i801_enable_host_notify is called with "SMBSLVCMD value before initialization: 01" and "SMBSLVCMD value after initialization: 01". I don't any subsequent i2c_i801 messages - i801_disable_host_notify is patched to also log the SMBSLVCMD values. Regards, Jason