From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966316AbbBCReR (ORCPT ); Tue, 3 Feb 2015 12:34:17 -0500 Received: from 8bytes.org ([81.169.241.247]:52611 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965720AbbBCReQ (ORCPT ); Tue, 3 Feb 2015 12:34:16 -0500 Date: Tue, 3 Feb 2015 18:34:13 +0100 From: Joerg Roedel To: Peter Zijlstra Cc: Linus Torvalds , Benjamin LaHaise , linux-aio@kvack.org, Linux Kernel , Jesse Barnes Subject: Re: [PATCH] iommu/amd: Fix amd_iommu_free_device() Message-ID: <20150203173413.GI3702@8bytes.org> References: <20150201144058.GM2974@kvack.org> <20150201221458.GN2974@kvack.org> <20150202001628.GO2974@kvack.org> <20150203112733.GM26304@twins.programming.kicks-ass.net> <20150203122551.GJ24151@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150203122551.GJ24151@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, On Tue, Feb 03, 2015 at 01:25:51PM +0100, Peter Zijlstra wrote: > Subject: iommu/amd: Fix amd_iommu_free_device() > > put_device_state_wait() doesn't loop on the condition and a spurious > wakeup will have it free the device state even though there might still > be references out to it. Hmm, have you seen spurious wakeups happening? The wakeup only comes from put_device_state() and only when the reference count goes to zero. >>From my understanding this should be correct, but maybe I got the API wrong. Joerg