Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1444178pxa; Sun, 2 Aug 2020 07:55:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxa9D26fvygN8kjadEzS/rwTI4I53aPZK49mG7dn0cHffXLT4MMWWB6omZ59BW38GZZnhg4 X-Received: by 2002:aa7:dd15:: with SMTP id i21mr12068708edv.153.1596380127849; Sun, 02 Aug 2020 07:55:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596380127; cv=none; d=google.com; s=arc-20160816; b=VUM4rT6+cJB3Yl3sH10k+46YNI4yzPAC6xHC80dlmVa6PDr8uT1R1gvh3GB/PyuFqw tr40WRTYUQpDUAQepL68ziX6Q6q152uM0D+HidzOjIKGkR10vHwRCd2ZU2xN2avLoU7P 2HG16chwNnzoOoBTjPsbKv+J/8yyoVOVmQyWAF1eg0Jnvv8XoP33S4d3Veap8CujJXP/ cfLsJLRJr7NrmtB/YJ7VIOspu0HPUQXVons6ol8WHlNe3fXrHj4NkiKGKGH+L4Lir2tj rYeWMpD+a75S8zdj31IKK/OP5Hd38rCRfegLkNre7n2ZTpqKNOJq6d/8IZxhUHtWOO+r AE1w== 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=1kkoTewt7Fx4Q+2DDC1UGcR4JlqqtBcQK2oUP1r3rTc=; b=bo0IJ/lDoznWwChTi/0A9sXPRzCvwxFTMusD/SU8T5FNhxaSUzz00Rm99qSpFunGYc fnNZbyGeP3zrq46dP0M4GE8qFVvVo24m2mfjfS/1xjrCY+qSUf0fJi53Gld4EvXx82gL GJ9bT5EZ+EOJ8VG154YyISp9peYh1HdCky5k+SOp7K8wuPi3YXjVRcTU56up2xTDedyk qou48S3r/Rp6viebNWjuhusjtdnqNHWBNQs+Ve122YRxBtiq/AI0+Xu1dKifwtCDrFWr HuV48Wi2DL0mRbhnN0K+WhS8OEJnIj0/6fSkuz4tSkMgLdBeVRqVDq2UgePXzF63kkxJ ai7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=h25uld9S; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t4si4222296ejt.506.2020.08.02.07.55.04; Sun, 02 Aug 2020 07:55:27 -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=@redhat.com header.s=mimecast20190719 header.b=h25uld9S; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726479AbgHBOxz (ORCPT + 99 others); Sun, 2 Aug 2020 10:53:55 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:40258 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725861AbgHBOxy (ORCPT ); Sun, 2 Aug 2020 10:53:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596380033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1kkoTewt7Fx4Q+2DDC1UGcR4JlqqtBcQK2oUP1r3rTc=; b=h25uld9SIfoj5VjErXtMPmIqvlXPAtJ9JBM59o8fHH2lQ1S+DyLmOlX51gMTheqs8+RYFB 9ufHZJCdVWjJaYwpalTcdDMcE3z82dp85ISkgHWnzjWf4A5Leg2ztBE7DWr4nwgqTn9jU+ 05CB8xgosBwf/jZez18nhURcbSzonbw= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-60-1dvEQ7sdPlenCbaA9LI3PA-1; Sun, 02 Aug 2020 10:53:51 -0400 X-MC-Unique: 1dvEQ7sdPlenCbaA9LI3PA-1 Received: by mail-qk1-f199.google.com with SMTP id n128so24173813qke.2 for ; Sun, 02 Aug 2020 07:53:51 -0700 (PDT) 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=1kkoTewt7Fx4Q+2DDC1UGcR4JlqqtBcQK2oUP1r3rTc=; b=nK1zJ3fuN7q86yjklm6XaC4Z8of9QPyn+Sn+LBsJ4xHPMPLkqcHnOd3431dlxX9KKs 6WPDY/jNCnS0c+X59fkacjxspzwg4S7wzaQx/5qdQ8ijbQ1vpdKuH/wcIRE6jhmy+2q5 Jcb8c+bn5NbLyCrMK3KLLJQvcm4Akw1dnDZWDtWn46vCIO/fNk5K5Rg9Tg5a30MOsPaB nckEyS7btX/ZkBeEuVM/R0qII8/HukKEU9bBcVoI5QK8ieRmhC+PrkQnROvOvBy5VHMy oW2FbNRXWz/Uc/pmbbeJH8NeIOGJkMTP0Qc4+i1LLdjI4FNe6oUD2QLBOJbOn8+BJHyL s+xw== X-Gm-Message-State: AOAM532zLEzOAVyarJ0B4g0LdOVZpOcEpZxrdztjAnicaCXIaxmpLBat dpnVbJ678Gw9TpoUoNicfie2sbmVOaYLGubhwCbkLaGUwlB87n5og6GyfyZyZko52OYkxzd/q0L e4fFOgyIKscKLd4G3a6bFNhuL X-Received: by 2002:a0c:f007:: with SMTP id z7mr12711375qvk.53.1596380031293; Sun, 02 Aug 2020 07:53:51 -0700 (PDT) X-Received: by 2002:a0c:f007:: with SMTP id z7mr12711349qvk.53.1596380031093; Sun, 02 Aug 2020 07:53:51 -0700 (PDT) Received: from trix.remote.csb (075-142-250-213.res.spectrum.com. [75.142.250.213]) by smtp.gmail.com with ESMTPSA id t127sm16326265qkc.100.2020.08.02.07.53.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 02 Aug 2020 07:53:50 -0700 (PDT) Subject: Re: [RFC PATCH 00/17] Drop uses of pci_read_config_*() return value To: Borislav Petkov , "Saheed O. Bolarinwa" 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: Tom Rix Message-ID: <6ecce8f3-350a-b5d5-82c9-4609f2298e61@redhat.com> Date: Sun, 2 Aug 2020 07:53:46 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200801125657.GA25391@nazgul.tnic> Content-Type: text/plain; charset=utf-8 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 5:56 AM, 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? > > 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 check you're replicating > > if (val32 == (u32)~0) > > everywhere, instead, is just ugly and tests a naked value ~0 which > doesn't mean anything... > I agree, if there is a change, it should be in the pci_read_* functions. Anything returning void should not fail and likely future users of the proposed change will not do the extra checks. Tom