[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250314083730.GC234496@rocinante>
Date: Fri, 14 Mar 2025 17:37:30 +0900
From: Krzysztof Wilczynski <kw@...ux.com>
To: Andrea della Porta <andrea.porta@...e.com>
Cc: Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Linus Walleij <linus.walleij@...aro.org>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, Bartosz Golaszewski <brgl@...ev.pl>,
Derek Kiernan <derek.kiernan@....com>,
Dragan Cvetic <dragan.cvetic@....com>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Saravana Kannan <saravanak@...gle.com>, linux-clk@...r.kernel.org,
devicetree@...r.kernel.org, linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org, linux-gpio@...r.kernel.org,
Masahiro Yamada <masahiroy@...nel.org>,
Stefan Wahren <wahrenst@....net>,
Herve Codina <herve.codina@...tlin.com>,
Luca Ceresoli <luca.ceresoli@...tlin.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH v7 08/11] misc: rp1: RaspberryPi RP1 misc driver
Hello,
Even though this is not for the PCI sub-system directly, I had a very brief
look over the code. I hope you don't mind.
As such, a few nit picks, nothing blocking.
> +# RaspberryPi RP1 misc device
Would this be better if it matched the "tristate" description below?
> +config MISC_RP1
> + tristate "RaspberryPi RP1 PCIe support"
> + depends on OF_IRQ && OF_OVERLAY && PCI_MSI && PCI_QUIRKS
> + select PCI_DYNAMIC_OF_NODES
> + help
> + Support the RP1 peripheral chip found on Raspberry Pi 5 board.
> +
> + This device supports several sub-devices including e.g. Ethernet
> + controller, USB controller, I2C, SPI and UART.
> +
> + The driver is responsible for enabling the DT node once the PCIe
> + endpoint has been configured, and handling interrupts.
> +
> + This driver uses an overlay to load other drivers to support for
> + RP1 internal sub-devices.
> +/* the dts overlay is included from the dts directory so
/*
* The dts overlay is included from the dts directory so
To make the code comment match rest of the style.
> +/*
> + * Copyright (c) 2018-24 Raspberry Pi Ltd.
> + * All rights reserved.
Copyright (c) 2018-2025 Raspberry Pi Ltd.
To spell the current year fully, plus update it to 2025 already.
I would also add an extra newline here to split the two apart a bit.
> + if (pci_resource_len(pdev, 1) <= 0x10000) {
> + dev_err(&pdev->dev,
> + "Not initialised - is the firmware running?\n");
> + return -EINVAL;
> + }
The American spelling in the above might be better. But I don't have
strong opinions here. It seems more popular in error messages.
> + err = pci_alloc_irq_vectors(pdev, RP1_INT_END, RP1_INT_END,
> + PCI_IRQ_MSIX);
> + if (err < 0) {
> + return dev_err_probe(&pdev->dev, err,
> + "pci_alloc_irq_vectors failed");
Missing a new line at the end, but also...
return dev_err_probe(&pdev->dev, err,
"Failed to allocate MSI-X vectors\n");
Or, something like this over this the function name. Perhaps exposing
error code could be useful to the end user? If so then something like this:
return dev_err_probe(&pdev->dev, err,
"Failed to allocate MSI-X vectors, err=%d\n", err);
Here and other errors where appropriate.
> + for (i = 0; i < RP1_INT_END; i++) {
> + unsigned int irq = irq_create_mapping(rp1->domain, i);
> +
> + if (!irq) {
> + dev_err(&pdev->dev, "failed to create irq mapping\n");
dev_err(&pdev->dev, "Failed to create IRQ mapping\n");
To make the error message capitalisation consistent.
> +static const struct pci_device_id dev_id_table[] = {
> + { PCI_DEVICE(PCI_VENDOR_ID_RPI, PCI_DEVICE_ID_RPI_RP1_C0), },
> + { 0, }
{ }
Would probably be sufficient.
> +MODULE_AUTHOR("Phil Elwell <phil@...pberrypi.com>");
> +MODULE_AUTHOR("Andrea della Porta <andrea.porta@...e.com>");
> +MODULE_DESCRIPTION("RP1 wrapper");
RaspberryPi RP1 misc device
To match the Kconfig comment in the above description or the one from the
"tristate" also in Kconfig.
Thank you for all the work here!
Krzysztof
Powered by blists - more mailing lists