Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp274120ybe; Tue, 3 Sep 2019 22:37:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHD04nFX1EZ6B17cj9v+AbjKpdPeR3jZHYl6LvpfoegtpyiSW4/1/7Kjo9/wEjaD0Za4WW X-Received: by 2002:a62:8344:: with SMTP id h65mr44350810pfe.85.1567575473312; Tue, 03 Sep 2019 22:37:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567575473; cv=none; d=google.com; s=arc-20160816; b=xJyiADD+W/PQxKdB1slb2jM4sEJJkq4r4ely799M7QphY0YcGVOBgPq0ZWwVjG3Qby Q38cEGc8cTnMOJ0cDxP1DpL+i51PRzPZJbA2vLmH/G7Lwxpcm3wBDhymaFfGYXDRyPnf x4eBhLGsdG3pzuKgd4zbMh8blc9IQrqaTiTolK5rR1KiVs8lAq8LunYCETufduhCRe4C lph1W13HIsF0pRnV0uFgmJ50MuXdWnx3alo1HOZtMvVPW9qryl4jRJe11Z8W+/xYpRMK S9U9EqsLt8XqTFJ0dXmj9vCzYwQOznYc84ltlZqm6leEkWb1IrZGXpLIa06L2DSeyzIF pEHg== 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=929BqlwTu6e+SP0/bwZQfv4U/iVscP4/EPHvvp9OlpU=; b=t/Rev2lCo7zvnpL6NwvpUM4M9HOAbndIvyma7yE2TFcy6p5bcPhzeNSVv5HMPeWH73 PDBM9rJiICu1g9Uxhn1pX9eTValscZdhJYydOr8MJ7R3V+aU72EW9uJXOAJHSkazyCbT KRQGKGqZR9dVDFKBRQP52VvTHaH4ly3DZqds1mdwrW7qy/4s9/HyyjWE6KkLuBcq06jz slmZanLnsIS03lo/gSV6LYJaCCt45eGJ+ORxHksgq5NPZa1XcrSa7uUC4qulW+Ojo/XS d9ug5jPMITj9MkCUZB/dO6SegJl667DD2kBU9aqewZkOUjzPgPLYs5QBSpzqwVEngcms /VwQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a90si16986173plc.133.2019.09.03.22.37.37; Tue, 03 Sep 2019 22:37:53 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728448AbfIDFf0 (ORCPT + 99 others); Wed, 4 Sep 2019 01:35:26 -0400 Received: from bmailout3.hostsharing.net ([176.9.242.62]:45307 "EHLO bmailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbfIDFf0 (ORCPT ); Wed, 4 Sep 2019 01:35:26 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 6318A101C0753; Wed, 4 Sep 2019 07:35:24 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 0BD23CDF; Wed, 4 Sep 2019 07:35:24 +0200 (CEST) Date: Wed, 4 Sep 2019 07:35:23 +0200 From: Lukas Wunner To: Kelsey Skunberg Cc: bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, skhan@linuxfoundation.org, rafael.j.wysocki@intel.com, keith.busch@intel.com Subject: Re: [PATCH 2/2] PCI: Unify pci_dev_is_disconnected() and pci_dev_is_inaccessible() Message-ID: <20190904053523.7lmuoo5zempxtsdq@wunner.de> References: <20190904043633.65026-1-skunberg.kelsey@gmail.com> <20190904043633.65026-3-skunberg.kelsey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190904043633.65026-3-skunberg.kelsey@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 03, 2019 at 10:36:35PM -0600, Kelsey Skunberg wrote: > Change pci_dev_is_disconnected() call inside pci_dev_is_inaccessible() to: > > pdev->error_state == pci_channel_io_perm_failure > > Change remaining pci_dev_is_disconnected() calls to > pci_dev_is_inaccessible() calls. I don't think that's a good idea because it introduces a config space read (for the vendor ID) in places where we don't want that. E.g., after the check of pdev->error_state, a regular config space read may take place and if that returns all ones, we may already be able to determine that the device is inaccessible, obviating the need for a vendor ID check. Config space reads aren't for free. Thanks, Lukas