<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }body { font-size: 10.5pt; font-family: 'Microsoft YaHei UI'; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span>Hi,Andrey</div><div><br></div><div>Thanks for your time.</div><div><br></div><div>Sorry, I have NOT given you guys  info.</div><div><br></div><div>The lsmod command output is :</div><div><span style="font-family: "" microsoft="" yahei="" ui'";="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'="">Module                  Size  Used by<br>nls_ascii              16384  1<br>nls_cp437              20480  1<br>vfat                   20480  1<br>fat                    69632  1 vfat<br>uas                    24576  0<br>usb_storage            73728  4 uas<br>fuse                   98304  7<br>evdev                  24576  8<br>pcspkr                 16384  0<br>crct10dif_pclmul       16384  0<br>crc32_pclmul           16384  0<br>serio_raw              16384  0<br>sg                     32768  0<br>ghash_clmulni_intel    16384  0<br>wmi                    16384  0<br>ac                     16384  0<br>button                 16384  0<br>video                  40960  0<br>acpi_cpufreq           20480  0<br>amdkfd                139264  1<br>radeon               1486848  3<br>ttm                    98304  1 radeon<br>drm_kms_helper        155648  1 radeon<br>drm                   360448  6 radeon,ttm,drm_kms_helper<br>i2c_algo_bit           16384  1 radeon<br>ip_tables              24576  0<br>x_tables               36864  1 ip_tables<br>ext4                  585728  1<br>crc16                  16384  1 ext4<br>jbd2                  106496  1 ext4<br>crc32c_generic         16384  0<br>fscrypto               28672  1 ext4<br>ecb                    16384  0<br>aesni_intel           167936  0<br>glue_helper            16384  1 aesni_intel<br>lrw                    16384  1 aesni_intel<br>gf128mul               16384  1 lrw<br>ablk_helper            16384  1 aesni_intel<br>cryptd                 24576  3 ablk_helper,ghash_clmulni_intel,aesni_intel<br>aes_x86_64             20480  1 aesni_intel<br>mbcache                16384  2 ext4<br>sd_mod                 45056  5<br>hid_generic            16384  0<br>usbhid                 53248  0<br>hid                   122880  2 hid_generic,usbhid<br>crc32c_intel           24576  2<br>psmouse               135168  0<br>xhci_pci               16384  0<br>xhci_hcd              188416  1 xhci_pci<br>ehci_pci               16384  0<br>ahci                   36864  1<br>libahci                32768  1 ahci<br>uhci_hcd               45056  0<br>libata                249856  2 ahci,libahci<br>ehci_hcd               81920  1 ehci_pci<br>usbcore               249856  8 usbhid,usb_storage,ehci_hcd,uhci_hcd,xhci_pci,uas,xhci_hcd,ehci_pci<br>scsi_mod              225280  5 sd_mod,usb_storage,libata,uas,sg<br>usb_common             16384  1 usbcore<br>r8169                  81920  0<br>mii                    16384  1 r8169<br></span></div><div><span style="font-family: "" microsoft="" yahei="" ui'";="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'=""><br></span></div><div>The output of lsub command :</div><div><br></div><div><span style="font-family: "" microsoft="" yahei="" ui'";="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'="">Bus 008 Device 003: ID 0951:1666 Kingston Technology DataTraveler G4<br>Bus 008 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub<br>Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br>Bus 005 Device 007: ID 0951:1624 Kingston Technology DataTraveler G2<br>Bus 005 Device 003: ID 05e3:0610 Genesys Logic, Inc. 4-port hub<br>Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br>Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br>Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br>Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br>Bus 002 Device 002: ID 413c:2105 Dell Computer Corp. Model L100 Keyboard<br>Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br>Bus 001 Device 002: ID 0461:4e04 Primax Electronics, Ltd <br>Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub</span></div><div><span style="font-family: "" microsoft="" yahei="" ui'";="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'=""><br></span></div>
<div>And also I would like to share some other info:</div><div>1 After trying some other  more than10 different  <span style="font-size: 10.5pt; line-height: 1.5; background-color: window;">model </span><span style="font-size: 10.5pt; line-height: 1.5; background-color: window;">USB keyboard , the problem always exists( PS2 keyboard/mouse do NOT have this problem);</span></div><div>2 The problem shows in other different machines(regular desktop machine);</div><div>3 The problem exists in linux; window 10 do NOT have it;</div><div>3 After adding some print info and delay( mdelay(5000); )  within kernel's suspending routine ( </div><div>file:kernel/power/suspend.c</div><div>function: static int suspend_enter(suspend_state_t state, bool *wakeup)</div><div>where: just before <span style="font-family: ''; font-size: 10.5pt; line-height: 1.5; background-color: window;"><i>error = platform_suspend_prepare_late(state);</i></span></div><div>) and make the kernel's loglevel to 8( console=ttyS0,115200n8 loglevel=8 no_console_suspend ) from the serial console, </div><div>I confirm that there is a time window during the suspending, within which any keypress or mouse press will cause the keyboard or mouse dead.</div><div>I guess  this has to do with kernel (maybe also BIOS).</div><div><br></div><div>Thanks again.</div><div><br></div><div>Jim</div><div><br></div><hr style="width: 210px; height: 1px; display: none;" color="#b5c4df" size="1" align="left">
<div><span></span></div>
<blockquote style="margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em;"><div> </div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px;FONT-FAMILY:tahoma;COLOR:#000000; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><div><b>From:</b> <a href="mailto:martink@posteo.de">Martin Kepplinger</a></div><div><b>Date:</b> 2017-09-05 14:32</div><div><b>To:</b> <a href="mailto:jingyun@cpu-os.ac.cn">jingyun</a></div><div><b>CC:</b> <a href="mailto:andrej.skvortzov@gmail.com">Andrey Skvortsov</a>; <a href="mailto:kernelnewbies@kernelnewbies.org">kernelnewbies</a></div><div><b>Subject:</b> Re: Re: USB keyboard can NOT wakeup from S3( suspend to RAM )</div></div></div><div><div>Am 31.08.2017 01:06 schrieb jingyun@cpu-os.ac.cn:</div>
<div>> Hi, Andrey</div>
<div>> </div>
<div>> Q:</div>
<div>> Do you mean that wakeup by keyboard doesn't work only if PC was</div>
<div>> suspended by pressing special suspend key on your keyboard?</div>
<div>> </div>
<div>> Answer:</div>
<div>> No.</div>
<div>> Wakeup by keyboard doesn't work only if I pressing the keyboard (fast</div>
<div>> enough) during the suspend.</div>
<div>> It has nothing to do with suspending method.</div>
<div>> </div>
<div>> Q:</div>
<div>> And if it was suspended by from operating system or by pressing button</div>
<div>> on case wakeup by keyboard does work?</div>
<div>> </div>
<div>> Answer:</div>
<div>> The problem has nothing to do with suspending method.</div>
<div>> Whatever the suspending method is( from desktop or echo mem ></div>
<div>> /sys/power/stat ), if I do NOT hit the keyboard during the suspend,</div>
<div>> then</div>
<div>> wakeup by keyboard does work.</div>
<div>> But if I hit the keyboard fast enough during the suspend, then after</div>
<div>> the suspend the keyboard seems dead.</div>
<div>> And wakeup by keyboard does NOT work any more.</div>
<div>> </div>
<div>> Thanks for your time.</div>
<div>> </div>
<div>> Jim</div>
<div>> </div>
<div>> -------------------------</div>
<div>> </div>
<div>>> FROM: Andrey Skvortsov</div>
<div>>> DATE: 2017-08-30 15:45</div>
<div>>> TO: jingyun@cpu-os.ac.cn</div>
<div>>> CC: kernelnewbies</div>
<div>>> SUBJECT: Re: USB keyboard can NOT wakeup from S3( suspend to RAM )</div>
<div>>> </div>
<div>>> On 17-08-16 18:03, jingyun@cpu-os.ac.cn wrote:</div>
<div>>>> hi, there</div>
<div>>>> </div>
<div>>>> thx in advance;</div>
<div>>>> </div>
<div>>>> I encounter a strange (maybe) bug:</div>
<div>>>> During the suspending of my linux box(which runs debian 9), I hit</div>
<div>>> the key of the USB interfaced keyboard;</div>
<div>>>> after making sure the box enter suspend state for a while ( which</div>
<div>>> I can tell from the power LED blinks),</div>
<div>>>> I can NOT wakeup it by hit that keyboard any more.</div>
<div>>>> But if I do NOT hit the key during the suspending, I CAN wake it</div>
<div>>> up by hitting the keyboard.</div>
<div>>> </div>
<div>>> Do you mean that wakeup by keyboard doesn't work only if PC was</div>
<div>>> suspended by pressing special suspend key on your keyboard?</div>
<div>>> And if it was suspended by from operating system or by pressing</div>
<div>>> button</div>
<div>>> on case wakeup by keyboard does work?</div>
<div>>> </div>
<div>>>> After that I tried Ubuntu 16.04(runs 4.4 version kernel ) and</div>
<div>>> Ubuntu 14.04 ( 3.13 kernel).</div>
<div>>>> And I found all of them got the same problem;</div>
<div>>>> </div>
<div>>>> Do not know if this is the right place to ask. Just a try.</div>
<div>>>> </div>
<div>>>> Thanks again.</div>
<div> </div>
<div>Sounds like a bug. Doesn't *have* to be in the kernel though. At least </div>
<div>it sounds like</div>
<div>pressing buttons "during" suspending resets a state to resumed before it </div>
<div>actually</div>
<div>suspended - preventing to resume...</div>
<div> </div>
<div>Is it an ordanary usb keyboard? Could you append the output of lsmod, </div>
<div>the modules</div>
<div>you are using and lsusb?</div>
<div> </div>
</div></blockquote>
</body></html>