Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp958402imu; Fri, 9 Nov 2018 08:41:45 -0800 (PST) X-Google-Smtp-Source: AJdET5dZ3xq7M6O3dkuuyYmQUoiAYc+ghNS+lokalFV79S/RjmW2rxPGkfb18MLnKCzeh1cco4Qq X-Received: by 2002:a63:b90a:: with SMTP id z10-v6mr8064904pge.221.1541781705060; Fri, 09 Nov 2018 08:41:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541781705; cv=none; d=google.com; s=arc-20160816; b=ROSAsFbmfaSzhDyH08a5wOi+tt/ceFlSUj0o3mVEsSOw9O3ZOpME/fWu4qD1giM4up ccYzJMLayhZ2Ie3m+W06YpQDEdbUkC1MgFuJTDJkXVrBzFl9KGg8V0MVyb+Ys9szQtqt nq0LbBBUdocRpAeQ82a5m0q6KmfC3uRD7U4frQRRS+V3ce9AvCH8Q/uZUD/iWGksaKM2 l2zDZAzWTULrwc0SKr/MCybubqM1zaDDmOvge9k6MldhZdsE4BtWpGkNFJg3UKBB4Gv4 /+QFlE0PyO142yjqM/MmNy2wlZ6MBZzHeTbpMThvUhEgpQamdeLHGpOFm+hae+DsJ8/L W5CQ== 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; bh=0e2YQAkHOn7O5bnFZOEpSut96/j8UmM9eVeL+Z7udXI=; b=PbcO4PGrNj/uzpg2ZNbgE4Rkk0JF0JcVQz0b4NhClejc1SMEGf8qCF0ByiMkT207iO SKdbR8GMMgIbLnxG2EgDUGGSotakpoOfOOCA/1D3Zn+3qm4ot7fuhB5xiunwQ+oq089f k6ZO2DdMR5Bd52BAEXABHEEEw6grAL4C+4IaUhZeJYvo40/8T0vzKoiwE7zlx7eYcTHh Dy782/pdCuERQaEFzmHBEmh8AmAiNF3kZ8Y5CZyAX+WKq/tFaAX8cLuatShlbncjeGoO 6zgQRoVorXggEbi6zGMfxLgBtw4/gFJJCSwkWzx7h0zYNlghFORBoj7vMzIox45b4ivn n6Lw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r68-v6si9061712pfk.151.2018.11.09.08.41.21; Fri, 09 Nov 2018 08:41:45 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728532AbeKJCV3 (ORCPT + 99 others); Fri, 9 Nov 2018 21:21:29 -0500 Received: from mga02.intel.com ([134.134.136.20]:41201 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727955AbeKJCV2 (ORCPT ); Fri, 9 Nov 2018 21:21:28 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Nov 2018 08:40:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,483,1534834800"; d="scan'208";a="106901690" Received: from unknown (HELO localhost.localdomain) ([10.232.112.69]) by orsmga001.jf.intel.com with ESMTP; 09 Nov 2018 08:40:06 -0800 Date: Fri, 9 Nov 2018 09:36:29 -0700 From: Keith Busch To: Greg Kroah-Hartman Cc: Lukas Wunner , Bjorn Helgaas , Alexandru Gagniuc , linux-pci@vger.kernel.org, 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: <20181109163629.GF2932@localhost.localdomain> 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> <20181109113257.GB29785@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181109113257.GB29785@kroah.com> User-Agent: Mutt/1.9.1 (2017-09-22) 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 03:32:57AM -0800, Greg Kroah-Hartman wrote: > 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 :) Indeed it is, but I don't want to abandon people with hardware in hand if we can make it work despite being broken. Perfection is the enemy of good. :) > > 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. The function has always been a private interface. It is not available for drivers to rely on. The only thing we're trying to accomplish is not start a transaction if software knows it will not succeed. There are certainly times when a transaction will fail that software does not forsee, but we're not suggesting the intent handles that either.