Commit 2174a08db80d ("sch_netem: acquire qdisc lock in netem_change()") was backported to older stables where it is causing 'sleeping in invalid context' bug. The following patch fixes the problem and can be cleanly applied to the stable branches affected. It was backported to 6.4.y about a month ago.