From: Andrea della Porta <andrea.porta@suse.com>
To: Stefan Wahren <wahrenst@gmx.net>
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>,
Krzysztof Wilczynski <kw@linux.com>,
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>,
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: Thu, 20 Feb 2025 18:34:21 +0100 [thread overview]
Message-ID: <Z7dnnW4npJmfOVE0@apocalypse> (raw)
In-Reply-To: <87525350-b432-40b3-927c-60cd74228ea4@gmx.net>
Hi Stefan,
On 15:21 Sat 08 Feb , Stefan Wahren wrote:
> Hi Andrea,
>
> Am 07.02.25 um 22:31 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.
...
> > +static int rp1_irq_set_type(struct irq_data *irqd, unsigned int type)
> > +{
> > + struct rp1_dev *rp1 = irqd->domain->host_data;
> > + unsigned int hwirq = (unsigned int)irqd->hwirq;
> > +
> > + switch (type) {
> > + case IRQ_TYPE_LEVEL_HIGH:
> > + dev_dbg(&rp1->pdev->dev, "MSIX IACK EN for irq %d\n", hwirq);
> This looks a little bit inconsistent. Only this type has a debug
> message. So either we drop this or add at least a message for
I think that this is indeed asymmetric. That warning says
that the 'special' IACK management is engaged for level triggered
interrupt, which is mandatory in order to avoid missing further
interrupts without the performance loss of busy-polling for
active interrupts. This is explained in par. 6.2 of:
https://datasheets.raspberrypi.com/rp1/rp1-peripherals.pdf
The point is that we're not stating the type of the interrupt
(edge/level triggered), but we warn that we're enabling a mechanism
useful for one type only (level triggered).
> IRQ_TYPE_EDGE_RISING, too. Btw the format specifier looks wrong
> (unsigned int vs %d).
Ack.
> > + msix_cfg_set(rp1, hwirq, MSIX_CFG_IACK_EN);
> > + rp1->level_triggered_irq[hwirq] = true;
> > + break;
> > + case IRQ_TYPE_EDGE_RISING:
> > + msix_cfg_clr(rp1, hwirq, MSIX_CFG_IACK_EN);
> > + rp1->level_triggered_irq[hwirq] = false;
> > + break;
> > + default:
> > + return -EINVAL;
> It would be nice to document why only IRQ_TYPE_LEVEL_HIGH and
> IRQ_TYPE_EDGE_RISING are supported. In case it's a software limitation,
> this function would be a good place. In case this is a hardware
> limitation this should be in the binding.
All ints are level-triggered. I guess I should add a short comment in
the bindings.
> > + }
> > +
> > + return 0;
> > +}
> > +
> > +static struct irq_chip rp1_irq_chip = {
> > + .name = "rp1_irq_chip",
> > + .irq_mask = rp1_mask_irq,
> > + .irq_unmask = rp1_unmask_irq,
> > + .irq_set_type = rp1_irq_set_type,
> > +};
...
> > + irq_set_chip_and_handler(irq, &rp1_irq_chip, handle_level_irq);
> > + irq_set_probe(irq);
> > + irq_set_chained_handler_and_data(pci_irq_vector(pdev, i),
> > + rp1_chained_handle_irq, rp1);
> > + }
> > +
> > + err = of_overlay_fdt_apply(dtbo_start, dtbo_size, &rp1->ovcs_id, rp1_node);
> > + if (err)
> > + goto err_unregister_interrupts;
> > +
> > + err = of_platform_default_populate(rp1_node, NULL, dev);
> > + if (err)
> > + goto err_unload_overlay;
> I think in this case it's worth to add a suitable dev_err() here.
Ack.
Many thanks,
Andrea
>
> Thanks
next prev parent reply other threads:[~2025-02-20 17:43 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 [this message]
2025-03-18 11:05 ` Andrea della Porta
2025-03-14 8:37 ` Krzysztof Wilczynski
2025-03-18 9:46 ` Andrea della Porta
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=Z7dnnW4npJmfOVE0@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).