According to upgrade advisor, I need to upgrade it to be 9.3 first.
Therefore, on the same night, I will upgrade ontap from 9.1P5 to 9.3P12 and then 9.5P2.
As I know that, after i upgrade it to 9.3P12, there are several firmware will be update automatically if the version in your cluster is older than the firmware that is bundled with the ONTAP upgrade package.
They are BIOS, Flash Cache, SP, Disk, and Disk shelf.
My question here is
Do I need to wait for all those firmware upgrade completed and then upgrade it from 9.3P12 to 9.5P2 or I can continue to upgrade it to 9.5P2 after veified the version - 9.3P12 and HA status, aggregate, and lifs are home port?
9.3P12 release on 5/27/2019
9.5P2 release on 3/24/2019 which is earlier then 9.3P12.
I would pick the latest P releases. But I would not jump from 9.1 to 9.3 to 9.5 in one day. When I run through this with customers I typically will wait a week or so between the major updates.
But to answer your question, yes you will need to wait for all the background firmware updates to finish before moving on. The disk and shelf firmware could be the same between the two versions, but SPs and other firmware will be different between 9.3 and 9.5.
I would also run through the IMT to verify that everything in your environment has compatibility with the new versions of ONTAP.
If you have firewalls between some of your lifs, be sure to verify your routes. Ontap 9.2 had major changes including removal of fastpath, this can really break things. This really burned me on my upgrade to 9.3.