3.12: update to latest mainline, fix merge conflicts

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>