There is a certain Shutdown bug, caused by ehci_hcd module (Enhanced Host Controlled Interface). What happens is that when you are on battery power and you try shutting down the laptop by using shutdown -h 0 command or poweroff, the system halts and then automatically reboots. The funny part is that even if you issue a ‘halt’ command while at the grub bootloader, the system reboots for one more time. i.e, you will have to issue halt twice (Grub bootloader -> halt -> system halts and reboots -> Grub bootloader -> halt -> system halts).
While running on AC power, the system shutdown works just fine and so the automatic thought initially is that it is caused by laptop-mode-tools, which comes up while working on battery. But lmt is not the culprit, the culprit is actually the ehci_hcd module (atleast for Sony VAIO VPCEA series laptop they are).
So, if you are facing this issue, try to remove this module before issuing poweroff or shutdown -h 0. The command to remove this modules is :
You can also put the above command into rc.local.shutdown so as to automate the procedure.