Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1547603pxa; Sun, 2 Aug 2020 11:29:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7MvArrIShiTNuPjeqLGqGoiS+vsFkjNiaYxRNAhNxutKVk8RFsx5vsVJ61681Rj732Bzj X-Received: by 2002:a17:907:372:: with SMTP id rs18mr13030413ejb.146.1596392949921; Sun, 02 Aug 2020 11:29:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596392949; cv=none; d=google.com; s=arc-20160816; b=xUy7jSt9kWiStXnvXWEwvfzPnlF16MlC1/+b7FGCsHzCPMjmPjA07IrnoH5SnOS4M6 9PHZpV6T+10QPhwrgqhRGlP2aIeSg0W3fyUNd+4+omvPGOGZrBbwLD1SBaUlDtjqWl9+ dQIJhjs52gj9pt82zVSOzCsmSGhUswg6NyB0LeyfbxQ74NjmBnBbycbLx5ucBy0woSIC HjMxmONajY5r1y6wXBEcb88DYSyUvTkC9Qt/8BHfj8x86Qk0eIjXyfcrxKq3PQcBROfq 7pQvr4t5cs4UusHvvAnTRH90M3fDNQ4vuIV39CHP4JM0ZgC5AZLXKaUZ6TEaRNBkX9CP 3VJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=ec+QZPQt4BI+HNScgjvbhAWx5U5Q2eYvCkS354frzh0=; b=oDc0Cmsv9cK8/KJyhz8fqR7bNqfa4JiKx2mAVmU2XTrjkiyKSq8eH8eyyLnHvPNTep mgGgB5LGoo7N4CvhLgr6wWvUO60os5OWdQvUv7ArRfF/QW4b/jW5zTUYSQACzwLRd9zh rEdOD22gzibhBmnbN1h0yN6zQtv77gK40+BFEe8+OwBHpF0oHjrWild9GucCodV1NMj3 2yk5QQBU/DfDV0XdwYMqGKQPDWyQa9HFB7H1nUHG/AmX0qJH0pdDZzFn/v4dDtZEAO6y dicWOKGucQrmk0Xd1zzn2n0EQTsefCSM+oFLJteTN0awLsvkUvE3Hcv3rlQRTF/pO7+D pGjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YtJLT8D3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v22si8997489eji.185.2020.08.02.11.28.47; Sun, 02 Aug 2020 11:29: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YtJLT8D3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727773AbgHBS1g (ORCPT + 99 others); Sun, 2 Aug 2020 14:27:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726920AbgHBS1f (ORCPT ); Sun, 2 Aug 2020 14:27:35 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CFDFC06174A; Sun, 2 Aug 2020 11:27:35 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id v22so14915937edy.0; Sun, 02 Aug 2020 11:27:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=ec+QZPQt4BI+HNScgjvbhAWx5U5Q2eYvCkS354frzh0=; b=YtJLT8D3c903d3hsfGfmpRep4DyZJhzRytGWo/UssPWnsu4TDB7JZAkT1sTJMmJUH+ bq5rDlN4QtT+Xdj0JNzjtQ2QqTr2pVyC4JOlcnf9bRRCSyXgovVOl9FdgJQfsiPfkKzY DWsX6GX1lxDOlwpnwJCtIh+GQ6RZkI/pzRvVJxUc5FGTjx+jay8s+7hZFlw796rU78Gc 7K1ApoysPqm8FRM+jQOGIRHengeFZ6xNP8mOw9mf8ONnQV8kOLpUVEJO7EpYgXqjQKbR ZXY6Otij2DqA3PujrgbIOxTi9tcd/lHDFFPdppv1+HoL/eGjvY6ERK9eoJvC1OZ061lc FmqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=ec+QZPQt4BI+HNScgjvbhAWx5U5Q2eYvCkS354frzh0=; b=K83uV3irkoUMjiaYGxaIKS/7/Xhw9LmAzT7GEm14xlebX6o+ahYRqHbiMaUg91zym0 HOCPVuhQFvtyGr5sKMZ3VhY5avZJ3J0dVI3uEXdHfVHfig8ldeOikWvKCM8+E1bnUje6 G/2FKjqgmGFDuSn2GyziNsKTy4iraIy9TOXl3SKC+PujmY1oSm/6HcRfncJ6C8YW2FGY Km/qhgofMmzTdBnhcOEh0R4V9pXI8vWWXUC2khNhxez7M0PSfQyiK6llzGQ952ESzuXB ZusXTc+b95kxkHR72i9XG/IoQU3EUle4GttbIa1qAAdfKtjMbvTDrCQrParNiHz1fCFS yGeQ== X-Gm-Message-State: AOAM532cCpjZiyS08P3ApXbDPMB2E+dwfN+U5Qy7ScIzWByrjx7/CRnq Tr3hLoPvYHymHVvS49nNY94= X-Received: by 2002:aa7:c9c2:: with SMTP id i2mr12251380edt.326.1596392853909; Sun, 02 Aug 2020 11:27:33 -0700 (PDT) Received: from net.saheed (95C84E0A.dsl.pool.telekom.hu. [149.200.78.10]) by smtp.gmail.com with ESMTPSA id b9sm2015326ejz.57.2020.08.02.11.27.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 02 Aug 2020 11:27:33 -0700 (PDT) Subject: Re: [RFC PATCH 00/17] Drop uses of pci_read_config_*() return value To: Borislav Petkov , trix@redhat.com Cc: helgaas@kernel.org, Kalle Valo , "David S. Miller" , Jakub Kicinski , Wolfgang Grandegger , Marc Kleine-Budde , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Joerg Roedel , bjorn@helgaas.com, skhan@linuxfoundation.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-mtd@lists.infradead.org, iommu@lists.linux-foundation.org, linux-rdma@vger.kernel.org, linux-ide@vger.kernel.org, linux-i2c@vger.kernel.org, linux-hwmon@vger.kernel.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-gpio@vger.kernel.org, linux-fpga@vger.kernel.org, linux-edac@vger.kernel.org, dmaengine@vger.kernel.org, linux-crypto@vger.kernel.org, linux-atm-general@lists.sourceforge.net References: <20200801112446.149549-1-refactormyself@gmail.com> <20200801125657.GA25391@nazgul.tnic> From: Saheed Bolarinwa Message-ID: Date: Sun, 2 Aug 2020 19:28:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200801125657.GA25391@nazgul.tnic> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/1/20 2:56 PM, Borislav Petkov wrote: > On Sat, Aug 01, 2020 at 01:24:29PM +0200, Saheed O. Bolarinwa wrote: >> The return value of pci_read_config_*() may not indicate a device error. >> However, the value read by these functions is more likely to indicate >> this kind of error. This presents two overlapping ways of reporting >> errors and complicates error checking. > So why isn't the *value check done in the pci_read_config_* functions > instead of touching gazillion callers? Because the value ~0 has a meaning to some drivers and only drivers have this knowledge. For those cases more checks will be needed to ensure that it is an error that has actually happened. > For example, pci_conf{1,2}_read() could check whether the u32 *value it > just read depending on the access method, whether that value is ~0 and > return proper PCIBIOS_ error in that case. The primary goal is to make pci_config_read*() return void, so that there is *only* one way to check for error i.e. through the obtained value. Again, only the drivers can determine if ~0 is a valid value. This information is not available inside pci_config_read*(). - Saheed