NX can't wakeup from suspend via USB after L4T 4.5.1

Hi nvidia
In L4T 4.3 jetpack 4.4 ,
i add a script command to enable usb bus power.
Then nx can be waked up from suspend via usb mouse/keyboard action.

set-usb-suspend.sh
ls /sys/bus/usb/devices/*/power/wakeup > ~/wakeup.log
while IFS= read -r line  
do 
	echo "enabled" > "$line"
done < <(cat ~/wakeup.log)

add it to /etc/udev/rules.d/99-nv-l4t-usb-host-config.rules

 ACTION=="add", SUBSYSTEM=="usb", RUN+="/bin/sh -c '/usr/local/bin/set-usb-suspend.sh'"

But when i take this modify to 4.5.1 and 4.6 on NX ,
usb can’t wake ubuntu from suspend , thus /sys/bus/usb/devices/*/power/wakeup have been enabled already.

And it works as well while flash same modified L4T 4.6 package to TX2NX . (wakeup from usb dev)

Is there any difference of suspend operation after 4.5.1 on NX to make this affect?

Probably same as this topic.

The wakeup of HID devices is default off except keyboards supporting boot protocol.
Therefore, except for keyboards supporting boot protocol, HID devices cannot wake up the system by default.

hid-core.c
1152     /* Some keyboards don't work until their LEDs have been set.
1153      * Since BIOSes do set the LEDs, it must be safe for any device
1154      * that supports the keyboard boot protocol.
1155      * In addition, enable remote wakeup by default for all keyboard
1156      * devices supporting the boot protocol.
1157      */
1158     if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT &&
1159             interface->desc.bInterfaceProtocol ==
1160                 USB_INTERFACE_PROTOCOL_KEYBOARD) {
1161         usbhid_set_leds(hid);
1162         device_set_wakeup_enable(&dev->dev, 1);//  <-----------------------
1163     }

Hi Wayne :
I’ve check lsusb for hid devices i am using.
lsusb.txt (5.0 KB)
Both devices have boot protocol supported.

And hid-core.c in both 4.4 and 4.5.1 are identical for this function.

Is there any debug info i can check in 4.5.1/4.6 for this wakeup feature i wanted? (failed to wakeup via usb hid)

Is there any hub in the topology of your usb and they are not enabled during the suspension?

I’ve already set all usb power attribute enabled before entering “suspend” test.


When version is L4T4.5.1/L4T6.1 , it can’t wake up via usb mouse , and optical usb mouse bottom light is ON during suspend status , so the power of usb should already be enabled.
Attached txt is the log from L4T 4.3 of NX , which wake operation is worked via usb mouse.
nx4.3_suspend_wake.txt (39.2 KB)

Is this NV devkit or your custom board?

I just took a test on devkit , it seems wakeup is worked on devkit.
We will keep find root cause on our carrier board.

We connect MOD_SLEEP with PWR_LED_CTRL via a resistor on our carrier board, it worked properly after disconnected.