Sayyiduna Ali (may Allah be pleased with him) narrates that when I used to come to the service of the Prophet (peace and blessings be upon him), if the Prophet (peace and blessings be upon him) was standing and performing prayer at that time, he would say "Subhan Allah"; this would be a sign that I was permitted to enter. And if the Prophet (peace and blessings be upon him) was not performing prayer at that time, he would simply grant permission (and there would be no need to say "Subhan Allah").