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

Pull spi fixes from Mark Brown:
"There's some driver specific fixes here plus one core fix for memory
leaks that could be triggered by a potential race condition when
cleaning up after we have split transfers to fit into what the
controller can support"

* tag 'spi-fix-v5.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
spi: stm32: fix pm_runtime_get_sync() error checking
spi: Fix memory leak on splited transfers
spi: spi-cadence-quadspi: Fix mapping of buffers for DMA reads
spi: stm32: Rate-limit the 'Communication suspended' message
spi: spi-loopback-test: Fix out-of-bounds read
spi: spi-cadence-quadspi: Populate get_name() interface
MAINTAINERS: add myself as maintainer for spi-fsl-dspi driver

+36 -8
+8
MAINTAINERS
··· 6901 6901 S: Maintained 6902 6902 F: drivers/dma/fsldma.* 6903 6903 6904 + FREESCALE DSPI DRIVER 6905 + M: Vladimir Oltean <olteanv@gmail.com> 6906 + L: linux-spi@vger.kernel.org 6907 + S: Maintained 6908 + F: Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt 6909 + F: drivers/spi/spi-fsl-dspi.c 6910 + F: include/linux/spi/spi-fsl-dspi.h 6911 + 6904 6912 FREESCALE ENETC ETHERNET DRIVERS 6905 6913 M: Claudiu Manoil <claudiu.manoil@nxp.com> 6906 6914 L: netdev@vger.kernel.org
+14 -3
drivers/spi/spi-cadence-quadspi.c
··· 907 907 struct dma_async_tx_descriptor *tx; 908 908 dma_cookie_t cookie; 909 909 dma_addr_t dma_dst; 910 + struct device *ddev; 910 911 911 912 if (!cqspi->rx_chan || !virt_addr_valid(buf)) { 912 913 memcpy_fromio(buf, cqspi->ahb_base + from, len); 913 914 return 0; 914 915 } 915 916 916 - dma_dst = dma_map_single(dev, buf, len, DMA_FROM_DEVICE); 917 - if (dma_mapping_error(dev, dma_dst)) { 917 + ddev = cqspi->rx_chan->device->dev; 918 + dma_dst = dma_map_single(ddev, buf, len, DMA_FROM_DEVICE); 919 + if (dma_mapping_error(ddev, dma_dst)) { 918 920 dev_err(dev, "dma mapping failed\n"); 919 921 return -ENOMEM; 920 922 } ··· 950 948 } 951 949 952 950 err_unmap: 953 - dma_unmap_single(dev, dma_dst, len, DMA_FROM_DEVICE); 951 + dma_unmap_single(ddev, dma_dst, len, DMA_FROM_DEVICE); 954 952 955 953 return ret; 956 954 } ··· 1130 1128 return 0; 1131 1129 } 1132 1130 1131 + static const char *cqspi_get_name(struct spi_mem *mem) 1132 + { 1133 + struct cqspi_st *cqspi = spi_master_get_devdata(mem->spi->master); 1134 + struct device *dev = &cqspi->pdev->dev; 1135 + 1136 + return devm_kasprintf(dev, GFP_KERNEL, "%s.%d", dev_name(dev), mem->spi->chip_select); 1137 + } 1138 + 1133 1139 static const struct spi_controller_mem_ops cqspi_mem_ops = { 1134 1140 .exec_op = cqspi_exec_mem_op, 1141 + .get_name = cqspi_get_name, 1135 1142 }; 1136 1143 1137 1144 static int cqspi_setup_flash(struct cqspi_st *cqspi)
+1 -1
drivers/spi/spi-loopback-test.c
··· 90 90 { 91 91 .description = "tx/rx-transfer - crossing PAGE_SIZE", 92 92 .fill_option = FILL_COUNT_8, 93 - .iterate_len = { ITERATE_MAX_LEN }, 93 + .iterate_len = { ITERATE_LEN }, 94 94 .iterate_tx_align = ITERATE_ALIGN, 95 95 .iterate_rx_align = ITERATE_ALIGN, 96 96 .transfer_count = 1,
+6 -2
drivers/spi/spi-stm32.c
··· 936 936 } 937 937 938 938 if (sr & STM32H7_SPI_SR_SUSP) { 939 - dev_warn(spi->dev, "Communication suspended\n"); 939 + static DEFINE_RATELIMIT_STATE(rs, 940 + DEFAULT_RATELIMIT_INTERVAL * 10, 941 + 1); 942 + if (__ratelimit(&rs)) 943 + dev_dbg_ratelimited(spi->dev, "Communication suspended\n"); 940 944 if (!spi->cur_usedma && (spi->rx_buf && (spi->rx_len > 0))) 941 945 stm32h7_spi_read_rxfifo(spi, false); 942 946 /* ··· 2064 2060 } 2065 2061 2066 2062 ret = pm_runtime_get_sync(dev); 2067 - if (ret) { 2063 + if (ret < 0) { 2068 2064 dev_err(dev, "Unable to power device:%d\n", ret); 2069 2065 return ret; 2070 2066 }
+7 -2
drivers/spi/spi.c
··· 1327 1327 if (msg->status && ctlr->handle_err) 1328 1328 ctlr->handle_err(ctlr, msg); 1329 1329 1330 - spi_res_release(ctlr, msg); 1331 - 1332 1330 spi_finalize_current_message(ctlr); 1333 1331 1334 1332 return ret; ··· 1722 1724 WARN_ON_ONCE(xfer->ptp_sts && !xfer->timestamped); 1723 1725 1724 1726 spi_unmap_msg(ctlr, mesg); 1727 + 1728 + /* In the prepare_messages callback the spi bus has the opportunity to 1729 + * split a transfer to smaller chunks. 1730 + * Release splited transfers here since spi_map_msg is done on the 1731 + * splited transfers. 1732 + */ 1733 + spi_res_release(ctlr, mesg); 1725 1734 1726 1735 if (ctlr->cur_msg_prepared && ctlr->unprepare_message) { 1727 1736 ret = ctlr->unprepare_message(ctlr, mesg);