Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3404006pxb; Wed, 13 Oct 2021 05:27:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/D02f/deiNEikfznRIQlQ470J6dwcLRLVlQxcQwb+pypAb7p6cUSpKOk4hXhkzyKkNBFC X-Received: by 2002:a17:90b:4f90:: with SMTP id qe16mr13410055pjb.137.1634128024201; Wed, 13 Oct 2021 05:27:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634128024; cv=none; d=google.com; s=arc-20160816; b=y41xVSfoqsHY0i1jvbYHZywGmDaVf4Vqbixsl6M2+SIHcmsGY+vJIz1sk5bkBnlDPd rEf1ouHAy3BsVqMg6P5aG7ElCBtNEX794mPzBaNFyMiC5+ps//j+j4GDObUZzGRDyHzZ RgXGdxHgxWm+6PdTaVx905TDEfK3CLI7gUdVUk72OLZOyN2UyG/BjLzMFjFUqquh+nZY U82N0eMa6Aw7Cq73roX03gLJWiltXgP08X21+ljF1FS+EM6WY3pYj6mKD5WCRI3ta8Fm mZEntcPEhYlpWOXGgqhExKBicehymqFr6XH8DcWV05Vu0Pera2P3VwZ2bBNpm/ZEc9hI /ASQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=UjMSPzxSpfVzrNTsm1DYlWYwEUedkQZLra9wcmfsnAo=; b=JCuxtfPOJKdbmucEmUa06Uz8j2+OQG3/g/1tot7EdFf+d2iPGoMXojfwGizas8CvAh S+4pG1HlNsR47gyUDnLUNVgXotOpcpHwtph3gFJ0TTlbkGVeQM7jCUvjEVOCWHfaRJbT qKIrKjXj9YOZiNNXvkDiw6p5VKT/jNSdYtd9yCssfCXZxDjxpq+OU1sOQJhI+j+n6FE7 Beo3WP7gnjjGngOYhRuWGnmJ7JGFPekBnXi34L4JVyW1EGdzxIZbH/ri4IO86aVoKrJw JTM7i0NmlbVE9aM8Qyk28Du9S+Wlk4nS0Xzs5vZvyqZEJ9UIJ4CCemeY/L/1cnGNe9tY qsZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t22si6364409pfl.302.2021.10.13.05.26.46; Wed, 13 Oct 2021 05:27:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233049AbhJMM1h (ORCPT + 99 others); Wed, 13 Oct 2021 08:27:37 -0400 Received: from bmailout1.hostsharing.net ([83.223.95.100]:35125 "EHLO bmailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233204AbhJMM1g (ORCPT ); Wed, 13 Oct 2021 08:27:36 -0400 X-Greylist: delayed 311 seconds by postgrey-1.27 at vger.kernel.org; Wed, 13 Oct 2021 08:27:36 EDT 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 "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 665DF3002AD66; Wed, 13 Oct 2021 14:20:19 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 52E72184F9A; Wed, 13 Oct 2021 14:20:19 +0200 (CEST) Date: Wed, 13 Oct 2021 14:20:19 +0200 From: Lukas Wunner To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Naveen Naidu , bhelgaas@google.com, linux-kernel-mentees@lists.linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Kuppuswamy Sathyanarayanan , Amey Narkhede Subject: Re: [PATCH 16/22] PCI: pciehp: Use RESPONSE_IS_PCI_ERROR() to check read from hardware Message-ID: <20211013122019.GA17324@wunner.de> References: <36c7c3005c4d86a6884b270807d84433a86c0953.1633972263.git.naveennaidu479@gmail.com> <20211011194740.GA14357@wunner.de> <20211012160505.3dov6gjnmxdq5lz6@theprophet> <20211012231201.xj7fvfgvpde5wwrl@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211012231201.xj7fvfgvpde5wwrl@pali> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 13, 2021 at 01:12:01AM +0200, Pali Roh?r wrote: > > On 11/10, Lukas Wunner wrote: > > > On Mon, Oct 11, 2021 at 11:37:33PM +0530, Naveen Naidu wrote: > > > > An MMIO read from a PCI device that doesn't exist or doesn't respond > > > > causes a PCI error. There's no real data to return to satisfy the > > > > CPU read, so most hardware fabricates ~0 data. > > > > > > > > Use RESPONSE_IS_PCI_ERROR() to check the response we get when we read > > > > data from hardware. > > > > > > Actually what happens is that PCI read transactions *time out*, > > > so the host controller fabricates a response. > > This is not fully correct. 0xffffffff is returned when some error > happens. It does not have to be timeout error. Errors like Unsupported > Request, Completer Abort or Configuration Request Retry Status (when > CRSSVE bit is disabled) are also reported as 0xffffffff and they do not > represent timeout. For example Unsupported Request is returned when you > try to read from non-existent device behind some PCIe switch. This particular patch concerns pciehp and in that context, "all ones" responses are predominantly timeouts caused by hot-removed devices. Thanks, Lukas