iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Tom Rix <trix@redhat.com>
To: Borislav Petkov <bp@alien8.de>,
	"Saheed O. Bolarinwa" <refactormyself@gmail.com>
Cc: Vignesh Raghavendra <vigneshr@ti.com>,
	linux-pci@vger.kernel.org, linux-fpga@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-ide@vger.kernel.org,
	linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	linux-rdma@vger.kernel.org, Richard Weinberger <richard@nod.at>,
	linux-atm-general@lists.sourceforge.net, helgaas@kernel.org,
	Jakub Kicinski <kuba@kernel.org>,
	linux-kernel-mentees@lists.linuxfoundation.org,
	Wolfgang Grandegger <wg@grandegger.com>,
	intel-gfx@lists.freedesktop.org, linux-gpio@vger.kernel.org,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	skhan@linuxfoundation.org, bjorn@helgaas.com,
	Kalle Valo <kvalo@codeaurora.org>,
	linux-edac@vger.kernel.org, linux-hwmon@vger.kernel.org,
	netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
	linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	linux-crypto@vger.kernel.org, dmaengine@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [RFC PATCH 00/17] Drop uses of pci_read_config_*() return value
Date: Sun, 2 Aug 2020 07:53:46 -0700	[thread overview]
Message-ID: <6ecce8f3-350a-b5d5-82c9-4609f2298e61@redhat.com> (raw)
In-Reply-To: <20200801125657.GA25391@nazgul.tnic>


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

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2020-08-02 15:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-01 11:24 [RFC PATCH 00/17] Drop uses of pci_read_config_*() return value Saheed O. Bolarinwa
2020-08-01 11:24 ` [RFC PATCH 15/17] iommu/vt-d: " Saheed O. Bolarinwa
2020-08-01 12:56 ` [RFC PATCH 00/17] " Borislav Petkov
2020-08-02 14:53   ` Tom Rix [this message]
2020-08-02 17:28   ` Saheed Bolarinwa
2020-08-02 18:46     ` Borislav Petkov
2020-08-02 19:14       ` Bjorn Helgaas
2020-08-02 20:18         ` Borislav Petkov
2020-08-03  6:56         ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ecce8f3-350a-b5d5-82c9-4609f2298e61@redhat.com \
    --to=trix@redhat.com \
    --cc=bjorn@helgaas.com \
    --cc=bp@alien8.de \
    --cc=davem@davemloft.net \
    --cc=dmaengine@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=helgaas@kernel.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=kuba@kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-atm-general@lists.sourceforge.net \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=refactormyself@gmail.com \
    --cc=richard@nod.at \
    --cc=skhan@linuxfoundation.org \
    --cc=vigneshr@ti.com \
    --cc=wg@grandegger.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).