Hello Manuel,
On Sun, May 01, 2016 at 09:32:46PM +0200, Manuel Roeder wrote:
> Hello! Here is the output (this is a newer Testkernel 4.5.2 with no
> patches, only one rtc-driver is enabled rtc-s35390a the rest is debian
> kernel-config. If needed I can backup the actual kernel/initrd and
> test again.
I'm surprised that rebinding after the i2cget command fails, but I don't
think the kernel version matters here.
>             bash-3150  [000] .... 245704.945876: i2c_read: i2c-0 #0 a=030 f=0001 l=1
>             bash-3150  [000] .... 245704.945974: i2c_reply: i2c-0 #0 a=030 f=0001 l=1 [70]
>             bash-3150  [000] .... 245704.945978: i2c_result: i2c-0 n=1 ret=1
>             bash-3150  [000] .... 245704.945981: i2c_read: i2c-0 #0 a=031 f=0001 l=1
>             bash-3150  [000] .... 245704.946075: i2c_reply: i2c-0 #0 a=031 f=0001 l=1 [00]
>             bash-3150  [000] .... 245704.946079: i2c_result: i2c-0 n=1 ret=1
>             bash-3150  [000] .... 245704.946082: i2c_read: i2c-0 #0 a=030 f=0001 l=1
>             bash-3150  [000] .... 245704.946175: i2c_reply: i2c-0 #0 a=030 f=0001 l=1 [70]
>             bash-3150  [000] .... 245704.946178: i2c_result: i2c-0 n=1 ret=1
>             bash-3150  [000] .... 245704.946181: i2c_read: i2c-0 #0 a=032 f=0001 l=7
>             bash-3150  [000] .... 245704.946467: i2c_reply: i2c-0 #0 a=032 f=0001 l=7 [68-a0-80-00-9a-44-98]
>             bash-3150  [000] .... 245704.946471: i2c_result: i2c-0 n=1 ret=1
>             bash-3150  [000] .... 245704.946505: i2c_read: i2c-0 #0 a=032 f=0001 l=7
>             bash-3150  [000] .... 245704.946755: i2c_reply: i2c-0 #0 a=032 f=0001 l=7 [68-a0-80-00-9a-44-98]
>             bash-3150  [000] .... 245704.946760: i2c_result: i2c-0 n=1 ret=1
>             bash-3150  [000] .... 245704.946765: i2c_read: i2c-0 #0 a=031 f=0001 l=1
>             bash-3150  [000] .... 245704.946852: i2c_reply: i2c-0 #0 a=031 f=0001 l=1 [00]
>             bash-3150  [000] .... 245704.946855: i2c_result: i2c-0 n=1 ret=1
looks fine up to here.
>           i2cget-3173  [000] .... 245732.145408: smbus_read: i2c-0 a=030 f=0000 c=1 BYTE_DATA
>           i2cget-3173  [000] .... 245732.145418: i2c_write: i2c-0 #0 a=030 f=0000 l=1 [01]
>           i2cget-3173  [000] .... 245732.145420: i2c_read: i2c-0 #1 a=030 f=0001 l=1
>           i2cget-3173  [000] .... 245732.155145: i2c_result: i2c-0 n=0 ret=-5
ok, this is an operation that the rtc doesn't like. There is a one
written to a ro-bit and it responds with EIO. That's unusual ok.
>           i2cget-3173  [000] .... 245732.155150: smbus_reply: i2c-0 a=030 f=0000 c=1 BYTE_DATA l=1 [79]
>           i2cget-3173  [000] .... 245732.155153: smbus_result: i2c-0 a=030 f=0000 c=1 BYTE_DATA rd res=-5
>             bash-3150  [000] .... 245744.882560: i2c_read: i2c-0 #0 a=030 f=0001 l=1
>             bash-3150  [000] .... 245746.888363: i2c_result: i2c-0 n=0 ret=-110
Now the driver wants to bind again but the request to read the Status
Register 1 times out. I guess the chip is still angry on us.
A bad thing about the rtc chip is that the flags are cleared at read. So
if it's in a strange state this is only signaled once[1]. And additionally
i2cget isn't really usable to read out the chip because it uses a
different protocol.
Can you please report (with the machine in the broken state) the output of
	echo 1 > /sys/kernel/debug/tracing/events/i2c/enable
	cat /sys/class/rtc/rtc0/wakealarm
	echo 0 > /sys/class/rtc/rtc0/wakealarm
	cat /sys/class/rtc/rtc0/wakealarm
	cat /sys/kernel/debug/tracing/trace
Is the machine after this sequence still unable to shut down?
Best regards
Uwe
[1] if you're a hardware engineer and consider implementing something
    like that: Don't do it unless you want your driver authors to curse
    on you. This is really stupid.
Attachment:
signature.asc
Description: PGP signature