From: Andrea della Porta <andrea.porta@suse.com>
To: Krzysztof Wilczynski <kw@linux.com>
Cc: Andrea della Porta <andrea.porta@suse.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Lorenzo Pieralisi <lpieralisi@kernel.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
Bjorn Helgaas <bhelgaas@google.com>,
Linus Walleij <linus.walleij@linaro.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Derek Kiernan <derek.kiernan@amd.com>,
Dragan Cvetic <dragan.cvetic@amd.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Saravana Kannan <saravanak@google.com>,
linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
linux-gpio@vger.kernel.org,
Masahiro Yamada <masahiroy@kernel.org>,
Stefan Wahren <wahrenst@gmx.net>,
Herve Codina <herve.codina@bootlin.com>,
Luca Ceresoli <luca.ceresoli@bootlin.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH v7 08/11] misc: rp1: RaspberryPi RP1 misc driver
Date: Tue, 18 Mar 2025 10:46:07 +0100 [thread overview]
Message-ID: <Z9lA31gBjpIRHm6y@apocalypse> (raw)
In-Reply-To: <20250314083730.GC234496@rocinante>
Hi Krzysztof,
On 17:37 Fri 14 Mar , Krzysztof Wilczynski wrote:
> 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.
Highly appreciated, thanks!
>
> As such, a few nit picks, nothing blocking.
>
> > +# RaspberryPi RP1 misc device
>
> Would this be better if it matched the "tristate" description below?
Ack.
>
> > +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.
Ack.
>
> > +/*
> > + * 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.
Ack.
>
> > + 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.
I agree.
>
> > + 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");
Ack.
>
> 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);
dev_err_probe() should already print the err code, no need to add it.
>
> Here and other errors where appropriate.
I've changed dev_err() to dev_err_probe() in cases where the error code
is not evident (i.e. hardcoded) from the source.
>
> > + 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.
Ack.
>
> > +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.
Ack.
>
> > +MODULE_AUTHOR("Phil Elwell <phil@raspberrypi.com>");
> > +MODULE_AUTHOR("Andrea della Porta <andrea.porta@suse.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.
Ack.
>
> Thank you for all the work here!
Thank you so much for your review!
Andrea
>
> Krzysztof
next prev parent reply other threads:[~2025-03-18 9:44 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-07 21:31 [PATCH v7 00/11] Add support for RaspberryPi RP1 PCI device using a DT overlay Andrea della Porta
2025-02-07 21:31 ` [PATCH v7 01/11] dt-bindings: clock: Add RaspberryPi RP1 clock bindings Andrea della Porta
2025-02-07 21:31 ` [PATCH v7 02/11] dt-bindings: pinctrl: Add RaspberryPi RP1 gpio/pinctrl/pinmux bindings Andrea della Porta
2025-02-07 21:31 ` [PATCH v7 03/11] dt-bindings: pci: Add common schema for devices accessible through PCI BARs Andrea della Porta
2025-03-10 21:21 ` Krzysztof Wilczynski
2025-03-11 11:36 ` Andrea della Porta
2025-03-11 13:32 ` Rob Herring
2025-03-11 14:36 ` Andrea della Porta
2025-02-07 21:31 ` [PATCH v7 04/11] dt-bindings: misc: Add device specific bindings for RaspberryPi RP1 Andrea della Porta
2025-02-07 21:31 ` [PATCH v7 05/11] clk: rp1: Add support for clocks provided by RP1 Andrea della Porta
2025-02-08 14:58 ` Stefan Wahren
2025-02-20 17:20 ` Andrea della Porta
2025-02-07 21:31 ` [PATCH v7 06/11] pinctrl: rp1: Implement RaspberryPi RP1 gpio support Andrea della Porta
2025-02-08 14:36 ` Stefan Wahren
2025-02-11 13:46 ` Andrea della Porta
2025-02-07 21:31 ` [PATCH v7 07/11] arm64: dts: rp1: Add support for RaspberryPi's RP1 device Andrea della Porta
2025-02-07 21:31 ` [PATCH v7 08/11] misc: rp1: RaspberryPi RP1 misc driver Andrea della Porta
2025-02-08 14:21 ` Stefan Wahren
2025-02-20 17:34 ` Andrea della Porta
2025-03-18 11:05 ` Andrea della Porta
2025-03-14 8:37 ` Krzysztof Wilczynski
2025-03-18 9:46 ` Andrea della Porta [this message]
2025-03-23 11:56 ` Krzysztof Wilczynski
2025-02-07 21:31 ` [PATCH v7 09/11] arm64: dts: bcm2712: Add external clock for RP1 chipset on Rpi5 Andrea della Porta
2025-02-07 21:31 ` [PATCH v7 10/11] arm64: defconfig: Enable RP1 misc/clock/gpio drivers Andrea della Porta
2025-02-07 21:31 ` [PATCH v7 11/11] arm64: defconfig: Enable OF_OVERLAY option Andrea della Porta
2025-02-08 13:42 ` Stefan Wahren
2025-02-10 12:55 ` Andrea della Porta
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=Z9lA31gBjpIRHm6y@apocalypse \
--to=andrea.porta@suse.com \
--cc=andrew@lunn.ch \
--cc=arnd@arndb.de \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bhelgaas@google.com \
--cc=brgl@bgdev.pl \
--cc=catalin.marinas@arm.com \
--cc=conor+dt@kernel.org \
--cc=derek.kiernan@amd.com \
--cc=devicetree@vger.kernel.org \
--cc=dragan.cvetic@amd.com \
--cc=florian.fainelli@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=herve.codina@bootlin.com \
--cc=krzk+dt@kernel.org \
--cc=kw@linux.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=lpieralisi@kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=manivannan.sadhasivam@linaro.org \
--cc=masahiroy@kernel.org \
--cc=mturquette@baylibre.com \
--cc=robh@kernel.org \
--cc=saravanak@google.com \
--cc=sboyd@kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=wahrenst@gmx.net \
--cc=will@kernel.org \
/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).