From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754049AbcBAMB0 (ORCPT ); Mon, 1 Feb 2016 07:01:26 -0500 Received: from smtp02.citrix.com ([66.165.176.63]:51591 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754014AbcBAMBY (ORCPT ); Mon, 1 Feb 2016 07:01:24 -0500 X-IronPort-AV: E=Sophos;i="5.22,379,1449532800"; d="scan'208";a="335248113" Subject: Re: [PATCH] Xen/PCI: correct notifier used for device removal To: Jan Beulich , Boris Ostrovsky , Konrad Rzeszutek Wilk References: <56AF566002000078000CCE71@prv-mh.provo.novell.com> CC: xen-devel , From: David Vrabel Message-ID: <56AF4911.8030208@citrix.com> Date: Mon, 1 Feb 2016 12:01:21 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 MIME-Version: 1.0 In-Reply-To: <56AF566002000078000CCE71@prv-mh.provo.novell.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/02/16 11:58, Jan Beulich wrote: > Commit 599bad38cf added BUS_NOTIFY_REMOVED_DEVICE in order to allow > avoiding removal of IOMMU mappings before the driver actually got > unbound from the device. Naturally we should be using this too. Because otherwise...? What happens if we don't make this change? Removing IOMMU mappings for a device when the driver is still bound to the device looks wrong to me. Surely the device is still active and may still be performing DMA at this point? David > --- 4.5-rc2/drivers/xen/pci.c > +++ 4.5-rc2-xen-PCI-remove-notifier/drivers/xen/pci.c > @@ -185,7 +185,7 @@ static int xen_pci_notifier(struct notif > case BUS_NOTIFY_ADD_DEVICE: > r = xen_add_device(dev); > break; > - case BUS_NOTIFY_DEL_DEVICE: > + case BUS_NOTIFY_REMOVED_DEVICE: > r = xen_remove_device(dev); > break; > default: > > >