From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:39232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giwWQ-0000F2-7r for qemu-devel@nongnu.org; Mon, 14 Jan 2019 02:18:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giwWO-0003WF-9e for qemu-devel@nongnu.org; Mon, 14 Jan 2019 02:18:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32974) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1giwWM-0003RR-DZ for qemu-devel@nongnu.org; Mon, 14 Jan 2019 02:18:56 -0500 Date: Mon, 14 Jan 2019 15:18:46 +0800 From: Peter Xu Message-ID: <20190114071846.GF24343@xz-x1> References: <20190113143641.38936-1-lifei1214@126.com> <20190114033130.GE24343@xz-x1> <87va2rwwlc.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87va2rwwlc.fsf@dusky.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH] hw/misc/edu: add msi_uninit() for pci_edu_uninit() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Fei Li , "Michael S . Tsirkin" , qemu-devel@nongnu.org, shirley17fei@gmail.com On Mon, Jan 14, 2019 at 08:02:23AM +0100, Markus Armbruster wrote: > Peter Xu writes: > > > On Sun, Jan 13, 2019 at 10:36:41PM +0800, Fei Li wrote: > >> From: Fei Li > >> > >> Let's supplement the msi_uninit() when failing to realize > >> the pci edu device. > >> > >> Cc: Markus Armbruster > >> Cc: Peter Xu > >> Cc: Michael S. Tsirkin > >> Cc: Marcel Apfelbaum > >> Signed-off-by: Fei Li > >> --- > >> hw/misc/edu.c | 1 + > >> 1 file changed, 1 insertion(+) > >> > >> diff --git a/hw/misc/edu.c b/hw/misc/edu.c > >> index cdcf550dd7..4feb7503de 100644 > >> --- a/hw/misc/edu.c > >> +++ b/hw/misc/edu.c > >> @@ -367,6 +367,7 @@ static void pci_edu_uninit(PCIDevice *pdev) > >> { > >> EduState *edu = EDU(pdev); > >> > >> + msi_uninit(pdev); > > > > It would be cleaner to me to call this after the join() since > > edu_fact_thread() could potentially use msi_*() helpers then the > > destructions follow the reverse order of init. > > Destruction in reverse creation order is good practice. > > This being the "QEMU educational PCI device", good practice is even more > desirable. Very persuasive. With that, I'd like to withdraw my excuse of "msi_uninit() is optional" too. :) Fei, please feel free to pick my r-b if you want to repost, and IMHO you can also add: Reported-by: Markus Armbruster Thanks, -- Peter Xu