Commit e6640487 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull spi fixes from Mark Brown:
 "A disappointingly large set of device specific fixes that have built
  up since I've been a bit tardy with sending a pull requests as people
  kept sending me new new fixes.

  The bcm63xx and lpspi issues could lead to corruption so the fixes are
  fairly important for the affected parts, the other issues should all
  be relatively minor"

* tag 'spi-fix-v6.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: nxp-fspi: Propagate fwnode in ACPI case as well
  spi: tegra114: remove Kconfig dependency on TEGRA20_APB_DMA
  spi: amlogic-spifc-a1: Handle devm_pm_runtime_enable() errors
  spi: spi-fsl-lpspi: fix watermark truncation caused by type cast
  spi: cadence-quadspi: Fix cqspi_probe() error handling for runtime pm
  spi: bcm63xx: fix premature CS deassertion on RX-only transactions
  spi: spi-cadence-quadspi: Remove duplicate pm_runtime_put_autosuspend() call
  spi: spi-cadence-quadspi: Enable pm runtime earlier to avoid imbalance
parents 82ebd4e3 40ad64ac
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1181,10 +1181,10 @@ config SPI_TEGRA210_QUAD

config SPI_TEGRA114
	tristate "NVIDIA Tegra114 SPI Controller"
	depends on (ARCH_TEGRA && TEGRA20_APB_DMA) || COMPILE_TEST
	depends on ARCH_TEGRA || COMPILE_TEST
	depends on RESET_CONTROLLER
	help
	  SPI driver for NVIDIA Tegra114 SPI Controller interface. This controller
	  SPI controller driver for NVIDIA Tegra114 and later SoCs. This controller
	  is different than the older SoCs SPI controller and also register interface
	  get changed with this controller.

+3 −1
Original line number Diff line number Diff line
@@ -353,7 +353,9 @@ static int amlogic_spifc_a1_probe(struct platform_device *pdev)

	pm_runtime_set_autosuspend_delay(spifc->dev, 500);
	pm_runtime_use_autosuspend(spifc->dev);
	devm_pm_runtime_enable(spifc->dev);
	ret = devm_pm_runtime_enable(spifc->dev);
	if (ret)
		return ret;

	ctrl->num_chipselect = 1;
	ctrl->dev.of_node = pdev->dev.of_node;
+14 −0
Original line number Diff line number Diff line
@@ -247,6 +247,20 @@ static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *first,

		if (t->rx_buf) {
			do_rx = true;

			/*
			 * In certain hardware implementations, there appears to be a
			 * hidden accumulator that tracks the number of bytes written into
			 * the hardware FIFO, and this accumulator overrides the length in
			 * the SPI_MSG_CTL register.
			 *
			 * Therefore, for read-only transfers, we need to write some dummy
			 * value into the FIFO to keep the accumulator tracking the correct
			 * length.
			 */
			if (!t->tx_buf)
				memset_io(bs->tx_io + len, 0xFF, t->len);

			/* prepend is half-duplex write only */
			if (t == first)
				prepend_len = 0;
+8 −10
Original line number Diff line number Diff line
@@ -1981,6 +1981,13 @@ static int cqspi_probe(struct platform_device *pdev)
	cqspi->current_cs = -1;
	cqspi->sclk = 0;

	if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) {
		pm_runtime_enable(dev);
		pm_runtime_set_autosuspend_delay(dev, CQSPI_AUTOSUSPEND_TIMEOUT);
		pm_runtime_use_autosuspend(dev);
		pm_runtime_get_noresume(dev);
	}

	ret = cqspi_setup_flash(cqspi);
	if (ret) {
		dev_err(dev, "failed to setup flash parameters %d\n", ret);
@@ -1995,14 +2002,7 @@ static int cqspi_probe(struct platform_device *pdev)
	if (cqspi->use_direct_mode) {
		ret = cqspi_request_mmap_dma(cqspi);
		if (ret == -EPROBE_DEFER)
			goto probe_dma_failed;
	}

	if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) {
		pm_runtime_enable(dev);
		pm_runtime_set_autosuspend_delay(dev, CQSPI_AUTOSUSPEND_TIMEOUT);
		pm_runtime_use_autosuspend(dev);
		pm_runtime_get_noresume(dev);
			goto probe_setup_failed;
	}

	ret = spi_register_controller(host);
@@ -2012,7 +2012,6 @@ static int cqspi_probe(struct platform_device *pdev)
	}

	if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) {
		pm_runtime_put_autosuspend(dev);
		pm_runtime_mark_last_busy(dev);
		pm_runtime_put_autosuspend(dev);
	}
@@ -2021,7 +2020,6 @@ static int cqspi_probe(struct platform_device *pdev)
probe_setup_failed:
	if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM)))
		pm_runtime_disable(dev);
probe_dma_failed:
	cqspi_controller_enable(cqspi, 0);
probe_reset_failed:
	if (cqspi->is_jh7110)
+7 −1
Original line number Diff line number Diff line
@@ -486,7 +486,13 @@ static int fsl_lpspi_setup_transfer(struct spi_controller *controller,
		fsl_lpspi->tx = fsl_lpspi_buf_tx_u32;
	}

	fsl_lpspi->watermark = min_t(typeof(fsl_lpspi->watermark),
	/*
	 * t->len is 'unsigned' and txfifosize and watermrk is 'u8', force
	 * type cast is inevitable. When len > 255, len will be truncated in min_t(),
	 * it caused wrong watermark set. 'unsigned int' is as the designated type
	 * for min_t() to avoid truncation.
	 */
	fsl_lpspi->watermark = min_t(unsigned int,
				     fsl_lpspi->txfifosize,
				     t->len);

Loading