Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp105359ybh; Tue, 14 Jul 2020 19:30:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuETPH7zo9fQ8nQVVReTRjycTLGXzadHjCAkgZ1mkQlJiQftcuvGjT/kw2tQwCR8NhsJ1v X-Received: by 2002:a05:6402:363:: with SMTP id s3mr7338840edw.238.1594780209820; Tue, 14 Jul 2020 19:30:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594780209; cv=none; d=google.com; s=arc-20160816; b=op6TFoXAQgTbzd6oLtH0owlCSmH6K5HFtq3HLcaRzV/v78CrAHjcRwzVmeTCD+Dwby PyFvKbIMkgSoWcBTuApOOn4LBHegjJyDTIGTteOQGDu1a+1cjrpteGa0kioGkjc5LHQ8 rk5Tds1eYg0XaYbJVqPl0QYGWJKPtx+YWBUPIXPsSACU/cZkijOhdlyBMUx3nnDw/AQx engYoN0O5UllJgEWmUtN0N0czifujKrg+cwNEx6iNhtPbeemONQzxjsGdjqVMyLJ8fcb 8u1E4WZ8xCkMifTSoMJwKU4CPF3qNhYzbU+deVQ+sgi6ShZRjhqokzkafJhfm4ScaS0C Oxyg== 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=INoE7YY5wKE84ktwUn9yjK659/Rsn1jfM1PPrUyxA5k=; b=Dwfjj2aTQGx+Cdq3Slm508qYYSC6BL1yRnDuNG9n6ASoFIcdzuAC2+mIEwLYlMvf8d tYxHP1SG58OCFuvmjIjpDXd5y9TfrDa4JF79QxXbfWF2PXzNpmMuZ6IPk6j74/YW8KUK WRrLbP+X9PEFZ3z9kMsEgJh7FKCUb+0opV0jNcunVQTbg92JnbZPy0cSElHfeC51A1Xy 7vdyxiZ8BmMQ0V7Fe5wN6zmWhYpTU460ZrlQdXwrmW1cW3ed/KNE6PnJ9/IBf6OSRCx6 5+/YNhPGfUztjydcIDbApHzewk2U3v7wBORkQ8gLJ178hM7PoC2hKmZnrP7a6YgwzDvO n27Q== 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 z21si342105ejm.542.2020.07.14.19.29.45; Tue, 14 Jul 2020 19:30:09 -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 S1727870AbgGOCQM (ORCPT + 99 others); Tue, 14 Jul 2020 22:16:12 -0400 Received: from kernel.crashing.org ([76.164.61.194]:36854 "EHLO kernel.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725977AbgGOCQL (ORCPT ); Tue, 14 Jul 2020 22:16:11 -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 06F2CWXx001242 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 14 Jul 2020 21:12:38 -0500 Message-ID: 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 Date: Wed, 15 Jul 2020 12:12:29 +1000 In-Reply-To: <20200714184550.GA397277@bjorn-Precision-5520> References: <20200714184550.GA397277@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 13:45 -0500, Bjorn Helgaas wrote: > > > fail for valid arguments on a valid pci_device* ? > > I really like this idea. > > pci_write_config_*() has one return value, and only 100ish of 2500 > callers check for errors. It's sometimes possible for config > accessors to detect PCI errors and return failure, e.g., device was > removed or didn't respond, but most of them don't, and detecting > these > errors is not really that valuable. > > pci_read_config_*() is much more interesting because it returns two > things, the function return value and the value read from the PCI > device, and it's complicated to check both. .../... I agree. It's a mess at the moment. We have separate mechanism to convey PCI errors (among other things the channel state) which should apply to config space when detection is possible. I think returning all 1's is the right thing to do here and avoids odd duplicate error detection logic which I bet you is never properly tested. > > For b), it might be nice to also change other aspects of the > > interface, e.g. passing a pci_host_bridge pointer plus bus number > > instead of a pci_bus pointer, or having the callback in the > > pci_host_bridge structure. > > I like this idea a lot, too. I think the fact that > pci_bus_read_config_word() requires a pci_bus * complicates things in > a few places. > > I think it's completely separate, as you say, and we should defer it > for now because even part a) is a lot of work. I added it to my list > of possible future projects. Agreed on both points. Cheers, Ben.