Merge Stephen Rothwell's patches