I have galaxy note 4 and i decided to restore it because it was so slow and suddenly the phone entered on (installing system update) mode and it's stocked in
Stock means that it has the official firmware. If there was an update available and you refused it enough times, it automatically installs (and you have to let it finish or the phone will stop working).