Skip to content

Commit 48fa8ec

Browse files
committed
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
2 parents 5f91b9b + 8c2ae77 commit 48fa8ec

File tree

8 files changed

+28
-15
lines changed

8 files changed

+28
-15
lines changed

drivers/spi/spi-bcm-qspi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <linux/platform_device.h>
2020
#include <linux/slab.h>
2121
#include <linux/spi/spi.h>
22-
#include <linux/spi/spi-mem.h>
22+
#include <linux/mtd/spi-nor.h>
2323
#include <linux/sysfs.h>
2424
#include <linux/types.h>
2525
#include "spi-bcm-qspi.h"
@@ -1221,7 +1221,7 @@ static int bcm_qspi_exec_mem_op(struct spi_mem *mem,
12211221

12221222
/* non-aligned and very short transfers are handled by MSPI */
12231223
if (!IS_ALIGNED((uintptr_t)addr, 4) || !IS_ALIGNED((uintptr_t)buf, 4) ||
1224-
len < 4)
1224+
len < 4 || op->cmd.opcode == SPINOR_OP_RDSFDP)
12251225
mspi_read = true;
12261226

12271227
if (!has_bspi(qspi) || mspi_read)

drivers/spi/spi-cadence.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,15 @@ static void cdns_spi_process_fifo(struct cdns_spi *xspi, int ntx, int nrx)
317317
xspi->rx_bytes -= nrx;
318318

319319
while (ntx || nrx) {
320+
if (nrx) {
321+
u8 data = cdns_spi_read(xspi, CDNS_SPI_RXD);
322+
323+
if (xspi->rxbuf)
324+
*xspi->rxbuf++ = data;
325+
326+
nrx--;
327+
}
328+
320329
if (ntx) {
321330
if (xspi->txbuf)
322331
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)
326335
ntx--;
327336
}
328337

329-
if (nrx) {
330-
u8 data = cdns_spi_read(xspi, CDNS_SPI_RXD);
331-
332-
if (xspi->rxbuf)
333-
*xspi->rxbuf++ = data;
334-
335-
nrx--;
336-
}
337338
}
338339
}
339340

drivers/spi/spi-cs42l43.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,10 @@ static int cs42l43_spi_probe(struct platform_device *pdev)
244244
priv->ctlr->use_gpio_descriptors = true;
245245
priv->ctlr->auto_runtime_pm = true;
246246

247-
devm_pm_runtime_enable(priv->dev);
247+
ret = devm_pm_runtime_enable(priv->dev);
248+
if (ret)
249+
return ret;
250+
248251
pm_runtime_idle(priv->dev);
249252

250253
regmap_write(priv->regmap, CS42L43_TRAN_CONFIG6, CS42L43_FIFO_SIZE - 1);

drivers/spi/spi-hisi-sfc-v3xx.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,11 @@ static const struct spi_controller_mem_ops hisi_sfc_v3xx_mem_ops = {
377377
static irqreturn_t hisi_sfc_v3xx_isr(int irq, void *data)
378378
{
379379
struct hisi_sfc_v3xx_host *host = data;
380+
u32 reg;
381+
382+
reg = readl(host->regbase + HISI_SFC_V3XX_INT_STAT);
383+
if (!reg)
384+
return IRQ_NONE;
380385

381386
hisi_sfc_v3xx_disable_int(host);
382387

drivers/spi/spi-imx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,7 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx,
13441344
controller->dma_tx = dma_request_chan(dev, "tx");
13451345
if (IS_ERR(controller->dma_tx)) {
13461346
ret = PTR_ERR(controller->dma_tx);
1347-
dev_dbg(dev, "can't get the TX DMA channel, error %d!\n", ret);
1347+
dev_err_probe(dev, ret, "can't get the TX DMA channel!\n");
13481348
controller->dma_tx = NULL;
13491349
goto err;
13501350
}
@@ -1353,7 +1353,7 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx,
13531353
controller->dma_rx = dma_request_chan(dev, "rx");
13541354
if (IS_ERR(controller->dma_rx)) {
13551355
ret = PTR_ERR(controller->dma_rx);
1356-
dev_dbg(dev, "can't get the RX DMA channel, error %d\n", ret);
1356+
dev_err_probe(dev, ret, "can't get the RX DMA channel!\n");
13571357
controller->dma_rx = NULL;
13581358
goto err;
13591359
}

drivers/spi/spi-intel-pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ static const struct pci_device_id intel_spi_pci_ids[] = {
7676
{ PCI_VDEVICE(INTEL, 0x7a24), (unsigned long)&cnl_info },
7777
{ PCI_VDEVICE(INTEL, 0x7aa4), (unsigned long)&cnl_info },
7878
{ PCI_VDEVICE(INTEL, 0x7e23), (unsigned long)&cnl_info },
79+
{ PCI_VDEVICE(INTEL, 0x7f24), (unsigned long)&cnl_info },
7980
{ PCI_VDEVICE(INTEL, 0x9d24), (unsigned long)&cnl_info },
8081
{ PCI_VDEVICE(INTEL, 0x9da4), (unsigned long)&cnl_info },
8182
{ PCI_VDEVICE(INTEL, 0xa0a4), (unsigned long)&cnl_info },
@@ -84,7 +85,6 @@ static const struct pci_device_id intel_spi_pci_ids[] = {
8485
{ PCI_VDEVICE(INTEL, 0xa2a4), (unsigned long)&cnl_info },
8586
{ PCI_VDEVICE(INTEL, 0xa324), (unsigned long)&cnl_info },
8687
{ PCI_VDEVICE(INTEL, 0xa3a4), (unsigned long)&cnl_info },
87-
{ PCI_VDEVICE(INTEL, 0xae23), (unsigned long)&cnl_info },
8888
{ },
8989
};
9090
MODULE_DEVICE_TABLE(pci, intel_spi_pci_ids);

drivers/spi/spi.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,6 +1717,10 @@ static int __spi_pump_transfer_message(struct spi_controller *ctlr,
17171717
pm_runtime_put_noidle(ctlr->dev.parent);
17181718
dev_err(&ctlr->dev, "Failed to power device: %d\n",
17191719
ret);
1720+
1721+
msg->status = ret;
1722+
spi_finalize_current_message(ctlr);
1723+
17201724
return ret;
17211725
}
17221726
}

include/linux/spi/spi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <uapi/linux/spi/spi.h>
2222

2323
/* Max no. of CS supported per spi device */
24-
#define SPI_CS_CNT_MAX 4
24+
#define SPI_CS_CNT_MAX 16
2525

2626
struct dma_chan;
2727
struct software_node;

0 commit comments

Comments
 (0)