Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp628150imu; Fri, 9 Nov 2018 03:34:02 -0800 (PST) X-Google-Smtp-Source: AJdET5cfDAOlzL96L3Kyof5eNjkzZozVBzqhKuwBljI6VVOZtslR2nbJNHrMOQezUwkrjuOav4xA X-Received: by 2002:a17:902:aa84:: with SMTP id d4-v6mr8680874plr.25.1541763242935; Fri, 09 Nov 2018 03:34:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541763242; cv=none; d=google.com; s=arc-20160816; b=fLJ7uaxJKPt3aYeEbvG74LQ1y7eu/T+AaWFC425Ch7TLVUNFtVeHqykMTz0LnCj0hp gzb/wajAsahRzwivBabPt1dXrjVs1JN7AqivLuUoq+ZQiDhWkzjvw4i9pIpTW13qI22A J5bkz9Tm1GGtNur38WPeh2bABmnf5n+32zM+E5LQn51nVMmmsfsfUJSwUUj2n+apt8PD muSujaKbq5vQvcLV0j9AsS4//og3pI5mkK/bbKJpVtmpV8JVatxeDw3x0ipXD/8ftZ6Q YTWpSVx6lOYxXerT1fQJUHp8nzqvSw44tijjQyG6fRdssQqG148+QNgyMpZIzbghqDsn AyWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=I/Be62U912kjkkJirnIIjuH3gb/qk2LE9omokJkbgrw=; b=UiKq3uq/b2zkcaP2dEUSCJYWYXte+biODFkveP66AKaU8/2eUABWB8Iy6WIwa0yPmS OsHudEIGVOWJ8l6IbWpfp9ELwd95EjgEmxMrMXHCplGurVv97Ht6T0QJahnUV74DRhmI 5/Qp8n7CDSRIuCqnivzbt+dw+oh30GWhbb05kM5EbbP92zMnVabFyPU7pRz2G6dnG5+4 Xd6Y1CgFwAZ8VlonmUJXshaU7tFRh+vaxqjDfCMLXldD41o9rT/CSl2LOqn7+pcirh4V BWTYAjV6tYpMJ7VLfEzxftCvJpQ+HODeeQ5XySG+CHv62lg/8lgy3206pi92LbTgTFu/ Ftcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Tozr26f2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k6si6983564pgr.500.2018.11.09.03.33.46; Fri, 09 Nov 2018 03:34:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Tozr26f2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728299AbeKIVNM (ORCPT + 99 others); Fri, 9 Nov 2018 16:13:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:49562 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727596AbeKIVNM (ORCPT ); Fri, 9 Nov 2018 16:13:12 -0500 Received: from localhost (71-6-98-120.static-ip.telepacific.net [71.6.98.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A84C520825; Fri, 9 Nov 2018 11:32:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541763178; bh=0DUF34A95pkCj93K68jf3LRXiQrTfL8ZmLN1ZhB5A30=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Tozr26f2KCK6bZF3T7jOTCNnJj3hvHyXvM6dbBm2a+JTH/ehrOGD+zkg5kg8nVp7w US8MDdsB032ur6avIu0eUoXA73d85ixGax85t3gYlhEEtZP7V8hxbdAk2lugcmLN7q SBaoCeqTJbteJ1e4tj9KOAH7jHGwNThWie8o1Yeg= Date: Fri, 9 Nov 2018 03:32:57 -0800 From: Greg Kroah-Hartman To: Lukas Wunner Cc: Bjorn Helgaas , Alexandru Gagniuc , linux-pci@vger.kernel.org, keith.busch@intel.com, alex_gagniuc@dellteam.com, austin_bolen@dell.com, shyam_iyer@dell.com, linux-kernel@vger.kernel.org, Jonathan Derrick , Russell Currey , Sam Bobroff , Oliver O'Halloran , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v2] PCI/MSI: Don't touch MSI bits when the PCI device is disconnected Message-ID: <20181109113257.GB29785@kroah.com> References: <20180918221501.13112-1-mr.nuke.me@gmail.com> <20181107234257.GC41183@google.com> <20181108200855.GE41183@google.com> <20181108220117.GA11466@kroah.com> <20181109072953.ox7qfpnibb7drmf6@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181109072953.ox7qfpnibb7drmf6@wunner.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 09, 2018 at 08:29:53AM +0100, Lukas Wunner wrote: > On Thu, Nov 08, 2018 at 02:01:17PM -0800, Greg Kroah-Hartman wrote: > > On Thu, Nov 08, 2018 at 02:09:17PM -0600, Bjorn Helgaas wrote: > > > I'm having second thoughts about this. One thing I'm uncomfortable > > > with is that sprinkling pci_dev_is_disconnected() around feels ad hoc > > > > I think my stance always has been that this call is not good at all > > because once you call it you never really know if it is still true as > > the device could have been removed right afterward. > > > > So almost any code that relies on it is broken, there is no locking and > > it can and will race and you will loose. > > Hm, to be honest if that's your impression I think you must have missed a > large portion of the discussion we've been having over the past 2 years. > > Please consider reading this LWN article, particularly the "Surprise > removal" section, to get up to speed: > > https://lwn.net/Articles/767885/ > > You seem to be assuming that all we care about is the *return value* of > an mmio read. However a transaction to a surprise removed device has > side effects beyond returning all ones, such as a Completion Timeout > which, with thousands of transactions in flight, added up to many seconds > to handle removal of an NVMe array and occasionally caused MCEs. Again, I still claim this is broken hardware/firmware :) > It is not an option to just blindly carry out device accesses even though > it is known the device is gone, Completion Timeouts be damned. I don't disagree with you at all, and your other email is great with summarizing the issues here. What I do object to is somehow relying on that function call as knowing that the device really is present or not. It's a good hint, yes, but driver authors still have to be able to handle the bad data coming back from when the call races with the device being removed. > However there is more to it than just Completion Timeouts, this is all > detailed in the LWN article. And that's a great article and your work here is much appreciated. I think we are in violent agreement :) thanks, greg k-h