The keyboard and touchpad of my MacBook (early 2015) regularly get unresponsive. This happens with Ubuntu 16.04 as well as 18.04 (running 4.15.0-22-generic at the moment). The only key that still works is the power button. External USB mouse and keyboard still work, even when the internal ones are frozen.
The system logs are full of these kind of errors when this happens:
[ 381.932744] bcm5974 1-5:1.2: could not read from device [ 382.087823] usb 1-5: reset full-speed USB device number 3 using xhci_hcd [ 382.215631] usb 1-5: device descriptor read/64, error -71 [ 384.324150] input: bcm5974 as /devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5:1.2/input/input17 [ 384.324225] bcm5974 1-5:1.2: could not read from device [ 384.324228] bcm5974: mode switch failed
Sometimes it can be revived by entering and exiting Suspend through closing the lid.
dmesg dump with a full cycle of freeze-suspend-wakeup-unfreeze can be found here: https://pastebin.com/URHRUPJ2