[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b4649385-ee50-499b-a965-e08f04fe0d3b@sirena.org.uk>
Date: Wed, 25 Jun 2025 20:09:15 +0100
From: Mark Brown <broonie@...nel.org>
To: Fabrizio Castro <fabrizio.castro.jz@...esas.com>
Cc: Philipp Zabel <p.zabel@...gutronix.de>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Magnus Damm <magnus.damm@...il.com>, linux-kernel@...r.kernel.org,
linux-spi@...r.kernel.org, linux-renesas-soc@...r.kernel.org,
Biju Das <biju.das.jz@...renesas.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Subject: Re: [PATCH 3/6] spi: Add driver for the RZ/V2H(P) RSPI IP
On Tue, Jun 24, 2025 at 08:23:01PM +0100, Fabrizio Castro wrote:
> +static int rzv2h_rspi_unprepare_message(struct spi_controller *ctlr,
> + struct spi_message *message)
> +{
> + struct rzv2h_rspi_priv *rspi = spi_controller_get_devdata(ctlr);
> +
> + rzv2h_rspi_spe_disable(rspi);
> + rzv2h_rspi_clear_fifos(rspi);
A bit interesting that we need to clear the FIFOs, but it's just one
register write so probably not worth worrying about.
> + ret = devm_clk_bulk_get(dev, RSPI_CLK_NUM, rspi->clks);
> + if (ret)
> + return dev_err_probe(dev, ret, "cannot get clocks\n");
> + ret = devm_request_irq(dev, irq_rx, rzv2h_rx_irq_handler, 0,
> + dev_name(dev), rspi);
> + if (ret)
> + return dev_err_probe(dev, ret, "cannot request `rx` IRQ\n");
> +
> + ret = clk_bulk_prepare_enable(RSPI_CLK_NUM, rspi->clks);
Are you sure that the interrupt handler is safe with the IP in reset and
clocks disabled...
> + init_waitqueue_head(&rspi->wait);
...and the wakequeue head it wakes up not yet initialised? This is also
a concern during unregistration where devm things will be unwound after
the remove() function has run.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists