spi: Fixes for v6.11

A few last minute fixes for v6.11, they're all individually unremarkable
 and only last minute due to when they came in.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmbkhAUACgkQJNaLcl1U
 h9BpZwf+KiV2aTGSouHZsIM2hNcZr8Nm+DH8aJgRWzeddqZ2JD6Hwi1YaUckd1sC
 rbXz6jMvjeG4EbVAokLyb3NudKa5GSoWmMKKeod620bX0Q9PAv+HpRiPK5/i5IFH
 HFHlpjRScpchc/vISgPk0ELgc5eq0jdRZHS5vUWw2tdkc6dmwjb5nPNO4lHxpbYx
 /ETQup7iPW9kfe5fUwWFhvD1MxHIwe1CGUtQLLZQPJdVaHWRD9AIZMTPu7DX0C6V
 PLckCBwzZN+fWUX3xnxfveYG++pdNWaVFFjuRZdKVbNT7SgF7VawTaIK7BxCuqeV
 fNuwheKH/lfzmdXlYGFVLjvyfVfSww==
 =W3IJ
 -----END PGP SIGNATURE-----

Merge tag 'spi-fix-v6.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "A few last minute fixes for v6.11, they're all individually
  unremarkable and only last minute due to when they came in"

* tag 'spi-fix-v6.11-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: nxp-fspi: fix the KASAN report out-of-bounds bug
  spi: geni-qcom: Fix incorrect free_irq() sequence
  spi: geni-qcom: Undo runtime PM changes at driver exit time
This commit is contained in:
Linus Torvalds 2024-09-13 11:46:05 -07:00
commit e936e7d4a8
2 changed files with 11 additions and 11 deletions

View File

@ -1110,25 +1110,27 @@ static int spi_geni_probe(struct platform_device *pdev)
spin_lock_init(&mas->lock);
pm_runtime_use_autosuspend(&pdev->dev);
pm_runtime_set_autosuspend_delay(&pdev->dev, 250);
pm_runtime_enable(dev);
ret = devm_pm_runtime_enable(dev);
if (ret)
return ret;
if (device_property_read_bool(&pdev->dev, "spi-slave"))
spi->target = true;
ret = geni_icc_get(&mas->se, NULL);
if (ret)
goto spi_geni_probe_runtime_disable;
return ret;
/* Set the bus quota to a reasonable value for register access */
mas->se.icc_paths[GENI_TO_CORE].avg_bw = Bps_to_icc(CORE_2X_50_MHZ);
mas->se.icc_paths[CPU_TO_GENI].avg_bw = GENI_DEFAULT_BW;
ret = geni_icc_set_bw(&mas->se);
if (ret)
goto spi_geni_probe_runtime_disable;
return ret;
ret = spi_geni_init(mas);
if (ret)
goto spi_geni_probe_runtime_disable;
return ret;
/*
* check the mode supported and set_cs for fifo mode only
@ -1157,8 +1159,6 @@ spi_geni_probe_free_irq:
free_irq(mas->irq, spi);
spi_geni_release_dma:
spi_geni_release_dma_chan(mas);
spi_geni_probe_runtime_disable:
pm_runtime_disable(dev);
return ret;
}
@ -1170,10 +1170,9 @@ static void spi_geni_remove(struct platform_device *pdev)
/* Unregister _before_ disabling pm_runtime() so we stop transfers */
spi_unregister_controller(spi);
spi_geni_release_dma_chan(mas);
free_irq(mas->irq, spi);
pm_runtime_disable(&pdev->dev);
spi_geni_release_dma_chan(mas);
}
static int __maybe_unused spi_geni_runtime_suspend(struct device *dev)

View File

@ -805,14 +805,15 @@ static void nxp_fspi_fill_txfifo(struct nxp_fspi *f,
if (i < op->data.nbytes) {
u32 data = 0;
int j;
int remaining = op->data.nbytes - i;
/* Wait for TXFIFO empty */
ret = fspi_readl_poll_tout(f, f->iobase + FSPI_INTR,
FSPI_INTR_IPTXWE, 0,
POLL_TOUT, true);
WARN_ON(ret);
for (j = 0; j < ALIGN(op->data.nbytes - i, 4); j += 4) {
memcpy(&data, buf + i + j, 4);
for (j = 0; j < ALIGN(remaining, 4); j += 4) {
memcpy(&data, buf + i + j, min_t(int, 4, remaining - j));
fspi_writel(f, data, base + FSPI_TFDR + j);
}
fspi_writel(f, FSPI_INTR_IPTXWE, base + FSPI_INTR);