spi: Fixes for v6.8

As well as a few device IDs and the usual scattering of driver specific
 fixes this contains a couple of core things.  One is a missed case in
 error handling, the other patch is a change from me raising the number
 of chip selects allowed by the newly added multi chip select support
 patches to resolve problems seen on several systems that exceeded the
 limit.  This is not a real solution to the issue but rather just a
 change to avoid disruption to users, one of the options I am considering
 is just sending a revert of those changes if we can't come up with
 something sensible.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmWz7e0ACgkQJNaLcl1U
 h9BOrAf/UwWplCW+rCznfkb8uAuShKlJux+RtAJZG8A70JeC3jsdN66yUyxmfrIY
 5qKtqcPA3VXdM8OQ/3r8tk/q+/2sXESLotefwKvONYrZYmq61lA+rayUiNDQjicJ
 devvPLns72ZKu3VpsdFAoXzA+mL8Byp65lBqW5dHVyt0itY1Ap2Zdi8CNSzEVLLs
 3Qhe26yy8sxILQZ6N4TSNYMV7l6yn3AjZ5kUDFi/CA1AWTTfazpioCAyADa3iTpR
 1i0zsMzeDEL0iu8gWuB62mqftwY5ua3NaSmpxWPebG4VtMXqu62PwQugiqmq+gDc
 bA0SLlzR4xub7dtyhEjmsCbn4pvafw==
 =RQ5N
 -----END PGP SIGNATURE-----

Merge tag 'spi-fix-v6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "As well as a few device IDs and the usual scattering of driver
  specific fixes this contains a couple of core things.

  One is a missed case in error handling, the other patch is a change
  from me raising the number of chip selects allowed by the newly added
  multi chip select support patches to resolve problems seen on several
  systems that exceeded the limit.

  This is not a real solution to the issue but rather just a change to
  avoid disruption to users, one of the options I am considering is just
  sending a revert of those changes if we can't come up with something
  sensible"

* tag 'spi-fix-v6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: fix finalize message on error return
  spi: cs42l43: Handle error from devm_pm_runtime_enable
  spi: Raise limit on number of chip selects
  spi: hisi-sfc-v3xx: Return IRQ_NONE if no interrupts were detected
  spi: spi-cadence: Reverse the order of interleaved write and read operations
  spi: spi-imx: Use dev_err_probe for failed DMA channel requests
  spi: bcm-qspi: fix SFDP BFPT read by usig mspi read
  spi: intel-pci: Add support for Arrow Lake SPI serial flash
  spi: intel-pci: Remove Meteor Lake-S SoC PCI ID from the list
This commit is contained in:
Linus Torvalds 2024-01-26 12:29:04 -08:00
commit 48fa8ec615
8 changed files with 28 additions and 15 deletions

View File

@ -19,7 +19,7 @@
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/spi/spi-mem.h>
#include <linux/mtd/spi-nor.h>
#include <linux/sysfs.h>
#include <linux/types.h>
#include "spi-bcm-qspi.h"
@ -1221,7 +1221,7 @@ static int bcm_qspi_exec_mem_op(struct spi_mem *mem,
/* non-aligned and very short transfers are handled by MSPI */
if (!IS_ALIGNED((uintptr_t)addr, 4) || !IS_ALIGNED((uintptr_t)buf, 4) ||
len < 4)
len < 4 || op->cmd.opcode == SPINOR_OP_RDSFDP)
mspi_read = true;
if (!has_bspi(qspi) || mspi_read)

View File

@ -317,6 +317,15 @@ static void cdns_spi_process_fifo(struct cdns_spi *xspi, int ntx, int nrx)
xspi->rx_bytes -= nrx;
while (ntx || nrx) {
if (nrx) {
u8 data = cdns_spi_read(xspi, CDNS_SPI_RXD);
if (xspi->rxbuf)
*xspi->rxbuf++ = data;
nrx--;
}
if (ntx) {
if (xspi->txbuf)
cdns_spi_write(xspi, CDNS_SPI_TXD, *xspi->txbuf++);
@ -326,14 +335,6 @@ static void cdns_spi_process_fifo(struct cdns_spi *xspi, int ntx, int nrx)
ntx--;
}
if (nrx) {
u8 data = cdns_spi_read(xspi, CDNS_SPI_RXD);
if (xspi->rxbuf)
*xspi->rxbuf++ = data;
nrx--;
}
}
}

View File

@ -244,7 +244,10 @@ static int cs42l43_spi_probe(struct platform_device *pdev)
priv->ctlr->use_gpio_descriptors = true;
priv->ctlr->auto_runtime_pm = true;
devm_pm_runtime_enable(priv->dev);
ret = devm_pm_runtime_enable(priv->dev);
if (ret)
return ret;
pm_runtime_idle(priv->dev);
regmap_write(priv->regmap, CS42L43_TRAN_CONFIG6, CS42L43_FIFO_SIZE - 1);

View File

@ -377,6 +377,11 @@ static const struct spi_controller_mem_ops hisi_sfc_v3xx_mem_ops = {
static irqreturn_t hisi_sfc_v3xx_isr(int irq, void *data)
{
struct hisi_sfc_v3xx_host *host = data;
u32 reg;
reg = readl(host->regbase + HISI_SFC_V3XX_INT_STAT);
if (!reg)
return IRQ_NONE;
hisi_sfc_v3xx_disable_int(host);

View File

@ -1344,7 +1344,7 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx,
controller->dma_tx = dma_request_chan(dev, "tx");
if (IS_ERR(controller->dma_tx)) {
ret = PTR_ERR(controller->dma_tx);
dev_dbg(dev, "can't get the TX DMA channel, error %d!\n", ret);
dev_err_probe(dev, ret, "can't get the TX DMA channel!\n");
controller->dma_tx = NULL;
goto err;
}
@ -1353,7 +1353,7 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx,
controller->dma_rx = dma_request_chan(dev, "rx");
if (IS_ERR(controller->dma_rx)) {
ret = PTR_ERR(controller->dma_rx);
dev_dbg(dev, "can't get the RX DMA channel, error %d\n", ret);
dev_err_probe(dev, ret, "can't get the RX DMA channel!\n");
controller->dma_rx = NULL;
goto err;
}

View File

@ -76,6 +76,7 @@ static const struct pci_device_id intel_spi_pci_ids[] = {
{ PCI_VDEVICE(INTEL, 0x7a24), (unsigned long)&cnl_info },
{ PCI_VDEVICE(INTEL, 0x7aa4), (unsigned long)&cnl_info },
{ PCI_VDEVICE(INTEL, 0x7e23), (unsigned long)&cnl_info },
{ PCI_VDEVICE(INTEL, 0x7f24), (unsigned long)&cnl_info },
{ PCI_VDEVICE(INTEL, 0x9d24), (unsigned long)&cnl_info },
{ PCI_VDEVICE(INTEL, 0x9da4), (unsigned long)&cnl_info },
{ PCI_VDEVICE(INTEL, 0xa0a4), (unsigned long)&cnl_info },
@ -84,7 +85,6 @@ static const struct pci_device_id intel_spi_pci_ids[] = {
{ PCI_VDEVICE(INTEL, 0xa2a4), (unsigned long)&cnl_info },
{ PCI_VDEVICE(INTEL, 0xa324), (unsigned long)&cnl_info },
{ PCI_VDEVICE(INTEL, 0xa3a4), (unsigned long)&cnl_info },
{ PCI_VDEVICE(INTEL, 0xae23), (unsigned long)&cnl_info },
{ },
};
MODULE_DEVICE_TABLE(pci, intel_spi_pci_ids);

View File

@ -1717,6 +1717,10 @@ static int __spi_pump_transfer_message(struct spi_controller *ctlr,
pm_runtime_put_noidle(ctlr->dev.parent);
dev_err(&ctlr->dev, "Failed to power device: %d\n",
ret);
msg->status = ret;
spi_finalize_current_message(ctlr);
return ret;
}
}

View File

@ -21,7 +21,7 @@
#include <uapi/linux/spi/spi.h>
/* Max no. of CS supported per spi device */
#define SPI_CS_CNT_MAX 4
#define SPI_CS_CNT_MAX 16
struct dma_chan;
struct software_node;