Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp106622ybh; Tue, 14 Jul 2020 19:32:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJze6A+X4YX2tik2h4ZfLrka/aE+xCLnVywh3n+N3zvEwvVNAabNzdrxPfAzi2Cz8bgdWrCc X-Received: by 2002:a17:906:950c:: with SMTP id u12mr7048052ejx.37.1594780360781; Tue, 14 Jul 2020 19:32:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594780360; cv=none; d=google.com; s=arc-20160816; b=ejuXyL/6qOHFORLjfPS+hnGHCkuiMV/5k7yKU8Lw+IbT3eEttD9ohW6jp0jLMdQusq L7vkiPi1cwISvyoTd8B9gUQjNbpvwG2rpMnCMLh3ECl1Buev8XVZBPhV7baCnoecQY3J XxOoLzupvusBxVFGMxDmpNtWkDgT8dn8PocZ+fWr0Y+JUQRbIPLvzf/RKXvTVvmZqtlv 1pdqNEOJycqu7uIQGXtVCD29xHU9yAN4mX/IOfKvdrfYo0lBMmWFDdu4+b005mntsE+v RyE+3kazJkFpb1NrxOoXQRnyubLm3e2HBhG5TsdTv5s2t+B6HH36VvmC21ZNjDEOrmO9 A1SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=1vwh8nFCklfYgLTvhZ+rdIZ1l6iM+KPMJ+mU2r7X3ss=; b=0N8a+lYPNu1tOfuwOClFebBe/WXpZM+76IRBE+Ijs4noX+DH3U+fQwLjtknSDQt8nd C/HZQhJQuiR6H0c7fZ42S93K3YcIB/bjMKuQOmM3yUrFx+7ZG3mk/x6cK9dHc87odKnE goh20KnAxiuDhxNNNmAeTIpX7hHg7aWNI6jlQrCSyDxKyimC6B6hwE25A0R0qzcrJ0jG t5DxGd2Py41bHQSaUdWZt2jqBtoTTaxInV7jxG3il/91mVAA9PTLrpfSC9/FTjXyxhDJ wUN+7JYcggPgaV3Kx2dfbCVVPe0CQ6oRGR/s7e9kmArUOZdAv4M5fvepb2TdIgzQEIBv 67QA== 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 dg2si394653edb.326.2020.07.14.19.32.18; Tue, 14 Jul 2020 19:32:40 -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 S1728305AbgGOCWb (ORCPT + 99 others); Tue, 14 Jul 2020 22:22:31 -0400 Received: from kernel.crashing.org ([76.164.61.194]:36952 "EHLO kernel.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726458AbgGOCWb (ORCPT ); Tue, 14 Jul 2020 22:22:31 -0400 Received: from localhost (gate.crashing.org [63.228.1.57]) (authenticated bits=0) by kernel.crashing.org (8.14.7/8.14.7) with ESMTP id 06F2JlC0001315 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 14 Jul 2020 21:19:51 -0500 Message-ID: <2629240c07af7fec5989127ed6da405e12cf77a3.camel@kernel.crashing.org> Subject: Re: [RFC PATCH 00/35] Move all PCIBIOS* definitions into arch/x86 From: Benjamin Herrenschmidt To: Bjorn Helgaas , Arnd Bergmann Cc: "Saheed O. Bolarinwa" , bjorn@helgaas.com, Shuah Khan , linux-pci , linux-kernel-mentees@lists.linuxfoundation.org, "linux-kernel@vger.kernel.org" , Richard Henderson , Ivan Kokshaysky , Matt Turner , Greg Ungerer , Geert Uytterhoeven , Russell King , Boris Ostrovsky , Juergen Gross , Thomas Bogendoerfer , Michael Ellerman , Paul Mackerras , linuxppc-dev , "David S. Miller" , sparclinux , Guenter Roeck , Greg Kroah-Hartman , Heiner Kallweit , Jakub Kicinski , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Kevin Hilman , Philipp Zabel , Jingoo Han , Gustavo Pimentel , Toan Le , Ray Jui , Scott Branden , Ley Foon Tan , Marek Vasut , Kjetil Oftedal Date: Wed, 15 Jul 2020 12:19:46 +1000 In-Reply-To: <20200714234625.GA428442@bjorn-Precision-5520> References: <20200714234625.GA428442@bjorn-Precision-5520> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-07-14 at 18:46 -0500, Bjorn Helgaas wrote: > Yes. I have no problem with that. There are a few cases where it's > important to check for errors, e.g., we read a status register and do > something based on a bit being set. A failure will return all bits > set, and we may do the wrong thing. But most of the errors we care > about will be on MMIO reads, not config reads, so we can probably > ignore most config read errors. And in both cases, we don't have the plumbing to provide accurate and reliable error returns for all platforms anyways (esp. not for MMIO). I think it makes sense to stick to the good old "if all 1's, then go out of line" including for config space. ../.. > Yep, except for things like device removal or other PCI errors. A whole bunch of these are reported asynchronously, esp for writes (and yes, including config writes, they are supposed to be non-posted but more often than not, the path from the CPU to the PCI bridge remains posted for writes including config ones). > So maybe a good place to start is by removing some of the useless > error checking for pci_read_config_*() and pci_write_config_*(). > That's a decent-sized but not impractical project that could be done > per subsystem or something: > > git grep -E "(if|return|=).*\ > finds about 400 matches. > > Some of those callers probably really *do* want to check for errors, > and I guess we'd have to identify them and do them separately as you > mentioned. I'd be curious about these considering how unreliable our error return is accross the board. Cheers, Ben.