Re: [PATCH 3/6] spi: Add driver for the RZ/V2H(P) RSPI IP
From: Mark Brown
Date: Wed Jun 25 2025 - 15:13:25 EST
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.
Attachment:
signature.asc
Description: PGP signature