Re: [PATCH v8 4/6] PCI: tegra: Add Tegra264 support

Thierry Reding <[email protected]> Mon, 27 Jul 2026 17:39:02 +0200
Newsgroups org.kernel.vger.linux-tegra,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci
Message-ID <amd7fUUzD9ZLc-85@orome>
On Wed, Jul 22, 2026 at 11:44:42AM -0500, Bjorn Helgaas wrote:
> On Thu, Jul 16, 2026 at 07:07:15PM +0200, Thierry Reding wrote:
> > From: Thierry Reding <[email protected]>
> > 
> > Add a driver for the PCIe controller found on NVIDIA Tegra264 SoCs. The
> > driver is very small, with its main purpose being to set up the address
> > translation registers and then creating a standard PCI host using ECAM.
> > ...
> 
> > + * The various memory regions used by the controller (I/O, memory, ECAM) are
> > + * set up during early boot and have hardware-level protections in place. If
> > + * the DT ranges don't match what's been setup, the controller won't be able
> > + * to write the address endpoints properly, so make sure to validate that DT
> > + * and firmware programming agree on these ranges.
> > + */
> > +static bool tegra264_pcie_check_ranges(struct platform_device *pdev)
> 
> Drive-by comment: I have a bit of an aversion to boolean functions
> named "check" because "check" is not a predicate with a true/false or
> yes/no answer.
> 
> "true" usually means success, which is the opposite of functions that
> return 0 for success.
> 
> In this case, it looks like "if (tegra264_pcie_check_ranges())" means
> the DT ranges match the hardware configuration.  If it were named
> "tegra264_pcie_valid_ranges()" or similar, an "if" test like that
> would read better.

Indeed, "valid ranges" is superior in this case.

Thierry
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAmpne5YACgkQ3SOs138+
s6GQ+A//WeFzw3KoYVOzNsMrSzRoXie99HtTHVBPg/kBvr4ois0lZ3WQEHa+J2Ud
1l5V2hv3q760uHAfQ+kvsOkJByU04WCKNXR3DphG6dEhRap42EfFan16PUWV3GCv
eH3X+5ohtv4G+U8BPfcyvKu6rRLfHAIfCLUv4yOVr7tU6LbLTzrADExj70mQrhM7
AzHjzmAzc323jnPOHhFg+YXFRlK+Y6VPh5zT0+EgA0JwFnOjrEf7d5JEP5HPfPuT
AZMEf7CJnoICRMWS1SjXaNBPllgK61MVhx9EC79/6oMWi1I89+Glutlhz9GTwdVj
Iw61t+2+vQxJQtpRQVSSBwnLnV3lRBvBbKsJZ9DSrbT8xz1BXeG2eTOGdgROD97/
KnkgHIYzpKL68OWWeXeb2FV7uJJocRIHUpaX5MA73gIHBsArGzmkOMhp69XOAGzC
i4a313skcX7hcUjNyKu9H0wSxf05QG9PhnICVIJb8lsD0edb5Ax19h8dwDzxiUXt
h48iBjYNJyzDQXxyOZxhmZ7/0v55t59lMVeokZTI7NNBu9TnL7LPV1JYeGnsRsO2
ZUy+zHcVTSGurw5UGFzAxiYnQ30lIdg7E1EMoIaVyyQnIsbmt2at7SzGoU98dCUe
ln4VM83pPz0SXFzVEcQTVUO3YkBf2DZrjWVZ0lkDYKp429FD6Gs=
=9cZE
-----END PGP SIGNATURE-----