Re: [PATCH v4 08/10] misc: rp1: RaspberryPi RP1 misc driver

Andrea della Porta
2024-11-29T16:27:48Z

Hi Stephan,

On 19:35 Mon 25 Nov , Stefan Wahren wrote:
> Hi Andrea,
>
> Am 24.11.24 um 11:51 schrieb Andrea della Porta:
> > The RaspberryPi RP1 is a PCI multi function device containing
> > peripherals ranging from Ethernet to USB controller, I2C, SPI
> > and others.
> >

...

> > + Support the RP1 peripheral chip found on Raspberry Pi 5 board.
> > + 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.
> Please fix up the leading whitespace here

Ack.

> > diff --git a/drivers/misc/rp1/Makefile b/drivers/misc/rp1/Makefile
> > new file mode 100644
> > index 000000000000..508b4cb05627
> > --- /dev/null
> > +++ b/drivers/misc/rp1/Makefile
> > @@ -0,0 +1,3 @@
> > +# SPDX-License-Identifier: GPL-2.0-only

...

> > +#define RP1_INT_SYSCFG 58
> > +#define RP1_INT_CLOCKS_DEFAULT 59
> > +#define RP1_INT_VBUSCTRL 60
> > +#define RP1_INT_PROC_MISC 57
> > +#define RP1_INT_END 61
> > +
> > +struct rp1_dev {
> > + struct pci_dev *pdev;
> > + struct irq_domain *domain;
> > + struct irq_data *pcie_irqds[64];
> > + void __iomem *bar1;
> > + int ovcs_id;
> /* overlay changeset id */

Ack.

> > + bool level_triggered_irq[RP1_INT_END];
> > +};
> > +
> > +static void msix_cfg_set(struct rp1_dev *rp1, unsigned int hwirq, u32 value)
> > +{

...

> > + struct device_node *rp1_node;
> > + struct rp1_dev *rp1;
> > + int err = 0;
> Please remove the extra space after err

Ack.

> > + int i;
> > +
> > + rp1_node = dev_of_node(dev);
> > + if (!rp1_node) {
> > + dev_err(dev, "Missing of_node for device\n");
> > + return -EINVAL;
> > + }
> > +
> > + rp1 = devm_kzalloc(&pdev->dev, sizeof(*rp1), GFP_KERNEL);
> > + if (!rp1)
> > + return -ENOMEM;
> > +
> > + rp1->pdev = pdev;

...

> > + 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");
> > + else if (err != RP1_INT_END) {
> Please add braces for the if case

Ack.

Many thanks,
Andrea

> > + dev_err(&pdev->dev, "Cannot allocate enough interrupts\n");
> > + return -EINVAL;
> > + }
> > +
> >