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

Pull spi fixes from Mark Brown:
"A small collection of fixes that came in since the merge window. Most
of it is relatively minor driver specific fixes, there's also fixes
for error handling with SPI flash devices and a fix restoring delay
control functionality for non-GPIO chip selects managed by the core"

* tag 'spi-fix-v6.9-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
spi: spi-mt65xx: Fix NULL pointer access in interrupt handler
spi: docs: spidev: fix echo command format
spi: spi-imx: fix off-by-one in mx51 CPU mode burst length
spi: lm70llp: fix links in doc and comments
spi: Fix error code checking in spi_mem_exec_op()
spi: Restore delays for non-GPIO chip select
spi: lpspi: Avoid potential use-after-free in probe()

+38 -32
+2 -2
Documentation/spi/spi-lm70llp.rst
··· 6 6 7 7 * National Semiconductor LM70 LLP evaluation board 8 8 9 - Datasheet: http://www.national.com/pf/LM/LM70.html 9 + Datasheet: https://www.ti.com/lit/gpn/lm70 10 10 11 11 Author: 12 12 Kaiwan N Billimoria <kaiwan@designergraphix.com> ··· 28 28 The schematic for this particular board (the LM70EVAL-LLP) is 29 29 available (on page 4) here: 30 30 31 - http://www.national.com/appinfo/tempsensors/files/LM70LLPEVALmanual.pdf 31 + https://download.datasheets.com/pdfs/documentation/nat/kit&board/lm70llpevalmanual.pdf 32 32 33 33 The hardware interfacing on the LM70 LLP eval board is as follows: 34 34
+1 -1
Documentation/spi/spidev.rst
··· 61 61 62 62 Sysfs also supports userspace driven binding/unbinding of drivers to 63 63 devices that do not bind automatically using one of the tables above. 64 - To make the spidev driver bind to such a device, use the following: 64 + To make the spidev driver bind to such a device, use the following:: 65 65 66 66 echo spidev > /sys/bus/spi/devices/spiB.C/driver_override 67 67 echo spiB.C > /sys/bus/spi/drivers/spidev/bind
+4 -4
drivers/spi/spi-fsl-lpspi.c
··· 830 830 831 831 is_target = of_property_read_bool((&pdev->dev)->of_node, "spi-slave"); 832 832 if (is_target) 833 - controller = spi_alloc_target(&pdev->dev, 834 - sizeof(struct fsl_lpspi_data)); 833 + controller = devm_spi_alloc_target(&pdev->dev, 834 + sizeof(struct fsl_lpspi_data)); 835 835 else 836 - controller = spi_alloc_host(&pdev->dev, 837 - sizeof(struct fsl_lpspi_data)); 836 + controller = devm_spi_alloc_host(&pdev->dev, 837 + sizeof(struct fsl_lpspi_data)); 838 838 839 839 if (!controller) 840 840 return -ENOMEM;
+2 -2
drivers/spi/spi-imx.c
··· 668 668 ctrl |= (MX51_ECSPI_CTRL_MAX_BURST * BITS_PER_BYTE - 1) 669 669 << MX51_ECSPI_CTRL_BL_OFFSET; 670 670 else 671 - ctrl |= spi_imx->count / DIV_ROUND_UP(spi_imx->bits_per_word, 672 - BITS_PER_BYTE) * spi_imx->bits_per_word 671 + ctrl |= (spi_imx->count / DIV_ROUND_UP(spi_imx->bits_per_word, 672 + BITS_PER_BYTE) * spi_imx->bits_per_word - 1) 673 673 << MX51_ECSPI_CTRL_BL_OFFSET; 674 674 } 675 675 }
+2 -2
drivers/spi/spi-lm70llp.c
··· 29 29 * 30 30 * Datasheet and Schematic: 31 31 * The LM70 is a temperature sensor chip from National Semiconductor; its 32 - * datasheet is available at http://www.national.com/pf/LM/LM70.html 32 + * datasheet is available at https://www.ti.com/lit/gpn/lm70 33 33 * The schematic for this particular board (the LM70EVAL-LLP) is 34 34 * available (on page 4) here: 35 - * http://www.national.com/appinfo/tempsensors/files/LM70LLPEVALmanual.pdf 35 + * https://download.datasheets.com/pdfs/documentation/nat/kit&board/lm70llpevalmanual.pdf 36 36 * 37 37 * Also see Documentation/spi/spi-lm70llp.rst. The SPI<->parport code here is 38 38 * (heavily) based on spi-butterfly by David Brownell.
+1 -1
drivers/spi/spi-mem.c
··· 382 382 * read path) and expect the core to use the regular SPI 383 383 * interface in other cases. 384 384 */ 385 - if (!ret || ret != -ENOTSUPP || ret != -EOPNOTSUPP) { 385 + if (!ret || (ret != -ENOTSUPP && ret != -EOPNOTSUPP)) { 386 386 spi_mem_add_op_stats(ctlr->pcpu_statistics, op, ret); 387 387 spi_mem_add_op_stats(mem->spi->pcpu_statistics, op, ret); 388 388
+12 -10
drivers/spi/spi-mt65xx.c
··· 788 788 mdata->xfer_len = min(MTK_SPI_MAX_FIFO_SIZE, len); 789 789 mtk_spi_setup_packet(host); 790 790 791 - cnt = mdata->xfer_len / 4; 792 - iowrite32_rep(mdata->base + SPI_TX_DATA_REG, 793 - trans->tx_buf + mdata->num_xfered, cnt); 791 + if (trans->tx_buf) { 792 + cnt = mdata->xfer_len / 4; 793 + iowrite32_rep(mdata->base + SPI_TX_DATA_REG, 794 + trans->tx_buf + mdata->num_xfered, cnt); 794 795 795 - remainder = mdata->xfer_len % 4; 796 - if (remainder > 0) { 797 - reg_val = 0; 798 - memcpy(&reg_val, 799 - trans->tx_buf + (cnt * 4) + mdata->num_xfered, 800 - remainder); 801 - writel(reg_val, mdata->base + SPI_TX_DATA_REG); 796 + remainder = mdata->xfer_len % 4; 797 + if (remainder > 0) { 798 + reg_val = 0; 799 + memcpy(&reg_val, 800 + trans->tx_buf + (cnt * 4) + mdata->num_xfered, 801 + remainder); 802 + writel(reg_val, mdata->base + SPI_TX_DATA_REG); 803 + } 802 804 } 803 805 804 806 mtk_spi_enable_transfer(host);
+14 -10
drivers/spi/spi.c
··· 1063 1063 if (spi->mode & SPI_CS_HIGH) 1064 1064 enable = !enable; 1065 1065 1066 - if (spi_is_csgpiod(spi)) { 1067 - if (!spi->controller->set_cs_timing && !activate) 1068 - spi_delay_exec(&spi->cs_hold, NULL); 1066 + /* 1067 + * Handle chip select delays for GPIO based CS or controllers without 1068 + * programmable chip select timing. 1069 + */ 1070 + if ((spi_is_csgpiod(spi) || !spi->controller->set_cs_timing) && !activate) 1071 + spi_delay_exec(&spi->cs_hold, NULL); 1069 1072 1073 + if (spi_is_csgpiod(spi)) { 1070 1074 if (!(spi->mode & SPI_NO_CS)) { 1071 1075 /* 1072 1076 * Historically ACPI has no means of the GPIO polarity and ··· 1103 1099 if ((spi->controller->flags & SPI_CONTROLLER_GPIO_SS) && 1104 1100 spi->controller->set_cs) 1105 1101 spi->controller->set_cs(spi, !enable); 1106 - 1107 - if (!spi->controller->set_cs_timing) { 1108 - if (activate) 1109 - spi_delay_exec(&spi->cs_setup, NULL); 1110 - else 1111 - spi_delay_exec(&spi->cs_inactive, NULL); 1112 - } 1113 1102 } else if (spi->controller->set_cs) { 1114 1103 spi->controller->set_cs(spi, !enable); 1104 + } 1105 + 1106 + if (spi_is_csgpiod(spi) || !spi->controller->set_cs_timing) { 1107 + if (activate) 1108 + spi_delay_exec(&spi->cs_setup, NULL); 1109 + else 1110 + spi_delay_exec(&spi->cs_inactive, NULL); 1115 1111 } 1116 1112 } 1117 1113