Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+11 -11
+8 -9
drivers/spi/spi-geni-qcom.c
··· 1110 1110 spin_lock_init(&mas->lock); 1111 1111 pm_runtime_use_autosuspend(&pdev->dev); 1112 1112 pm_runtime_set_autosuspend_delay(&pdev->dev, 250); 1113 - pm_runtime_enable(dev); 1113 + ret = devm_pm_runtime_enable(dev); 1114 + if (ret) 1115 + return ret; 1114 1116 1115 1117 if (device_property_read_bool(&pdev->dev, "spi-slave")) 1116 1118 spi->target = true; 1117 1119 1118 1120 ret = geni_icc_get(&mas->se, NULL); 1119 1121 if (ret) 1120 - goto spi_geni_probe_runtime_disable; 1122 + return ret; 1121 1123 /* Set the bus quota to a reasonable value for register access */ 1122 1124 mas->se.icc_paths[GENI_TO_CORE].avg_bw = Bps_to_icc(CORE_2X_50_MHZ); 1123 1125 mas->se.icc_paths[CPU_TO_GENI].avg_bw = GENI_DEFAULT_BW; 1124 1126 1125 1127 ret = geni_icc_set_bw(&mas->se); 1126 1128 if (ret) 1127 - goto spi_geni_probe_runtime_disable; 1129 + return ret; 1128 1130 1129 1131 ret = spi_geni_init(mas); 1130 1132 if (ret) 1131 - goto spi_geni_probe_runtime_disable; 1133 + return ret; 1132 1134 1133 1135 /* 1134 1136 * check the mode supported and set_cs for fifo mode only ··· 1159 1157 free_irq(mas->irq, spi); 1160 1158 spi_geni_release_dma: 1161 1159 spi_geni_release_dma_chan(mas); 1162 - spi_geni_probe_runtime_disable: 1163 - pm_runtime_disable(dev); 1164 1160 return ret; 1165 1161 } 1166 1162 ··· 1170 1170 /* Unregister _before_ disabling pm_runtime() so we stop transfers */ 1171 1171 spi_unregister_controller(spi); 1172 1172 1173 - spi_geni_release_dma_chan(mas); 1174 - 1175 1173 free_irq(mas->irq, spi); 1176 - pm_runtime_disable(&pdev->dev); 1174 + 1175 + spi_geni_release_dma_chan(mas); 1177 1176 } 1178 1177 1179 1178 static int __maybe_unused spi_geni_runtime_suspend(struct device *dev)
+3 -2
drivers/spi/spi-nxp-fspi.c
··· 805 805 if (i < op->data.nbytes) { 806 806 u32 data = 0; 807 807 int j; 808 + int remaining = op->data.nbytes - i; 808 809 /* Wait for TXFIFO empty */ 809 810 ret = fspi_readl_poll_tout(f, f->iobase + FSPI_INTR, 810 811 FSPI_INTR_IPTXWE, 0, 811 812 POLL_TOUT, true); 812 813 WARN_ON(ret); 813 814 814 - for (j = 0; j < ALIGN(op->data.nbytes - i, 4); j += 4) { 815 - memcpy(&data, buf + i + j, 4); 815 + for (j = 0; j < ALIGN(remaining, 4); j += 4) { 816 + memcpy(&data, buf + i + j, min_t(int, 4, remaining - j)); 816 817 fspi_writel(f, data, base + FSPI_TFDR + j); 817 818 } 818 819 fspi_writel(f, FSPI_INTR_IPTXWE, base + FSPI_INTR);