From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Subject: Re: [PATCH 07/37] iommu: Add a page fault handler To: Jonathan Cameron References: <20180212183352.22730-1-jean-philippe.brucker@arm.com> <20180212183352.22730-8-jean-philippe.brucker@arm.com> <20180308164035.000065c2@huawei.com> From: Jean-Philippe Brucker Message-ID: Date: Wed, 14 Mar 2018 13:08:07 +0000 MIME-Version: 1.0 In-Reply-To: <20180308164035.000065c2@huawei.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , "xieyisheng1@huawei.com" , "ilias.apalodimas@linaro.org" , "kvm@vger.kernel.org" , "linux-pci@vger.kernel.org" , "xuzaibo@huawei.com" , Will Deacon , "okaya@codeaurora.org" , "yi.l.liu@intel.com" , Lorenzo Pieralisi , "ashok.raj@intel.com" , "tn@semihalf.com" , "joro@8bytes.org" , "robdclark@gmail.com" , "bharatku@xilinx.com" , "linux-acpi@vger.kernel.org" , Catalin Marinas , "rfranz@cavium.com" , "lenb@kernel.org" , "devicetree@vger.kernel.org" , "jacob.jun.pan@linux.intel.com" , "alex.williamson@redhat.com" , "robh+dt@kernel.org" , "thunder.leizhen@huawei.com" , "bhelgaas@google.com" , "linux-arm-kernel@lists.infradead.org" , "shunyong.yang@hxt-semitech.com" , "dwmw2@infradead.org" , "liubo95@huawei.com" , "rjw@rjwysocki.net" , "jcrouse@codeaurora.org" , "iommu@lists.linux-foundation.org" , "hanjun.guo@linaro.org" , Sudeep Holla , Robin Murphy , "christian.koenig@amd.com" , "nwatters@codeaurora.org" Content-Type: text/plain; charset="us-ascii" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+bjorn=helgaas.com@lists.infradead.org List-ID: Hi Jonathan, Thanks for reviewing On 08/03/18 15:40, Jonathan Cameron wrote: >> +/** >> + * iommu_fault_queue_unregister() - Unregister an IOMMU driver from the fault >> + * queue. >> + * @flush_notifier: same parameter as iommu_fault_queue_register >> + */ >> +void iommu_fault_queue_unregister(struct notifier_block *flush_notifier) >> +{ >> + down_write(&iommu_fault_queue_sem); >> + if (refcount_dec_and_test(&iommu_fault_queue_refs)) { >> + destroy_workqueue(iommu_fault_queue); >> + iommu_fault_queue = NULL; >> + } >> + up_write(&iommu_fault_queue_sem); >> + >> + if (flush_notifier) >> + blocking_notifier_chain_unregister(&iommu_fault_queue_flush_notifiers, >> + flush_notifier); > I would expect the ordering in queue_unregister to be the reverse of queue > register (to make it obvious there are no races). > > That would put this last block at the start before potentially destroying > the work queue. If I'm missing something then perhaps a comment to > explain why the ordering is not the obvious one? Sure, I'll fix the order, I don't think there was any good reason for it Thanks, Jean _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel