عَنْ عَلِيٍّ رَضِيَ اللَّهُ عَنْهُ قَالَ: كُنْتُ آتِي النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ فَأَسْتَأْذِنُ فَإِنْ كَانَ فِي صَلَاةٍ سَبَّحَ، وَإِنْ كَانَ فِي غَيْرِ صَلَاةٍ أَذِنَ لِي
Sayyiduna Ali (may Allah be pleased with him) says: I used to come to the Noble Prophet (peace and blessings be upon him). So when I would ask permission and he was in prayer, he would say "Subhan Allah," and if he was not in prayer, he would grant me permission.