From mboxrd@z Thu Jan 1 00:00:00 1970 From: jianchao.w.wang@oracle.com (jianchao.wang) Date: Fri, 25 May 2018 11:10:39 +0800 Subject: [PATCHv3 9/9] nvme-pci: Don't wait for HMB completion on shutdown In-Reply-To: <20180524211539.GM11037@localhost.localdomain> References: <20180524203500.14081-1-keith.busch@intel.com> <20180524203500.14081-10-keith.busch@intel.com> <20180524204506.GA29048@lst.de> <20180524211539.GM11037@localhost.localdomain> Message-ID: <3452269f-a1bb-cfe6-635b-6b69a46862c1@oracle.com> Hi Keith On 05/25/2018 05:15 AM, Keith Busch wrote: >> Also if we really need to reset the controller submitting any command >> just doesn't seem very helpful. We might as well just skip trying >> to disable the HMB, as the controller needs to come up in a clean >> state anyway. > That's also fine with me. > Does it mean just need to disable the controller with transiting CC.EN ?1? to ?0? without sending any admin commands including deleting cq/sq ? The specification indeed says that when Controller Reset (CC.EN transitions from ?1? to ?0 - The controller stops processing any outstanding Admin or I/O commands. - All I/O Submission Queues are deleted. - All I/O Completion Queues are deleted. - The controller is brought to an Idle state. When this is complete, CSTS.RDY is cleared to ?0?. - The Admin Queue registers (AQA, ASQ, or ACQ) are not reset as part of a controller reset. All other controller registers defined in section 3 and internal controller state are reset. Then for the timeout case at least, for LIVE state, nvme_timeout could hand over all the things to reset_work and return BLK_EH_RESET_TIMER, when reset_work is ongoing, just disable the controller with setting CC.EN and disable the related pci things and return BLK_EH_HANDLED to complete the admin commands to wake up the reset_work. (certainly with your patch to move update_hw_nr to scan_work) nvme_timeout doesn't need to invoke nvme_dev_disable any more and life will be simpler :). Thanks jianchao