WAKE on LAN broken on Apalis TK1

Hello,

We had managed to get Wake-on-LAN working on toradex_tk1_l4t_r21.5-next back in Feb 2017. But recently on BSP v2.7.4 it’s broken again. Putting the TK1 into LP1, we were able to wake up using GPIO or clock but not LAN.

Looking at dmesg for something related we see this.

[    6.561797] of_get_named_gpio_flags exited with status 235
[    6.561819] of_get_named_gpio_flags exited with status 117
[    6.561886] gpio wake14 for gpio=235
[    6.567325] _gpio_request: gpio-117 (WOL_GPIO) status -16
[    6.567337] gpio-keys gpio-keys.3: Failed to request GPIO 117, error -16
[    6.575897] gpio-keys: probe of gpio-keys.3 failed with error -16

We looked at the kernel tree to see if I could figure out what was broken.

http://git.toradex.com/cgit/linux-toradex.git/commit/?h=toradex_tk1_l4t_r21.5-next&id=7ad9771527d2b1c884beb22d9df28bae899f8d3d

This commit seemed to touch the Ethernet code. One thing we noticed is that gpio_request(LAN_WAKE_N, "LAN_WAKE_N"); is done, but there doesn’t seem to be a equivalent gpio_release.

You’re right, we need to release the GPIO for WOL to be possible. Please try with this patch:
http://git.toradex.com/cgit/linux-toradex.git/commit/?h=toradex_tk1_l4t_r21.6-next&id=ac337dd506037f5971644a11ac6370829b3ffe14

Thanks! This works. Hope this goes into the next release :slight_smile:

Unless it causes problems in testing it will be in 2018 Q1 release.