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.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
"A collection of driver specific fixes, most minor apart from the OMAP
ones which disable some recent performance optimisations in some
non-standard cases where we could start driving the bus incorrectly.

The change to the stm32-ospi driver to use the newer reset APIs is a
fix for interactions with other IP sharing the same reset line in some
SoCs"

* tag 'spi-fix-v6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
spi: spi-pci1xxxx: Drop MSI-X usage as unsupported by DMA engine
spi: stm32-ospi: clean up on error in probe()
spi: stm32-ospi: Make usage of reset_control_acquire/release() API
spi: offload: check offload ops existence before disabling the trigger
spi: spi-pci1xxxx: Fix error code in probe
spi: loongson: Fix build warnings about export.h
spi: omap2-mcspi: Disable multi-mode when the previous message kept CS asserted
spi: omap2-mcspi: Disable multi mode when CS should be kept asserted after message

+41 -20
+1
drivers/spi/spi-loongson-core.c
··· 5 5 #include <linux/clk.h> 6 6 #include <linux/delay.h> 7 7 #include <linux/err.h> 8 + #include <linux/export.h> 8 9 #include <linux/init.h> 9 10 #include <linux/interrupt.h> 10 11 #include <linux/io.h>
+1 -1
drivers/spi/spi-offload.c
··· 297 297 if (trigger->ops->enable) { 298 298 ret = trigger->ops->enable(trigger, config); 299 299 if (ret) { 300 - if (offload->ops->trigger_disable) 300 + if (offload->ops && offload->ops->trigger_disable) 301 301 offload->ops->trigger_disable(offload); 302 302 return ret; 303 303 }
+18 -12
drivers/spi/spi-omap2-mcspi.c
··· 134 134 size_t max_xfer_len; 135 135 u32 ref_clk_hz; 136 136 bool use_multi_mode; 137 + bool last_msg_kept_cs; 137 138 }; 138 139 139 140 struct omap2_mcspi_cs { ··· 1270 1269 * multi-mode is applicable. 1271 1270 */ 1272 1271 mcspi->use_multi_mode = true; 1272 + 1273 + if (mcspi->last_msg_kept_cs) 1274 + mcspi->use_multi_mode = false; 1275 + 1273 1276 list_for_each_entry(tr, &msg->transfers, transfer_list) { 1274 1277 if (!tr->bits_per_word) 1275 1278 bits_per_word = msg->spi->bits_per_word; ··· 1292 1287 mcspi->use_multi_mode = false; 1293 1288 } 1294 1289 1295 - /* Check if transfer asks to change the CS status after the transfer */ 1296 - if (!tr->cs_change) 1297 - mcspi->use_multi_mode = false; 1298 - 1299 - /* 1300 - * If at least one message is not compatible, switch back to single mode 1301 - * 1302 - * The bits_per_word of certain transfer can be different, but it will have no 1303 - * impact on the signal itself. 1304 - */ 1305 - if (!mcspi->use_multi_mode) 1306 - break; 1290 + if (list_is_last(&tr->transfer_list, &msg->transfers)) { 1291 + /* Check if transfer asks to keep the CS status after the whole message */ 1292 + if (tr->cs_change) { 1293 + mcspi->use_multi_mode = false; 1294 + mcspi->last_msg_kept_cs = true; 1295 + } else { 1296 + mcspi->last_msg_kept_cs = false; 1297 + } 1298 + } else { 1299 + /* Check if transfer asks to change the CS status after the transfer */ 1300 + if (!tr->cs_change) 1301 + mcspi->use_multi_mode = false; 1302 + } 1307 1303 } 1308 1304 1309 1305 omap2_mcspi_set_mode(ctlr);
+2 -2
drivers/spi/spi-pci1xxxx.c
··· 762 762 return -EINVAL; 763 763 764 764 num_vector = pci_alloc_irq_vectors(pdev, 1, hw_inst_cnt, 765 - PCI_IRQ_ALL_TYPES); 765 + PCI_IRQ_INTX | PCI_IRQ_MSI); 766 766 if (num_vector < 0) { 767 767 dev_err(&pdev->dev, "Error allocating MSI vectors\n"); 768 - return ret; 768 + return num_vector; 769 769 } 770 770 771 771 init_completion(&spi_sub_ptr->spi_xfer_done);
+19 -5
drivers/spi/spi-stm32-ospi.c
··· 804 804 return ret; 805 805 } 806 806 807 - ospi->rstc = devm_reset_control_array_get_exclusive(dev); 807 + ospi->rstc = devm_reset_control_array_get_exclusive_released(dev); 808 808 if (IS_ERR(ospi->rstc)) 809 809 return dev_err_probe(dev, PTR_ERR(ospi->rstc), 810 810 "Can't get reset\n"); ··· 936 936 if (ret < 0) 937 937 goto err_pm_enable; 938 938 939 - if (ospi->rstc) { 940 - reset_control_assert(ospi->rstc); 941 - udelay(2); 942 - reset_control_deassert(ospi->rstc); 939 + ret = reset_control_acquire(ospi->rstc); 940 + if (ret) { 941 + dev_err_probe(dev, ret, "Can not acquire reset %d\n", ret); 942 + goto err_pm_resume; 943 943 } 944 + 945 + reset_control_assert(ospi->rstc); 946 + udelay(2); 947 + reset_control_deassert(ospi->rstc); 944 948 945 949 ret = spi_register_controller(ctrl); 946 950 if (ret) { ··· 991 987 if (ospi->dma_chrx) 992 988 dma_release_channel(ospi->dma_chrx); 993 989 990 + reset_control_release(ospi->rstc); 991 + 994 992 pm_runtime_put_sync_suspend(ospi->dev); 995 993 pm_runtime_force_suspend(ospi->dev); 996 994 } ··· 1002 996 struct stm32_ospi *ospi = dev_get_drvdata(dev); 1003 997 1004 998 pinctrl_pm_select_sleep_state(dev); 999 + 1000 + reset_control_release(ospi->rstc); 1005 1001 1006 1002 return pm_runtime_force_suspend(ospi->dev); 1007 1003 } ··· 1023 1015 ret = pm_runtime_resume_and_get(ospi->dev); 1024 1016 if (ret < 0) 1025 1017 return ret; 1018 + 1019 + ret = reset_control_acquire(ospi->rstc); 1020 + if (ret) { 1021 + dev_err(dev, "Can not acquire reset\n"); 1022 + return ret; 1023 + } 1026 1024 1027 1025 writel_relaxed(ospi->cr_reg, regs_base + OSPI_CR); 1028 1026 writel_relaxed(ospi->dcr_reg, regs_base + OSPI_DCR1);